News for hackers. Stuff that matters.

jblotus

Re:Your Coffee Shop Doesn’t Use Two-Phase Commit [pdf] on Monday February 29, 2016 @10:44PM (#11200653)
Not sure what your statement means.
Re:How I Fired Myself on Friday March 01, 2013 @11:16AM (#5305068)
just awesome
Re:Simply scale with Nginx, Memcached, PHP-FPM and APC on Friday February 01, 2013 @10:43AM (#5151315)
interesting, for those of us who have been using apc for years.

Simply scale with Nginx, Memcached, PHP-FPM and APC

http://www.jblotus.com/2013/02/01/simply-scale-with-nginx-memcached-php-fpm-and-apc/

When I started programming in PHP, my hosting setup involved a cPanel installation with Apache and MySQL. This has been the de facto standard for many PHP developers and for the most part I don’t think any of that needs to change. I simply never had to deal with websites that got more than 10,000 visits a day. This all changed when I started work at my current job a few years ago. We sell an...

( Read More... | 2 comments | 2 points | on HN )
Re:Common JavaScript Gotchas on Tuesday January 15, 2013 @09:30AM (#5060218)
ok i see your point. i conflated the terms function and closure in this case.
Re:Common JavaScript Gotchas on Tuesday January 15, 2013 @09:27AM (#5060203)
after thinking about it for a while, I was misrepresenting what block scope actually was and removed those references in the post.
Re:Common JavaScript Gotchas on Sunday January 13, 2013 @07:51PM (#5052646)
author here.

<?php $a = 1; /* global scope */

function test() { echo $a }

test();

in javascript, $a would be 1 but in PHP it is undefined and won't produce output,

Re:Common JavaScript Gotchas on Sunday January 13, 2013 @10:37AM (#5050956)
thanks for the help
Re:Common JavaScript Gotchas on Sunday January 13, 2013 @08:52AM (#5050740)
i've also run into this, usually through double event binding
Re:Common JavaScript Gotchas on Sunday January 13, 2013 @08:50AM (#5050737)
well, functions close over scope no matter what you call them.
Re:Common JavaScript Gotchas on Saturday January 12, 2013 @11:27PM (#5049969)
author here, it wasn't about hiding private variables. i was demonstrating using closures to avoid global namespace collisions which i think is generally a big problem for beginners.
Re:Common JavaScript Gotchas on Saturday January 12, 2013 @11:07PM (#5049935)
thanks for reading
Re:Common JavaScript Gotchas on Saturday January 12, 2013 @11:04PM (#5049929)
or both for next level mode!

Common JavaScript Gotchas

http://www.jblotus.com/2013/01/13/common-javascript-gotchas/

PHP was my first programming language, and my initial exposure to JavaScript was through libraries like jQuery. There were things about JavaScript that always seemed to trip me up in the beginning due to how they worked differently than PHP. Heck there are still some things today that are confusing. I want to share some of the things that I struggled when I started working with JavaScript. I am...

( Read More... | 27 comments | 125 points | on HN )
Re:My Programming Heroes: Douglas Crockford on Saturday January 05, 2013 @06:51PM (#5014546)
all the greats get criticized