« first day (318 days earlier)      last day (4627 days later) » 

9:01 AM
0
Q: Why is JavaScript not used for software development?

Jose FaetiDuring my years of web development with JavaScript, I come to the conclusion that it's an incredible powerful language, and you can do amazing things with it. It offers a rich set of features, like: Dynamic typing First-class functions Nested functions Closures Functions as methods ...

 
9:50 AM
So i make a broad statement like "There are no JS IDEs"
and then the noobs come in with the trolls saying "Visual studio is a JS IDE" -.-
 
10:12 AM
actually aptana evolved from thing called "javascript IDE"
though the auto-complete seems to lack
 
meh
aptana, eclipse, vs2010, netbeans, cloud9 & webstorm are all mediocre as JS IDEs
 
posted on August 30, 2011

On 10th and 11th of May we’re organising the second edition of Mobilism in Amsterdam. The first one was a huge success; see for instance the videos of Luke Wroblewski’s and Nikolai Onken’s sessions. We’re eager to repeat this succes, and therefore we’re happy to announce that Jason Grigsby, co-founder of CloudFour in Portland and mobile strategist extraordinaire,

RT @annevk: The other day @samweinig landed support for new Event() etc. in WebKit. http://t.co/i2wqSBw #domcore
 
10:39 AM
@Raynos Vim ftw
 
@Zirak or emacs or sublime text 2 or <insert-text-editor-of-choice/>
 
Emacs is nice, but Vim ftw :3
 
@Zirak theres nothing wrong with $.each
Apart from (key, value) instead of (value, key) FFFFFFFFFFFFFFFFFFFFFFFFfffff
 
@Raynos Checked sublime text. Seriously? It costs money?
 
@Zirak meh
It doesn't
It just complains if you dont buy a licence
I believe they call it "nagware"
 
10:49 AM
eh, what the hell, I'll give it a try. Can't be more disappointed than the NetBeans experience...
 
do try sublime text 2
If your on linux I recommend the dev build
 
Winshit, unfortunately. Planning to do something about it soon
 
Do it now
Install (ez-mode=ubuntu) or ask @tereško "What's the most manly *unix distro"
 
My computer's specs are worse than a Commodore 64
Also, without a second thought - Ubuntu
ah crap, might need to sell my soul again. When will people stop using Java?
 
Seriously
java jobs
why dont you get a job in somethign decent
 
11:00 AM
Where is that magnificent place where you get decent jobs in?
 
ehm
your startup
 
I'm a poor person with "no education". And I'm running out of pizza money. My soul isn't that important to me, anyway :P
For a startup you need an idea, time, money and patience. Only have time at my disposal...
Also, I made some websites. But my design skills are those of a giraffe and it gets old to move a div 3 pixels and change the background dymagically.
But you're still young. You'll have time to get screwed over when you finish uni (or college.)
 
11:21 AM
...
There is a lack of skilled developers
especially in the js & php world
Stop aiming so low
 
@Raynos at a guess i would give that title to Slackware because it is one of the last "old school" distros , and in my experience - quite painful to use and maintain. Even when you have learned it.
i would recommend to looks at some other distros which have done some evolving
 
@Raynos If my "skilled" you mean "having years of experience in php and js", then I'm not one of them. I just like to build interesting stuff, and don't like to see that it looks like crap
 
Oh
 
Only have about 2 years of experience in web development
 
11:36 AM
long time in the internet actually
 
tes... (sorry)
 
@Zirak so do I ;)
I consider myself a competent JS developer
Not quite there with the web
 
well the first language i learned was JavaScript, but the book was horrible
after some other stuff i came back somwhere in 2009/10
 
Well, in the land of the blind, the sighted man rules...It's not difficult to be competent when the rest are idiots
 
and know i am working on javascript engines
 
11:44 AM
I still can't find a definition for "competent programmer"
 
"Having the necessary ability, knowledge, or skill to do something successfully."
 
Anyone can write a Hello World in C
((given a compiler of course))
 
Anybody have idea about phonegap???
 
@Raynos: There's a lack of skilled developers in php? Well that's because skilled people run away from php
2
 
@sinni800 have u worked ever before on phonegap?
 
11:48 AM
@sinni800 Why do people love hating php?
 
because it's very easy
 
@PradeepG Never.
 
@Zirak: because PHP makes it so easy for them :)
 
It's way too easy to find valid points for hate
 
php isn't that bad. It's a nice language that a lot of idiots like, and so is javascript
 
11:50 AM
Coming from object oriented programming languages, I get frequently stumped.
 
well except JavaScript is a very pretty language at it's core
4
*its
 
