HNHacker News
TopNewBestAskShowJobs

scardine

1,990 karma · joined November 12, 2012

[ my public key: https://keybase.io/scardine; my proof: https://keybase.io/scardine/sigs/qeBpi0HYlFKHREYPh9n-xmWcbtfL4QLbtHsGFGzGD2g ]
submissionscomments
scardine··on Cameras Could Replace Car Mirrors?
I guess you can have heated lens just like you have heated mirrors (I'm living in Brazil so I don't have this problem).

I like to use darker film in side windows, but it makes hard to use the side mirrors at night, I would love to replace them with cameras.

Things like night mode and anti-glare would be pretty cool as well.

scardine··on Ken Thompson's Unix Password
Right after finishing Electronics vocational school I spent the next year working as an intern at Unicamp (Campinas University in Brazil). The job was at the computer lab of the School of Electrical and Computer Engineering[1]. This was before ethernet (yeah, I' that old), so dumb terminals were linked to the CPUs through RS-232 cables - when I was not burning my fingertips soldering DB-25 connectors I was tinkering with every computer I could get my hands on.

I saw /etc/passwd and asked my boss how to decrypt the passwords. He told me it was a one-way encryption, so the login program would just encrypt the password you provided and compare to the encrypted value. He went on explaining the old crypt algorithm and even made a bet I could not guess his password. He said it was related to a movie.

So at 17 I was hooked and started studying the sources. In the end I just patched and recompiled the passwd binary to store clean text passwords in a hidden file. Later I learned this was called a trojan horse.

And even now, 30 years later, I remember his face when I told the movie was Citizen Kane and his password was "rosebud".

Thank you Miguel and Gorgonio for teaching me about C and Unix! This knowledge paid my rent for 3 decades and I still love the job.

[1] http://www.internationaloffice.unicamp.br/english/teaching/g...

[2] https://en.wikipedia.org/wiki/RS-232

scardine··on Ask HN: How do I make the move to consultant?
It is a catch 22: unless you are spending at least half your time prospecting new clients it is hard to keep a steady income, but it is hard to invest that much time in the commercial side of your "one man show" if you are not charging high enough.

Every beginner underestimate how much salesmanship it takes to run a successful freelancer career.

scardine··on On Stimming and Autistic Authenticity
It may come as a surprise, but neurotypical people also show stereotypical movements (stereotypy is the term used formally in scientific literature for this behavior).

There is a neural pathway that triggers this to occur in about any human, under the right circumstances - just watch anyone doing something that demands deep focus or concentration combined with fine motor skills.

For example, watch a musician or a someone playing videogame and you can identify motor stereotypical moves in the facial muscles (specially tongue/mouth/jaw).

The stereotypical moves in autistic persons tend to be very characteristic and are easy to spot if you have a trained eye.

So don't worry about moving your toes in patterns or jiggling your leg while you are coding, it is perfectly normal.

scardine··on Open-Source Seeds
I'm OK with GMO products, what I hate is:

* GMO that don't produce viable seeds so I have to buy seeds from you every season.

* GMO that only works with some other supply available only from the same provider (think of a car that only works with gas from Ford).

* Patents on living organisms: a farmer should be allowed to plant the seeds they grew in their own farm, produce hybrids and so on, without paying royalties.

* If GMO strains get accidentally cross-pollinated from a neighbor farm you should not be on the hook for it.

scardine··on Who cares about functional programming?
Python is kind of a strange beast - definitely imperative but with some FP-ish features: functions first-class citizenship, list comprehensions, generator functions/expressions (and there is the functools module). It is gaining more and more native immutable collections with each release. This multi-paradigm approach is what makes it one of the best glue-languages out there.

Python lacks tail call optimizations and recursion dept is limited to ~1000, so if your algorithm is not O(log n) or better you may have to convert from recursive to iterative (there is a recipe that makes conversion trivial) but other than that I'm content with its FP-style features.

scardine··on What ORMs have taught me: just learn SQL (2014)
Have you tried Python's SQLAlchemy, the ORM parent posts are praising? The `sqlalchemy.sql` module is awesome and pretty much maps 1:1 to raw SQL.

Composing SQL expressions using this library instead of using string interpolation/concatenation has several advantages:

* DRY and composition * safety * portability (if you have switch the underlying DBMS)

Often the result is as good or better than my raw SQL. The fact that Python has an amazing REPL makes the process pretty much like testing queries in the database prompt but with less cognitive switch between languages.

In the end it is a matter of taste, but I have to agree with parent posts, SQLAlchemy raises the bar for other ORMs.

scardine··on A Lunar Space Elevator Is Feasible and Inexpensive, Scientists Find
The space elevator itself would be something outrageously expensive and dangerous to build - but there will always be people willing to take the challenge.
scardine··on A Lunar Space Elevator Is Feasible and Inexpensive, Scientists Find
I just finished reading the "Mars Trilogy" by Kim Stanley Robson where there is a tension between the "red" and "green" parties (first group want to keep Mars pristine, the other want to terraform it). The reds even sabotaged Mars space elevator in order to slow down emigration.

I guess it will be like Antarctica, where several countries made territorial claims[1] over it, many of them overlapping.

The UN's 1984 Moon Treaty[2] is dead letter - it has never been defied but is defunct in practice as none of the most prominent space-faring nations have ratified it.

If someone settles in the Moon you can refute their claims over territory there but what else can you do? Set an embargo? Send a military force and try to kick them out? Nuke them? Someone with knowledge and resources to colonize that desolated rock in space is not an adversary to be underestimated...

[1] http://www.antarctica.gov.au/about-antarctica/people-in-anta... [2] http://disarmament.un.org/treaties/t/moon

scardine··on A Lunar Space Elevator Is Feasible and Inexpensive, Scientists Find
The moon has ideal conditions for solar energy harvesting: no atmosphere, no weather...

Since Project Apollo in the 1970s it is known that all the materials needed for manufacturing photovoltaic cells are present in lunar rocks and dust. Not saying it is an easy engineering feat, but the raw materials are there.

scardine··on A Lunar Space Elevator Is Feasible and Inexpensive, Scientists Find
Leaving moon's gravity well may be cheaper than getting to space from earth but it is far from free.

With a space elevator in the moon you can use raw material from the moon to assemble huge stations and ships in space.

scardine··on Purdue Pharma files for bankruptcy with $10B plan to settle claims
In Brazil there is a concept called Business Entity Disregarding (Desconsideração da Personalidade Jurídica) that can get both ways: make partners liable for company debts or companies liable for partner debts. It can be triggered when the plaintiff engaged in some kind of asset hiding fraud or there are substantial confusion regarding company/personal assets.
scardine··on California passes bill that classifies gig economy workers as employees
As I understood, once you hire someone in France the labor code makes it virtually impossible to terminate the contract.

In Brazil employers have to pay a fine if they fire a worker without a "fair cause" (~ 3.2% over the sum of all compensation paid to the employee while they worked for you), so the longer someone worked for you the more expensive it gets to fire them.

scardine··on California passes bill that classifies gig economy workers as employees
Interesting, so in France you can't fire someone but can legally make his life miserable through constant relocation? Brutal...
scardine··on California passes bill that classifies gig economy workers as employees
Interesting, in Brazil all the companies in the chain are liable in a labor-related law suit. Before the 2017 Labor Reform[1], frivolous law suits by former employees were a billionaire market because it used to be a risk-free gamble - after the reform the litigant is liable for exaggerated claims and there was a 46% drop in labor cases[2].

When I look at any market where the labor code is excessively protective, I see high unemployment rates specially among the young - Brazil, Spain, France[3]... I don't know about causation but clearly there is a correlation between employee over-protection and unemployment rates. I think it is the law of unintended consequences[4] in action: the legislator intention was good (protecting employee) but the net result is negative.

[1] https://www.jonesday.com/en/insights/2017/12/brazilian-labor...

[2] https://www.capital-ges.com/an-insider-view-of-the-brazilian...

[3] https://countryeconomy.com/unemployment

[4] https://en.wikipedia.org/wiki/Unintended_consequences

scardine··on Tired of Stack Overflow
You can flag it for reopening (but you need at least 3k rep IINM).
scardine··on Run Commands, the 'rc' in '.bashrc'
If you run a terminal multiplexer like byobu you may want to run it only for the ssh connection, not for every sub-shell (otherwise you may get a warning about running a multiplexer inside another multiplexer session).
scardine··on Show HN: Zero-Config Documentation Websites for Python
If you are on 3.7 you can add this import:

    from __future__ import annotations
And then forward references don't need to be strings. I wonder if this could fix the generated page.
scardine··on Major book publishers sue Amazon’s Audible over new speech-to-text feature
I think transcription (even if not perfect) helps a lot when English is not your first language and you are still training your ear. Remember not everybody processes audio the same way, think ASD or ADD people.
scardine··on Why Are So Many Developers Hating on Object-Oriented Programming?
It is like JavaScript: I don't hate JS itself, I hate spaghetti-code people write with it (but I do hate automatic type casting).

I don't hate C, I hate dangling pointers and buffer overruns.

I don't hate OOP, I hate over-engineered class hierarchies, state hiding and leaky abstractions.

I don't hate FP, I hate when people write a new undocumented DSL for each project just because "it is so easy in an expressive language like X".

scardine··on A Beginner’s Introduction to Python Web Frameworks (2018)
Sound reasons but there is nothing preventing you to adopt this pattern with Jinja. :-)

I'm glad that Jinja2 templates are now first-class citizens in Django as I care about performance and don't feel like patronizing template designers with a carefully handicapped template language.

scardine··on A Beginner’s Introduction to Python Web Frameworks (2018)
It is a design decision from a time where the general belief was that template designers played in a lower league compared to "real" software developers.

It is 2019 and personally I see no reason to think professional template designers will shoot themselves in the foot if we give them too much power. We are all consenting adults...

scardine··on A Beginner’s Introduction to Python Web Frameworks (2018)
> Also, you don't get much by switching Django templates to Jinja.

Well, you gain a lot of performance - as much as 10x depending on the complexity of your template. Also, Jinja is a lot less crippled than Django Templates (for example, you can't call a function/method with parameters in Django Templates).

scardine··on New Life Found That Lives Off Electricity (2016)
Have you watched "The Expanse"? I like that explosions in space does not make sound and inertia look right in this show, how would you classify it?
scardine··on Hiring Is Broken: What Do Developers Say About Technical Interviews?
> A candidate might reasonably assume that they can look better than the other candidates by spending more time on the problem

The same is true with a take-home, candidates see the (often underestimated) statement "this should not take more than X hours" and assume they will have a better shot if the invest more than the X hours.

I forgot to mention that we also accept past contributions - in the end the hypothetical candidate can spread this 60 hours investment over any other hiring processes using the same method.

I'm thinking about writing a "social code challenge manifesto".

scardine··on Hiring Is Broken: What Do Developers Say About Technical Interviews?
Exactly. And it is way easier to fake a resume than fake public reputation. For example, looking at a stackoverflow profile I can tell if someone knows how to ask and how to answer (a good question is 90% of the answer).

[1] https://stackoverflow.com/users/22656/jon-skeet

[2] https://stackoverflow.com/users/444036/paulo-scardine

scardine··on Hiring Is Broken: What Do Developers Say About Technical Interviews?
Exactly, many people complain about about not being hired because they lack experience and they can't build experience if they are not hired.

My advice is always "build experience contributing to FOSS projects in your spare time".

We are pushing the envelope and often find bugs or lacking features. I want to hire people that can fix/implement those and send the PRs upstream instead of nagging the project maintainers.

scardine··on Hiring Is Broken: What Do Developers Say About Technical Interviews?
My companies do something a bit different: we ask people to pick any issue from any opensource project in our tech stack and try to land a patch closing it.

We think this is better then wasting the candidate's time on a toy project - at least the can write off their time on the opensource-karma account.

Also, we can check not only their code but also their communication style and other skills that matter in the real world (projects on our tech stack have a high threshold for documentation, unit tests and other stuff that matters).

We call it "social code challenge" and it is working wonderfully for our recruiting process.

scardine··on Turkmenistan on the brink of collapse?
Well, regarding South America there is a generation that grew up reading "Open Veins of Latin America: Five Centuries of the Pillage of a Continent" (even the author Eduardo Galeano has criticized his own work).

Blaming all the region problems on the "imperialists" and stuff like that is a line of thought still very alive and kicking around here - it is way easier to blame some imaginary entity than taking responsibility for your present situation. It is very inline with the current "outrage porn" culture.

[1] https://www.amazon.com/Open-Veins-Latin-America-Centuries/dp...

scardine··on I am a horse in the land of booleans
I have not touched PHP in the last 10 years but if memory serves it also has the ternary operator. Ok, lets try it:

    $ php -a
    Interactive mode enabled
    php > echo 1 == 1 ? "foo" : "bar";
    foo
    php > echo 1 == 2 ? "foo" : "bar";
    bar
Looks like javascript has it too:

    1 == 1 ? "foo" : "bar"
    "foo"
    1 == 2 ? "foo" : "bar"
    "bar"
Page 1 of 20Next →