Better HN
topnewbestaskshowjobs
Log inSign up

DCoder

1,260 karma · joined Nov 2, 2009 (17y ago) · 479 submissions

not here anymore
Submissions

comment 12y ago · link · parent

Funny, an issue for that error was filed back in March 2013: https://github.com/jhusain/learnrx/issues/9

And a pull request fixing it was submitted back in August: https://github.com/jhusain/learnrx/pull/27

comment 12y ago · link · parent

Actually, Microsoft's SQLSRV PDO driver supports named parameters.

comment 12y ago · link · parent

There are other uses for ASM aside from getting more speed. Learning ASM will show you how things work at a low level, which is helpful when you try to understand C pointers and other details. Reading assembly also lets you (try to) understand the programs you don't have the source for - device drivers¹, malware¹, copy-protection, regular third-party applications ...

I spent several years disassembling a game (C&C Red Alert 2), understanding the code, fixing the shitty parts and glitches left in it, and extending it. It was fascinating.

¹These examples are certainly far from trivial, I know, but that is half the fun.

comment 12y ago · link · parent

See also:

* http://qdb.us/latest - more active than bash.

* http://quotes.burntelectrons.org/browse - quotes from irc.mozilla.org , mostly Mozilla-focused.

* http://www.xkcdb.com/ - covers #xkcd and related channels. Randall Munroe participates sometimes.

comment 12y ago · link · parent

See also: "Transporting the [Lockheed] A-12s to Area 51" at http://www.roadrunnersinternationale.com/transporting_the_a-...

comment 12y ago · link · parent

See also: free bonus chapters at http://www.informit.com/store/old-new-thing-practical-develo... , under Sample Chapters.

comment 12y ago · link · parent

An alternative to emigrating could be finding a local company working on projects for foreign clients. For example, I live in Eastern Europe and work for a company that deals 99% with clients from Denmark (Central Europe). I make significantly more than the average worker here does. Just be careful and make sure the company values quality and best practices over a quick buck.

comment 12y ago · link · parent

Viktor Suvorov was not KGB (secret police). He was GRU (Military Intelligence).

comment 12y ago · link · parent

From past experience, their support is good, but one significant thing I missed was type inference:

    // function signature
    getNumber(context: any, callback: (result: Number) => void);
    
    // calling that function
    // unfortunately, here the type of num is any
    // unless I specify it manually
    getNumber(..., (num) => { ... });
Visual Studio figured out the type on its own.

comment 12y ago · link · parent

See a certain Linux kernel exploit: http://lwn.net/Articles/342330/

comment 12y ago · link · parent

Be careful with that if you use data-binding in your templates, such as Knockout.js . Visual Studio doesn't know the types of your viewmodels, so those templates are not indexed and not subject to refactoring.

comment 12y ago · link · parent

> I also believe there are some nice SQL sanitation libraries out there. This is not the right approach. Separating the query structure from the data is the right way to go - parametrized queries are much safer than sanitization, which is subject to all sorts of encoding headaches.

comment 12y ago · link · parent

It's from [0], which was on HN not too long ago [1].

[0] http://natashenka.ca/posters/ [1] https://news.ycombinator.com/item?id=7156405

comment 12y ago · link · parent

> how many times have I bought a movie on iTunes to show my kids how to do it right, and then torrented it as I couldn't wait for the download, too slow.

Hey, at least you have the option of getting it on iTunes. Where I am, neither iTunes, Amazon Instant Video or any other online service is willing to even sell me the content I want.

comment 12y ago · link · parent

Since you're using MySQL, you can start it with --i-am-a-dummy [1]. Not a backup, but still handy.

[1] http://dev.mysql.com/doc/refman/5.6/en/mysql-tips.html#safe-...

comment 12y ago · link · parent

> It appears that you can't provide answers without first asking questions.

That's not true. You can write answers right away, but you need to acquire some rep before you can write comments .

comment 12y ago · link · parent

Not entirely true. PHP definitely tries to perform a numeric comparison on two strings if it thinks they are both numerical strings, but this behaviour changed in PHP 5.4 [0]. heron87's scenario was reported as a bug [1], changed in PHP 5.4 and caused new problems [2].

See the string comparison routine in 5.3 [3] and 5.4 [4]. The new implementation still inspects the strings to see if they are numeric and then tries to do a numeric equality check rather than string equality check, leading to amusing tricks like

     var_dump("0xFF" == "255.0"); // true!
But if both values overflow the long type and their double representations are equal, the new implementation falls back to actual string equality. A quick check at [5] shows that both values heron87 compared have identical double representations, assuming (sizeof double == 8), so the new representation detects the long overflow, then it sees that double representations are also identical, and then it returns to string equality rather than numeric equality. The old implementation did not consider long overflow and ended up comparing the numeric values.

[0] http://3v4l.org/a0nKq

[1] https://bugs.php.net/bug.php?id=54547

[2] https://bugs.php.net/bug.php?id=62097

[3] https://github.com/php/php-src/blob/PHP-5.3/Zend/zend_operat...

