HNHacker News
TopNewBestAskShowJobs

sebcat

1,241 karma · joined October 24, 2012

Mowgli could not help laughing when the Bandar-log began, twenty at a time, to tell him how great and wise and strong and gentle they were, and how foolish he was to wish to leave them. "We are great. We are free. We are wonderful. We are the most wonderful people in all the jungle! We all say so, and so it must be true," they shouted. -- Kaa's Hunting
submissionscomments
sebcat··on Let's make the Emacs GC safe and iterative
One could argue that. One could also argue that it should be possible to collect any garbage successfully created.
sebcat··on Let's make the Emacs GC safe and iterative
> I'm just wondering what is the exact scenario, involving what structure.

> Was: Re: bug#30626

    (seq-doseq (_ (stream-range 1 1000000)) nil)
sebcat··on The Makefile I use with JavaScript projects
Ah, that works!
sebcat··on The Makefile I use with JavaScript projects
That doesn't work for me. Tried with empty Makefile, no Makefile, with make (PMake) and gmake (GNU Make).
sebcat··on The Makefile I use with JavaScript projects
> It actually doesn't know anything at all about how to build C, C++, or any other kind of code.

I guess it depends on how you define "know", but there are implicit rules.

    $ cat foo.c
    #include <stdio.h>
    int main() {
      printf("Hello\n");
      return 0;
    }
    $ cat Makefile
    foo: foo.c
    $ make
    cc -O2 -pipe    foo.c  -o foo
    $ ./foo
    Hello
sebcat··on Memory Tagging and how it improves C/C++ memory safety
ASan has lower overhead than Valgrind, and is great when you cross-compile something to an embedded/constrained system. I have however observed noticeable overhead on code doing many small allocations.

Which was nice to be able to observe, because the code didn't need to do many small allocations.

sebcat··on An SVG that always shows today's date
> Well, it's not really a thing. In a browser (the only kind of UA that'll really run any scripts in an SVG), SVG basically gets treated as SGML, all the DOM stuff is the same. If you include it as an image tag, the scripts don't tend to run, AFAIK

It breaks expectations. I havn't looked at it recently, but it used to be the case that hosting user submitted SVGs on your domain could yield JS-execution in the origin context. Embedding or iframing without sandbox isn't/wasn't secure either.

A quick google search on SVG XSS gives:

https://hackerone.com/reports/148853 https://phabricator.wikimedia.org/T85850

sebcat··on Nocode: The best way to write secure and reliable applications
alternatively; why write code when your software company can grow on hype alone?
sebcat··on Norway as a destination for tech founders
> Taxes are insanely high: income tax is on the level as Switzerland; VAT is 24.5%.

What's the employer payroll tax?

For comparison: in Sweden, the employer payroll tax is 31.42%, the income tax is ~30% (depending on where you live) and the VAT is 25% for most goods (food is 12% IIRC).

The employer payroll tax is a bit interesting. As an employee you never see that money, but you more or less pay it (lower wages).

sebcat··on GoPro has discontinued its developer program
> GoPro could turn themselves around if they supported their customer community by opening up their hardware interfaces more

Is it theirs to open up though? When I last looked at it, it seemed as if most of their tech was Ambarella SoCs. Doing a quick search now, it seems they went with Socionext for Hero 6.

Even if they could open it up, it would be a non-trivial cost to support. Multiple products, probably multiple breaking API changes between firmware releases, ... It would probably have to be on a partnering program basis, and for that you need partners willing to share the costs.

As for lowering the price... The market is becoming saturated, competition increased and cheaper alternatives have been popping up. Lowering COGS is hard. GoPro grew up and cornered the market for a while. In doing so, they grew in the environment they were in, but the environment changed and now they have to adopt to the new conditions. That's easier said than done.

