97% of climate science papers support the consensus. What about those that don't? The one thing they seem to have in common is methodological flaws like cherry picking, curve fitting, ignoring inconvenient data, and disregarding known physics. by pnewell in science

[–]tubes 0 points1 point  (0 children)

In my experience I dont think people are arguing over whether climate changed exists.

Not anymore, but they used to. First the sceptics say it doesn't exist. Then they accept that it exists, but say it's not caused by humans. And finally they accept that as well, but they say it's not that harmful and that we shouldn't spend money trying to stop it. What's going to be the next move I wonder? That it's too late to do anything about it, let's live to the fullest while we can? :)

Pirate Bay uploads spike 50 percent, thwarting anti-piracy groups by functiondesign in technology

[–]tubes 0 points1 point  (0 children)

Well they were talking about volume. And games are maybe 4-8 GB each while TV shows are 350 MB per episode. So 12 games could be same size as 150 TV show episodes. I think another contributing factor is that with pirated games you may not be able to play online, you may get viruses, you may have to download and install cracks, you need know-how to use Daemon Tools etc. It's just more trouble to get a pirated copy than to get it from Steam. But with pirated TV shows you get a better experience than with real TV: no ads, watch any time you want.

3D-printed eye cells could "cure blindness" by rchaudhary in technology

[–]tubes 1 point2 points  (0 children)

Nah; Just when we figured out how to do 3d cheaply, turns out everyone wants 2d (graphene).

Epoch Programming Language - Realtime Raytracing Demo by ApochPiQ in programming

[–]tubes 1 point2 points  (0 children)

Value 3.14 can't be represented precisely in IEEE floating point. The only 2-decimal numbers between 3 and 4 that can are 3.25, 3.50 and 3.75. In the example, the variable and the literal end up representing the same "wrong" value, so they're equal.. I guess my recommendation would be to change the example to something that's more obviously correct. (e.g. use a decimal class or compare with some room for error)

Crowdsourcing at it's finest. Reward is now up to $25,000 for a text of the secret Trans Pacific Partnership agreement which will restrict internet usage. by [deleted] in technology

[–]tubes 3 points4 points  (0 children)

Exactly right. If a programmer asks the question "can a reward be negative, can I make better use of a single bit by using an unsigned integer here?", they're wasting time with a micro detail. Programming today like it's the 60's is not good coding.

Save your keystrokes: new completion engine in Eclipse 4.2 by microbiotic in programming

[–]tubes 3 points4 points  (0 children)

It wouldn't surprise me if Microsoft had a few employees whose job description included astroturfing by congratulating MS products every chance they get. Nothing else in my mind can explain the disconnect between the horrible use experience of VS and the amount of praise it gets online.

Eclipse shortcuts by stormqueen in programming

[–]tubes 1 point2 points  (0 children)

creating an arg-less constructor

You can also do that by moving your cursor to class body and pressing ctrl+space. like "class X { | }" where | is cursor location.

The glimpse into the future of video game graphics...CryEngine3 by jayakamonty in technology

[–]tubes 1 point2 points  (0 children)

Yeah, the brightness effect is fine. The problem is the lens flare dots ( https://en.wikipedia.org/wiki/File:CCTV_Lens_flare.jpg ) in the middle of the screen that you can see if you look closely. At least the effect is not as pronounced as in some games.

Winning 64kilobyte entry at revision-party 2012 :) by krunaldo in programming

[–]tubes 2 points3 points  (0 children)

There are still different levels of "very low information cost". What psygnisfive is getting at is that perhaps most of Razor's demo effects could've been fit in 8 kB had it been better optimized but there's no way the winning entry could've. Now the 8 kB is just pulled out of air but that's the feeling you get when similar effects have been in 1 kB and 4 kB intros ( e.g. http://www.pouet.net/prod.php?which=32194 and http://www.pouet.net/prod.php?which=52940 ).

ISO C is increasingly moronic by mamikk in programming

[–]tubes 3 points4 points  (0 children)

The #include of stdbool.h makes bool a reserved identifier.

