« first day (257 days earlier)      last day (4693 days later) » 

2:05 AM
0
Q: Infobox on click required

user29660I've searched for 3 hours now and cant find a solution. All im after is when you click on an input field in a form, an infobox at the side reveals itself. I tried messing about with jquery and just couldnt get it to work even though im sure the code is correct (arent we always lol). Anyway id ap...

 
 
2 hours later…
4:22 AM
0
Q: Scrolling Box2D DebugDraw

onedayitwillmakeI'm developing a game using Box2D (javascript implementation - Box2DWeb), and I would like to know how I can pan the debug draw. I know the usual answer is - don't use debug draw, it's just for debugging. I'm not, however not all my objects are on the same screen, and i'd like to see where they a...

RT @sgalineau: #IE10 Platform Preview 2 http://t.co/3LCSfjQ. Positioned floats, HTML5 drag and drop, FileReader, HTML5 Forms, Web Worker ...
CSS Floats and Positioning (editor’s draft) http://t.co/G61mlVl "have text and other inline content wrap around specified elements"
 
4:43 AM
RT @paul_irish: @kangax Also requestanimationframe, page visibility api, and the new setImmediate(): http://t.co/SyT9ERy #ie10
RT @johnallsopp: "What CouchDB can do for HTML5, web apps and mobile The utility of CouchApps and how CouchDB could shape..." http://tum ...
RT @HTML5Grind: Mighty Engine is HTML5-based game engine for real-time MMOs - PC, iPhone, Android, etc. Video: http://bit.ly/mkrTDM (via ...
 
Sam
4:54 AM
hi All
@Ryan
 
 
3 hours later…
7:56 AM
RT @slicknet: Catch @schill's epic #f2esummit11 talk about HTML5 Audio: http://t.co/gL6yGMe
 
8:13 AM
Seen in w3fools :
document.write() is always the wrong answer, except in one case, which this is not.
In which case(s) document.write() should be used ?
 
morning all
 
9:04 AM
Whats that IE10 ?
Web workers you say.
Oh IE, it's great that you catch up. NOW WHERE ARE MY WEB SOCKETS >:(
@kbok I think thats a joke. Its always the wrong answer
 
@Raynos Ok.
 
@Raynos , IE is just working on the things that are more common
according to sputnik.googlelabs.com/run , IE9 has better EcmaScript3 support then Opera and far superior to Firefox's implementation
 
9:24 AM
@teresko really?
 
IIRC , latest Opera had 78 mistakes , IE9 - 70 , and firefox - 172
 
But FF has superior HTML5 compliance
 
and chrome i have is in VM , so i dont want to run it
@Raynos true , but in world wild web it is pretty hard to use HTML5 to the full extent
( sorry for triple-highlight )
 
0
Q: W3TotalCache and Javascript -- what should go where, when?

aendrewI'm just starting to use W3TotalCache and am a little perplexed by how I should load the gobs of javascript and CSS rendering on the site in the question. Adding some of the pre-minified jQuery scripts via the Minified wizard in W3TotalCache breaks them when loading on the site; same with CSS. W...

 
Chrome 12 failed 136
Use html shims and graceful degradation :)
 
9:54 AM
0
Q: why closure is important for javascript?

TomCapsC#'s lambda expression also has the feature of closure but is rarely discussed by the c# communities or books. I see far more javascript people and books talk about its closure feature than it does in the C# world.Why is that?

 
10:33 AM
That guy ^ tells me I dont know how JavaScript works :)
 
@Raynos lol
speech technique : NO YOU DON'T KNOW
 
i had the similar experience yesterday
 
 
someone said to me that wrapping your code in (function(){ })(); is "cruft"
 
@teresko what does cruft mean ?
 
10:42 AM
...
 
@teresko That's a bit like saying using var to declare variables is cruft
 
@teresko that depends though
doing it in node.js is cruft
I used to do that in node before i understood node had global and module scope.
 
@Raynos > That guy ^ tells me I dont know how JavaScript works :) <= actually, as you sugested him, that guy is here. Ready to learn that PHP and D are functionnal language as thay have first class functions.
 
@de
 
