HNHacker News
TopNewBestAskShowJobs

no_gravity

2,245 karma · joined August 19, 2011

Serial Webpreneur. Like to meet like-minded people.

www.gibney.de

submissionscomments
no_gravity··on Ask HN: What are you doing this weekend?
Working on a version of https://www.literature-map.com which will be used to organize scientific articles about literature.

The design will look like this:

https://www.gibney.de/preview

The big blue arrow leads to the articles which are related to the topic in the center.

Now parsing through a big German text corpus to calculate where the research topics will be placed on the map.

no_gravity··on Microsoft and Google collaborate to make PWAs better
From how I read it, this reduces the probability that the data gets deleted due to low disk space / garbage collection:

    Persistent storage can help protect
    critical data from eviction, and
    educe the chance of data loss.
Are you sure this keeps the data when the user deletes their browser data? To me it sounds like it does not:

    Persistent storage is not deleted by the browser,
    even if storage is running low. It will only be
    deleted if the user chooses to remove it via
    their site settings.
no_gravity··on Microsoft and Google collaborate to make PWAs better
> Native File System API

Great, so there is light at the end of the tunnel!

> store that data on the server

Well, we talked about that already:

https://news.ycombinator.com/item?id=23793541

no_gravity··on Microsoft and Google collaborate to make PWAs better
Keeping the user logged in is not the issue. A PWA can inject a unique ID into the installation in various ways.

The problem is the data. Imagine a text editor where all your text documents are gone after you cleared the data of a different app, the browser.

I wrote a fitness app as a PWA some time ago and its pretty annoying to download all the instruction videos again every time you clear your "browser data". Plus all infos about which exercises you did and when is gone for good of course.

no_gravity··on Microsoft and Google collaborate to make PWAs better
Can you elaborate why it could be a good thing for users?

Not being able to reliably store data on the device means that PWAs have to send the users data over the internet and store it on an external server. I would think users rather do not like that.

I am only talking about installed PWAs here. Of course not every website should be able to avoid having its cookies deleted.

no_gravity··on Microsoft and Google collaborate to make PWAs better
The main problem I see in PWAs these days is that they cannot permanently store data on the device. As soon as the user deletes their "browser data", all the data of the PWAs on the device is lost too.

If PWAs would get their own permanent storage like other apps, it would be a huge step forward.

no_gravity··on Way to keep your cool running a Raspberry Pi 4 (2019)
How would that work?
no_gravity··on Way to keep your cool running a Raspberry Pi 4 (2019)
Just exchanged the charger .. the hanging still occurs.
no_gravity··on Way to keep your cool running a Raspberry Pi 4 (2019)
I will try that. At first I would like to see if I can find the problem. I would have thought that when the SD card is not responding, it would show up as "wa" in top and "%util" in iostat -x. But both are zero for the next output after a freeze.
no_gravity··on Way to keep your cool running a Raspberry Pi 4 (2019)
My PI is too cool. It freezes.

I have playing with a PI Zero W over the last weeks. At first everything worked as expected.

But now it developed some strange "hangings" I cannot explain. It kinda randomly freezes in time for a few minutes every now and then.

Sometimes it takes several minutes to ssh into it. Sometimes, the terminal just freezes for several minutes.

Neither top nor iostat seem to show any elevated activity during these periods. Since they hang throughout the freeze, its a bit hard to say though.

The strangest thing: Pings to the PI always come back fast. So its probably not that the hardware really freezes completely.

no_gravity··on P2P Matrix
Ok, great. Here comes more feedback :)

Since I did not save my password when signing up, I proceeded to set an email. Got a confirmation email and clicked the link in it.

Then signed out and clicked the "Set a new password" link.

But it does not work. I always get the message "Failed to send email: This email address was not found".

no_gravity··on P2P Matrix
I think someone needs to look into the onboarding process. My experience so far:

1: Clicked on "Try Now".

2: Was greeted with a blob of text. Spotted "The easiest way to try Matrix is to use the Riot Web ...".

3: Clicked on "Riot Web" because that is a link.

4: Got transferred to a different website with a lot of buttons on it.

5: Clicked on the green "Get started button"

6: Got transferred to another page with a bunch of buttons on it

7: Clicked on "Browser"

8: A new window with a "Sign in" and a "Create Account" button opened

9: Clicked on "Create account"

10: Entered a username and password

11: Got asked to do the Google Captcha

12: Had to select 4 tiles with traffic lights and cklick next

13: Was told to select stairs.

14: Since there were no stairs, I clicked "Skip"

