Společnost Pebble představila (YouTube) chytré hodinky Pebble Round 2. S kulatým e-paper displejem, s open source PebbleOS a vydrží baterie přibližně dva týdny. Předobjednat je lze za 199 dolarů s plánovaným dodáním v květnu.
Na novoroční inauguraci starosty New Yorku Zohrana Mamdaniho bylo zakázáno si s sebou přinést Raspberry Pi anebo Flipper Zero. Raspberry Pi i Flipper Zero jsou explicitně uvedeny v seznamu zakázaných věcí jak na na veřejné pozvánce, tak i na oficiálních stránkách města.
OpenTTD (Wikipedie), tj. open source klon počítačové hry Transport Tycoon Deluxe, byl vydán v nové stabilní verzi 15.0. Přehled novinek v seznamu změn a také na YouTube. OpenTTD lze instalovat také ze Steamu.
Správce oken IceWM byl vydán ve verzi 4.0.0, která např. vylepšuje navigaci v přepínání velkého množství otevřených oken.
Od 1. ledna 2026 jsou všechny publikace ACM (Association for Computing Machinery) a související materiály přístupné v její digitální knihovně. V rámci této změny je nyní digitální knihovna ACM nabízena ve dvou verzích: v základní verzi zdarma, která poskytuje otevřený přístup ke všem publikovaným výzkumům ACM, a v prémiové zpoplatněné verzi, která nabízí další služby a nástroje 'určené pro hlubší analýzu, objevování a organizační využití'.
K 1. lednu 2026 končí 70leté omezení majetkových autorských práv děl autorů zesnulých v roce 1955, viz 2026 in public domain. V americkém prostředí vstupují do public domain díla z roku 1930, viz Public Domain Day.
Všem vše nejlepší do nového roku 2026.
Crown je multiplatformní open source herní engine. Zdrojové kódy jsou k dispozici na GitHubu pod licencí MIT a GPLv3+. Byla vydána nová verze 0.60. Vyzkoušet lze online demo.
Daniel Stenberg na svém blogu informuje, že po strncpy() byla ze zdrojových kódů curlu odstraněna také všechna volání funkce strcpy(). Funkci strcpy() nahradili vlastní funkcí curlx_strcopy().
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
int main(int argc, char **argv)
{
int length, i = 0;
int fd;
int wd;
char buffer[BUF_LEN];
fd = inotify_init();
if (fd < 0) {
perror("inotify_init");
}
wd = inotify_add_watch(fd, "/home/tomesh/Dropbox/C/sync", IN_ALL_EVENTS);
if (length < 0) {
perror("read");
}
while (1) {
length = read(fd, buffer, BUF_LEN);
struct inotify_event *event = (struct inotify_event *) &buffer[ i ];
if (event->len) {
if (event->mask & IN_CREATE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was created.\n", event->name);
} else {
printf("The file %s was created.\n", event->name);
}
}
if (event->mask & IN_DELETE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was deleted.\n", event->name);
} else {
printf("The file %s was deleted.\n", event->name);
}
}
if (event->mask & IN_MODIFY) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was modified.\n", event->name);
} else {
printf("The file %s was modified.\n", event->name);
}
}
if (event->mask & IN_MOVED_FROM) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved from.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved from.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVED_TO) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved to.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved to.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %ds was itself moved.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself moved.\n", event->name, event->cookie);
}
}
if (event->mask & IN_DELETE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was itself deleted.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself deleted.\n", event->name, event->cookie);
}
}
if (event->mask & IN_OPEN) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was opened.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was opened.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ATTRIB) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d attr was changed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d attr was changed.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ACCESS) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was accessed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was accessed.\n", event->name, event->cookie);
}
}
}
}
(void) inotify_rm_watch(fd, wd[0]);
(void) close(fd);
exit(0);
}
Řešení dotazu:
i += EVENT_SIZE + event->len;
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
int main(int argc, char **argv)
{
int length, i;
int fd;
int wd;
char buffer[BUF_LEN];
struct inotify_event *event;
fd = inotify_init();
if (fd < 0)
perror("inotify_init");
wd = inotify_add_watch(fd, "/home/tomesh/Dropbox/C/sync", IN_ALL_EVENTS);
while (1) {
i = 0;
length = read(fd, buffer, BUF_LEN);
if (length < 0)
perror("read");
if (length == 0)
sleep(1);
while (i < length) {
event = (struct inotify_event *) &buffer[i];
if (event->mask & IN_CREATE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was created.\n", event->name);
} else {
printf("The file %s was created.\n", event->name);
}
}
if (event->mask & IN_DELETE) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was deleted.\n", event->name);
} else {
printf("The file %s was deleted.\n", event->name);
}
}
if (event->mask & IN_MODIFY) {
if (event->mask & IN_ISDIR) {
printf("The directory %s was modified.\n", event->name);
} else {
printf("The file %s was modified.\n", event->name);
}
}
if (event->mask & IN_MOVED_FROM) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved from.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved from.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVED_TO) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was moved to.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was moved to.\n", event->name, event->cookie);
}
}
if (event->mask & IN_MOVE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %ds was itself moved.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself moved.\n", event->name, event->cookie);
}
}
if (event->mask & IN_DELETE_SELF) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was itself deleted.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was itself deleted.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ATTRIB) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d attr was changed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d attr was changed.\n", event->name, event->cookie);
}
}
if (event->mask & IN_ACCESS) {
if (event->mask & IN_ISDIR) {
printf("The directory %s with cookie %d was accessed.\n", event->name, event->cookie);
} else {
printf("The file %s with cookie %d was accessed.\n", event->name, event->cookie);
}
}
i += sizeof(struct inotify_event) +event->len;
}
}
(void) inotify_rm_watch(fd, wd);
(void) close(fd);
exit(0);
}
Tiskni
Sdílej: