Better HN
topnewbestaskshowjobs
Log inSign up

DCoder

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

not here anymore
Submissions

comment 13y ago · link · parent

Create a separate profile or close _all_ open Chrome windows first.

  "c:\path\to\chrome\dir\chrome" --user-data-dir="c:\path\to\chrome\dir\User Data/test" --record-mode

comment 13y ago · link · parent

Yes, The West Wing is worth watching in its entirety.

comment 13y ago · link · parent

Because that's how the Mercator projection distorts object size: http://en.wikipedia.org/wiki/Mercator_projection#Distortion

comment 13y ago · link · parent

That makes sense (thank you, don't know why I didn't realize that myself), but if I override that with css height: auto; , the browser no longer reserves space for the image while loading it... quite unfortunate.

comment 13y ago · link · parent

If you specify width and height explicitly, certain browsers will have issues resizing them (if you set max-width: 100%, Chrome will squish a larger image horizontally but leave the height as it was, IE will scale it proportionally).

comment 13y ago · link · parent

And the effort not to give up when your reverse-engineering efforts reveal remarkable stupidities in the original code. We all know crunch happens, but that doesn't make dealing with the resulting spaghetti any easier.

(I spent several years reverse-engineering Command & Conquer RA2, I should know - that game has hacks and flukes everywhere.)

comment 13y ago · link · parent

There is the Pointer Lock API [1], but it's still WIP.

[1] http://www.html5rocks.com/en/tutorials/pointerlock/intro/

comment 14y ago · link · parent

SO users with 10k+ reputation can still see deleted questions.

comment 14y ago · link · parent

FYI: the email: field in your profile is private, other users can only see the about: field.

comment 14y ago · link · parent

That is what "Close as too localized" option is for.

comment 14y ago · link · parent

Compare that to a training exercise the soviets carried out - 40+ thousand troops engaging in combat while a nuke is detonated overhead: http://www.johnstonsarchive.net/nuclear/radevents/1954USSR1....

comment 14y ago · link · parent

There's an easier-to-read version for those who don't like PDF: http://jeena.net/images/2012/php-the-good-parts.jpeg :-)

comment 14y ago · link · parent

The intro text explicitly defines those datatype sizes:

In other words, please answer each question in the context of a C compiler whose implementation-defined characteristics include two's complement signed integers, 8-bit chars, 16-bit shorts, and 32-bit ints. The long type is 32 bits on x86, but 64 bits on x86-64 (this is LP64, for those who care about such things).

comment 14y ago · link · parent

Reddit[1] found the "Joseph" in question, his comments are still visible in his public activity stream: https://github.com/pirtlj

[1] http://www.reddit.com/r/programming/comments/tionj/linus_tor...

comment 14y ago · link · parent

Leave Stack Overflow open in the background for some time to get a special message from a Unicorn Clippy.

comment 14y ago · link · parent

Currently I'm using a heavily hacked third party time picker that was patched onto jquery ui datepicker, and half of the advanced datepicker functions don't work or work badly. It took me a day of research and at least two days of hacking to make this work well: http://imgur.com/87e9g.png , I'd love to see a replacement that just works without any hacking needed :)

comment 14y ago · link · parent

Looks nice. Any plans to integrate a time picker?

comment 14y ago · link · parent

If you're hosting your own WordPress (or any other solution, actually), you really should be keeping an eye for any updates. WP is a popular hacker target, even waiting a day after an announcement can be enough to get hacked. Thanks to Muprhy's law, such an announcement will definitely come when you're on vacation somewhere.

That's, of course, assuming that such an announcement is made in the first place. Last year the timthumb bug was being exploited and not all theme download sites bothered to alert the users that the themes were vulnerable.

comment 14y ago · link · parent

> I was kinda looking forward to see the "water surface" in 3d with lighting and reflection

http://madebyevan.com/webgl-water/ might be more interesting then.

comment 14y ago · link · parent