15: Had to select 7 tiles with fire hidrants and click next

16: Had to select 4 tiles with traffic lights and click next

17: Had to select 3 tiles with traffic lights and click next

18: Had to accept terms an conditions and click "accept"

19: Had to enter a recovery passphrase.

20: Had to confirm my recovery passphrase.

21: Was forced to click a "copy" button to copy the recovery passphrase.

22: Had to click "continue"

23: Staring at a spinner for a while.

24: Was prompted with an "OK" button. Clicked it.

25: Was prompted with a "Welcome to Riot" page with different options.

26: Clicked "Explore public rooms".

27: Clicked on the first one.

28: Had to look at a spinner for a while with "Joining room" next to it.

29: Still looking at the spinner ...

30: Spinner is still spinning ... will take the time to post this to HN.

Update:

31: Back to the Matrix window. Hurray! I'm in a channel. Typing "Hello" and enter. It seems to work.

I wonder if it would be an option to shortcut these 31 steps into just one and throw everyone who clicks "Try Now" into a "Welcome to Matrix" channel.

no_gravity··on Python performance: it’s not just the interpreter
I wanted to play with variations of the code. For that it is useful to make it output a "summary" so you know the variation you tried is computationally equivalent.

For the first benchmark, I added a combined string length calcuclation:

    def main():
     r = 0
     for j in range(20):
       for i in range(1000000):
         r += len(str(i))
     print(r)
    main()
When I execute it:

    time python3 test.py
I get 8.3s execution time.

The PHP equivalent:

    <?php
    function main() {
     $r = 0;
     for ($j=0;$j<20;$j++)
       for ($i=0;$i<1000000;$i++)
         $r += strlen($i);
     print("$r\n");
    }
    main();
When I execute it:

    time php test.php
Finishes in 1.4s here. So about 6x faster.

Executing the Python version via PyPy:

    time pypy test.py
Gives me 0.49s. Wow!

For better control, I did all runs inside a Docker container. Outside the container, all runs are about 20% faster. Which I also find interesting.

Would like to see how the code performs in some more languages like Javascript, Ruby and Java.

no_gravity··on Microsoft Surface Go 2 review
This seems to be a compatibility list of Surface devices with a special kernel made by someone. I don't see how it is related to what is in the Ubuntu repos?

If anything, the exsitence of this kernel seems to be an indication that the major distributions do not cope well with the Surface and do not work out of the box.

no_gravity··on Microsoft Surface Go 2 review
Do you have a link where someone describes how he got Ubuntu to run on the Go natively without installing software from outside of the repos? The user reports I saw did not get WiFi to work with what is in the Ubuntu repos.
no_gravity··on Microsoft Surface Go 2 review
Is there a tablet that can run one of the major Linux distributions?

I am surprised that there is not a single commercial Linux tablet on the market. Given how many developers use Linux, one would think the market is big enough for at least one product?

And it seems no major distribution supports any of the tablets out there.

no_gravity··on A look at modern PHP
PHP has a lot going for it. It is popular, fast, has a nice syntax and a ton of useful functionality baked right into the language.

The main weakness I see in PHP is the lack of modules. PHP provides namespaces to avoid name conflicts. First of all, that does not completely root out naming conflicts. The developer who puts a namescpace into their code can only hope that it does not clash with someone else's.

Secondly, it makes it necessary that both, the code that provides reusable functionality and the code that uses it have to deal with the issue of namespaces.

A module system like Python and Javascript have is superior to this. Then only the user of the reusable code decides where to put it into the namespace.

no_gravity··on The Doctor Who Helped Defeat Smallpox Explains What's Coming
From what I read in this article and other sources, performing more tests seems to be a very promising approach to get this pandemic under control.

The number of positive tests and death rates are published every day on all channels. I wish the number of performed tests would be also published daily. What gets measured gets managed.

I wonder what limits the number of tests that can be performed. How much would it cost to ramp up testing capabilities so that every person with symptoms can be tested? How much to increase it to a level that everyone can be tested?

no_gravity··on How to Find New Music
Interesting. I have never seen that happen and can not reproduce it. Anything special about the browser you use? Feel free to shoot me an email then we can figure it out.
no_gravity··on Using Firefox for a faster, calmer and distraction-free internet
The main reason I often use Chromium instead of Firefox is that it starts up faster.

I even wrote a oneliner to see if it is just an illusion:

http://www.gibney.de/browser_startup_speed

As can be seen in the tests, it is mainly about the startup time after a reboot. Where Chromium is way faster.

