HNHacker News
TopNewBestAskShowJobs

eliasdorneles

65 karma · joined July 17, 2014

Homepage: https://eliasdorneles.com

GitHub: https://github.com/eliasdorneles

submissionscomments
eliasdorneles··on Sorry, I'm in a meeting
My solution is to watch YouTube on brave browser.
eliasdorneles··on The best relationships are all-encompassing.
Those relationships are the ones who hurt the most when they end.
eliasdorneles··on Introduction to Computer Music (2009) [pdf]
> My question is: Is thinking about music as applied mathematics a good way to create good music? Or is it just the most easily digestible model of music for the crowd on this site?

You are probably aware that there are these things called synthesizers, which exist both hardware and software, complex pieces of technology that can shape sound. There are people who are specialized in creating them (with code and/or electronics), people who are specialized in programming them (creating presets) and people who excel in using them to make music. And many more different profiles who are in between. Each will care about different aspects, they all contribute to making music.

Life is not black and white, and music neither. What is even "good music"? What is your mental model for "the crowd on this site"? In your questions, aren't you reducing the possibilities of learning by putting these into boxes?

The world is big, life is rich and people are much more diverse than what one typically perceives.

eliasdorneles··on Show HN: A Drum Listening Game
Tbh I've only personally tested on Firefox (desktop and mobile) on Linux and Android, and some friends tried on Chrome. I'm going to install Chromium and see if I can reproduce -- thanks!
eliasdorneles··on Show HN: A Drum Listening Game
Thanks for trying it out and thank you for the honest feedback.

That's interesting, many friends of mine tested it and nobody reported an issue with loading. (Btw I wrote the audio loading code more than 10 years ago, it wasn't written by any LLM -- you're free to judge tho)

Yes, the +22 at the top means the remaining levels. I need to clarify that, you're the second person that seems confused by it.

Thank you again for the feedback.

eliasdorneles··on Thoughts on Go vs. Rust vs. Zig
I second that! I was trying Zig for some small projects, but ended up switching to Odin, because I found it much more comfortable!
eliasdorneles··on Writing toy software is a joy
Fair point, my example was indeed "shipped to production" and may not compare a throwaway static generator toy project.

I still think those estimates are off, because I think many of those projects would need significant research and learning time, possibly more than actually coding -- not to mention time spent troubleshooting when something goes wrong.

eliasdorneles··on Writing toy software is a joy
I quite enjoy the spirit of the article, and I believe joy in programming has become even more important in the AI agent coding age we're leaving.

However, am I the only one finding those time estimates way too short?

I'm not the fastest programmer on Earth, but I'm not the slowest either, and I think most of those projects would take me a lot more time than those estimates, specially if I'd be working only 2-3 hours per day.

I feel most of those projects would take significant time researching and learning about the subjects, before even starting to code.

Example: recently I replaced my Pelican blog by my own hacky static site generator written in Odin, working 2-3h per day, it took me 2 weeks -- and this is a simpler project than many on that list.

eliasdorneles··on Piano Emulator in Your Terminal
As far as I have explored the subject, the support for playing with the computer keyboard will probably be restricted to "simple plucking" (no support for "press and hold", and no velocity).

For keyboard expression, it will be simpler to just use MIDI input.

eliasdorneles··on Piano Emulator in Your Terminal
Hello, author here

Not just yet, MIDI input is the next big feature I want to add! =)

("dang it!" protested a voice "i wanted this to be a surprise!! now, you've ruined it, announcing on HN...", "rhoo, it will be fine!" reassured another)

eliasdorneles··on Piano Emulator in Your Terminal
> So you can play piano over SSH obviously!

Oh yeah, you can call some friends to login to the same server and play a concert over SSH!

eliasdorneles··on Piano Emulator in Your Terminal
so cool! thanks for sharing that!
eliasdorneles··on Piano Emulator in Your Terminal
Hello, the app creator here

> it hints at a latent desire for computing closer to how I enjoy it ;)

Agreed, same here!!

If you like this, you might also like my solitaire clone for the terminal: https://github.com/eliasdorneles/usolitaire =)

eliasdorneles··on Piano Emulator in Your Terminal
Interesting, thanks, i'll have to check out how that works =)
eliasdorneles··on Piano Emulator in Your Terminal
Hello, UPiano creator here =)

> Why insist on doing this inside a terminal... ?

Simple: because it's fun!

eliasdorneles··on Using attrs for everything in Python
Lombok is kinda bigger commitment than attrs, because it interfaces with Java compiler internals (last time I used it, it was only possible to compile with sun/oracle jdk).

attrs seems lesser risk IMO, it's just a plain Python library, no other deps.

