HNHacker News
TopNewBestAskShowJobs

sergiosgc

4,044 karma · joined April 13, 2012

submissionscomments
sergiosgc··on The link between personality and success (2021)
I really dislike that link in the article. People lacking self-confidence may be more prone to introversion, but the reverse is false. Introversion is not mostly caused by lack of self-confidence, and it's not something you should "fix", as the article implies.

Of course, extreme cases of introversion (or extroversion) are pathological, but not on the normal scale of things.

sergiosgc··on Ask HN: Do you use foreign keys in relational databases?
That's not how you migrate. You disable the foreign keys, load the data, then enable them (which checks everything is ok).
sergiosgc··on What I learned working with a senior engineer as a new grad
Congratulations on the post. One may agree or disagree with the content, but the text is clear, to the point, and generally very well written.

Good writing is, to me, the foundation of a good engineer. I know excellent engineers who are not great verbal communicators, but every excellent engineer I know writes like you do. I think it is the result of a structured thought process, that flows naturally into a structured clear text.

sergiosgc··on GM makes $1,500 subscription mandatory on GMC, Buick, Cadillac Models
That's not it. EU countries have income tax.
sergiosgc··on How fast is 12th Gen Intel Core?
I'm also developing in Rust, with a 12th gen i7-1270P. It's an absolute beast; I'd say it's on the range of 2x speedup vs my previous laptop (11th gen i7).

I have no idea about power consumption yet (the laptop is a couple weeks old). On light load, the laptop easily crosses the 8h mark but it won't, certainly, when grinding rust compiles. The M1's power efficiency is on a different league.

sergiosgc··on I still love PHP and JavaScript
You can have a statistic approach, and that's what the OP is referring to. If you find out about an unknown unknown frequently, they are out there. If you go years without hitting one, they are (probably) absent.
sergiosgc··on I still love PHP and JavaScript
Anything "falsy" -- any item that, when cast to boolean results in false. So, also zeroes, falses and empty strings.
sergiosgc··on I still love PHP and JavaScript
> I will quietly place my face in my hands and weep to the memory of php coding I did 20 years ago.

You should revisit the language. PHP7 was a huge leap forward. It's a different language now.

sergiosgc··on Researchers demo Bluetooth relay attack against Tesla
I'd implement two mitigation features ASAP:

1. Disable the ability to unlock the car if the phone has been stationary for a while. No more siphoning authentication from a phone in the night stand.

2a. Setup phone presence inside the car as a second authentication factor for starting the car. BMWs can detect if the key is inside or outside the car; I imagine the same positioning can be detected out of a bluetooth+wifi+nfc radio source.

2b. If phone positioning would require extra hardware, an alternative is using phone NFC as authentication (I think the keycard is NFC, so the hardware should be present)

sergiosgc··on Wp-SQLite: WordPress running on an SQLite database
Nice side effect: SQLite's SQL is almost entirely compatible with Postgresql. This probably allows one to use Postgresql instead of Mysql.
sergiosgc··on Historic fertilizer crunch threatens food security
Synthetic fertilizers do not deplete soil fertility. Some agricultural practices do, with a strong emphasis on mono-culture, but it is wrong to throw everything in the same bag.

Growing without synthetic fertilizers appeals to the symbiotic Nature living, I get that. It's an ideal like any other, maybe worth of pursuit. But we first need to make peace with the fact that we'll either:

a) Be able to feed about a billion humans at most; or

b) Completely destroy many pristine ecosystems by multiplying arable land area by 5.

Removal of synthetic fertilizers would induce a yield drop of 80%: https://ourworldindata.org/grapher/cereal-crop-yield-vs-fert...

sergiosgc··on Ask HN: What’s a good laptop for software development at around $2k?
M1 Macbooks support OSX only. That's a deal breaker.
sergiosgc··on U.S. forgives 40k student loans
Student loans should be discharged on personal bankruptcy. All of the other examples you give can be written off like that. Student loans, however, are rarely discharged by judges on those processes.
sergiosgc··on Ask HN: What’s a good laptop for software development at around $2k?
7th gen keyboard is the best in the X1 Carbon history, 8th gen had reliability problems, and the current generation (9th) is very very good, if you are ok with the reduced key travel. I happen to like it, but it is really a matter of personal preference.
sergiosgc··on Ask HN: What’s a good laptop for software development at around $2k?
Sorry, but no. That is entirely false. I get 10h out of a Lenovo X1C, and Lenovo is not special. Good battery life is not yet a given in every laptop, but easy enough to find with a bit of care when choosing the laptop.
sergiosgc··on Ask HN: What’s a good laptop for software development at around $2k?
I second that. I only use X1Cs. Had a gen3, gen7 and currently use a gen9. The one I have now (X1C Gen9) is the first one that turns the fans on without any CPU heavy task (compiling, blender, stuff like that). Low RPM, but fanning nonetheless. I throttled the CPU (i7-1165G7@2.8GHz) to 2GHz (the hardware limit is 4.7GHz), and it no longer heats up; bullet dodged.

The gen7 had a screen malfunction, repaired under warranty with flawless service. I just upgraded because it would take two weeks for service turnaround, and we might as well have a spare laptop around.

Excellent keyboard, much better than Macs. I use trackpoint, so I'm unable to evaluate the trackpad. The internal display is 1920x1200, and I have nothing bad to say about it. Excellent linux driver coverage. Runs cool, even if it required capping its performance.

sergiosgc··on If you’re not using SSH certificates you’re doing SSH wrong (2019)
The SSO flow is way too complex for something that must work on an emergency.
sergiosgc··on Nintendo Switch prevents downgrades by irreparably blowing its own fuses (2020)
Why can't I tamper with hardware I bought and paid for? It's not theirs to brick, whatever the justification.

