Better HN
topnewbestaskshowjobs
Log inSign up

nazri1

1,332 karma · joined Dec 13, 2010 (15y ago) · 91 submissions

https://github.com/holygeek/
Submissions

comment 3y ago · link · parent

I have given up on all hope of UI/UX getting better on general consumer devices. The downward trend started since smartphone became mainstream.

comment 3y ago · link · parent

I know I’m going to miss reading his goofy email signatures.

Rest in peace Bram.

comment 5y ago · link · parent

Use mutt! Now you can read each post as if it was part of an email thread. But first you have to get the comments saved as a maildir email conversations... that’s where my fetchpost[1] tool comes in. Demo: https://asciinema.org/a/593u87rrsa3mevktyekepm4ke

[1] https://github.com/holygeek/fetchpost

comment 7y ago · link · parent

    time_ns = t[1].tv_nsec - t[0].tv_nsec + 1000000 * (t[1].tv_sec - t[0].tv_sec);
                                            ^^^^^^^ should be 1E9 instead

5.

Resolving deltas dominates clone time(public-inbox.org ↗)

1 points · by nazri1 · 7y ago · discuss

6.

Ask HN: What Easter Eggs Have You Written for Your $Dayjob

13 points · by nazri1 · 7y ago · 15 comments

comment 7y ago · link · parent

I feel you. https://xkcd.com/1172/

comment 7y ago · link · parent

You can use numfmt to parse the number:

    $ seq -w 0001 0005|numfmt 
    1
    2
    3
    4
    5
Or just use plain sed:

    $ seq -w 0001 0005|sed 's/^0*//'
    1
    2
    3
    4
    5

comment 7y ago · link · parent

Ha I could say the same thing about my $EDITOR, which happens to be vim. I learned how to use it about 2 decades ago and I still use it almost daily since. Some things are really worth investing your time learning them.

comment 7y ago · link · parent

Blank space at the bottom - just so when you page down through the page and reach the end, the last readable content would correctly shift up the same amount as the previous shift.

comment 7y ago · link · parent

I used the default one in CmakeLists.txt (-O3).

I ran the comparison again on another machine that I have and this time their performances are about the same:

c++:

    $ time ./tinykaboom
    ./tinykaboom  46.72s user 0.01s system 364% cpu 12.804 total
go:

    $ time ./tinykaboom     
    ./tinykaboom  42.50s user 0.07s system 350% cpu 12.161 total

comment 7y ago · link · parent

I saw the openmp pragma and thought to myself "neat! should be fun to watch the cores work hard at this" and went ahead and compiled and run it and smiled at the 400% cpu usage in top.

    $ time ./tinykaboom 
    ./tinykaboom  78.08s user 0.02s system 369% cpu 21.159 total
Then I wondered how it would fare if I were to port it to Go and went ahead and hastily did port to Go and thought that, "hmmm this should run a bit slower than the c++ version" but surprisingly it ran more than twice faster:

    $ go build ./tinykaboom.go
    $ time ./tinykaboom 
    ./tinykaboom  34.32s user 0.03s system 368% cpu 9.315 total
https://github.com/holygeek/tinykaboom/blob/master/tinykaboo...

Here's the corresponding perf report:

Go:

    Samples: 103K of event 'cycles:pp', Event count (approx.): 37252033995665
    Overhead  Command     Shared Object      Symbol
      32.17%  tinykaboom  tinykaboom         [.] math.sin
      28.80%  tinykaboom  tinykaboom         [.] main.hash
      11.81%  tinykaboom  tinykaboom         [.] main.rotate
       7.76%  tinykaboom  tinykaboom         [.] math.Min
       5.18%  tinykaboom  tinykaboom         [.] main.lerpFloat64
       4.25%  tinykaboom  tinykaboom         [.] main.noise
       2.59%  tinykaboom  tinykaboom         [.] runtime.mallocgc
       2.59%  tinykaboom  tinykaboom         [.] main.fractal_brownian_motion
       2.58%  tinykaboom  tinykaboom         [.] main.signed_distance
