Better HN
topnewbestaskshowjobs
Log inSign up

pksadiq

509 karma · joined Oct 27, 2015 (11y ago) · 252 submissions

https://www.sadiqpk.org
Submissions

1.

How AI Is Changing Open Source(enblog.eischmann.cz ↗)

1 points · by pksadiq · 3mo ago · discuss

2.

How AI Is Changing Open Source(enblog.eischmann.cz ↗)

6 points · by pksadiq · 4mo ago · discuss

comment 1y ago · link · parent

I wrote a similar tool[0] a few days back because I wanted a bit more accuracy with timestamp (to measure CPU/idle time) and `ts` occasionally had a deviation of several 10ms. If I knew this, and is accurate enough for me, I might not have written one.

[0] https://www.sadiqpk.org/projects/tis

4.

Multi Key Term: Map different keyboards to different terminals on same screen(sadiqpk.org ↗)

8 points · by pksadiq · 2y ago · 1 comment

5.

GNU Emacs DWIM keybindings for C, Python, Rust, and more(sadiqpk.org ↗)

2 points · by pksadiq · 3y ago · discuss

6.

GNU Emacs DWIM keybindings for C, Python, Rust, and more(sadiqpk.org ↗)

2 points · by pksadiq · 3y ago · discuss

comment 3y ago · link · parent

This specific change shall excite many as CC BY-SA 4.0 is one way GPLv3 compatible, but CC BY-SA 3.0 is not. Which means that free software developers can now embedded many Wikimedia contents in their GPLv3 applications. This seems not mentioned in the blog post though.

comment 3y ago · link · parent

> since the decimal average is -0.5

The C standard says: When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded (This is often called ‘‘truncation toward zero’’).

So it should be 0 (as per C standard, not sure what C++ standard says)

comment 3y ago · link · parent

> x/2 + y/2 + (x & y & 0x01)

This returns -1 for x = INT_MIN and y = INT_MAX were the answer should be 0 (for an example). so not a correct solution

comment 3y ago · link · parent

  int mid(int x, int y) {
    return (x/2 + y/2) + (1 & x & y);
  }
would be a more readable solution

edit: Actually, this fails on mid(INT_MIN, INT_MAX) and possibly other mixed sign values (returns: -1, expected: 0 (or -1 is okay?), where the precise answer is -0.5)

more edit: The C standard says: When integers are divided, the result of the / operator is the algebraic quotient with any fractional part discarded (This is often called ‘‘truncation toward zero’’).

So -1/2 should be 0.

11.

Tell HN: How to close your LinkedIn account

2 points · by pksadiq · 3y ago · 2 comments

comment 4y ago · link · parent

> Programming from the Ground Up

> https://download-mirror.savannah.gnu.org/releases/pgubook/Pr...

There is an updated version of the book from the author: "Programming Under the Hood" or "Learn to Program with Assembly". See[0]

[0] https://github.com/johnnyb/programming_under_the_hood

comment 5y ago · link · parent

> Why is this even a thing? Maybe I should just go back to buying everything with cash, it's impossible to keep up with all the crap we need to disable or hack around

And some agencies may be more interested in these exclusion databases. So I don't think there is any way to get out of this maze. When you sign up to exclude from a list, you get included in many other.

14.

Show HN: Map different keyboards to different pseudo terminals(sadiqpk.org ↗)

2 points · by pksadiq · 5y ago · discuss

comment 5y ago · link · parent

And it's much better when used with gdb-many-windows and speedbar

16.

A Common C/C++ Core Specification [pdf](open-std.org ↗)

3 points · by pksadiq · 6y ago · 2 comments

comment 6y ago · link · parent

Note: GTK+ has been renamed to GTK about a year back[0]. The title may better be updated.

[0] https://mail.gnome.org/archives/gtk-devel-list/2019-February...

18.

Corona Safe Network(coronasafe.network ↗)

1 points · by pksadiq · 6y ago · discuss

comment 6y ago · link · parent

There is a Merge Request to support QR code for hotspot created in GNOME control center: https://gitlab.gnome.org/GNOME/gnome-control-center/merge_re... Hopefully, shall be available in next release

comment 6y ago · link · parent

> What is the probability of something like this appearing in a normal program written by somebody who is unaware of trigraphs?

A good compiler (eg: gcc) will warn if any token is interpreted as a trigraph

Edit: digraph works a bit differently [0]

[0] https://en.wikipedia.org/wiki/Digraphs_and_trigraphs#C

comment 7y ago · link · parent

> The committee chose to adopt memccpy but rejected the remaining proposals.

Is that the case? Reading the updated standard draft[0] they also included strdup and strndup. May be they rejected first, then chose to add later.

[0] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2385.pdf

22.

Kerala’s monsoon is no longer the same(timesofindia.indiatimes.com ↗)

1 points · by pksadiq · 7y ago · discuss

23.

Librem 5 July Update(puri.sm ↗)

57 points · by pksadiq · 7y ago · 21 comments

12345
9