Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 4y ago · link · parent

> What they call "building your own framework" is simply what I think of as programming.

If you want an analogy, this is like a builder claiming that he is going to make all bricks and nails himself. You don't usually write your own standard library, why would you write your own framework?

comment 4y ago · link · parent

Because if you move from one project to another you want to see a familiar implementation of Request class or ORM from a framework rather than reverse engineer custom-built undocumented untested replacement for this.

It may make sense if custom framework is a magintude order better, but if it is the same as a standard framework or worse then it is not worth to spend time on it.

comment 4y ago · link · parent

Judging by screenshots in the article, I don't think that UI is as bad as described. Actually, it is better than UI of private commercial financial institutions. It uses black letters on a white background, links are properly underlined, no annoying notifications from CEO, no full screen popups, no timers making you hurry, no attempts to upsell something unnecessary, no asking to subscribe for a newsletter, no deceiving descriptions that mention only good sides and conceal the risks.

Regarding virtual keyboard, of course it would be better to use physical keys, but for reasons I don't understand they don't have a wide adoption that they deserve.

comment 4y ago · link · parent

That's why keyloggers also log the title of an active window.

comment 4y ago · link · parent

This seems like a loss. Gnome and other companies had to pay money (as I understand) for an invalid patent, a patent lawyer had to pay for re-examination and a patent troll lost nothing except for a patent that was invalid anyway.

Are vaguely worded patents legal? For example, if someone in the age of black-and-white TV would patent an idea that "colors can be transmitted wirelessly or by wire, decoded or not decoded by a TV or other electronic or non-electronic device and displayed or not displayed on a screen or other medium". Would this idea without any research count as a valid patent application? Please explain, knowledgable people.

comment 4y ago · link · parent

I use nano when I need to edit something from CLI because I don't like ancient editors with modes or non-standard key combinations from 80s. And in nano the most important shortcuts are at least written in the bottom of screen.

While nano supports some standard shortcuts (arrows, Ctrl + arrows, Home, End, PgUp, PgDn), others are non-standard and I don't understand why. For example, "save" is Ctrl + O instead of common Ctrl + S, exit is "Ctrl + X" instead of "Ctrl + Q", Esc doesn't work when you want to cancel search, and so on. What a nonsense. Why should someone use different shortcuts for the same function.

comment 4y ago · link · parent

I guess it is to prevent some people from taking a shower for too long while others are waiting.

comment 4y ago · link · parent

Wtorek probably means "the second day", and Środa means "middle". Piątek probably means "fifth".

comment 4y ago · link · parent

By the way, I think that tracking the grocery is possible with today's technology, you just need to install several cameras in the fridge, so that you can connect with a smartphone and see what is missing. Maybe one could train a neural network to recognize kind and amount of products, but as there are so many of them, and so many different types of packaging, I think that this would be difficult.

comment 4y ago · link · parent

Sorry for posting a comment unrelated to the article, but that site is broken. The cookie settings dialog, provided by a third-party company, doesn't work as promised.

When I opened the page, I saw a cookie banner, untoggled all toggles that were togglable and clicked "Reject all cookies". The cookie dialog said that there will be only functional cookies and they won't contain any personal information. How nice, I thought, Internet is changing for the better. I also can enjoy the privileges of EU citizens.

But then - just out of curiosity - I decided to see what cookies are left in my browser. Imagine my surprise when I saw 6 (six) cookies. Those included:

- an UUID with name 'stripe_mid' expiring in a year

- OptanonConsent, which, I assume, represents chosen settings and contains UUID in 'consentId' field. This UUID is set when the page is loaded. I guess they store your preferences on the server and not in cookies as I thought. Obviously, you can be tracked with this cookie as the identifier seems to be unique.

- user_geoip_fallback and user_geoip, both of which contain an IP address

To check that the dialog indeed doesn't work, I deleted all cookies except for cookies related to the consent dialog, and reloaded the page. Stripe and geoip cookies have been set again.

It turns out that you shouldn't trust cookie dialogs from that third-party company which you often see on different sites. They are either broken or intentionally deceive a user.

comment 4y ago · link · parent

I'll try to explain why we choose those 7 notes out of 12. Note, that this is just my opinion and not a scientific and proven research.