c++:

    Samples: 234K of event 'cycles:pp', Event count (approx.): 86721459552303
    Overhead  Command     Shared Object        Symbol
      67.93%  tinykaboom  libm-2.23.so         [.] __sin_avx
      30.80%  tinykaboom  tinykaboom           [.] _Z5noiseRK3vecILm3EfE
       1.27%  tinykaboom  libm-2.23.so         [.] __floorf_sse41
       0.00%  tinykaboom  tinykaboom           [.] _Z23fractal_brownian_motionRK3vecILm3EfE
       0.00%  tinykaboom  tinykaboom           [.] floorf@plt
If anyone can give suggestions on how to make the tinykaboom.cpp faster that would be neat!

13.

The Errors of TeX (1978-2014) [pdf](texdoc.net ↗)

22 points · by nazri1 · 7y ago · 9 comments

comment 8y ago · link · parent

(shameless plug) git number: https://github.com/holygeek/git-number

Use numbers for dealing with files in git.

comment 8y ago · link · parent

For any OSS products that claims to make money you can check their product page and see if they put out some pricing information. For example https://www.hashicorp.com/products/consul

comment 8y ago · link · parent

Truestory. I graduated with EE degree and a few years after that I still get a kick out of making an LED, connected directly to my desktop printer port, blink on and off. Different strokes for different folks, yeah?

comment 8y ago · link · parent

    DEFUN ("atan", Fatan, Satan, 1, 2, 0,
Hah I couldn't read that with a straight face!

comment 8y ago · link · parent

The kind of work where you need to run javascript loaded from third party sites and make it do stuff to the user (advertisements, chat).

comment 8y ago · link · parent

With the old UI I don’t have to scroll down to see the labels that I frequently go to. The new UI uses a heavier font that the labels list takes up more vertical space than they used to which is becoming a nag for me.

comment 8y ago · link · parent

Not unlike systemd, not too long ago...

comment 8y ago · link · parent

Does assembly count? Prince of Persia's source code (not really open source...): https://github.com/jmechner/Prince-of-Persia-Apple-II

One look at any of the assembly files and you can get a sense of how properly organized the source code is.

comment 8y ago · link · parent

I’ve read on some forum somewhere that women who have given birth rate labor pain as less painful than passing kidney stone.

comment 8y ago · link · parent

Someone I know swears by rowatinex https://www.ncbi.nlm.nih.gov/m/pubmed/1431192

I pray that I won’t ever need to consider taking it though (passed one stone last year)

comment 8y ago · link · parent

If they allow people to vote on which artist to be chosen then my vote would go to Andy Weir[1] (author of The Martian[2])... but then in his talks he stated quite clearly of his fear of flying, so ... :D

[1] https://en.wikipedia.org/wiki/Andy_Weir [2] https://en.wikipedia.org/wiki/The_Martian_(film)

comment 8y ago · link · parent

A good joke consists of an introduction, which establishes the story to be told and gracefully segues into the punchline. Your post here demostrate that very well sir.

comment 8y ago · link · parent

Mine is 16 each for two flights per floor at work, 19 floors. I do it 5 days a week, only for going up, so far. I’ve yet to do the same for when going down.

comment 8y ago · link · parent

Go one step further and add these to you vimrc:

    command Tab1 set ts=1 sts=1 sw=1
    command Tab2 set ts=2 sts=2 sw=2
    command Tab4 set ts=4 sts=4 sw=4
    command Tab8 set ts=8 sts=8 sw=8

28.

Ten Rules for Writing Cross Platform 'C' Code (2008)(ski-epic.com ↗)

3 points · by nazri1 · 8y ago · 2 comments

comment 8y ago · link · parent

See also: Shlemiel the painter [1]

[1] https://www.joelonsoftware.com/2001/12/11/back-to-basics/

1234