@deadalnix :)
Well I'm going to start of with D is far too procedural / imperative to treat as a functional langauge. I would advice against it.
It also completely depends on your definition of functional language.
 
10:54 AM
I do agree.
 
RT @Paul_Kinlan: A new low-level DOM mutation notification API http://6sen.se/kNkBEf
 
Anything which allows you to write code in the functional paradigm is a functional language, there are grey areas though
 
And I do agree that javascript as functionnal languages capabilities.
 
js is not a pure functional language
like LISP and haskell.
 
OK, so javascript is definitively in the greay area
 
10:55 AM
They enforce functional paradigm rather then allow it.
I think js is significantly less grey then PHP and D.
 
thoses examples are taken on purpose : you can hardly define them as functionnal
 
The reason I say javascript is functional is because I believe javascript is more suited to the functional paradigm then the imperative paradigm
 
the goal was to make obvious the fact that having first class function doesn't make a language a functionnal language
 
That's all. I feel functional style javascript is more natural to the langauge then imperative style javascript
 
Actually, I use it a lot
^^
 
10:57 AM
first class functions do allow functional paradigm code in a language.
I can write functional code in D. It's a dirty hack and feels really unnatural
but it's possible
What I should have said was that "The functional paradigm is more suited to javascript then the imperative" but I said javascript is a functional language instead, poor choice of words
 
I wouldn't have anything to answer if you would have said that ;)
the fact is, as javascript allow eval, that javascript can be any paradigm
For exemple, I did a lib that allow full support of POO in javascript
by amssively generating code for missing functionnalities
but just like lisp
 
What's POO ?
 
OOP sorry :D
 
Well there are limitations with js.
You can't do meta things like you can in LISP
 
POO is a local acronym in my language
 
11:02 AM
you can't extend the core keywords and syntax
 
yes true, the possibilities are more limiteds
 
and arguments along the likes of "I can write a compiler in js to support any paradigm I want" are very silly.
 
but still enough for OOP :D
naaaaaa
 
JS already has OOP
 
I don't write a compiler
 
11:02 AM
prototypical OOP.
 
certainly not OOP !
 
Ok, interpreter. Word chocing
 
prototype is different than OOP
 
prototypical OOP is different from classical OOP
 
ok, have to eat
 
11:03 AM
OOP is OOP. You have objects and relations then you have OOP
 
back soon, but it's interesting ;)
 
@deadalnix Are you french ?
 
yes :D
 
I often hear that Java is POO :D
 
programmation orientée objet
 
11:04 AM
je sais ;)
 
I have the problem of being too theoritical academic.
And down voting pragmatic answers for pedantic academic reasons :P
 
RT @stshank: Font fans on who care about browsers: Mozilla wants your help testing font rendering on Windows 7: http://bit.ly/l2vXkF #ty ...
 
11:32 AM
@deadalnix of course you also need to define JavaScript. I mean EcmaScript5
I would have more difficulty pushing forward that EcmaScript3 is a functional language
Not to mention that no-one actually answered the question
Why are closures (not first class functions, not anonymous functions) more commonly used in js then C#
I can see @ammoQ answer of "To emulate classical OO"
 
11:53 AM
Yes, that's a possibility, but not the one
I think because closure are an easy, effiscient way, to declare data that are shared across a set of piece of code without messing up the global scope
and Actually, I would disagree with OOP support in javascript : even if some functionnalities exists, you don't have polymorphism and inhéritance in javascript
 
0
Q: (Open Source) Examples of JavaScript Prototypical OO

RaynosReference Related Question: Prototypical OO in JavaScript In the above question I mainly focused on Can write prototypical OO like this? Do we need constructors and initialization logic, What are the alternatives? New question: Basically are there any good examples of javascript pr...

@deadalnix ... var Child = Object.create(Parent) Tada! Inheritance
Polymorphism follows trivially from duck typing
@deadalnix functions are an efficient way to declare data shared across a set of code without messing with global scope.
It has absolutely nothing to do with closures
 
in javascript, it has
in C#, you would use object for that purpose
 
12:14 PM
Your misunderstanding what a closure is compared to what a first class function is.
That or your phrasing your argument wrong ;)
The outer wrapper is not a closure
Inner wrappers (like in event handlers) are however closures.
 