I hate that the idea that you rent stuff from companies, instead of buying and owning, is now so ingrained that people defend actively destroying someone's equipment remotely.

sergiosgc··on I think US college education is nearer to collapsing than it appears
There is nothing intrinsically wrong with positive rights. The right to physical safety involves active participation of others, and you'd be bonkers to say it isn't a valid right. No society functions without police.

What we do with positive rights is bundle them up into government provided services, so the load gets distributed evenly through society. These tend to work well, at least in Europe. I really can't understand the US view that anything that is state-provided is inefficient.

sergiosgc··on Welcome to Web 3.0
The idea of a public ledger, where any public record can be kept without the need of a central authority certainly has value. The fact that current tech solutions are not efficient, and thus expensive, should not hide that value.

Instead of going through offshoots trying to find the killer app, I'd much prefer to see cryptocurrency tech evolve in order to bring costs down. Take the base use case of keeping "bank account" records and run with it until it works (as of now, it does not). Out of the viable -- for my definition of viable -- cryptocurrencies out there, the only one I see moving in the right direction is Ethereum. They are taking their sweet time, though.

If a killer use case is needed, think micropayments: The ability to pay 0.1¢ to listen to a song, paying directly to the artist.

sergiosgc··on Elementary OS is imploding
It's a very risky move. These agreements usually have a generous period for participants to seek funding (six months is typical). If the deal is economically advantageous (11k for a 50k share), and the problem is liquidity, the buying party can find an external investor willing to get in on the deal.
sergiosgc··on Elementary OS is imploding
The company avoided a shareholder fight for shares. This is actually a defense mechanism for the company, not the founders.
sergiosgc··on Elementary OS is imploding
It solves the basic problem of stabilizing the shareholder group. No more infighting.

Important to your point, this method makes it difficult to stray from the real valuation. If Alice really wants out, she does not value the shares as much as Bob. Her just valuation will be viewed as a good deal by Bob. The scenario you define probably will not happen. If it does happen, then by definition Alice actually valued staying with company.

sergiosgc··on Elementary OS is imploding
Having a shootout agreement in place I think is the best option: At any moment, a founder may wish to buy someone else's equity, or may wish to sell his own. At that moment, he proposes a transaction value. The counter-party has the choice to take either side of the transaction.

Example: Alice wants out. She proposes that Bob buys her shares for 50k. Bob may either accept the purchase, if he thinks the price is correct, or he must sell his own shares to Alice if he thinks the proposal is over-valued.

There are more details to this, like a horizon allowing for funds to be sought, the possibility of financing by the company or dealing with more than two partners, but this is the gist of it.

sergiosgc··on Russian forces invade Ukraine after Putin orders attack
Portugal's prime minister announced a simplified visa programme for any Ukrainian wishing to flee the conflict. If in need, get in touch with the Portuguese embassy in Kiev [1]. It is still staffed.

[1] https://kiev.embaixadaportugal.mne.gov.pt/en/

sergiosgc··on Blockchain-based systems are not what they say they are
> For Ethereum and most other altcoins, it's not possible to run a full node on a home computer. That's why most of the nodes are run by companies such as Infura.

I have never tried to run a full node, but from what I read, the specs for a full node are nowhere near the realm of impossible: https://www.reddit.com/r/ethereum/comments/jv8ovb/what_are_t...

1TB SSD, 16GB RAM, an i5 is pretty run-of-the-mill.

sergiosgc··on PHP 8.1.0
I have. Elegant it is not. Actually, it smells like Enterprise Java code, which made me flee from the Java ecosystem. To each his own, but this is not an elegant event listener (copied from the examples page):

  use App\Events\ArtistInformationFetched;
  use App\Services\MediaMetadataService;
  use Throwable;
  
  class DownloadArtistImage
  {
      private MediaMetadataService $mediaMetadataService; 
  
      public function __construct(MediaMetadataService $mediaMetadataService)
      {
          $this->mediaMetadataService = $mediaMetadataService;
      }
  
      public function handle(ArtistInformationFetched $event): void
      {
          $info = $event->getInformation();
          $artist = $event->getArtist();
  
          $image = array_get($info, 'image');
  
          if (!$artist->has_image && $image && ini_get('allow_url_fopen')) {
              try {
                  $this->mediaMetadataService->downloadArtistImage($artist, $image);
              } catch (Throwable $e) {
              }
          }
      }
  }
Source: https://laravelexamples.com/example/koel/events-listeners
sergiosgc··on Depression is more than low mood, it’s a change of consciousness
Not a native speaker either, so take this with a grain of salt. I read it as acting promptly, staying ahead of the problem, do not postpone remedial action.
sergiosgc··on Useful sed scripts and patterns
Many people maintain those in a text file, somewhere. My approach is slightly different. I keep them in my shell history file itself.

First, set your HISTSIZE to 1 trillion. Then, tag the relevant commands in the history file with a comment after the command (e.g. sed -n '5,10p' some.log # print selected lines). It gets searchable within the shell, either by the comment or the start of the command. Always at my fingertips.

sergiosgc··on Useful sed scripts and patterns
> Awk/sed made sense for the time and place they are from, but things have changed.

Don't do that. Do not assume something is of no use because you don't know how to use it. Double that recommendation for tools that have widespread use. There is a reason they're used everywhere.

In the case of awk/sed/perl: Nothing beats them for composition in one-liner text processing pipelines.

← PreviousPage 4 of 34Next →