const std = @import("std");
const fmt = std.fmt;
const debugPrint = std.debug.print;
pub fn main() !void {
const src = "hogehgoehgoe";
const ch = 'A';
var dst = [_]u8{0} ** 0x20;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const c = std.c; | |
fn ahi(val: ?*anyopaque) callconv(.C) ?*anyopaque { | |
const p = @as(*u32, @ptrCast(@alignCast(val))); | |
std.debug.print("val 0x{x}\n", .{p.*}); | |
return p; | |
} | |
pub fn main() !void { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const debugPrint = std.debug.print; | |
const Thread = std.Thread; | |
const Mutex = Thread.Mutex; | |
fn hoge(m: *Mutex, val: *u32) void { | |
const ret: u32 = val.* * 2; | |
{ | |
m.lock(); | |
defer m.unlock(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const c = std.c; | |
const fs = std.fs; | |
const Child = std.process.Child; | |
pub fn main() !void { | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
const allocator = gpa.allocator(); | |
const fd = try fs.cwd().createFile("hoge", .{}); | |
defer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const Child = std.process.Child; | |
const ArrayList = std.ArrayList; | |
pub fn main() !void { | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
const allocator = gpa.allocator(); | |
defer { | |
const deinit_status = gpa.deinit(); | |
_ = deinit_status; |
sudo apt remove xdg-desktop-portal
Resolving Waybar not starting issue
host: Kubuntu 24.04LTS
Encountered an error Error calling StartServiceByName for org.freedesktop.portal.Desktop: Timeout was reached
when trying to start Waybar, which prevented it from showing up. Resolved the issue with the following steps:
Solution:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun bunkai (n) | |
(let ((limit (floor (sqrt n)))) | |
(labels ((f (n divisor acc) | |
(if (and (not (= 1 n)) | |
(<= divisor limit)) | |
(if (zerop (mod n divisor)) | |
(f (/ n divisor) | |
divisor | |
(cons divisor acc)) | |
(f n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo pmset -a disablesleep 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
printf("Hello, world!!\n"); | |
return 0; | |
} |
NewerOlder