1,862 karma · joined May 29, 2016
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.
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.
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
I much prefer the latter (HTML5 + CSS3 + JS + WebAsm).
(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.)
I am aware of that. Still, performing multiple operations on the data within a single loop and with less copying would be an optimization.
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.
>This could be telling the story of IE users being murdered out of existence.
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 :)
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?
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 :(
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 sawNaturally, "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.
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 :(
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.
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.