HNHacker News
TopNewBestAskShowJobs

eriknstr

1,862 karma · joined May 29, 2016

Dear HN, please delete this account.
submissionscomments
eriknstr··on Reverse engineering a Nintendo Switch cartridge
You're pretty determined when you decide to dissolve the packaging of an IC :)
eriknstr··on 4D Toys: a box of four-dimensional toys
The rest of the video up until 16:26 has been about projecting down one dimension but it's doing so in different ways instead of just simple cross-section and it's using videos to show rotations and stuff.
eriknstr··on 4D Toys: a box of four-dimensional toys
Another quote from the video I linked in parent comment.

6:19

> As complex numbers are to real numbers, quaternions are to complex numbers. It's like a way to build up even further. [...] Real numbers are one-dimensional. Complex numbers are two-dimensional. [...] For three dimensions there is no natural number system, but for four dimensions there is and it looks like this.

eriknstr··on 4D Toys: a box of four-dimensional toys
Same here. I understand perfectly everything that was said in the video but I still don't understand how the fourth dimension quite works.

However, having only heard of hypercubes and not hyperspheres before I decided to see if there was anything useful about them online and I found this video that I just started watching and already 1 min 50 sec into the video something very interesting was said;

> Everybody knows what the sphere is. I'm thinking of a hollow sphere so like a basketball right. That's a two-dimensional surface living in a three-dimensional space. The hypersphere is generalized one dimension up, so in four dimensions you have this three-dimensional space called the 3-sphere or the hypersphere.

https://www.youtube.com/watch?v=krmV1hDybuU

Already this is telling me something that I have not heard before, and which I find much more helpful than talking about what a shape looks like from the perspective of someone living one dimension further down. That being said it was still useful having that explained as well, which is what Flatland: The Movie (2007) was about as well. Just this fact I quoted above was even more useful IMO.

eriknstr··on Hacker, Hack Thyself
Once they have the hash type table in place they should switch to Argon2.
eriknstr··on Hacker, Hack Thyself
You are correct that there are 10^8 possibilities for a string of 8 digits.

10 possibilities in position 1

10 possibilities in position 2

...

10 possibilities in position 8

10 * 10 * 10 * 10 * 10 * 10 * 10 * 10

Alternatively one can even simply observe that 99999999 is the highest number possible and since 00000000 is possible also then we have 99999999 + 1 different possibilities = 100000000 = 10^8

eriknstr··on Kerbal Space Program Acquired by Take-Two Interactive
Your original comment read as if you were saying that Unity was to blame for what the graphics look like.
eriknstr··on Goodbye PNaCl, Hello WebAssembly
Electron apps are not really relevant when talking about Java applets. Java applets embed in the browser, so compare Java applets with HTML5, CSS3, JavaScript and WebAssembly.

I much prefer the latter (HTML5 + CSS3 + JS + WebAsm).

eriknstr··on Goodbye PNaCl, Hello WebAssembly
I think that's what parent commenter was implying.

(However, I don't agree. I remember the horrible Java applets and I am thankful that I pretty much never encounter any of them these days.)

eriknstr··on Intel Announces Skylake-X: Bringing 18-Core HCC Silicon to Consumers
3, 5, 7, 9. Makes sense to me.
eriknstr··on Basic 2D Rasterization
Very interesting article. Well written and it answers several questions that I've had but which I hadn't previously gotten around to investigate. Looking forward to the next article in the series.
eriknstr··on Writing a Unix Shell
Loop fusion is a good name for what I want, thanks.
eriknstr··on Writing a Unix Shell
>UNIX shells already optimise pipelines by running the commands along it concurrently.

I am aware of that. Still, performing multiple operations on the data within a single loop and with less copying would be an optimization.

eriknstr··on Ask HN: What are some examples of successful single-person businesses?
But if he moved even a single millibitcoin out of his wallet I think the market might react with panic in fear that he would sell a lot of coins at once, and so the fear of the value plummeting might cause it to do just that.

So even if he is alive, could he ever reap the benefits of those coins?

Hopefully he mined with different wallets so that he's been able to sell smaller amounts of coins without anyone knowing that it was him.

eriknstr··on Ask HN: What are some examples of successful single-person businesses?
He put it back up once a lot of clones started appearing though, didn't he? The reason being that since people would play the exact same kind of game either way he might as well be the one to get the revenue?
eriknstr··on Ask HN: What are some examples of successful single-person businesses?
I like the top comment for that on imgur.

>This could be telling the story of IE users being murdered out of existence.

eriknstr··on MoonScript, a programmer friendly language that compiles to Lua
Dude, this is neat. Itch.io is a great site, I've bought a few things through it.

I like how your HN profile page mentions only MoonScript and not itch.io, though, in that the former is an open source project and the latter is a company :)

