HN user

JoeAcchino

270 karma
Posts7
Comments35
View on HN

Clicking on StartGame does not work beacause the button is not wired to anything:

  func _on_StartGame_pressed():
      pass # Replace with function body.
Probably not ready for the public, but fun to hack around and trying to understand how it works from the inside out.
GNU Typist (2017) 6 years ago

Bottleneck is the brain, English is not my first language and I usually score 10 wpm less than my native language.

Would this work?

  c := colly.NewCollector()

  // this functions create a goroutine and returns a channel
  ch := c.HTML("a")  
  e := <- ch
  link := e.Attr("href")
  // ...
I'm a bit rusty (ah!) with go, so bear with me if the above contains errors.

I'm reading How to Fail at Almost Everything and Still Win Big: Kind of the Story of My Life by Scott Adams and I'm about to start The Power of Habit by Charles Duhigg.

I'm also reading again Comme un roman by Danil Pennac, a beautiful essay about the joys of reading.

Unix Tricks 12 years ago

You know what else I hate? Typing in long commands in the Mac OS X terminal and then them wrapping weirdly.

I solved this by adding the following line in my ~/.bashrc

  shopt -s checkwinsize
Never tried on Mac OS X though, so I don't know if it works.

How do I compile this? GCC complains:

    CFLAGS="-g -pipe" make -k donut
    cc -g -pipe    donut.c   -o donut
    donut.c:1:2: warning: data definition has no type or storage class [enabled by default]
    donut.c: In function ‘main’:
    donut.c:4:16: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default]
    donut.c:5:12: warning: incompatible implicit declaration of built-in function ‘memset’ [enabled by default]
    donut.c:9:63: error: ‘s’ undeclared (first use in this function)
    donut.c:9:63: note: each undeclared identifier is reported only once for each function it appears in
    donut.c:10:18: error: expected ‘,’ or ‘;’ before ‘in’
    donut.c:11:32: error: ‘t’ undeclared (first use in this function)
    make: *** [donut] Errore 1
    
    Compilation exited abnormally with code 2 at Thu Jan 23 16:11:12

I don't know how useful is this to track unique visitors, the next month I will probably have a different fingerprint.

All it takes is a new release of Firefox (different version in the User-Agent string) a new font or any plugin update.

So with that fingerprint you can possibly identify me now, but you cannot track me over time.

This regexp

    [^ @]*@[^ @]*
will validate strings like `@example.com` and `joe@` and even a single `@`. Probably
    [^ @]+@[^ @]+
is what he wants, plus server side validation (that is the classic "click link to validate address" email).
    find ~/my/docs/ -type f -name '*.txt' -exec sed -i.bak 's/inheritance/composition/g' {} +
This will search all files ending in `.txt` and will exec `sed 's/inheritance/composition/g'` on it. Sed modifies files in-place and saves a backup file with .bak extension (-i.bak) and is called the minimum necessary times (-exec +).

My best advice to someone using the command line is to learn `find` + `xargs` or, even better, `find` + `parallel`.

This is great.

Just a minor note (ah!): the number "1" on the left on my name on the top right corner made me think I had some welcome message in my inbox so I tried to click it.

Ok, time to watch some videos. I'll use this as teoric complement of justinguitar.com

I really don't understand why coursera and edx classes ask me x hours per week. My amount of free time is not constant through time, so I can't enroll in edx AI class with realistic expectations and this really bugs me.

I think that all online classes should offer two paths:

1. one for people that can follow lectures and homeworks, meeting deadlines and everything. This is what edx and coursera are now offering. 2. the other for people that can't keep the course pace, allowing assignment submissions without deadlines.

Unix tricks 13 years ago

3) if all the lines of the 10+GB file are actually unique, wouldn't awk keep the whole file in RAM? For files larger than my RAM could this leave my system unresponsive because it's thrashing on swap?