News for hackers. Stuff that matters.

jQueryIsAwesome

Re:Explosions near Boston Marathon finish line on Monday April 15, 2013 @04:23PM (#5554050)
Well, TSA will start checking marathonists anytime soon.

Ban me or whatever you need to do but the reality is that one bomb and Americans cry, while at the same time incentivate thousands of bombs and deads in Mexico for their useless "war on drugs" and also creating pointless wars around the world (eg. Iraq)

I'm Colombian, like, live in Colombia/South America.
Mass media focus on drama not in information; so your emotions are appealed more than rational thoughts.

You can't do nothing about the North Korea crisis even if you watch the news, that's a "Reality check".

Re:Hal Finney: Bitcoin and me on Sunday April 14, 2013 @11:45PM (#5549619)
I never said "cure-all"... I never even mentioned cancer nor did the people in the video.
Re:Hal Finney: Bitcoin and me on Sunday April 14, 2013 @12:51PM (#5547363)
Billions of dollars are wasted to fight against a analgesic and therapeutic drug that could help millions; this world haves very dumb and/or corrupted people in charge.
Slightly related: If you are using ST2 I recommend the "Clipboard Manager" plugin to have multiple clipboards, it gets anything that is copied inside ST2 or any other software, it works with multiple cursors which is really handy.
Re:Own your own Bitcoin Exchange on Saturday April 13, 2013 @09:58PM (#5545527)
Where does it say that bitcoins are money?
Re:Own your own Bitcoin Exchange on Saturday April 13, 2013 @09:53PM (#5545517)
DOSS attacks can be overcome with a solid infrastructure like Cloudflare (expensive but possible) and also with the help of modern browser capabilities such as webRTC and offline cache.
Re:Console.log with style on Saturday April 13, 2013 @01:32PM (#5543893)
The features of the console is not really a usability issue.
Re:Console.log with style on Friday April 12, 2013 @09:56PM (#5542214)
I found a way... well, sort of:

    var log = function(){
        args = [].slice.call(arguments);
        args.unshift(console);
        return console.log.bind.apply(console.log, args) 
    }
But you have to add extra parenthesis at the end, hopefully is not too much overhead for most devs.

    log("message")()
Re:Console.log with style on Friday April 12, 2013 @08:52PM (#5542039)
Maybe add console.assert to that list:

    console.assert(str.length === 10, "String is not 10 characters long!");
and console.group/groupEnd

    console.group("sums");
    console.log(1 + 1);
    console.log(2 - 3);
    console.groupEnd();
Re:Console.log with style on Friday April 12, 2013 @08:38PM (#5541997)
This "console"... IE5 didn't even have console... and event the current one IE haves is a joke compared to firefox or chrome.
Re:Csscss: a CSS redundancy analyzer that analyzes redundancy on Wednesday April 10, 2013 @06:50PM (#5528753)
The author also haves one of the best bios in twitter:

> I connect stuff and copy bits. Sometimes it doesn't work

Re:How to share your data effectively on Monday April 08, 2013 @03:25PM (#5513905)
"Well, that explains why the business world is so broken"
Re: on Monday April 08, 2013 @03:13AM (#5510374)
"Freedom" is slowly losing its meaning.
Re:Show HN: Subvim – Vim customized to be like SublimeText on Saturday April 06, 2013 @07:10PM (#5505413)
Is awesome but it needs some work, it would be _really_ nice if it were syntax aware, so if you start Ctrl+D in a variable it should only select where is being used as a variable and not other things (regex, strings, etc) or at least a boolean option to enable this behavior.
Re:Show HN: Subvim – Vim customized to be like SublimeText on Saturday April 06, 2013 @07:05PM (#5505393)
ST3 will be released soon and is supposedly going go fully support all vim commands in vintage mode with better performance.
Re:Homeless in Silicon Valley on Saturday April 06, 2013 @10:49AM (#5503710)
There must be a name for the logical fallacy of taking analogies way too literally.
Re:Thesis Hatement on Friday April 05, 2013 @03:13PM (#5500411)
> better-than-thou crowd

The irony burns like flames from hell.

Re:Homeless in Silicon Valley on Friday April 05, 2013 @03:03PM (#5500355)
Kurt Cobain was homeless during a period of his life and was a drug addict and arguably also had mental issues; what I want to say is that is not "social justice" what many of them need but help finding passions that can provide at least for their basics needs (of course also some level of help with their addictions and mental issues)
The tracking problem seems easy to solve; but admitedly I never went to college so this may be just dumb, but why don't just use a external reference device? A little device that saves your initial position and triangulates the diff between your initial position and your current position.
Re:Callbacks are imperative, promises are functional on Sunday March 31, 2013 @01:40AM (#5467846)
I see no benefits in promises, zero, none.
Re:Callbacks are imperative, promises are functional on Saturday March 30, 2013 @08:36PM (#5467191)
Sorry, I don't see no clarity there. And how would that fix the fact that stat works in individual files?, and more importantly, how does a function like that handles error? Individual level, group level? It is confusing.
Re:Callbacks are imperative, promises are functional on Saturday March 30, 2013 @08:28PM (#5467174)
Nope, the shared scope would obligate me to create a function with binded params for each iteration so "i" is not the last value (e.g. path.length) in every call. Examples: http://stackoverflow.com/questions/1451009/javascript-infamo...
Re:Callbacks are imperative, promises are functional on Saturday March 30, 2013 @08:25PM (#5467168)
The example I'm talking about is the one where he doesn't handle errors either, this one: http://pastebin.com/98CarwzU.

And your example is disingenuous too, why do we need to add so much logic instead of collecting the errors if you want to handle them anyway?

    result.push(err || data);
So you don't need to copy around a variable called "hasFail", one line can be enough

    var failed = results.every(Buffer.isBuffer);
Re:Callbacks are imperative, promises are functional on Saturday March 30, 2013 @08:04PM (#5467121)
... and what does that haves to do with promises?

And in such case you would only do this once outside the listeners of http/or-whatever connections so it would be done just once regardless of the number of concurrent activity.

Re:Callbacks are imperative, promises are functional on Saturday March 30, 2013 @07:43PM (#5467076)
All the code and such a big abstraction for the first example when it could have done like this:

    var result = [];
    paths.forEach(function (i, file){
        fs.stat(file, function (err, data){
            result.push(data);
            if (i === 0) {
                // Use stat size
            }
            if (result.length === paths.length) {
                // Use the stats
            }
        });
    });
Fairly understandable, more efficient and without introducing logic patterns foreign to many. It also meet his requirements (It is parallel and we only hit every file once)
> Only humans perform experiments on other species that we would regard as torture.

Because only humans are capable to, do you seriously think overwhelming cognitive advantage would be used any different if we had different traits? If our heads were shaped like the ones of mice? Or if we had 4 stomachs like the cows? And this selfishness and disregard for other animals well being is what made humans growth so quickly and one of the main reasons you and me exist.

Fixes done.

Older »