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 9y ago · link · parent

Then they can make other ridiculous rules too, for example "you should pay 100x the price in menu unless you can stand on your head for an hour". That would probably increase the income dramatically.

comment 9y ago · link · parent

What you are describing applies only to US where copyright laws are biased towards the interests of publishers. Developing adblockers in other countries might be the solution I think. It is unbelievable that a publisher might decide what I do with content on my computer. No, he cannot or at least should not be able to decide. If he doesn't want me to block the ads then he should not serve the pages to me in the first place.

comment 9y ago · link · parent

It is designed perfectly and it works as we see.

comment 9y ago · link · parent

You probably did not understand the issue. The domain in question is a part of a copyrigth protection scheme. Blocking access to it is a circumvention of copyright protection scheme and it is illegal under DMCA. No, you cannot block hosts that are a part of a copyright protection scheme and you cannot distribute the software that does that.

How you block the domain - with a simple string or an automatically trained neural network - doesn't matter.

comment 9y ago · link · parent

That is smart but the primary reason why that is possible is the copyright laws that are biased towards the interests of copyright holders.

comment 9y ago · link · parent

They might use a scheme that would allow access by default and block it with a script from that domain. So blocking the domain becomes a circumvention (today I finally learned how to write this word).

Or that domain could be used to collect views stats for copyrighted content and make decisions based on that stats. Blocking this domain is obviously messing with copyright protection scheme which is illegal inder DMCA.

comment 9y ago · link · parent

It is their website but after I download the content to my hard drive it becomes my files and I can do whatever I want with them privately (as long as I do not redistribute it, claim authorship etc). That is how copyright should work, but of course the actual laws might be biased to the interests of some party. There is nothing new if you learn the history of human society, some groups of people always wanted to have more rights than others.

comment 9y ago · link · parent

> We changed around your copyrighted work to remove stuff we decided we don't like.

That is totally ok. For example, if I record a video from TV and remove the ads is that a violation? I think it is not as long as I use this video for myself and do not distribute it.

Copyright laws should not regulate what I do in my house or on my computer. I should be able to modify any copyrighted work as I wish as long I am not redistributing it (and yes, I should be able to inspect and patch copyright protection schemes too).

comment 9y ago · link · parent

For example, the web page with copyrighted content can load a script from admiral's domain that would check whether a user is allowed to view the page or not. Adblocker is blocking that domain and therefore circumventing copyright protection scheme which is illegal under DMCA.

The people who invented this are really smart I must admit.

comment 9y ago · link · parent

The reason why this is possible is because DMCA by itself is biased towards interests of copyright holders and therefore can be abused. You can always claim that some domain is used for protecting copyright and therefore blocking access to that domain as well as distributing software that can do it is clearly a violation of DMCA.

comment 9y ago · link · parent

It is impractical to cover every line of code with tests (it would get too expensive). Futhermore, in this case the author would have to test production config interacting with Amazon servers rather than a piece of code.

And even 100% code coverage doesn't find all possible errors.

comment 9y ago · link · parent

Would not it be better to explain why something is a propaganda and what is its purpose rather than block it?

comment 9y ago · link · parent

What about mining cryptocurrency on a page load as a solution against scrapers?

comment 9y ago · link · parent

If you try too hard then you can accidently hide content from search engines too.

comment 9y ago · link · parent

I think you are wrong. Windows API compared to HTML APIs are very low-level. For example, there is no automatic layout and you must specify exact size and position of every GUI element like button or input field.

comment 9y ago · link · parent

I don't see how UBI would help? A person living on UBI will probably have the lowest social rank.

The problem probably is a lack of good job positions and a surplus of working force.

comment 9y ago · link · parent

Breaking Function.prototype.toString() might actually be a good idea because now the engine has to keep the source code in memory and most of the times it is absolutely unnecessary. It would be better to free this memory.

comment 9y ago · link · parent

> or that the Telegram binary weighs ~11Mb?

The memory footprint of a native and JS app is very different. While 11Mb Windows app won't require more than 11Mb of memory for the code, JS 11Mb app might require some 50-100 Mb of memory only for keeping the code, different caches and internal structures.

comment 9y ago · link · parent

Most of these features are unnecessary until the user tries to play a video, a game, opens a dialog etc.

comment 9y ago · link · parent

That should take less than one second, not ten.

comment 9y ago · link · parent

This suggestion also requires a JS engine to have an AST compatible with the one that is described. So the browser developers will have less freedom in a choice of an internal AST representation.

comment 9y ago · link · parent

Please also look at my comment that shows the opposite: Facebook is loading a lot of unnecessary modules: https://news.ycombinator.com/item?id=14916177

comment 9y ago · link · parent

Most of the code doesn't have to be loaded immediately. For example, you write in your comment, that Facebook can play 360 degrees videos, but the player doesn't have to be loaded until the user tries to play such a video.

I decided to look at Facebook code more closely. It is modular and contains several thousand of small modules. For example, on a news feed page the browser has loaded 66 JS files with total size of 5.7Mb containing 3062 modules [1].

But it is clear that many of those modules are not necessary to display a page. For example, a module with a name "XP2PPaymentRequestDeclineController" that is probably related to payments is not necessary. Or a module with a name "MobileSmsActivationController". Obviously Facebook preloads a lot of code for different dialogs that might be unused most of the times the page is loaded.

Of course I understand that it is very difficult to optimize code when a large team is contantly writing new code and everybody has strict deadlines so there is no time for optimizations, especially if they require serious refactoring.

[1] https://gist.github.com/codedokode/cb506cee367bdb9e1071bc186...

comment 9y ago · link · parent

You forget that Facebook code is executed inside a browser (for example it doesn't have to render UI because HTML/CSS engine does that) while "desktop chat applications" can contain a Webkit engine, Node.JS and a lot of bloated uncompiled libraries.

7Mb of Javascript is too much. 200-300 Kb should be enough to view photos and post comments.

comment 9y ago · link · parent

I don't like the part that explains the motivation for implementing binary encoding:

> A brief survey from July 2017 of the uncompressed JS payload sizes for some popular web applications on desktop and mobile:

> Facebook 7.1 MB

I think Facebook should just remove the code they don't need rather than invent new compression methods. There is no way a social network with a chat needs so much JS code.

comment 9y ago · link · parent

Typosquatting can be prevented by premoderation in the repository.

comment 9y ago · link · parent

That makes no sence. Any company would try to maximize its profit in such situation, so if you don't like this you will have to become self-employed.

comment 9y ago · link · parent

> like for example how cloudflare protects ALL requests to the domain.

The primary purpose of cloudflare is to hide the IP address of the server and filter packets on IP level. It does not magically protects from any attack, especially on application level.

It is wrong to assume that there is a universal automatic solution against DDOS. Neither CDN nor Cloudflare nor REST API (how?) can help with this.

comment 9y ago · link · parent

I don't use browser extensions at all because they are often made by unknown developers and I cannot trust them.

comment 9y ago · link · parent

> There is no ISP proactive battle against VPNs.

That is until some government official learns about them.

1
166167168
185