"Why does 0123456789, when entered into a form result in null"
 
yes, you can write decent code with PHP. but the language won't help you with that which means that most people write absolutely horrible code.
 
What do you mean by "the language won't help you with that"? How does C, js or VB help you write good code?
If you don't know how to write good code, then you'll write bad code in any language
 
Depends on the definition of bad
 
11:52 AM
but php is rotten at its core
 
@evilpie lol unicode
 
is_index isset ? oO
 
@Zirak: a standard library that isn't object oriented and has ten of different functions for the same goal but with a different degree of brokenness?
 
Lol String functions that work per byte, not per unicode codepoint
 
@Zirak not even a consistent naming convention in the standard library
more comments on how to fix a function, then documentation for the most functions
 
There's the weird camel-case and underscore mixup in the core, but it did pretty nicely for a language that migrated from procedural to oo
 
@Zirak you call that oo?
 
It's more OO than C++
 
> Anyway I will tell you that I can take any piece of C++ code and write something thats at most 3 times as slow in node.js
How screwed am I?
 
Zirak: evidence?
 
11:56 AM
Writing some C++ code is evidence enough.
 
@Zirak competent programmer is competent
 
$a = new "thisistheclassname"; // works
 
Basically I can haved a conversation with them about programming for more then an hour
without them beaming stupidity
 
It does make some things easier... I had to do a lot of reflection to instanciate classes by name in c#
Or run functions by name
 
@Zirak
 
11:57 AM
PHP just does that... It feels like using a hooker. I feel bad being able to cheat so much
 
with 2 personalities
 
@Zirak any competent programmer can write a C compiler that's within two orders of magnitude of gcc in terms of efficiency
 
0
Q: Encouraging recurrent users to +1 (or Facebook Like)

Yannick WurmI want to display a message to users who have visited my site 5 times, but have not yet +1'ed or Like'd to please do so. I guess javascript and a cookie are likely required. But have no idea how to go about doing this. Any ideas? Cheers, yannick

 
@evilpie hear hear!
 
php sucks at some aspects, no language doesn't, but I don't think it sucks much more than any other language. I've had to deal with tons of crap Java, C#, C VB and others spew at you, and I gotta say, php could've been a lot worse.
@Raynos Writing a compiler is actually very difficult
 
12:01 PM
@Zirak yeah I know
but any competent programmer can do it given a pencil, shit loads of paper & the dragon book
 
On paper, yeah, I can write a compiler, but in practice? I'll run away screaming like a little girl
 
Meh
 
@Zirak: Even I have trouble figuring out which PHP function is supposed to be used to sanitize input. There are always a bunch and the docs never explain the difference. Which explains why PHP apps are always full of security vulnerabilities, even if the developers do try.
@Zirak: And that's really exceptional, I've never seen a language messed up like that.
 
But, admittedly, compilers make you know the language you compile and the language you compile with much much better.
 
@Zirak I can write an ES5 to ES5 compiler if I needed to
If your a competent PHP developer then you can write a PHP5.3 -> PHP5.3 compiler
By that definition no-one is a competent PHP programmer :p
fuck off would I want to write a PHP compiler
 
12:04 PM
@WladimirPalant I think the biggest problem with sanitizing is the deprecated/old functions. mysql_* are a bane, and that's a big thorn in the ass, because you need to know exactly what to use
@Raynos The hell is a ES5 -> ES5 compiler?
 
@Raynos there is one that compiles it to .NET IL, Phalanger
 
@Zirak it's a compiler that compiles ES5 to an intermediate language then compiles it back
 
i started writing a jit for JS, github.com/evilpie/python-js-jit
 
Like ES5 -> C and C -> ES5 except your intermediate language is of your choice
 
@Zirak strip_tags() isn't deprecacted and yet you shouldn't use it.
htmlspecialchars() is what you should use but the docs totally fail to explain the use case
and I've seen tons of webpages using addslashes() instead - simply because the use cases are never really explained.
 
12:11 PM
If you know what you actually want you wouldn't need the use cases
 
people who start with web development don't know. they know "I need to sanitize user input, how?"
 
But since most PHP programmers are snippet copiers and, sorry, retards (this stems from the fact that most are some elementary / high school teens who see PHP is the most popular web language and... just try it out without knowing ANYthing about programming in general), we will need those explanations..
But rather than a use case and a code snippet, they should get an explanation of what and why
 
but nobody sane really invests time in explaining php issues to kids
 
Also after a long time of having to sanitize shit, I now use Propel for my db layers
 
...
I dont know how to start with PHP
 
12:14 PM
At least no more database attacks
 