eriknstr··on Annotated Algorithms in Python, Free EBook [pdf]
Via https://www.reddit.com/r/programming/comments/6e0m7p/full_fr...
eriknstr··on Noise: a JSON full text and ad-hoc query engine with example-based query syntax
When it mentioned Node.js I prepared myself to get disappointed that it wasn't written in Erlang but instead I was delighted to find that it was written in Rust :)
eriknstr··on Tallest Lego building with 4 pieces?
>I think problems like this can actually be more interesting than solutions

Reminds me of an animated shortfilm I saw not too long ago but not that recently either.

There's this person that has a box full of questions and s/he encounters an elderly person that has "all the answers", and I'm not going to spoil the rest.

I just can't for the life of me remember what it was called and I can't find it with any web search I can think of either. Anyone know which one I'm thinking of?

eriknstr··on Show HN: Early-stage Yahoo Pipes spiritual successor
Unreal Engine 4 Blueprints are amazing from what I've seen, and show what a good visual editor can be capable of. LabVIEW is a PITA in my experience. That being said I have not invested very much time in LabVIEW but I have no motivation to either. I don't mean to flame, that's not the intention, but does anyone on HN actually think that LabVIEW is a comfortable and productive tool? If so, how and why?
eriknstr··on Writing a Unix Shell
Not everyone understood what I meant to say but you did, thanks :)

Starting from the Unix utilites is simply because I'm so used to them.

I can assure you, however, that anyone who was under the impression that my system was actually Unix would be in for a nasty surprise :->

My system would be, shall we say, not POSIX compliant.

My system would take the things I like about Unix, such as being command-line centric and having utilities focused on being good at small individual tasks and using pipes to glue them together seemingly (but actually as mentioned each pipeline is compiled to an optimized program when run), and the filesystem would remain essential and hierarchical.

I would separate Operating System binary data, Operating System config files, Application binary data, Application config files, User config files, User downloaded data and User created data STRICTLY!

Also like I mentioned, to have structured binary data instead of text. This would lead to commands which are named like in POSIX but which operate a bit differently with regards to the arguments they take.

Probably a lot of other things as well that I've been thinking about but which escapes me at the moment.

But yeah, all of that remains a dream because it would involve more work than I have time for :(

eriknstr··on Writing a Unix Shell
Yes. I just forgot to :)
eriknstr··on Writing a Unix Shell
I intended for the delimiter to be tab in this example.

Using sed or awk is an option, yes, but I am so used to the standard utilities that I would rather keep using them.

Also I'm not sure if your sed script does what I intended for it to do.

1. Take ever line that starts with 2017-05-29.

2. Out of the lines we have, remove any that contain INFO or WARN.

3. Take the five last of all of those lines.

4. Take the first and third fields of all of those lines.

Let's create a sample file

    cat > /tmp/somefile <<EOF
    2017-05-28T08:30+0200	nobody	ERR: Foobar failed to xyzzy.
    2017-05-29T13:01+0200	nobody	INFO: Garply initiated by grault scheduler.
    2017-05-29T13:37+0200	nobody	DEBUG: Garply exited with 0.
    2017-05-29T14:12+0200	nobody	WARN: Plugh quux corge.
    2017-05-29T14:55+0200	nobody	ERR: PLUGH QUUX CORGE!
    2017-05-30T00:17+0200	nobody	ERR: Failed to retrieve baz needed for thud.
    EOF
(Note that due to how HN formatting works you won't be able to copy-paste this because HN requires leading space to format as code but then it includes the spaces in the output also and we don't want leading space in the file.)

    grep ^2017-05-29 /tmp/somefile | egrep -v 'INFO|WARN' | tail -n5 | cut -f1 -f3
Note: I had a typo in my original example where I said "grep -v" where I meant "egrep -v".

Result:

    2017-05-29T13:37+0200	DEBUG: Garply exited with 0.
    2017-05-29T14:55+0200	ERR: PLUGH QUUX CORGE!
Running it with your pipeline

    sed '
    /^2017-05-29/!d;
    /INFO/d;
    /WARN/d;
    s/ /INFO/;
    s/ /INFO/;
    s/ .*//;
    s/INFO.*INFO/ /;
    ' /tmp/somefile \
    |tail -n5
results instead in:

    2017-05-29T13:37+0200	nobody	DEBUG: exited
    2017-05-29T14:55+0200	nobody	ERR: QUUX
But that's just because you assumed that space was the delimiter when it was not.

Your use of the word "INFO" as a placeholder for the first two occurrences of the space character threw me off quite a bit when reading your script, since the word "INFO" occurs in the file we are working with itself, but it makes sense to use a word that we know is no longer possible to be present since we've already removed all lines that contain it. However, while a neat trick, those kinds of strange hacks are the kinds of things that has brought me to believe that having objects (like they have in Microsoft PowerShell) instead of pure text would be beneficial in Unix also.

---

As for your comments on compiling into a single program and run that, I don't think you understood what I meant, or I don't think that busybox and those chrunched binaries you mentioned perform the optimization I am talking about, do they.

---

