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

It is still possible to generate diffs. You can convert doc files to plain text or HTML with openoffice and compare text versions.

Or, even better, new .docx format is actually XML so it can be diff'ed too. You just need a good UI to display diffs.

comment 10y ago · link · parent

The problem might be not JS but using DOM (every colored word has to be a separate node and every time you add or remove a letter there would be a reflow) instead of custom widget written in compiled language and heavily optimized for displaying colored text in monospace font.

Sublime uses high level language (python) too but not for rendering.

comment 10y ago · link · parent

Why do reviewers work for free? And why scientists agree to give away their work for free?

comment 10y ago · link · parent

You can make it so that opting in and out takes equal effort.

comment 10y ago · link · parent

It looks like everybody today wants to spy on you. Google, Facebook, and Twitter want to look at your browsing history, NSA wants to see your calls, emails, and messages history. Microsoft wants to know about everything you do at your PC and now even package managers want to have their share of data, too. What about asking my opinion first? Well, as homebrew developer have said

> The problem with opt-in is that you don’t get representative data.

Users do not seem to be enthusiastic about participating when they have a choice so let's go without asking them.

comment 10y ago · link · parent

Note that there are downsides with this method:

- the startup time increases

- if you run several instances of an app, they consume more memory because code uses anon mapping instead of file mapping

- the whole executable file is loaded to memory at startup

comment 10y ago · link · parent

> Alternatively, I suppose cookies could be used, but that's a slightly messier solution, imo. Cookies are shared between tabs. You should use URL or builtin browser capabilities (remembering scroll position on a page) for this purpose.

Infinite scroll has other UX problems. For example, you cannot see the footer of a page or cannot navigate to the items by page number. As there is no page numbers you cannot even remember how to find some item.

comment 10y ago · link · parent

I don't think it will help. Sites that care about CSRF are already implementing protection (via CSRF tokens) and those who don't care won't use this feature.

The main problem is that browsers allow POSTing data cross-site by default instead of blocking such requests unless it is allowed explicitly.

comment 10y ago · link · parent

iOS applications are moderated and Apple might not want Uber to collect too much information on their users.

comment 10y ago · link · parent

So this is information about Uber app that I found in some blog:

-------

Android Uber app code has many suspicious places. For example, it contains a namespace "com.baidu.frontia" and classes there include such code as:

    localObject = ((TelephonyManager)localObject).getSubscriberId(); // gets IMSI 
    ((TelephonyManager)localObject2).getDeviceId(); // gets IMEI
    localObject1 = ((WifiInfo)localObject1).getMacAddress();
    public static void makeCall(String paramString)
    public static void sendSMS
Also there is the code that collects information about cell towers, mcc and mnc codes, scans wifi networks.

I looked quickly through the code and it seems that those methods are never called. They are probably just a part of a library not used in this app. Uber mostly uses baidu maps, authorization and payment API.

comment 10y ago · link · parent

I really don't like all these IoT things. Modern software (except for Apple mobile devices) is full or bugs and vulnerabilities. So yesterday a hacker could break into your PC and see your files and tomorrow NSA or some bored teenager will be able to turn off the light and open the doors in your home.

And I don't like the idea of having critical parts of a device or infrastructure somewhere in a foreign country. Today "smart" phones, TVs or even cars send encrypted data over Internet to their manuacturers. How do you check they don't spy on you?

"Cloud" services have much in common with proprietary software: user cannot have full control over them.

comment 10y ago · link · parent

Why would anyone want to trust their precious personal information including real name, photograph, and friend list to some random guy from the internet? Would you publish it on reddit? On NH? On shady anonymous forums?

comment 10y ago · link · parent

Google already is censoring content at DMCA requests. And what about privacy? What would you do to remove some unpleasant information about yourself from the internet?

comment 10y ago · link · parent

Golang has some magic too - for example magic with capital letters in exported symbols. But generally golang is easier to read than line like this:

> static NAME: &'static str = "du";

comment 10y ago · link · parent

I mean if you have to write that match construct around every function call the code quickly gets bloated, doesn't it? And that is not good.

comment 10y ago · link · parent

Though I like ideas behind Rust but the code is awful. If you look at the code you'll see a lot of misterious symbols (as in Perl) and strange constructs like wrap, unwrap, Arc etc. They make the code less readable.

Also Rust doesn't have exceptions so you have to wrap almost any function call with let/match/Ok/Err. Ugly.