I just know it has 10000 functions
 
All of which are of questionable use sometimes
 
I know 90% of the websites and tutorials about PHP are "How to bad code 1-on-1"
I need to have the manual to "competent modern PHP"
 
There are actually good php books
 
and nobody sane invests time into updating old advises for PHP programming (putting together SQL queries, yeah)
 
12:15 PM
I know how I did it
 
I cant distinquish a good php book from a bad one
And if I cant do that then what can noobs do?
 
I started with a language mostly sane people use
C#... And did my development there, people are a lot more sane there
And then, with the general knowledge of programming I went over, and now I think I make clean code.
 
I learned php from making crap, hacking it, and then making the crap a little less crappier
 
My current php implementation has a butchered mvc system without the m
 
o/
Is it called Model 1?
 
12:17 PM
RT @ryah: MSFT is looking for a #nodejs focused engineer http://t.co/EXbfPb6
RT @silviapfeiffer: Webkit TOT landed a full WebVTT parser http://ow.ly/6g1xL - looking forward to seeing it work in Safari and Chrome
 
No, it's not :D
I'm coding a site and those assholes told me to not use any frameworks
So to keep myself sane I implemented a little (m)vc system
I know I made at least one error
Sending HTML before having the first PHP output
Uhh can I use string[0] to get the first character? Is a string a char array? :P
 
EW PHP
Y U LINK PHP
 
Oh yeah I can
I just JSFiddled it
JUST CUZ
I hate PHP but I currently have to use it
 
@sinni800 Chrome Developer Tools/Firebug, meet them, love 'em
 
Firebug sucks
Chrome Developer Tools are much better
I'm using them
 
12:25 PM
:D
 
I tried all four
IE, Opera, Firefox, chrome
And I find the Chrome ones the best
 
WTK
Maybe the best in terms of performance (especially under linux) but other than that... pheww
 
IE Dev tools suck so hard
 
RT @kylebarrow: Anyone else getting a lot of false positives with the window.applicationCache error event?
RT @borismus: Posted: Developing Multiplayer HTML5 Games with Node.js. http://t.co/FveFk1W
 
WTK
Firefox has much better development tools
 
12:27 PM
i would go with firefox + chrome
 
@sinni800 my PHP friend says your code is trollz
 
Haha trollz
Of course somebody says my code is shit. But I find it okay that way
Although if there are security flaws
 
he is currently raging :P
 
HOW good is he in php?
I'm a bloody beginner
 
"But I find it okay that way" one of the many problems in the php community
 
12:29 PM
omg Raynos has a face
 
which "he" do you referrer to ?
 
@evilpie I did a lot of grinding on this code, and this is the best I could come up with
My controllers cant change the site title :D only the body
I know I should incorporate some kind of "get a string of the whole html content from controller" stuff... But that was too complex because I had a friggin time constraint
 
@jAndy did you win?
@sinni800 I think he has 8 years of experience :P
 
So wut
 
I wouldnt want to write PHP thats any less then his
 
12:33 PM
@Raynos: nope, I totally forgot about it and when I finally remembered (sunday night) it was too late of course
 
wow removing bad chars manually :(
 
I have general programming experience of maybe 10 years
 
@jAndy did you get jsconfeu ticket?
I went there 6pm
realised it opened 6pm CEST which was 4pm my time
and was like FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFf
 
yay probably going to be at jsconf, too
 
@sinni800 I have 1.5 o/
 
12:34 PM
but to my defence.. I was visiting a friend, so, just lost it from my focus
lol
 
to my defence I was hacking nodeknockout
@jAndy stackchat.raynos.org
 
@Raynos: that is a node clone from this chat ?
 
Yes
 
seems like I cannot login with my google account yet
 
12:39 PM
@Raynos Well at first it was very easy stuff. I was 10 so I used vbscript to do... stuff.
 
omg my head is so spinning. I'm currenting mergin my mediator/dispatcher directly with a promise maker. Dude, I can't think so far ahead.. brrr
 
I like one thing about php
And that is var_dump
 
I'm wondering if there is already any "definition" or "wording" on what I'm implementing right now
 
huh?
wow my jquery/js code worked out of the box
 
mediator.dispatch({ name: 'MyFooEvent', queuePromise: {
    allDone: {
       done: function _done() {
       },
       fail: function _fail() {
       },
       timeout:   5000
    }
}});
something like this.. you're dispatching an event througout your system/module land and be able to have couple of callbacks for the special case you create a "queuePromise"
that fires, when all listeners push and resolve a promise object into the event object
 
@Raynos: whats that
 
mediator.emit("myFooEvent", someData, cb)
 
don't think you got it
 
mediator.on("myFooEvent, function(someData, cb) {
  doSomethingAsync(someData, function() {
    // do shit
    cb();
  });
});
 