[4] https://github.com/php/php-src/blob/5.4/Zend/zend_operators....

[5] http://babbage.cs.qc.cuny.edu/IEEE-754/index.xhtml

comment 13y ago · link · parent

While I admit that using a framework instead of your own solution is a good solution, please note that that's not "zero work", it just passes the buck to the client. The framework's knowledge of the timezones still has to be kept up to date. For example, Israel used to have ad-hoc DST times changing each year and "...the unpredictability of IDT in Israel became frustrating enough that Microsoft Windows stopped trying to track changes and just made Israeli time be Greenwich Mean Time plus two hours (GMT+2) (and disabled the daylight saving option). This has led to various ad hoc solutions to the problem in Windows systems and other Microsoft software (e.g. Outlook calendar entries are often off by an hour when shared, due to the lack of IDT support)." [1]

[1]http://en.wikipedia.org/wiki/Israel_Summer_Time

comment 13y ago · link · parent

Seen this pattern many times before. One of those 'en' strings is the current user's language being written into the source, the other is hardcoded. If your server-side templating engine is impotent and only supports variable interpolation without conditionals, this approach is easier than pulling the right JS snippet from somewhere else.

comment 13y ago · link · parent

TypeScript only does enough run-time argument checking to support default argument values.

Full run-time type checking would have overhead. It would also be unnecessary in places where data flows from Typescript function to Typescript function — those places should already be foolproof after the compile-time checks.

comment 13y ago · link · parent

This was discussed on Reddit after Sourceforge announced the new installer three weeks ago: http://www.reddit.com/r/technology/comments/1jk1gz/sourcefor... , several users confirmed the crapware in the installers.

comment 13y ago · link · parent

It appears I misremembered this a little bit - the issue was with license ownership, not license type. The answer we got from Hetzner support was: " we don't offer MSSQL licenses, if you want it you need your own license for MSSQL and also for Windows server 2008 R2, because you can't use your own licenses with our Windows license. "

And yes, it is reasonable to expect the customer to provide the licenses for the software, but hosting companies can also sell monthly software usage to their customers - we ended up choosing a host that did exactly this. The monthly cost we pay for Windows + MSSQL will not reach the total cost of a full MSSQL license for three years.

comment 13y ago · link · parent

Be careful and ask support to confirm all the software in your stack will be runnable. We tried to launch an SQL Server (MSSQL) -backed system on one of their root servers and their support said "the Windows licenses we use do not allow installing MSSQL - you will have to buy your own licenses for Windows and SQL Server".

comment 13y ago · link · parent

You probably meant "speck", not "spec".

comment 13y ago · link · parent

See also discussion on Reddit [1] and a particularly interesting comment [2].

[1] http://www.reddit.com/r/programming/comments/1gfve8/how_not_...

[2] http://www.reddit.com/r/programming/comments/1gfve8/how_not_...

comment 13y ago · link · parent

I'm talking about a managed server. No root access. If there was root access, I wouldn't be listening to their "we can't limit access because that's how our management tools work".

comment 13y ago · link · parent

I host several customer projects on Hetzner managed servers. Ports of all the services, MySQL, Postgres, smtp, everything else are open to the world and their support refuses to lock that down in any way.

I accept that for managed servers they need to connect from outside to manage them, but how hard would it be to drop all traffic except for the IP range their management systems use?

comment 13y ago · link · parent

That tag can stop you from scrolling sideways because it also says "the width of this document should be the same as the width of the device", killing all horizontal scrolling. It shouldn't affect vertical scroll though, unless height is constrained through some other styling rules.

comment 13y ago · link · parent

What's there to fix? The tag says "you cannot zoom this site to levels less than 1.0 or more than 1.0", the browser complies. I'm not proud of it, but I've used this very approach to fix a stupid bug in iOS Safari - rotating the device without this zoom lock changed the zoom in ridiculous ways.

comment 13y ago · link · parent

It doesn't record where you click or what you open, just every request as it moves over the wire.

I am getting quite different results - it records http requests and user input (keyboard/mouse).

Windows 7 x64, Chrome 25.0.1364.172 m :

  # navigate to chrome directory
  cd C:\Users\User\AppData\Local\Google\Chrome\Application\
  # run chrome with a new profile
  chrome --user-data-dir="../User Data/recording_test" --first-run --record-mode
  # use the new chrome profile to browse around
  # close chrome
  # launch it in playback mode
  chrome --user-data-dir="../User Data/recording_test" --playback-mode
  # watch disaster ensue as it locks your mouse (not keyboard), 
  #   replays all activity (url bar input, navigation, mouse cursor movements...), 
  #   and doesn't even stop when you alt-tab 
  #   to a different application
It feels unpolished - mouse scroll wasn't recorded, the "translate this page?" bar wasn't showing up the same way as in the recording, and most importantly, I managed to switch to a different application and it continued sending input to that application. HTTP requests did get cached as promised, and non-cached requests (due to missing scroll event, it clicked on a different link) resulted in a cache error.
1
111213
16