HNHacker News
TopNewBestAskShowJobs

IvanK_net

2,453 karma · joined August 20, 2013

submissionscomments
IvanK_net··on For algorithms, a little memory outweighs a lot of time
Oh okay, that was my second guess.
IvanK_net··on For algorithms, a little memory outweighs a lot of time
A single tape machine is still a multi tape machine, only with one tape.
IvanK_net··on For algorithms, a little memory outweighs a lot of time
I am confused. If a single-tape turing machine receives a digit N in binary, and is supposed to write N ones on the tape, on the right side of the digit N, it performs N steps.

If you expect N ones at the output, how can this machine be simulated in the space smaller than N?

This machine must decrement the digit N at the beginning of the tape, and move to the end of the tape to write "1", so it runs in time O(N^2), not O(N)? (as it takes N "trips" to the end of the tape, and each "trip" takes 1, 2, 3 .. N steps)

Since turing machines can not jump to any place on a tape in constant time (like computers can), does it have any impact on real computers?

IvanK_net··on EU ruling: tracking-based advertising [...] across Europe has no legal basis
I think that 70 % of web users believe, that each website that they open can see their real name, their address, their phone number, the files on their computer, their browsing history and a lot more, and they believe that the GDPR laws are the only attempt to prevent websites from misusing (e.g. selling) all their private data.
IvanK_net··on I just want to code (2023)
I have no idea why they mention coding. It is the same in any kind of job. You can bake cakes for fun, make music for fun, write poems, novels, play chess for fun, practice sports, grow potatos ...

At a certain stage, you realize that in order to be able to do only that job, you must make someone pay you for it. You must do it in a way (or in a volume) which makes others happy. The fact that it makes you happy is not enough anymore.

I don't think there is an angel and a devil. It is still the same thing. If you like the result of your work, there is a high chance that others will like it. You don't need to change what you do by a 100%. Changing it by 5% - 10% is often enough.

IvanK_net··on Estimates of plant CO2 uptake rise by nearly one third
We could plant, cut down and burn trees for the energy, in a circle, and keep carbon levels in our atmosphere the same, instead of digging up new carbon from the ground and burning it. We will have to bury carbon back under the ground at some point.
IvanK_net··on Why my apps will soon be gone from the Google Play Store
I am the creator of a photo editor www.photopea.com, used by around 1 million people every day (of which 300,000 use Android, 150,000 use iOS). After reading this article, I am so happy that I never spent a single hour trying to publish my tool at the "mobile stores" :D
IvanK_net··on H.264 Is Magic (2016)
You can have a PNG and JPG versoin of the original image without no loss, and the files would be about the same size.

You can have a PNG and JPG version of the original image, with the same loss - "average error per pixel", and the files would be about the same size.

I know there is no lossy compression described in a PNG standard. But there exist programs which produce tiny PNG files with a loss. So comparing an MP4 encoder with a bult-in loss to a PNG encoder without any built-in loss is not fair. They should have made the MP4 encoder encode the video in a lossless way, just like they did with PNG.

IvanK_net··on H.264 Is Magic (2016)
I know that the "lossines" is not included in PNG encoders, as it is in JPG / WEBP encoders. But the idea is the same: if you are ready to "accept some loss" (by reducing the number of colors in this case), you can get a much smaller PNG file.
IvanK_net··on H.264 Is Magic (2016)
That is what a "lossy compression" means. Instead of encoding the original image, you look for a similar image, that can be losslessly encoded into a smaller file.

In PNG, you look for an image with 100 - 200 colors (so that colors repeat more often) and losslessly encode it with DEFLATE.

In JPG, you look for an image with with a reduced description through DCT, and losslessly encode it with Huffmann trees.

IvanK_net··on H.264 Is Magic (2016)
Lossy compression is possible in PNG to a certain degree. This is the "same PNG", but 94 kB instead of 1015 kB:

1015 kB: https://sidbala.com/content/images/2016/11/outputFrame.png

94 kB: https://www.photopea.com/keynote.png

IvanK_net··on H.264 Is Magic (2016)
Lossy compression is possible in PNG to a certain degree. This is the "same PNG", but 94 kB instead of 1015 kB:

1015 kB: https://sidbala.com/content/images/2016/11/outputFrame.png

94 kB: https://www.photopea.com/keynote.png

