HNHacker News
TopNewBestAskShowJobs

nazri1

1,332 karma · joined December 13, 2010

https://github.com/holygeek/
submissionscomments
nazri1··on Anything longer ago than yesterday should just say the actual date
I have given up on all hope of UI/UX getting better on general consumer devices. The downward trend started since smartphone became mainstream.
nazri1··on Bram Moolenaar has died
I know I’m going to miss reading his goofy email signatures.

Rest in peace Bram.

nazri1··on Ask HN: Hacker News comment tree indentation on text-based web browsers?
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

nazri1··on I Got a Knuth Check for 0x$3.00

    time_ns = t[1].tv_nsec - t[0].tv_nsec + 1000000 * (t[1].tv_sec - t[0].tv_sec);
                                            ^^^^^^^ should be 1E9 instead
nazri1··on Microsoft begins work on its 2020 Windows releases in new preview
I feel you. https://xkcd.com/1172/
nazri1··on Problem solving with Unix commands
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
nazri1··on SQL: One of the most valuable skills
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.
nazri1··on Captain Marvel throwback site
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.
nazri1··on KABOOM in 180 lines of bare C++
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
nazri1··on KABOOM in 180 lines of bare C++
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!
nazri1··on Ask HN: Best Command-Line Applications?
(shameless plug) git number: https://github.com/holygeek/git-number

Use numbers for dealing with files in git.

nazri1··on HashiCorp has raised $100 million in Series D funding
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
nazri1··on Ask HN: Is there a modern “power on to basic” computer, for kids to learn on?
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?
nazri1··on Continued progress porting Emacs to Rust

    DEFUN ("atan", Fatan, Satan, 1, 2, 0,
Hah I couldn't read that with a straight face!
nazri1··on Do You Really Know CORS?
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).
nazri1··on Please Google, let us revert to the classic Gmail look
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.
nazri1··on Am I logged in or not? GDPR case study on the example of Chrome browser change
Not unlike systemd, not too long ago...
nazri1··on Ask HN: What open source project, in your opinion, has the highest code quality?
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.

nazri1··on Kidney Stones Are More Beautiful Than You Might Think
I’ve read on some forum somewhere that women who have given birth rate labor pain as less painful than passing kidney stone.
nazri1··on Kidney Stones Are More Beautiful Than You Might Think
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)

nazri1··on Dear Moon
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)

nazri1··on Um – Create your own man pages so you can remember how to do stuff
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.
nazri1··on A Nerd’s Way to Walk Up the Stairs (2011)
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.
nazri1··on Python has brought computer programming to a vast new audience
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
nazri1··on Layoffs at Watson Health Reveal IBM’s Problem with AI
See also: Shlemiel the painter [1]

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

nazri1··on Learn just a little Awk (2010)
https://thedailywtf.com/articles/What_Is_Truth_0x3f_
nazri1··on Show HN: Grep with colours written in Go
I'm okay with it being not as fast because speed is not the goal here, but rather highlighting specific patterns to make it easier to spot for the human eyes, especially when tailing log lines from your development webserver.
nazri1··on Wapp – a single-file web framework by the creator of SQLite
> Gitk was the first graphical repository browser. It’s written in tcl/tk.

Source: https://git-scm.com/docs/gitk

Actual tcl source: https://github.com/git/git/blob/master/gitk-git/gitk

nazri1··on Show HN: RoughJS – Create hand-drawn graphics using JavaScript
Having an option to make the result deterministic would be nice. That way you can use it for drawing stuff that's guaranteed to be rendered identically when loaded at different times.
nazri1··on Modeling Redux with TLA+
Any takers for doing this in lisp? ;)
Page 1 of 3Next →