I'd say they'd have to broaden their product portfolio in order to avoid/get out of stagnation and decline. I think that was their thought when going into the drone market, but it didn't go well from what I understand. There's other markets for products built around optical sensors (surveillance/security, "smart" sensors w/ computer vision, ...).

Supporting an open developer program is probably not a viable thing for them to do right now.

sebcat··on U.S. tests nuclear power system to sustain astronauts on Mars
Or Runit Island: https://en.wikipedia.org/wiki/Runit_Island
sebcat··on Rust in 2018: easier to use
I also do this. I make use of Capsicum/seccomp-bpf and jail/chroot to a ro mountpoint, use SSP, ASLR where possible, ... But I still use C as my primary programming language. I've also written code in golang professionally for a year or two.

It's quite common in the embedded space to use C or C++. It's easy to run everything as root and skip fundamental bound checking, so those languages get a bad rep in that space. Totally understandable. But it is possible to engineer solutions that are a lot safer too. It's just a question of priorities. Companies not prioritizing writing safe code or not working on having a safe architectural design will not bother with Rust or other memory safe languages. There's little to no market incentive in most areas. Sad but true.

sebcat··on From 200K lines of CoffeeScript to zero: making decaffeinate super-stable
Other types of businesses choose to maintain large chunks of code in a "legacy language" and paying people to maintain it overtime, at a cost (e.g., banks and COBOL).

Let's say there's a COBOL -> C/C++/Rust/someotherfancylang transpiler. Maybe there is one, maybe not. Would it make sense for a bank to invest in something like that, or is there really no incentive to do so? Why would there be an incentive for a startup to do so, but not for a bank?

sebcat··on Are all BSDs created equally? A survey of BSD kernel vulnerabilities [video]
Which tells me that 1) the deficiencies are minor or 2) the benefits outweigh the deficiencies, or a combination.
sebcat··on Things I have learnt as the software engineering lead of a multinational
"It is even better to act quickly and err than to hesitate until the time of action is past"

-- Carl von Clausewitz (On War?)

sebcat··on 640k Really Is Enough for Anyone
The boot time bottleneck (if it can be called that) on my old ABC80 was waiting for the CRT to warm up. The prompt was already there and fading into view a couple of seconds after power-up.

Booting from ROM is one thing. Loading something from tape, that's another story.

sebcat··on Building a Regex Engine in Fewer Than 40 Lines of Code
In Lua, LPeg[1] is my goto for anything that can't be done/gets too complex with patterns.

[1] http://www.inf.puc-rio.br/~roberto/lpeg/

sebcat··on Using LD_PRELOAD to cheat, inject features and investigate programs (2013)
Massif is a good tool for memory profiling: http://valgrind.org/docs/manual/ms-manual.html
sebcat··on Using LD_PRELOAD to cheat, inject features and investigate programs (2013)
LD_PRELOAD is a pretty decent tool to have in your toolbox when debugging, and you can't fire up lldb/gdb.

I've used it in the past to get an overview of what gets passed to SSL_write, SSL_read: https://github.com/sebcat/openssl-hook

sebcat··on In a Venezuela Ravaged by Inflation, ‘a Race for Survival’
Private property as ownership is unjust according to e.g., Proudhon. Growing a piece of land and reaping the fruits of your labor is different from having a piece of land(/shares of a company/...) and benefiting from the work others do on that land.

Not saying that I agree with that, just presenting a different point of view.

sebcat··on In a Venezuela Ravaged by Inflation, ‘a Race for Survival’
Revolutionary communism/Marxism (which Chávez identified with) likes the idea of the dictatorship of the proletariat. It is not a requirement for socialism in itself, and a lot of socialists would be directly opposed to it.
sebcat··on A good resource for financial advice to share with people in their twenties?
Good point. The idea would be to avoid loss on the way down, and repurchase when the numbers go up again, but that would of course be very difficult to know when that is.
sebcat··on A good resource for financial advice to share with people in their twenties?
Caveat: I have no idea what I'm doing, but it has worked out well so far.