I would assume that in that line, the "cb" will fire for every listener individually
 
12:48 PM
@jAndy yes
Ehm
 
thats easy
I'm talking about that you dispatch an event, and you have fail/done callbacks for the case all listeners are finished (when that is, may get defined by each listener callback individually through promise objects, handled by the dispatcher)
it's actually very similar to "waitForMultipleObjects" in threaded system
 
@jAndy ugh
why would you want that
 
that is why I also pass over a timeout there
 
I think your abusing events if you need a hook for all listeners are finished
thats some hard core hard coupling right there
 
well.. I had some cases where I want to know when all of my modules finished a specific task (which starts in each module, when some event was fired)
so my present solution was, so fire another event "back" at some point
@Raynos: I don't see the tight coupling there, delight me ?
for instance, I've got like 20 modules, each of those modules loads an image (thumbnail). now every module only has access to its own "image load" event, but I want to start loading the "high res images" once all thumbnails where loaded
 
12:58 PM
Awhhh I change my avatar at the worst possible moment.. meta.stackoverflow.com/questions/103456/…
And I missed all the fun conversations about languages and C++ and startups and JIT compilers, and... :(
 
@jAndy I think its fine but it annoys me
it reaks of better design
You shouldnt have to wait on listeners to finish
 
I don't have to, but I at least have a possibilty to do so now
I wouldn't know a better architecture for my above described problem
and it's not "waiting", pretty bad word for an event driven system. of course nothing holds or waits, it's just hanging in an promise maker
 
@Incognito im not sure what that means. but im sanitizing the data now, it shouldnt do that now
 
@Incognito what is jsfiddle, and how do I use it!!! :P
 
1:14 PM
@Neal It no longer has the error, I'm happy :P.
 
@Incognito I didnt recognise you
 
@Loktar JSFiddle is a magical instrument that you play with the nose. It was invented in the fourth century by archbishop Lemonmaster of Antioch. He passed it down to the child of odin, who begat the masters of the universe. The masters, although childish in their moral delineations, used the great Fiddle of JS to outcast the evils demons who would merge the fundamental elements of the universe.
2
For it was told in times long past by the lords of eldritch that the marking text of hyper, the sheets of cascading style, and scripts of java must remain locked away in their own realms for all eternity. The war against such sin continues to this day.
 
HAHAHA nice
 
@Raynos Just think how I felt when I realized you weren't a cartoon anymore.
 
@Incognito yes?
oh that
 
1:22 PM
do you know any lightweight javascript parser?
 
I could offer me as human parser... I might be faster than JScript.
 
i remember seeing one recently ugh memory
 
arrg i hate display names with non english characters...
its hard to respond to
 
@Neal Truth
 
@evilpie yes
burrito
 
1:37 PM
Actually, I ran into something interesting on Facebook when I tried to enter an 'e' with an accent. Hitting Alt+0 will take you to the FB help page.
Also, Chrome won't allow Alt-key combinations at all, apparently (I'm guessing this is due to menu shortcuts in combination with Alt)
Actually, Alt-0233 isn't working in any application I've tried it in. (Should be é)
This bothers me a little
 
ha:
@RyanKinal chrome lets me do alt combo's whats not working for u?
é
see? im on chrome
 
Huh. Apparently the normal number row won't work.
café
You have to use the number pad. I was unaware.
 
@RyanKinal lol that what i usually use for numbers.
thats usually how the alt cmds work
 
Hey guys ! Does anyone have a hint about what jQuery calls I can use to replace Prototype's Class.create (with inheritance) ? It's for a script I have to swith from Prototype to jQuery and I'm not sure what's the best way to adapt the class structure without breaking anything. Or if I have to rewrite my own inheritance management code.
 
1:55 PM
@Shtong Object.create
ES5 has OO build in
 
oh
well.. might be a solution but i'm not sure the support for ES5 is broad enough yet
 
Well depends
do you need to support legacy browsers
Just use the es5-shim for legacy browsers
All modern browsers support es5 apart from opera
 
i'll ask but it's for a public app so it might be used by people using opera I guess
or other older browsers
 
Ugh jsfiddle is going so slow today :?
 
but thanks Raynos ES5 + es5-shim looks promising
i'll try this out
 
2:03 PM
@Shtong Object.defineProperty has parts that cannot be emulated in IE8 and less.
Read the README. It's safe to use if you dont use those parts of object.defineproperty
namely get/set/enumerable/configurable/writeable
 