I looked at one random file which turned out to be a `du' command implementation: https://github.com/uutils/coreutils/blob/master/src/du/du.rs...

Are they really starting a new OS level thread for every directory found? Looks like an easy way to exhaust system resources to me. Also I don't see the code that would collect error information if if the thread panics.

comment 10y ago · link · parent

You cannot compare bytes on a disk with a gun. People don't die from transferring data.

comment 10y ago · link · parent

Usually most time is spent loading third party trackers, advertisement and social network widgets. You can "optimize" that only on client side by blocking them.

comment 10y ago · link · parent

I have JS disabled by default except some sites. I just want to notice that usually it is not only JS fault. Javascript in general is not slow - the problem is usually with third-party scripts (analytics, advertisement, social network buttons) that add huge load on a browser. They load large JS frameworks, create many iframes (and every iframe is like a new tab in a browser - it has own DOM, own stylesheets, its own JS VM), track events like mouse movement. For example Google AdSence can add several additional iframes per banner.

For example, reddit frontpage (which doesn't have much ad) has 6 additional iframes. It makes 76 requests (775 Kb) while loading of which only 15 (taking 335 Kb) belong to reddit domains, other are third-party. So by just disabling third-party services (you can do it on the browser side) they can make the page two times smaller.

Techcrunch has 19 additional iframes. It makes 273 requests (of which approximately 190 are third-party) and loads 2.1 Mb of data (of which approximately 1.1 Mb account for third-party domains). Opening single techcrunch page is like opening 20 new tabs in your browser.

And as a site owner you cannot optimize your ad provider scripts. Yet you can "optimize" them out at a browser side as a user.

Instead of blaming everything on javascript or jquery people should look at network tab in developer tools.

comment 10y ago · link · parent

There would be no data truncation if you enable strict mode (sql_mode = 'STRICT_ALL_TABLES'). Indeterminate results appear only if the column values in a group are different. SQL standart doesn't allow such selects at all (even if the values in the group are the same) so you have to write longer queries.

MySQL is not that bad, it was used in facebook and wikipedia.

comment 10y ago · link · parent

> how could you even possibly keep track of what system fonts they all have available?

CSS declares special pseudo fontnames like serif, sans-serif, monotype that you can set as a backup font. They should work in all browsers.

> I get paid lot to fix these problems so really it's in my be$t intere$t to tell you NOT to use web fonts, and to hire me over and over again fixing sizing and spacing bugs

It only means the person that programmed original CSS code was not qualified enough to do this properly. Why "fix" this by adding multikilobyte download instead of fixing the code?

comment 10y ago · link · parent

If someone is getting layout bugs from font rendering differences they should learn CSS better. The idea of CSS is to program layout independent from platform or device differences like font rendering or pixel density.

By the way I think downloadable fonts should not be used on technical sites and manuals. As a user I would like to get information as fast as possible and custom fonts make page display slower - browser doesn't render text until font is loaded. It would be nice if Chromium allowed to disable loading fonts on a per-site basis as it does with javascript (which I have disabled by default).

comment 10y ago · link · parent

Also the ability to replace software would allow criminals to bypass anti-theft mechanisms.

comment 10y ago · link · parent

Replacing hardware parts and replacing software is diferent. Unofficial "jaibreak" software updates can contain errors or backdoors or intentionally written malicious functions programmed to be acivated on a special day.

comment 10y ago · link · parent

Also there is a choice not to visit sites that do not want you to read them.

comment 10y ago · link · parent

I remember they had some rule for google news that allowed paywalls if a user can read at least N articles per month from google search results. This is probably the same case.

https://support.google.com/news/publisher/answer/40543?hl=en...

comment 10y ago · link · parent

If you are not affiliated with Hollywood studios, movies cost $10/each to watch... and so on.

comment 10y ago · link · parent

Stealing CC is bad thing. But why punish LR for this and not IT professionals who stole them? Or Visa who still cannot make secure payment system? Or Microsoft who cannot make secure operating system?

comment 10y ago · link · parent

Software developers are well paid and can easily find a new job if fired. All those laws are made for unqualified and therefore easy to replace workers.

And the taxes in US are lower.

comment 11y ago · link · parent

You could probably proxy a file through your own server and add any headers you like. But in that case browser cannot use a version of a script cached at other sites.
1
181182183184185