na, but every function within is a closure
 
Only if it references variables up the scope chain
And saying otherwise is an interpreter specific detail ;)
You know if you chain your answer to focus on inner functions being closures I can remove the downvote
 
yes, this is why I'm talking about sharing pieces of data across pieces of code without messing up with the global scope
this is the most common use of closure in javascript in the real world
most pogrammers don't even know that functionnal programming exists
sad, but true
 
I agree, just don't think your answer portrays that point properly ;)
 
12:38 PM
@deadalnix most programmers are so ill-educated that they should keep the distance from computers
there is nothing more harmful then a developer with little knowledge
 
12:49 PM
I know, I was stating a fact, not a judgement. And yes, most programmers should quit right now.
 
@deadalnix Then there would be a huge shortage for programmers
 
posted on June 30, 2011

This week’s. Huge news: HP is in talks to license webOS. Samsung is reportedly interested. Samsung is looking for a replacement for Android. Google should be very worried about this. Very useful post: why WebKit does not equal WebKit. I’ve proved beyond doubt that there is no WebKit on mobile, but why is that the case? This article provides insight. Interesting data on mobile

 
I think there really is a need for mediocre, low-paid programmers
 
Usually, I'm spending more time managing thses programmer than doing the work by myself
So I would say no
eventually, it probably depends on the job you are doing
I guess It could be usefull for little and simple projects
 
1:07 PM
Hi, I'd like to know how much the salary of a JavaScript developer with middle proficiency is?
 
@deadalnix You also encounter bad programmer in very large projects
 
@deadalnix so so sad but true.
 
If they are correctly framed, with quality process and so on, the software end up working
Isn't that what SSII is all about ?
 
@deadalnix that's why Java, C# and "Design Patterns" exist
That's why Drupal, Wordpress and full-stack PHP frameworks exist.
@SaeedNeamati depends on location
depends on your definition of middle profiency
 
@Saeed > it depends on so much stuff that it's hard to answer
maybe you could start telling us in which contry you are ?
 
1:12 PM
I don't deem myself to be middle profiency yet, but I'd expect 80$k for middle proficiency. No offence but I doubt your more skilled then me ;)
 
@Raynos : aven with java, C# or full stack framework, so programmer still success in messing up everything
Anyway, I did made an edit on the answer given about closures in JS based on what we discussed here
 
hi all gm
 
1:54 PM
@Neal gm = good morning ?
 
@kbok yes
:-)
 
lol
it's 4pm where I am ^^
 
hey folks !
 
gm @Neal
only 9 am here
 
    $.ajax({ url : 'page.php', type : 'POST',
                 success : function (data) { $("#container").html(data) }
               });

page.php :

    ...
    echo( fgets($file) );
there are space before the data in my #container
someone have any idea ?
 
2:11 PM
@Loktar its 10am here
well 10:11am
@kbok where r u? lol
 
@Neal france.
 
@kbok rly? that seems like its too many hrs ahead
i know england is+5 from here and israel is +7
so i guess it makes sense
france is in between
nm
ok cool
 
hey @kbok peut-être pourrais-tu m'aider avec mon problème ? :)
 
ugh, i hate the new google layout...
@Oddantfr what is it?
 
@Oddantfr vérifie que ton browser ne trimme pas la sortie de page.php
 
2:18 PM
c'est quoi?
 
essaie de sortir data sur la console aussi, ça peut aider
 
@kbok I did but I resolve this trouble trimming the output data, this is not really neat but it works for now
:(
 
Do you trim it in the JS or in the PHP side ?
 
js
i try to trim on php side but nothing happens
it's an ajax problem
 
weird
 
2:21 PM
yes
 
although I never use plaintext with ajax
I usually prefer a simple json struct
because it's way simpler when you want to add metadata (last changed, lang, etc)
 
@kbok yes good point, I'll read how to do that with json syntax thanks
 
@Oddantfr No problem :) happy js
 
@kbok anyway where do you live in France ?
:)
 
5
Q: (Open Source) Examples of JavaScript Prototypical OO