IvanK_net··on Keep Out – WebGL Game
It reminds me my WebGL First-Person-Shooter https://dinohunt2.ivank.net that I made 10 years ago :)
IvanK_net··on Learn WebGPU
BTW. For the last 15 years, all web browsers on Windows do WebGL on top of DirectX (using the Angle library https://github.com/google/angle).
IvanK_net··on ThumbHash: A better compact image placeholder hash
Wow, nice! I wrote a BC1 encoder in JS, it is quite simple :) https://github.com/photopea/UTEX.js/blob/master/UTEX.js#L198
IvanK_net··on ThumbHash: A better compact image placeholder hash
I think they should siply use four patches of BC1 (DXT1) texture: https://en.wikipedia.org/wiki/S3_Texture_Compression

It allows storing a full 8x8 pixel image in 32 Bytes (4 bits per RGB pixel).

IvanK_net··on Web fingerprinting is worse than I thought
The idea of the Incognito mode is, that the website should be unable to detect that you are using the Incognito mode.

There is a bug in Chorme, which I reported, but they told me they will not fix it: https://bugs.chromium.org/p/chromium/issues/detail?id=120485...

IvanK_net··on TinyVG – an alternative binary encoded vector graphics format
If someone already implemented an XML parser for you, SVG is easier to implement than TVG (if you are trying to extract the same type of content out of SVG as out of TVG).
IvanK_net··on TinyVG – an alternative binary encoded vector graphics format
If we ZIP both SVG and TVG, the difference is not that large anymore.

For most of people, wide support is more important than 20% smaller file size. That is why it is hard for WEBP to replace JPG.

IvanK_net··on Vivaldi co-founder: Advertisers 'stole the internet from us'
People writew Wikipedia for free, people answer at StackOverflow for free, we got used to it.
IvanK_net··on Show HN: Doc Converter – Convert PDF docs to Word documents on your computer
It is usually a PDF containing a single JPG file inside, which you can see and export at the original resolution.

To edit it, I guess you could paint over the text with white, and add a new text on top of it.

IvanK_net··on Show HN: Doc Converter – Convert PDF docs to Word documents on your computer
I wrote a free PDF editor (open a PDF, edit, export a PDF), my users edit around 500,000 PDF files every month.

I have been gradually improving it for the past five years. It is a part of my photo editor https://www.Photopea.com. I know really a lot about PDF, I wish I didn't know that much :D I am glad to see that there are others who try to "make sense" of PDF files instead of just rendering them :)

** fun fact: Often, a PDF contains text as an array of characters, each has its X and Y coordinate and a style (white characters omitted). It is up to you to "cluster" them into words, lines, paragraphs ...

** Often, PDF text is made uneditable (on purpose). You see a text "Hello", but in fact, there is a text "bsiin", and a font, which renders "b" with a shape that looks like a letter "H", "s" as "e", and so on. If you open that PDF in a PDF viewer, select "Hello" and copy-paste it elsewhere, you get "bsiin".

IvanK_net··on Ask HN: Is PayPal an open scam at this point?
I accept payment cards and PayPal in my SaaS. The PayPal option costs 10% more money (I tell the client about it in advance). Half of people still chooses to pay with PayPal.
IvanK_net··on Ask HN: Is PayPal an open scam at this point?
Back in 2019, my business partner sent me $30,000 USD over PayPal. PayPal took a fee of $1,690. At some cases, it is cheaper to buy a plane ticket and travel to get money in person. A year later, they have introduced an additional withdrawal fee of 3%.

** My business partner had problems with a wire transfer, so PayPal seemed as the easiest solution.

IvanK_net··on Hello, PNG
Adding 1 Byte to each line of raw pixel data is not that much. You can set it to zeros to avoid filtering. But it gives you a chance to improve the compression.
IvanK_net··on Hello, PNG
I have implemented a Zlib / Deflate decompressor (RFC 1951) in 4000 characters of Javascript. It could be shorter, if I did not try to optimize.

E.g. this C implementation of Deflate adds 2 kB to a binary file: https://github.com/jibsen/tinf

IvanK_net··on Quite OK Image is now my favorite asset format
I guess you are taking photographs. One should never try to store photographs with no loss. With a lossy format, like JPG or WebP, you can get 5x smaller file size, while giving up 0.000001% of the original information (which usually corresponds to specific values of noise, that are not important in practice).
IvanK_net··on PostScript: A Digital Printing Press
I wrote a PostScript interpreter in Javascript four years ago :) Write a program and see it rendered: https://www.ivank.net/veci/pdfi/
IvanK_net··on Show HN: A color picker for named web colors
Today I learned that #00ff00 is not green, but lime! :)
IvanK_net··on Photopea: A free Photoshop alternative making millions
GIMP has a neat feature called "Color To Alpha", which no other editor has (including Adobe Photoshop). I have added it to Photopea two years ago: https://github.com/photopea/photopea/issues/2205
← PreviousPage 3 of 14Next →