I implemented Klarna as a payment option in one e-shop recently. Said e-shop operates in Denmark, Sweden and (as of this week) Norway, but the Klarna option is only available in Sweden. The owner said that without this option it wasn't worth even opening the Swedish version.

Klarna also requires your Social Security Number, in those countries which use it, as well as other information: http://integration.klarna.com/en/testing/test-persons .

381.

JetBrains releases PhpStorm 3.0(jetbrains.com ↗)

1 points · by DCoder · 14y ago · discuss

comment 15y ago · link · parent

I have used this for a few things. One of them that was the most interesting to code, even though very narrowly useful, was a way to compare two memory dumps from a C++ game to find the objects that don't match (after the game detects a checksum mismatch between online players, the players are asked to make these dumps, and then submit them to us; We drag'n'drop two dumps into a webpage and get a printout of objects that don't match). Admittedly a C++ app would have been a lot faster, but Chrome still managed to read the dumps and extract the relevant info in several seconds.

comment 15y ago · link · parent

Sometimes you really need to invoke external commands through exec(). In those cases, make sure to use escapeshellcmd() and escapeshellarg().

comment 15y ago · link · parent

You're probably referring to http://www.readwriteweb.com/archives/open_thread_the_interne... .

comment 15y ago · link · parent

x86 assembler doesn't.

I mentioned C+++ Templates: The Complete Guide - it demonstrates a similar template (15.2.4) to add two values, and even with simple addition it points out a flaw similar to this one (and admittedly more likely to come up in the real world) - determining the return type for, say, int + char. Their solution is a traits class with a specialization for each pair of types. Sounds complicated, but then again, so is writing a template function to perform simple multiplication.

comment 15y ago · link · parent

  template <class ttype>
  ttype multiply(ttype a, ttype b)
  {
    return a * b;
  }
int * int doesn't always fit in an int. C++ Templates: The Definitive Guide suggests using a traits class to solve problems like this. Templates are a complex subject in general, and I wouldn't recommend using them without having read the aforementioned book.

comment 15y ago · link · parent

You could also use 13 months of 28 days each - that totals 364 days as well.

comment 15y ago · link · parent

In my experience, writing PHP on one platform and deploying it on another doesn't always work out. Your developers have to be aware of where their app will be deployed and the specifics of that OS.

> I think PHP support on Windows is as good as on any other OS.

I have seen several things fail in that environment - escaping shell commands and arguments is problematic, invoking external executables is only reliable when full path is used [1], realpath() (used to, at least) chokes on / as a directory separator... Autoloading classes based on classname => filename can produce funny results. File uploads can work differently (case sensitive filenames - foo.jpg and foo.JPG can coexist in Linux, but not in Windows).

On the other hand, there are things like the new MSSQL PDO driver that only exist in the Windows world.

---

[1] Windows 2003 Server was running our app, which invoked Imagick similar to `convert $input.jpg $output.jpg`.

Worked just great for half a year.

Deployed to a second machine, Windows 2008 Server.

Command execution fails silently.

Change %PATH% to be identical to the old server's one.

Restart.

Still fails.

Compare phpinfo().

$_ENV['PATH'] in new server doesn't match %PATH% (it appears to be re-sorted with windows folders first), $_ENV['PATH'] in old server matches %PATH%.

Messing around with new %PATH% changes nothing, new server keeps giving PHP the silently-reordered %PATH%.

Nothing helps, short of specifying full path to `convert`.

A very fun thing to debug.

comment 15y ago · link · parent

Anecdote: one side-project I'm working on is a simple DLL injector that can insert arbitrary DLLs into other processes at launch time. It's been used out in the open for over three years, but only one security suite (Comodo) blocks it from running. Is modifying other processes' memory not as suspicious as Chrome's behaviour?

comment 15y ago · link · parent

PyCharm is produced by the same guys who created Resharper and a lot of other great tools like PHPStorm and TeamCity. Been using PHPStorm for nearly a year now, and I still find new things it can do.
1
1213141516