If you like Lombok, I'd expect you'll love attrs. :)

eliasdorneles··on Using attrs for everything in Python
Hello, Hynek! Thanks for attrs, wonderful library!

I'd suggest to market the "serious business aliases" more prominently. It's not about aesthetics, but expectations: people like me are immediately puzzled by "attr.ib()", thinking "why ib?".

The reason is because after reading a lot of Python code, our brain is already trained to recognize attributes and method names after the dot.

Also, it's a reasonable expectation to be able to import a function or submodule and the code still make sense, but this won't make sense:

  from attr import s, ib

  @s
  class Thing(object):
      x = ib()

I understand it looks such a small thing for you and others already used to this DSL, and also that it's not the most important technical aspect of the library. However, I do think it's an important human aspect of it.

I have the feeling that by making the "no non-sense" alternative more prominent in the examples and documentation, it would reduce cognition steps for newbie users and maybe make your own life easier by not having to explain and paste this link every time someone finds it odd (which will probably continue to happen).

Cheers!

eliasdorneles··on Git Undo
I've also wrote about undoing things in Git and other productivity tips here: http://eliasdorneles.github.io/2016/06/19/on-getting-product...
eliasdorneles··on A (not So) Short Story on Getting Decent Internet Access
This story is simply badass!
eliasdorneles··on Scrapy Tips from the Pros: April 2016 Edition
ahh, __VIEWSTATE, a pain in the butt for everyone doing webscraping of government official websites. :)
eliasdorneles··on Python 3 comes to Scrapy
There has been some discussions and a proof-of-concept with asyncio + aiohttp: https://github.com/scrapy/scrapy/pull/1455

However, as you said, it'd be a major change and it would affect the whole ecosystem (plugins and extensions), so it's complicated. We'll see what happens. :)

eliasdorneles··on Scrapy Tips from the Pros
Well, missing data can happen from problems in several different levels:

1) site changes caused the items that were scraped to be incomplete (missing fields) -- for this, one approach is to use an Item Validation Pipeline in Scrapy, perhaps using a JSON schema or something similar, logging errors or rejecting an item if it doesn't pass the validation.

2) site changes caused the scraping the items itself to fail: one solution is to store the sources and monitor the spider errors -- and when there are errors, you can rescrape from the stored sources (it can get a bit expensive store sources for big crawlers). Scrapy doesn't have a complete solution for this out-of-the-box, you have to build your own. You could use the HTTP cache mechanism and build a custom cache policy: http://doc.scrapy.org/en/latest/topics/downloader-middleware...

3) site changed the navigation structure, and the pages to be scraped from were never reached: this is the worst one, it's similar to the previous one, but it's one that you want to detect earlier -- saving the sources doesn't help much, since it happens at an early time during the crawl, so you want to be monitoring it.

One good practice is to split the crawl in two: one spider does the navigation and push the links of the pages to be scraped into a queue or something, and another spider reads the URLs from that and just scrape the data.

eliasdorneles··on Parse Natural Language Dates with Dateparser
Agreed, that can be truly challenging. It's important to store the timestamp of when the page source was downloaded, together with the timezone if available.
eliasdorneles··on Handling JavaScript in Scrapy with Splash
Nice tutorial! Lua scripting is lovely.
eliasdorneles··on Dateparser: Python parser for human readable dates
I don't mean to trash anything, these are known bugs (there are lots of them issued there: https://bugs.launchpad.net/dateutil).

It seems that dateutil has just not been receiving much love from its developers lately.

eliasdorneles··on Dateparser: Python parser for human readable dates
interesting. it seems to support only English dates, sadly.
eliasdorneles··on Dateparser: Python parser for human readable dates
Well, it is meant to be very forgivable. Right now it outputs the same thing for both "1 week ago" and "1 weeks ago" (even though the latter is grammatically incorrect).

Can you elaborate what you mean by "proper grammar for singular values"?

eliasdorneles··on Dateparser: Python parser for human readable dates
Yeah, dateutil it is cool, but it has a few problems:

  >>> from dateutil import parser
  >>> parser.parse('')
  datetime.datetime(2014, 11, 24, 0, 0)
It gets worse with fuzzy parsing:

  >>> parser.parse('something meaningless', fuzzy=True)
  datetime.datetime(2014, 11, 24, 0, 0)
eliasdorneles··on XPath tips from the web scraping trenches
That is very cool, indeed! =) I'm stuck with XPath 1.0 still, because XPath 2.0 hasn't found its way to lxml yet -- it seems to be quite a lot of work to implement it.
eliasdorneles··on XPath tips from the web scraping trenches
Thanks, that is novelty to me! I don't seem to get an example working, though. Is that XPath 2.0?