Not sure what the reason. Maybe Chromium actively caches something right during the boot? Or maybe it uses less dependencies?

no_gravity··on The Smartphone vs. the Camera Industry
How much better are the photos you get out of the Fuji then the ones you get out of your iPhone?

The Fuji X100F is about 3 times as heavy then a usual smartphone. So carrying it around would quadruple the weight of my "camera equipment".

I wish somebody would run around with a pocket camera and a phone for a day and then write a blog posts with comparison shots.

no_gravity··on Ask HN: How do you build applications that require zero maintenance?
1: A slim stack

Every part of the stack will need maintenance every now and then. Some parts even introduce breaking changes and force you to alter your own code. The slimmer the stack, the less often you have to fix it. And the less often you have to fix or refactor your application.

2: A stack that values stability

Linux is a good example. Linus Torvald: "We do not break userspace!"

PHP is a another one. The core developers rarely introduce breaking changes. And when they plan to do so, there is usually an intense fight over it.

3: Acceptance Testing

In the simplest form that means sending http requests to your web application and check if it returns the expected output. In my experience, acceptance tests find more real world issues then unit tests.

4: Write less code

Writing the same functionality with less code has multiple advantages. One of them is that it will break less often. Much more could be said about it. Paul Graham brings up the value of terseness frequently:

https://twitter.com/paulg/status/1068483193605681152 https://twitter.com/paulg/status/1126403387044573185 https://twitter.com/paulg/status/1056858408039735297

Less is more. This is actually one of the reasons why I named my account no_gravity.

no_gravity··on Serverless: slower and more expensive
As I understand it, the author conducted the test on an unusually slow connection. With a roundtrip time of almost half a second. Even a typical consumer line is multiple times faster.

He states that the workload is "saving one event to the database".

And then sees 0.42s for his old solution and 0.48s for the serverless solution.

Even if the server waits for the event being written to disk before it answers the request - that should be a negligible time compared to the roundtrip time he sees.

So the "15%" only hold for his very slow connection. If he repeated the same test on a faster connection, then it could turn out the serverless architecture is not only 15% slower but multiple times slower.

If 0.40s of those "0.42s vs 0.48s" he sees are due to his slow connection, then on a fast line it would be 0.02s vs 0.08s. Then his conclusion would be "4x slower" instead of "15% slower".

no_gravity··on Ask HN: PostgreSQL or MySQL?
I really like the direct DB to filesystem mappings of the MyISAM engine in MySql. A database is simply a directory. A table is simply 3 files in that directory:

    - One for the structure
    - One for the data 
    - One for the indexes
You can simply copy a MyISAM database by copying the directory (while the MySql server is stopped).

MariaDB has forked the MyISAM engine and created the Aria engine. It is a crash safe version of MyISAM and is now their default engine for all system tables.

So in contrast to MySql, you can completely disable InnoDB in MariaDB. MySql does not support that anymore as their system tables are InnoDB.

Especially for non-concurrency workloads, MyISAM and Aria are super fast.

For these reasons, I really like MariaDB.

no_gravity··on The cost of parsing JSON
Awesome. So it does hold true for PHP as well.
no_gravity··on The cost of parsing JSON
Not sure if eval is the right choice as the article compares parsing json to using a native js structure as well.

The correct comparison would be to try it on the 7MB json data the article is based on.

no_gravity··on The cost of parsing JSON
Correct.
no_gravity··on The cost of parsing JSON

    Because the JSON grammar is much simpler than
    JavaScript’s grammar, JSON can be parsed more
    efficiently than JavaScript.
Hmm.. shouldn't that hold for most programming languages then?

Let's try it for PHP:

    time php -r 'for ($i=0;$i<10000000; $i++) $data = [1,2,3];'
    
    real 0m0,173s
    user 0m0,161s
    sys  0m0,012s

    time php -r 'for ($i=0;$i<10000000; $i++) $data = json_decode("[1,2,3]");'
    
    real 0m4,125s
    user 0m4,120s
    sys  0m0,005s
So for 10 million repetitions, a small PHP structure is about 20x faster then parsing JSON. But to test the point of the article, one should use the sama data structure it uses (https://raw.githubusercontent.com/WebKit/webkit/ffdd2799d323...) and parse it only once.
no_gravity··on By 2050, many world cities will have weather like they’ve never seen
https://en.wikipedia.org/wiki/Artificial_sunlight
no_gravity··on By 2050, many world cities will have weather like they’ve never seen
It already works for the other 50%.
Page 1 of 11Next →