I have some of my savings in index funds. The low fees, the risk profile (if that's a proper term for it in English) and historical performance (which is not a guarantee for future performance) of certain indices is what I like about them.

If I create an index consisting of Company A, B, C, with 40% A, 30% B, 30% C and call that index "the sebcat index" others may sell sebcat index funds consisting of company A, B, and C stocks at those proportions. Of course, that's a bit too arbitrary. Normally you would have an index based on e.g., the N largest companies on a specific market/region. The index may be adjusted over time depending on market cap or something else, funds may not follow the index exactly, but that's the gist of it, to the best of my knowledge (see caveat). It's not in itself bound to geographical regions, though if you buy funds tracking foreign companies you should be aware of currency effects, politics &c (though local companies could be affected by that as well of course).

Look up a couple of indices (e.g., MSCI indices), then find what index funds on your exchange tracks these indices. Look up what the funds consist of exactly. If you compare two different funds tracking the same index, they should have similar performance over time. Buy one or two per index. The fees should be relatively small, 0-0.4%.

If you expect a crash to happen, or you see a crash happening that is not likely to end soon, sell any index funds affected and maybe put the money in interest funds, or gold, or something that you believe will not be as affected by, or benefit from the current situation on the market. Then buy back when (or if) the market goes up again (depending on your time frame).

sebcat··on Ditching Go for Node.js
> it seems the number of channels was exponential to the number of users in a room

I do not see this in the code linked to from the article.

sebcat··on Ditching Go for Node.js
I count three goroutines per connection: One for ChatHandler.Loop (when invoked from ChatService), one for ChatHandler.socketReaderLoop and one for socketWriterLoop.

Each ChatHandler has three (buffered) channels: outgoingInfo.channel, sockChannel, readErrorChannel (not buffered)

There are some things that could cause bottle necks that are not related to goroutines and channels: Every published message calls GroupInfoManager.GetUsers to get a list of all the users in a group. That can be expensive (I don't know if it is or isn't). And then for every user in a channel, their userOutGoingInfo is retrieved.

I would suggest profiling before switching languages.

EDIT: changed "benchmarking" to "profiling" EDIT2: changed "are likely to" to "could" (... cause bottle necks) since I don't know

sebcat··on Argentina says signals detected, likely from missing submarine
I'm not so sure it's that simple. Airplanes can glide, autorotation is hard and rotors tends to break apart violently on impact.
sebcat··on Ask HN: What are best tools for web scraping?
> Is the modified version you use a personal version or a well-known fork?

I had a specific thing I needed to do, gumbo-parser was a good match, I poked at it a little and moved on. It started with this[1] commit, then I did some other work locally which was not pushed because google/gumbo-parser is without an owner/maintainer. There are a couple of forks, but no/little adoption it seems.

[1] https://github.com/sebcat/gumbo-parser/commit/c158f8090c2df0...

sebcat··on Ask HN: What are best tools for web scraping?
lxml can be hit-or-miss on HTML5 docs. I've had greater success with a modified version of gumbo-parser.
sebcat··on Security Breach and Spilled Secrets Have Shaken the N.S.A.
> The agency regarded as the world’s leader in breaking into adversaries’ computer networks failed to protect its own.

Those are two very different things. Focusing on one of them doesn't automatically benefit your efforts on the other.

sebcat··on Sugar alters hormones and metabolism, sets stage for obesity and diabetes
I'm 17x cm and weigh 7x kg. I run (mostly 10K, completed a half-marathon recently) and lift weights semi-regularly. I have a relatively low sugar intake. I don't feel energetic at all. I get home from work and more or less lay down until I fall asleep. Gabriel Iglesias seems to be way more energetic than me.

Jaggery seems to be 50% sucrose, and honey is mostly glucose and fructose. Shouldn't it have the same effect on blood sugar levels?

← PreviousPage 5 of 14Next →