Using the k language you mention in that fashion seems more like a hack and will require a lot of work each time. I would rather rewrite all core commands of my system so that they produced true objects, or actually, rather than objects just structured binary data. I don't need the output to have methods you can call.

One of the main things I want from structured binary data is to be able to select the columns of data by name instead of by index and without having a mess of some commands using tab for delimiter and others space and so on.

So instead of

    zfs list -H | cut -f1,3,4
I would like to

    zfs list | cut name used avail
for example, or something like that.

Also all commands that output tabular data must have a "header" command that will show the column headers. So to see the headers that the 'list' subcommand of the zfs command will output, I would say

    zfs header list
And it would tell me

    NAME	USED	AVAIL	REFER	MOUNTPOINT
and furthermore since I am authoring the shell, when you tab to complete a command it will call the binary with the header subcommand and output the headers so that you can have them easily accessible while you're working on a pipeline. And furthermore this shall work with pipes already present.

So if I type

    zfs list | cut
and then tab to complete, it will call

    zfs header list
and pipe that to

    cut header
which will return the input it saw

Naturally, "header" will be a reserved word.

All commands will understand how to work with tabular data.

When you use grep you will either specify which column to use, or you can tell it to look across all columns with *

The shell will only expand * to file names when the * is positionally last in the argument list of a command since all commands will take the list of files as the last ones in their list of arguments.

---

All of this being said, I appreciate all replies, including yours.

eriknstr··on Browse Against the Machine
Furthermore, Safari is proprietary. Firefox is not and most of Chrome is not (Chromium).
eriknstr··on Writing a Unix Shell
I have a pretty good idea for a shell but I don't know when I'll ever find time to implement it.

The idea is that the shell should be able to optimize pipelines. Pipeline here meaning a chain of commands piped into one-another.

So if you have a pipeline like

    grep ^2017-05-29 /var/log/somefile | grep -v 'INFO|WARN' | tail -n5 | cut -f1 -f3
Then the idea is that instead of piping the whole result from command to command, your shell would compile a set of commands into a single program and run that.

Now you might say that that sounds like it goes against the Unix philosophy, but actually it doesn't need to. If all of the core utilities were implemented in such a way that their logic could be extracted without duplication of code then the shell can still be doing "one thing and one thing well".

---

Another idea I have is to make these core utilities pipe objects instead of text, like on Windows. I am very fond of bash but I think one thing that Microsoft seems to have done right is to have the idea of being able to work on objects in PowerShell. But I don't want PowerShell. I want a mostly Unix shell, except, as I said, with objects.

I just wish I had more time :(

eriknstr··on Show HN: ObjectCropBot – Interactively Crop Objects from Photos with AI
Neat. However I think the proper term would be cut-out. Cropping is just cutting of edges vertically or horizontally.
eriknstr··on View Counting at Reddit
I think the main problem is not concurrently updating the counter. After all updating the HLL must also be done concurrently.

The primary motivation on their part for using HLL is given in the intro.

>In order to maintain an exact count in real time we would need to know whether or not a specific user visited the post before. To know that information, we would need to store the set of users who had previously visited each post, and then check that set every time we processed a new view on a post. A naive implementation of this solution would be to store the unique user set as a hash table in memory, with the post ID as the key.

>This approach works well for less trafficked posts, but is very difficult to scale once a post becomes popular and the number of viewers rapidly increases. Several popular posts have over one million unique viewers! On posts like these, it becomes extremely taxing on both memory and CPU to store all the IDs and do frequent lookups into the set to see if someone has already visited before.

eriknstr··on What's the difference between the com and exe extensions? (2008)
>So of course, the "logical" thing to try was to write a .bat and save it with a different extension and see what happened.

Ha ha, same here. Also the next thing I did was to open exe files with notepad and conclude that this is what real code looked like and that the programmers that wrote the programs had written it that way.

When a little bit later I learned that programs were written in languages like C++, I got a book about C++ while on vacation and I read a bit in that book and I wrote down the Hello World program on paper and wrote variations of it and a couple of programs that would ask questions and say something. When I got back from vacation I sat down in front of my computer, typed in hello world and used a compiler called Bloodshed C++ which the book had recommended and compiled the program and double-clicked the exe file, only to have it open a window and immediately close. I had failed to understand that I needed to run the program via cmd.exe because of course Hello World exits immediately when it's printed the text.

This discouraged me a bit so I stayed away from programming languages for several years after that but at least I kept learning HTML and a bit about reverse engineering and a couple of other things and eventually I got back to programming when I started high school and we were using Texas Instruments TI-84 Plus calculators and we were given a couple of programs written in TI-BASIC which we were told to store on our calculators. Once I'd written some programs of my own in TI-BASIC I then read a book about PHP and wrote some PHP.

Such was the beginning of my experience with programming.

eriknstr··on Facebook's tentacles reach further than people think
You have slight misspelling. The name is AdNauseam. Their website is https://adnauseam.io/
← PreviousPage 4 of 18Next →