well if it's can be emulated I guess it's the same with Prototype, so it shouldn't be used in that lib I have to work on
it's pretty simple anyway, I didn't see anything else than Object.create and Object.extend yet
 
Object.extend doesnt exist
Your probably looking for this pattern
Object.keys(defaults).forEach(function(key) {
  if (config && config[key]) defaults[key] = config[key];
});
 
2:30 PM
will ES5's Object.create use the same initialization system than Prototype's ?
call the initialize method with the parent constructor as a parameter & stuff ?
i'm starting to think I'm gonna have to completely rewrite this stuff. Classic OOP with javascript should be forbidden by international laws :/
 
Hi guys
Did this ever happened to you that a .js file is ignored ?
 
not generally
 
A simple alert(); in the .js file can't be fired.... I dunno what's going on lol
 
@Shtong wut?
 
usually if thats the case the path is off, or theres an error
 
2:44 PM
object.create is object.create
It creates a new object
its prototypical oo
 
woah @Raynos new avatar eh
 
Guys... I've answered two questions today. That's like, two more than any normal day.
 
I call it with <script type="text/javascript" href="js/script.js"></script> and the path is correct, but it's just ignored
 
@Warface Is there a script error that makes the whole script not run? Does it validate in a lint test?
 
Firebug don't tell me nothing, no error, nothing at all
 
2:45 PM
@Shtong yes your going to have to rewrite it
which idiot decided you should change from prototype to jquery?
 
lol nice @RyanKinal Ive answered a few but am not getting many accepts
 
@Warface Does it pass lint?
 
@Loktar I have yet to get rep from either of them, lol
 
@Raynos The story is, the library we need to reuse was written with prototype, and I have to integrate it with a website already using jquery extensively
and I thought using both jquery and prototype would be overkill
 
lint ? it's a simple alert('testing');
 
2:47 PM
@Shtong Good thought
 
It can't have syntax error
 
idk I think its a path issue still, or possible file mispelling.
 
I would have to agree with @Loktar
@Warface Out of curiosity, what browser are you using?
 
No it's not, the file path it's correct
Chrome
Even on firefox and Safari, nada
 
@Warface View Source -> click on js/script.js, see where it takes you
 
2:49 PM
It takes me to the script content... please stop telling me the path it's not good because it is !!
 
@Warface Dude, you have all the symptoms of a bad path. We're just trying to diagnose.
 
Yeah I know but it's not, even with the full localhost path nothing
 
yeah not trying to be mean.. just trying to help. Its usually so simple to over look things like that.
 
@Warface Do you see your script in the network tab of the debugger ?
 
Which debugger ?
 
2:51 PM
f12 webkit debugger
 
firebug or chrome script debugger
 
@Warface In Chrome's dev tools, click on the "Scripts" tab, and see if your script is in the list of scripts.
 
yeah the F12 one :)
 
OMG.
I just figured it out
 
was it the path @RyanKinal? :P
 
2:52 PM
only the .php file is loaded...
 
You have <script type="text/javascript" href="js/script.js"></script>
 
ha
 
Yes Ryan
 
nice
 
It should be <script type="text/javascript" src="js/script.js"></script>
 
2:52 PM
it's src -_-
 
lol haha
see easy to overlook!
even we did initially
 
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF**************** How could I done that !
Thanks guys
 
@Shtong why do you want to "reuse some prototype library"
Find one compatible with jquery or write your own
 
But my editor is supposed to complete tag, how come href was in it....
 
porting prototype code to jquery is shooting yourself in the foot
 
2:54 PM
good catch @RyanKinal
 
well
Thanks
 
@Warface No problem
 
0
Q: wp_enqueue_script & constants?

WordpressorI'm enqueuing a script: wp_enqueue_script('my-script', MY_SCRIPTS."/my-script.js"); How to get MY_SCRIPTS const working in this context? I know this works: $template_dir = get_bloginfo('template_directory'); wp_enqueue_script('my-script',"$template_dir/my-scripts/my-script.js"); But I don...

 
yeah, I think i'll rewrite it
 
dont do it
 
2:55 PM
there should be some mini chat rep. You would of got like 5 votes if you caught that fast enough if it were a real SO question.
 
I searched for a jquery equivalent (a lot) but there isn't any
 
Aug 9 at 16:49, by Ryan Kinal
Or maybe bragging rights.
 
@Shtong what do you need
 
an xdot interpreter
parsing some text files generated by another program, and rendering directed graphs on a canvas as a result
 

« first day (318 days earlier)      last day (4627 days later) »