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.
is it possible in Intelij Idea to set a file watcher for .Xresources
15 June 2025 @ 10:55 pm
I tried setting a file type Any and a scope pattern of .Xresources and also tried *.Xresources but neither worked. I suspect it is not possible, but perhaps there is some way to do this. My hope was to run xrdb with the filepath as an argument.
Mixing ReferenceFileDocument and @Observable
15 June 2025 @ 10:55 pm
I have an app in which the data model is @Observable, and views see it through
@Environment(dataModel.self) private var dataModel
Since there are a large number of views, only some of which may need to be redrawn at a given time, I believe that @Observable is more efficient at run time than @Published and @ObservedObject
I’ve been trying to make the app document based. Although I started using SwiftData, it has trouble with Codable, and a long thread in the Developer forum suggests that SwiftData does not support the Undo manager - and in any event, simple JSON serialization is all that this app requires.
Unfortunately, ReferenceFileDocument inherits from ObservableObject, which seems to not play nice with @Observable.
I’d like to keep using @Observable, but haven’t been able to figure out how. When I deserialize a JSON ReferenceFileDocument, I can’t seem to connect it to an @Observable class instance and to let the various views
How to fix GSC page indexing validation for non-existing pages/assets
15 June 2025 @ 10:50 pm
We have recently migrated our website from a Wordpress based to a Laravel framework based. All is good for the website itself, however for the Google Search Console, we are having some failed page indexing results. The .htaccess is not blocking said URL paths, considering some of these URL's or assets no longer exists. What could be the possible fix for these issues since these failed page indexing results could affect our website. The migration from Wordpress to Laravel framework has been deployed since 3rd week of May 2025. Since with Laravel routes, the file extension such as .php really isn't reflected in the URL.


Server Console Freezes and Spams Prompt After Client Idle Period
15 June 2025 @ 10:48 pm
I am developing a C based server-client application where the server sends packets to clients and reads back data, the packets are serialized structs followed by relevant buffer data. The issue occurs when I interact with a client, let the connection idle for a while (e.g., 15-20 seconds), and then try to send a command again. The console freezes briefly and then spams the client prompt.
console.c
void console(Server *server) {
Client *client = NULL;
menu();
while (1) {
char *option = input();
if (strstr(option, "exit") && !client) {
stop_server(server);
break;
}
if (strstr(option, "session")) {
int selected = 0;
sscanf(option, "%*[^0-9]%u", &selected);
client = get_by_socket(server, selected);
continue;
}
if (strstr(option, "detach")) {
client = NULL;
javafx MediaPlayer: why are hundreds and thousands of threads running?
15 June 2025 @ 10:45 pm
I noticed hundreds and thousands of threads running while debugging my javafx MediaPlayer application in Netbeans.
So I went to this simple demo code, ran it in the debugger, and again saw hundreds of threads while playing a single track.
What is the reason for so many threads running and how to reduce the number of running threads?
public class MediaExample extends Application {
public static void main(String[] args) {
launch(args);
}
public void start(Stage primaryStage) throws MalformedURLException {
File mediaFile = new File("assets/media/Golden-48569.mp4");
Media media = new Media(mediaFile.toURI().toURL().toString());
MediaPlayer mediaPlayer = new MediaPlayer(media);
MediaView mediaView = new MediaView(mediaPlayer);
Scene scene = new Scene(new Pane(mediaView), 1024, 800);
primaryStage.setScene(scene);
primaryStage.show()
using EFCore.BulkExtensions is it possible to do BulkInsertOrUpdate based on values from join?
15 June 2025 @ 10:35 pm
Using EFCore.BulkExtensions is it possible to determine the update or insert based upon comparison with values from another table or query?
The base set of data can be determined only by a join of this type:
var currentProducts = (from p in context.Products
join ps in context.ProductSuppliers on p.Id equals ps.ProductId into ppsJoin
from pps in ppsJoin
where pps.SupplierId == supplierId
select new Product());
The main point is that the key column Product.Id is not the comparand. Sku is the comparand but only for the specified supplier (since a sku value is not necessarily unique). So a sku is an insert if {SupplierId, Sku} does not exist. But Product does not have the supplier information directly - only through ProductSupplier.
I have tried setting different configurations but have failed to succeed.
var bulkConfig = new Bu
Pygbag Out of Memory
15 June 2025 @ 10:32 pm
I'm trying to make a game in python with pygame that can run on a website and I'm using pygbag to do so. I'm running into an issue where it gives me an pygame.error: Out of memory error.
Best way to structure variables in vanilla javaScript for a small project
15 June 2025 @ 10:30 pm
I am new to learning frontend web dev and i am working on a simple pomodoro web app although it has many settings and states to keep track of i want to know if it's common use to let functions modify global variables such as the settings variables directly or is it better to keep all the variables as properties to a " status " object and pass that object to functions
here are the starter variables i have with the second approach
timer: {
pomoCount: 0,
currCycle: 0,
timerDisp: { min: 25, sec: 0 },
totalSec: 25 * 60,
over: 0,
paused: 1,
countDown : null
},
task: {
tskShown: 0,
taskList: [],
},
settings: {
lbInterval: 4,
cycleList: [25, 5, 15],
autoCheckTsk: 0,
autoSwitchTsk: false,
autoStrtPomo: false,
autoStrtBrk: false,
},
};```
Truncate a Datetime at different lengths without DATETRUNC
15 June 2025 @ 9:44 pm
I want to truncate a datetime(7) at different lengths - determined by parts - in SQL Server 2019 (DATETRUNC starts on 2022 *). Kind of "year-month", "year-month-day", ... up to seconds.
https://learn.microsoft.com/en-us/sql/t-sql/functions/datetrunc-transact-sql?view=sql-server-ver15
In case below I truncate up to minute (leaving seconds a precision):
SELECT
FORMAT(DATEPART(year,my_col), '0000')
+ '-' + FORMAT(DATEPART(month,my_col), '00')
+ '-' + FORMAT(DATEPART(day,my_col), '00')
+ ' ' + FORMAT(DATEPART(hour,my_col), '00')
+ ':' + FORMAT(DATEPART(minute,my_col), '00') AS my_col
FROM my_schema.my_table
I get "2025-06-10 19:43" - which is OK.
Any shorter code that would do the work of DATETRUNC
Restore an image through Matlab with noise and psf
15 June 2025 @ 9:42 pm
I'm trying to solve a problem where I'm given the magnitude and phase spectrum of an image. I know the spectrum information is centered and compressed, so I'm working backward, but I'm getting lost when it comes to figuring out the PSF and noise or what to do from this point.
mag = load('esp_mag_g5.txt'); % Espectro de magnitud
fase = load('esp_fase_g5.txt'); % Espectro de fase
figure(1)
imshow(mag,[]);
mag1=exp(mag)-1;
F = mag1 .* exp(1j * fase);
F_shifted = ifftshift(F);
imagen_restaurada = ifft2(F_shifted);
imagen_restaurada = real(imagen_restaurada);
figure(2);
imshow(imagen_restaurada, []);
title('Imagen Restaurada (Inversa de Fourier)');
LEN = 15; % Longitud del desenfoque
THETA = 106; % Ángulo del desenfoque
PSF = fspecial('motion', LEN, THETA);
% Parámetro K ajusta ruido/nitidez:
%K = 0:0.001:0.1;
K = 0.01;
% Aplicar filtro Wiener
imagen_restaurada_wiener = deconvwnr(imagen_restaurada, PSF, K);
% Mostrar imagen restaurada con filtro Wiener
figur
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