According to observations by ancient Greeks, the sounds whose frequency have simple ratios of small natural numbers like 2/3 or 4/3 or 5/4 sound harmonically and pleasing together. Except for number 7 (I don't know why). So, if we take several such sounds we expect to get a nice sounding chord.

For example, in a C major chord (C + E + G) the frequencies ratio of E to C is 5/4, ratio of G to C is 3/2 and ratio of G to E is 6/5. So, if we denote frequency of C as 4f, then the frequencies of C, E, G are 4f, 5f and 6f. Those are indeed ratios of small numbers and notes in C major chord are considered in harmony with each other.

By the way, if we invert the chord as G, C, E we get ratios of 3f, 4f and 5f. These are the smallest numbers that we can use to build a 3-note chord. Does it mean that inverted C chord is the most perfect and sounds most harmonical? As a person without an ear for music I don't understand.

Because of this ancient people made scales that consisted of notes with good ratios. For example, if we take first 6 notes of a major scale (C, D, E, F, G, A), the frequencies would be f, 9/8f, 5/4f, 4/3f, 3/2f, 5/3f. Except for D, all of these are small numbers and if ancient Greeks were right, the song made from them should sound harmonical. D also has good ratios with some notes like G (D/G ratio is 3/4).

But this scale has a disadvantage, that one cannot easily raise or lower the pitch. Different people have different voice ranges, but if you have an instrument with these notes, you cannot change the key and transpose the melody. For example, if you had a sequence of C, D, F then you cannot pick higher or lower notes with same ratios.

That's why people invented an equally tempered scale. It turned out that if you divide an octave into 12 equally spaced notes, then 7 of them are pretty close to a traditional major scale. That's why it is 2212221 and not something else. With equally tempered scale one can transpose a song up or down easily, keeping the same ratios between notes.

By the way, note B seems to use different pitches in different scales. There is a space between frequencies of A and C, so there is a place for a note, but there is no simple ratio one could use for B and different scales used different pitches for the note.

You can read more about pitch ratios here [1].

While major chord sounds "most" harmonical, but there are only 3 major chords in a major scale, and the music tends to be boring if it uses only perfect ratios. I guess that's why musicians started to use more and more "imperfect" chords over time. For example, in a minor chord like A, C, E ratios are 10f:12f:15f. And indeed a minor chord sounds like a wrong version of a major chord. If we take a chord with 7th, the ratios get even worse, and some musicians use chords with notes that do not belong to a normal chord, or even do not belong to the key.

By the way, non-harmonical notes are ones that differ only by a half tone - for example, E and F (ratio is 16:15) or three tones (ratio is 36:25).

[1] http://www.swarthmore.edu/NatSci/ceverba1/Class/e5_2006/Musi...

comment 4y ago · link · parent

> UEFI is defined by a versioned standard that can be tested and certified against

But is it actually tested against or only can be?

comment 4y ago · link · parent

This is not true. If you need 1000 lines of templates to display a page, it will be 1000 lines no matter whether you use Twig (PHP) or React (JS). And Twig in my opinion looks better than JS code mixed with HTML tags and split into 100 files 10 lines each.

comment 4y ago · link · parent

There are cases when server-side rendering (without SPA) is easier and faster. For example: documentation sites, blog-like sites, internet stores, sites like Hacker News. In all these cases, you can save on development time by writing just one application instead of two (server and client), and improve performance (no need to load multimegabyte JS applications and make multiple AJAX requests to display a page).

Of course, there are cases when SPA-style application is better, for example: (graphic/circuit/text) editors, IDEs, mobile newsfeed-based apps - everything that resembles an app rather than a page with text, menus and images. But in these cases you usually don't need server-side rendering. And sometimes you cannot even use it - for example, if your code needs to know browser windows size to arrange objects on the page.

So I think that SSR (running JS on server) is rarely useful.

comment 4y ago · link · parent

You cannot claim that the only people who are against Putin are those who took part in illegal protests that are punished with hefty fines and arrests. Not everyone is that brave.

While Putin might have high rating in the polls, his party United Russia could win only 50% of seats in Moscow Parliament in 2019 (after most popular independent candidates were not allowed to be in the ballot). Furthermore, members of United Russia nominated as independent candidates to hide their party affiliation. If you believe that only ten thousands people are against the government then how can you explain this?

Another example is that Navalny was denied to register a political party for many years. If he has only 1% or 2% of supporters, as propaganda claims, why deny registering a party? Let him take part in election and get his deserved 1% with a disgrace (by the way, in 2013 Moscow Mayor election he got 27% of votes and obviously that was the last election he was allowed to take part in).

So from the above facts I can conclude that Putin's support is not absolute. There are reasons why he doesn't allow to hold fair elections, why protests are not allowed, why all major mass media are controlled by the government and Internet is censored. You don't need this with true 80% voter support.

comment 4y ago · link · parent

Yandex could simply not display any news at their frontpage instead of displaying propaganda. I doubt that there would be any consequences for it. After all, it is a search engine and not a news agency.

comment 4y ago · link · parent

I think that there could be many reasons why Russians support a special operation.

In glorious Soviet times Russians ruled 16 countries (including Ukraine) that were parts of USSR, had puppet governments in Eastern Europe and friendly governments in Middle Asia and Africa (and by the way Russian Empire was even larger and included territories of modern Poland and Finland). Traitor Gorbachev surrended Eastern Germany and East European countries to America, and traitor Yeltsin (first President of Russia) helped to disintegrate USSR. Many ex-USSR countries were lured into NATO and turned against Russia. Due to Yeltsin following malignant American advices, Russian economy has collapsed, crime rate has raised, and oligarchs have stolen valuable assets, leaving people in poverty.

America also defeated many former Russian allies, like Yugoslavia. Then America refused to stop NATO expansion to the East.

So some people might want a revanche. They want Russia to be strong, victorous and glorious and not a third-world country surrounded by American bases preparing to make a final blow. And if that is not possible, at least they want to stop NATO from expanding to the East.

Also, in Ukraine there are Russian people and some believe that they are treated there unfairly. For example, they are not taught Russian language at school, there is no Russian television and so on. Obviously, Russia must protect them.

Also, propaganda doesn't call it a "war". It is actually illegal to call it a war. It is a "special military operation" for liberation of Ukranian people from Nazis and American influence. As Putin stated, Russia doesn't plan to occupy Ukranian territories.

Russia had no choice and no other means to prevent a big war planned by the West, propaganda says.

So there might be people who believe propaganda. If they have no other sources of information, what should they think?

Also, here are some quotes from a pro-government news agency TASS. Hope they give an idea how propaganda portrays the situation around Ukraine:

> the majority of Russian respondents - 88% - agreed that there are nazist organizations in Ukraine that are a threat to Russia ... 70% of respondents stated that Unkrainian government supports such nazist organizations ... According to the results of the poll, most respondents expect that special military operation will end with a trial of Ukranian nazis for commited crimes. [1]

> Medinsky (presidential aide) : The crimes commited by Ukranian government against Russian people in Ukraine became a challenge for Russia ... Russia has to protect peaceful civilians, its compatriots, who were assaulted, killed, threatened... [2]

> Russian senator Ekaterina Altabaeva: one cannot exclude Russia from world politics, and current special operation for denazification of thе country and protection of Russian-speaking citizens affirms a fateful role that Russia has always played in the world history ... at the end of 18th century not a single gun in Europe was allowed to fire without Russia's permission... [3]

And here is quote from other news agency:

> Military operation in Donbass is not a beginning of a war, but an attempt to prevent a global war, said spokeswoman of Ministry of Foreign Affairs ... also, it is an ending of the war that has been continuing for 8 years. [4]

So if someone wants to understand what an average Russian sees in the news or in social networks or on the Yandex frontpage, try reading sites like TASS or Interfax Russia, or 1tv.

[1] https://tass.ru/obschestvo/14412735

[2] https://tass.ru/politika/14414033

[3] https://tass.ru/politika/14412115

[4] https://www.interfax.ru/russia/824241

comment 4y ago · link · parent

> also backed by independent pollsters like levada

Do they publish how many of respondents refused to talk? I saw information that majority of people refuse to answer questions about war. So it might be that the results are based mostly on opinions of people who agree to talk.

comment 4y ago · link · parent

It's not that simple. Yandex has a frontpage that is viewed by tens of millions of users daily and is equivalent to TV. And Yandex since long ago has been intentionally filtering news that are shown there, for example, keeping silent about anti-Putin protests etc. So Yandex has been helping to spread propaganda for many years.

Please don't portray Yandex as a victim of strict martial laws (although oficially there is no war, only a "special operation". Calling it a war is an offence).

comment 4y ago · link · parent

I saw sites that have "reject all cookies" button right on the cookie banner. Maybe you should ask why other sites do not want to do the same?

Also, GDPR is not only about cookies, it is about tracking in general. For example, collecting IP address and device fingerprint is also considered tracking, although it doens't use cookies.

comment 4y ago · link · parent

And given that in the beginning there was a Big Bang, we can assume that this is what happens when the black hole becomes large enough.

comment 4y ago · link · parent

Also it might allow intentionally crashing Telegram by allocating too much memory.

comment 4y ago · link · parent

First I thought that Telegram makes bots available online for users without Telegram, but it seems that they only have added a webview to Telegram.

comment 4y ago · link · parent

This can also be used for social engineering, for masquerading as Telegram interface or system popups to get user's trust. And, of course, for disclosing the identity of users.

comment 4y ago · link · parent

Maybe you are right, but the instant price of stock will probably fall down after "dilution", so for example if you had $10 000 worth of stock before dilution, and you want to sell it the next day, you probably will get less than $10 000 because now there are more shares available in the market (more supply, but the same demand as yesterday).

comment 4y ago · link · parent

I don't really understand how this "poison pill" is legal. Imagine that you own a stock that can be sold at free market at $10/share. Then the board decides that whoever buys those shares will have to resell them to board members at $1. This means that now the price of those shares drops to $1 and you have lost $9 per share. How this can be legal?

comment 4y ago · link · parent

Yandex has an agreement with copyright holders and removes sites with pirated content from results. But those are Russian copyright holders and they mostly care about content in Russian.

Also Yandex removes sites that are banned in Russia, for example BBC in Russian or Navalny's site.

comment 4y ago · link · parent

But on the other side if you have a proprietary interface then there will be less accessories and the product will be less attractive for customers.

comment 4y ago · link · parent

I'd like to note that identifiers like passport number, phone number, or a credit card number, are not really numbers (despite the word "number"). Number is something the represents a quantity (for example, 3.5 km). Credit card number or phone number is not a quantity, it is just an identifier, a string made of digits. For example, there are phone numbers that start with zero (like 02), and the leading zeros would be lost if you try to convert it into an integer.

So if you need a database field or a variable for such identifier, you should choose a string type, not numeric.

comment 4y ago · link · parent

No, this is not fair. If making accessories is not profitable, then don't make them. Instead release the documentation and let others make the accessories.
1
112113114
185