RaynosReference Related Question: Prototypical OO in JavaScript In the above question I mainly focused on Can write prototypical OO like this? Do we need constructors and initialization logic, What are the alternatives? New question: Basically are there any good examples of javascript pr...

I find it hard to express what I actually want to ask. Does anyone have any suggestions for question improvement?
 
2:27 PM
@Oddantfr Rennes
@Raynos This is a very good question
BTW I think there is a typo : Can write prototypical OO like this?
 
@Raynos yeah good q.
 
@kbok ok nice to meet a Rennais, never went there but hardly plan to, nice city !
 
@Oddantfr Indeed. :) Where are you from ?
 
@kbok La Rochelle, I move there for my studies i was living in Lille actually
 
ahhh html5 localStorage is rly cool
apparently you cant store objects?
 
2:33 PM
@Neal ... JSON use -.-
 
@Raynos hmmmm one sec
@Raynos it stores it as a string
look at the localStorage for this page
 
Yes it does store it as a string
so use JSON
@ThomasShields @kbok I still think I'm not communication the actual thing I want
 
@Raynos but it would be stored as a string..
 
which is a large example of "pure" prototyping OO
@Neal JSON IS A FUCKING STRING.
 
@Raynos no its not
no idea where u got that idea
 
2:35 PM
@Neal get out.
Do you seriously not know the difference between json and object literals?
 
json.org -- nowhere does it say json is a string
 
lol
 
...
json is a data format
The way you represent that data is a stream of bytes
 
9
Q: What is the difference between JSON and Object Literal Notation?

pencilCakeCan someone tell me what is the main difference between a Javascript object defined by using "Object Literal Notation" and JSON object? According to a Javascript book it says this is an object defined by using Object Notation: var newObject = { prop1 : true, showMessage : function (msg)...

 
2:37 PM
the most common representation is a string
 
@Raynos Regarding your question, it's actually quite clear but you should put more emphasis on the two criterias. People do not seem to read them.
 
Seriously man, this is basic stuff I expect you to know :\
 
i see that. but read down to the end..
 
@Raynos whoa calm down. I think you two have a different definition of what a string is.
 
@kbok i think so too
@Raynos read the answer: stackoverflow.com/questions/2904131/… json can have string in it
it is not a string..
 
2:40 PM
@Neal JSON is actually a string before it is given an object literal semantic
 
@kbok that may be. but when u actually use it, it is not
 
@Neal It's converted, but still anything which lets you store strings allows you to store JSON ie KVP or cookies
And as I get it, html5 storage as well
 
@kbok ook. thats a better explanation then "@Neal JSON IS A FUCKING STRING."...
thank you
 
@Neal You're welcome :)
 
@Neal Sorry, I got a bit annoyed.
 
2:43 PM
@Raynos not sure why. but ok
 
JSON is the serialized string you get when you serialize an object
So you store objects in localstorage by running them through JSON.stringify
 
ok
 
and you run them through JSON.parse on the way out.
@Neal I get annoyed because I expect you to be good ;)
 
@Raynos haha i have my points of brain freezingness
 
http://dev.icalapp.rogersdigitalmedia.com.rogers-test.com/menutest.htm

How can I perfectly horizontally and vertically align the body box with the menu on all browsers?
 
2:51 PM
@ErrorErrorError holy cow did you find a template? or did you do that yourself?
or just a nice background picture
 
i did it myself :)
 
cuz that actually looks halfway decent.
 
yeah woot :P
 
okay KEEP IT. that's your best yet.
and emulate that style.
 
i redesigned it after reading all those videos u toldm e to watch on design principle
 
2:53 PM
awesome!
 
i have a problem though lol, the bottom border and the border of the middle picture are different for different browser, do you know how i can align them properly so they stay consistant for all browsers?
 
which browser shows it like you like, and which browsers show it wrong?
 
google chrome shows it the way i like it except that box needs to be shifted over a lil to the right to align with the menu
 
btw, maybe if you started your blur at 0 0 .2em #cacaca and then when you hover change it to 0 0 .15em #cacaca ...
okay one sec
 
i used filters and CSS3 :D
 
2:56 PM
yeah good job!
 
for the menu and background i made up lol
 
