Free web resources everyday
Tag: WebDev
Web development news and tutorials
ReadWriteWeb.com
Web Apps, Web Technology Trends, Social Networking and Social Media
Nifty Corners Cube
Rounded corners the javascript way
Nifty Corners Cube
StackOverflow.com
Random snippets of all sorts of code, mixed with a selection of help and advice.
Kafka Producer command line headers issue
2 April 2025 @ 6:50 am
I am trying to put a message to a kafka topic. The message contains both headers and a JSON payload.
My command is like this:
echo 'headerKey1=value1;headerKey2=value2\t{\"myJson\":\"payload\"}' | ./bin/kafka-console-producer.sh \ --topic my-topic \ --bootstrapserver: myserver \ --property "parse.headers=true"
I get the following error:
No headers delimiter found on line number 1
Comparing gradients in tensorflow gradientTape with finite difference approximation
2 April 2025 @ 6:48 am
Background:
I am part of a team developing a TensorFlow model trained to emulate a physical model. This CNN-based model takes physical parameters and calculates physical properties like flow or temperature. Part of the capabilities involve using automatic differentiation of the forward model to tackle the inverse problem - inferring physical model parameters from observations. While the forward model emulator works very well, I have been trying to diagnose problems with the inverse capabilities that perform far less well than the emulated physical model.
One test that I thought would be very simple was to compare the gradients that I get from the gradientTape with gradients calculated by doing finite differencing of small perturbations in my parameters i.e. a sort of brute force approach. Ultimately these gradients are then used to minimize a cost function, which represents misfit between the forward model and observations. Clearly it is very important that these gradients ar
SwiftUI @SectionedFetchRequest display repeated section items but there are distinct values
2 April 2025 @ 6:47 am
This is definition of my request:
@SectionedFetchRequest(
sectionIdentifier: \.team,
sortDescriptors: [SortDescriptor(\.team.identifier, order: .forward), SortDescriptor(\.name, order: .forward)],
animation: .easeInOut
) var items: SectionedFetchResults<Team, User>
This is my Team and User entity:
@objc(Team)
class Team: NSManagedObject, Fetchable {
@NSManaged var identifier: Int16
@NSManaged var name: String
@NSManaged var users: Set<User>
}
@objc(User)
class User: NSManagedObject, Identifiable, Fetchable {
@NSManaged var identifier: String
@NSManaged var name: String
@NSManaged var team: Team
}
In my database, there are 2 Teams with unique identifiers and names, however when I display them on the list:
var body: some View {
// ...
ForEach(items) { section in
HStack {
TextLabel(section.
How to resample a dataset to achieve a uniform distribution
2 April 2025 @ 6:46 am
I have a dataset with a schema like:
df = pl.DataFrame(
{
"target": [
[1.0, 1.0, 0.0],
[1.0, 1.0, 0.1],
[1.0, 1.0, 0.2],
[1.0, 1.0, 0.8],
[1.0, 1.0, 0.9],
[1.0, 1.0, 1.0],
],
"feature": ["a", "b", "c", "d", "e", "f"],
},
schema={
"target": pl.Array(pl.Float32, 3),
"feature": pl.String,
},
)
If I make a histogram of the target-z values it looks like:
I want to resample the data so its flat along z.
I managed to do it in a hacky-many-steps way (also very slow). I was wondering if people could suggest a cleaner (and more efficient) way?

Is there a difference between cp -r and cp -aL, and about security
2 April 2025 @ 6:46 am
I have a question about Linux commands.
What is the difference between cp -r and cp -aL?
I tried both cp -r and cp -aL. For example, the original file is A. When I used cp -r, the result was B, and when I used cp -aL, the result was C.
I noticed that A and C have exactly the same permissions, but A and B have different permissions.
Aside from that, is there any other difference?
Is there any advantage to using cp -aL?
My coworker said, “Using cp -aL creates a copy that is completely independent from the original file, so it’s better for security.”
I tried to search for the reason behind this, but I couldn’t find any clear explanation.
Yaml template Checkout GitHub repositories using a PAT service connection and Azure Repos using SPN+FIC for automation without a PAT
2 April 2025 @ 6:44 am
We are currently working on the logic to automate the checkout of GitHub repositories using Personal Access Tokens (PAT) through service connections. Additionally, we aim to clone Azure repositories using Service Principal Name (SPN) and Federated Identity Credential (FIC) service connections for our YAML templates.
Challenges:
The PAT for Azure repositories expires every 7 days, which poses a challenge for our automation process.
We are collaborating with multiple partners, some of whom use GitHub repositories while others use Azure repositories.
Implement a solution to address the PAT expiration issue for Azure repositories.
Ensure seamless integration and automation for both GitHub and Azure repositories.
Flutter - iOS API Misuse <CBCentralManager: 0x30032d2c0>
2 April 2025 @ 6:44 am
I've a Flutter app built using flutter_blue_plus, this works just fine on android but when I try to run it on iOS it gives an issue when I try to initiate a BLE scan.
The log stream for the same being-
flutter: The Dart VM service is listening on http://127.0.0.1:56397/WD53Kf2Lcb8=/
[FBP-iOS] handleMethodCall: flutterRestart
[FBP-iOS] initializing CBCentralManager
[FBP-iOS] showPowerAlert: yes
[FBP-iOS] restoreState: no
API MISUSE: <CBCentralManager: 0x30032d2c0> has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported
[FBP-iOS] initializing checkForMtuChangesTimer
[FBP-iOS] disconnectAllDevices(flutterRestart)
[FBP-iOS] connectedPeripherals: 0
[FBP-iOS] handleMethodCall: getAdapterState
[FBP-iOS] centralManagerDidUpdateState CBManagerStatePoweredOn
The bluetooth implementation of mine is
Power Automate + Microsoft Forms: How to update only one SharePoint item based on Forms response when multiple items have same status?
2 April 2025 @ 6:42 am
TL;DR:
Problem: When a Microsoft Forms response is submitted, Power Automate updates all SharePoint list items with the same status, instead of updating only the one related item.
Each approval stage is handled by a separate flow. If multiple items have the same status (e.g., 'S2'), the Forms-triggered flow ends up updating all of them — not just the intended one. This breaks the approval logic and corrupts the data.
I need a way to ensure that only one specific SharePoint item is updated, even when several items share the same status.
FULL DESCRIPTION:
I'm building a multi-stage approval process using:
• Microsoft Forms (to collect inputs),
• SharePoint list (to track items and statuses),
• Power Automate (to coordinate approvals and data updates).
Each stage of the approval (S1 → S2 → S3...) is handled by a separate Power Automate flow. The flow sends
What is the best way to parse such files & use variables as well as their values?
2 April 2025 @ 6:39 am
//file1.php
$config['english']['login'] = "login here";
$config['english']['logout'] = "logout";
//file2.php
$anotherVar['english']['varone'] = "Some text in var one";
$anotherVar['english']['vartwo'] = "Some text in var two";
Now, consider a whole bunch of files with data like this. The variables can be anyting!
I need to create similar files for other languages.
I can use eval(), parse the file & explode with "=" etc. but the variable values can be in multiple lines, and some lines could be commented out, etc., which is a big headache if i just parse using file_get_contents or with file
What is the best way to achieve what i want?
I want to list all such variables from a given list of files in "english"
And then, for each file, I want to take the value of each variable in the file and then write out to files in other directories, replacin
TypeError: 'int' object is not subscriptable from a list
2 April 2025 @ 6:38 am
import random as rnd
print("Willkommen im Dungeon-Abenteuer!",'\n', "Dein Ziel ist es zu überleben unddenverstecktenSchatz zu finden.",'\n', "Bewege dich durch den Dungeon und erlebe spannende Ereignisse!") print("-----------------------------------") schatz = [rnd.randint(0,5),rnd.randint(0,5)] falle1 = [rnd.randint(0,5),rnd.randint(0,5)] falle2 = [rnd.randint(0,5),rnd.randint(0,5)] falle3 = [rnd.randint(0,5),rnd.randint(0,5)] falle4 = [rnd.randint(0,5),rnd.randint(0,5)] falle5 = [rnd.randint(0,5),rnd.randint(0,5)]
hp = 100 playerloc = [0,0]
while hp != 0: step = input("Wohin möchtest du gehen? (Norden (N), Süden (S), Osten (O), Westen (W)): ")
if step == "N":
playerloc = playerloc[1] + 1
x = playerloc[1]
if x < 0:
playerloc = playerloc[1]-1
print("du hast die wand erreicht gehe in eine andere richtung")
print("deine position ist:&qu
960.gs
CSS Grid System layout guide
960.gs
IconPot .com
Totally free icons
Interface.eyecon.ro
Interface elements for jQuery
Interface.eyecon.ro
ThemeForest.net
WordPress Themes, HTML Templates.
kuler.adobe.com
color / colour themes by design
webanalyticssolutionprofiler.com
Web Analytics::Free Resources from Immeria
webanalyticssolutionprofiler.com