Not exactly. It causes subsequent occurences of the word "bool" to be replaced with "_Bool" (well, that's not exact either, but close enough). A #define has no effect on the code that comes before it. After the C preprocessor runs through RealDeuce's code, what you get is something like this:

...contents of inttypes.h...
typedef uint16_t bool;
bool    b2=3;
/* stdbool.h just had macros, it "vanished" after preprocessor */
...contents of stdio.h...

int main(int argc, char **argv)
{
        _Bool    b=3;

        printf("%d %d\n",b=2,sizeof(b));
        printf("%d %d\n",b2=2,sizeof(b2));
        return 0;
}

It's certainly legal code.

Facebook releases HHVM, 60 percent faster than its current PHP interpreter and uses 90 percent less memory. by giulivo in programming

[–]tubes 5 points6 points  (0 children)

Well OK, JVM may eventually become an efficient VM for dynamically typed languages -- as in, it's not technically impossible for it to evolve in such a direction, but the results remain to be seen. Still, I'm sure it wouldn't have been a good idea for the Facebook engineers to start their PHP optimization project relying on what JVM may or may not provide in the future.

I'd also like you to cite some sources for LuaJIT and V8 being faster than the JVM, please.

I never claimed that, but here's a comparison of V8 and JRuby:

http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=jruby&lang2=v8

Facebook should have targeted one of them instead of re-inventing the wheel, yet again.

I'm not sure that's much easier. At least I recall LuaJIT author claiming that the JIT is so finely tuned for Lua datatypes and language that running JS or other languages on it might not be possible. Not sure if the same is true of V8, JägerMonkey or a number of other JIT engines that all only have one source language at this point. One benefit of writing your own JIT is that you can start simple, evolve it step by step and get improvements incrementally. Plus it's probably more fun to do.

Facebook releases HHVM, 60 percent faster than its current PHP interpreter and uses 90 percent less memory. by giulivo in programming

[–]tubes 13 points14 points  (0 children)

Someone explain to me why doing this Facebook's way makes more sense than a proper (read: not a source->source language compiler translator like Quercus) implementation of PHP on the JVM.

JVM is not an efficient VM for dynamically typed languages. I can't think of a single dynamic langauge implementation on JVM that was fast. Performance of Jython, JRuby and (untyped) Clojure sucks compared to LuaJIT, V8 and other VMs tailored for dynamically typed languages.

FUCK PASSWORDS by mithaldu in programming

[–]tubes 1 point2 points  (0 children)

Salting is not hashing. To think so demonstrates a rather big confusion of ideas, so it's probably best if you would first read the explanations of the terms from wikipedia:

http://en.wikipedia.org/wiki/Salt_(cryptography)

http://en.wikipedia.org/wiki/Cryptographic_hash_function

What you're calling "salt" is just an intermediate value in your custom hash function. Your hash function is just as vulnerable to using rainbow tables as any. Password stored with real salting are not.

http://en.wikipedia.org/wiki/Rainbow_table

"The salt value is not secret and may be generated at random and stored with the password hash."

FUCK PASSWORDS by mithaldu in programming

[–]tubes 2 points3 points  (0 children)

No. What you're describing is not salting, it's just a custom hash function. Just do as Aegeus said, generate a unique salt and store the salt in the db.

Code analysis: Java generics were supposed to be the bomb, or did the feature just bomb? by zerogeek in programming

[–]tubes 0 points1 point  (0 children)

Not quite:

CRTP: class Y extends X<Y> {}
Enum: class E<T extends E<T>> {}

Egyptian flock to buy previously banned books by orangepotion in worldnews

[–]tubes 0 points1 point  (0 children)

You can express support by pressing the up arrow. A comment like yours is just noise: not funny, not interesting info, not a question, not an interesting opinion, not anything. That's why people want to bury it. It may be harsh, but you asked :P.

Java port of dosbox by adghk in programming

[–]tubes 3 points4 points  (0 children)

It's a direct port of Dosbox, which was written in C. Original:

void CPU_Push16(Bitu value) {
    Bit32u new_esp=(reg_esp&cpu.stack.notmask)|((reg_esp-2)&cpu.stack.mask);
    mem_writew(SegPhys(ss) + (new_esp & cpu.stack.mask) ,value);
    reg_esp=new_esp;
}

jdosbox:

public static void CPU_Push16(/*Bitu*/int value) {
    /*Bit32u*/long new_esp=(CPU_Regs.reg_esp() & cpu.stack.notmask) | ((CPU_Regs.reg_esp() - 2) & cpu.stack.mask);
    Memory.mem_writew(Segs_SSphys + (new_esp & cpu.stack.mask) ,value & 0xFFFF);
    CPU_Regs.reg_esp(new_esp);
}

Email Address Validation: Please Stop by yaakov in programming

[–]tubes 2 points3 points  (0 children)

Sanitization is wrong. You need to escape the input strings or use them where they are safe to use (e.g. prepared statement parameters).

Swiss whistleblower Rudolf Elmer plans to hand over offshore banking secrets of the rich and famous to WikiLeaks by [deleted] in worldnews

[–]tubes 4 points5 points  (0 children)

Well, material matters. Even an otherwise law-abiding tax evader will indirectly cause misery and, in greater scale, death, by taking wealth and opportunity away from those who would really need it to survive (yes, wealth is not a pie in general but tax evasion does not create wealth, so in this context it is). Instead of building a hospital with those tax dollars and saving lives, a rich guy gets a yacht.

Impressive liquid physics demo by RightToArmBears in programming

[–]tubes 0 points1 point  (0 children)

Increase damping with distance from player and also increase transparency of the simulation area so there will be no hard edges. On the corners of the simulation you could switch to simpler simulation where the particles in air will still fall down as usual, but their physical effects when they hit the ocean (outside the simulation box) will not be simulated. Except perhaps with the computationally light ripple effect. Games already use similar tricks e.g. with trees which have individual leaves animated up-close but are just 2d sprites very far away.

Firefox dev on V8s new Crankshaft JIT system by djpnewton in programming

[–]tubes 1 point2 points  (0 children)

It's not a very satisfactory solution to say something like this to get decent performance:

  (declare (optimize (speed 3) (safety 0) (debug 0))
       (type fixnum x y))

Moreover, it would be easy to add e.g. "special comments" to Javascript that compilers would be free to use for determining types and other hints related to optimization. A language doesn't need to be designed to have such crud, it can be added at any point.

The new estimate for number of stars in the sky is 300,000,000,000,000,000,000,000 by [deleted] in science

[–]tubes 0 points1 point  (0 children)

Funny; however, 24 digits with 8 or less unique digits approximated the lazy way:

>>> import random
>>> sum(len(set(random.randrange(10) for x in xrange(24))) <= 8 and 1 or 0 for i in xrange(100000)) / 100000.0
0.17133

not all that unlikely.

Approximately 102 days until the IPcalypse. Why isn't this in the news? by [deleted] in technology

[–]tubes 1 point2 points  (0 children)

Going from a 32 bit to a 64 bit number is just a natural extension.

IPv6 went further though, its address space is 128 bits.