RT @annevk: Permissions For Web Applications by @rocallahan: http://t.co/zJXCUxX #webplatform
 
okay the box looks right for me...
you mean the main content?
 
it looks right...
 
2:57 PM
that big grey box with borders should align with emnu
 
align horizontally? vertically? and where should it align to? the top? the side? the bottom?
 
see how that grey box is too much to the left.... it should be a bit more to the right
unless u think that looks right lol
 
what version of chrome are you using..
because it's right for me
 
i guess ill just leave it like that it looks fine
even if its al ittle too much to the left it can be considered stylish :P
 
out of curiousity though, which version of Chrome do you have?
 
3:03 PM
im trying to find out lol
 
@ThomasShields doesnt look right in chrome for me either
 
dont know how to find my version of chrome
 
i have 12.0.742
 
@ErrorErrorError Wrench --> About Google Chrome
 
@ErrorErrorError wrench > about google chrome
 
3:04 PM
in fire fox it kind of looks good
 
@Neal interesting...
 
except in firefox the grey image is too close to menu's bottom border
 
I'm thinking you shouldn't be doing an absolutely positioned image to accomplish this.
 
hmm what do you suggest?
 
a centered div
one moment
 
3:08 PM
In case people don't know coder.io is probably one of the best technology based news feeds
 
@ErrorErrorError I didn't copy everything over but here's with using a div. jsbin.com/uweyir/edit#preview
pretty much just replaced that image with:
`<div id="main"></div>`
 #main {
    margin:50px auto;
    width:1000px;
    background-color:#999;
    height:1200px;
    border:5px solid #292421
    }
 
w00t jQuery 1.6.1 is finally on jsfiddle
 
thats looks much better thanks a million, im also experimenting with double border
OO looks sexy lol
 
OO?
Object Oriented programming?
 
3:21 PM
RT @mathias: Mothereffing CSS escapes: http://mothereffingcssescapes.com/
RT @divya: Does this need to be said even more often? Perils of UA sniffing, IE edition http://t.co/9pSkUQB
 
oh okay
yeah the double border looks awful.
 
i always have 20-30 tabs open at all times for chrome or fire fox
 
that pic you just showed me only had 19
:P
I just closed out half of my 20
:)
 
yeah ive got 5 in firefox :P
19 in chrome 5 in fox
 
3:53 PM
How can I define a thread in my page so every 5 secondes (for example) a function is triggered ?
 
setInterval(function(), timeout)
 
or
setInterval(code, timeout)
 
user1385191
proof positive why "oh, but Google does it!" is a poor excuse
 
thanks @Thomas what about its crossing-browser ?
can I use it without make sure the browser support it ?
 
3:56 PM
@Oddantfr fully compat as far as i'm aware. It's setTimeout() that has issues.
 
ok
@Thomas helpful !
 
hey guys: I have a list of list-items each of which has an attribute named "completed" which varies between 0 and 1. I need to get the 'id' of the first-child with completed=0. This does not work:
$("li.foo[completed='0']:first-child").attr('id')
nor does this:
$("li.foo[completed='0']").first().attr('id')
any suggestions?
 
thanks
 
RT @shepazu: For my geekier folks, here's a proposal to meld Canvas and SVG to improve both (& accessibility) http://schepers.cc/canvasvg
 
4:13 PM
nvm
 
@ErrorErrorError looks good, one second
@ErrorErrorError one more video; this time about Typography. Watch this and then redesign your fonts: channel9.msdn.com/Events/MIX/MIX11/EXT02
and for the love of pete don't use an image for the words "Alerts that work"
 
user1385191
guys, would you mind taking the site discussion here? chat.stackoverflow.com/rooms/575/web-developers-lounge
 
@MattMcDonald ah good idea, thanks.
 
Your link to the msdn browser sniffing article is amusing @Matt.
 
user1385191
it goes both ways because Microsoft's been guilty of it too
 
lol
 
user1385191
4:57 PM
> We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.
 
user1385191
(in regards to $.browser)
 
yeah
$.browser is a little heavy handed these days
but IE can't really complain too much seeing as it took them so long to get their shit together
 

« first day (257 days earlier)      last day (4693 days later) »