« first day (85 days earlier)      last day (4856 days later) » 
02:00 - 18:0018:00 - 00:00

2:11 AM
Word
 
Sentences
Or maybe you're looking for Powerpoint instead?
 
Period
 
lol
Visio
That little joke project of ours seems to have grown well...
 
2:45 AM
I say we do it every friday. Code-Blowing-Friday...
 
@ircmaxell Man, that blows
 
?
Dam edit window
Code-Bowling-Friday
 
Screw Follow Friday then :P
 
Exactly!
20 views from a notable question badge, 10 +1's from a Good Question badge, I think I should have gotten the booster badge already, but we'll see... Not bad for 1 silly question
 
 
10 hours later…
12:58 PM
@YiJiang Added settimeout to the garden and fixed the HTML formatting, and thx for the copy editing :)
 
@IvoWetzel My pleasure
 
@IvoWetzel Bug: The hasownproperty code block menu entry doesn't have underline when hovered
Actually, the same with all code blocks in the menu
 
I'm stating to hate CSS... again
 
@IvoWetzel Meh, just give those code blocks a transparent background for menu items, or give them underline when hovered
#navbox code { background: none; }
 
1:06 PM
@YiJiang Ah yes, forgot to remove the background color..
 
Oh, and suggestion: use an unordered list for the navigation menu
 
The CSS really needs a cleanup at some point
@YiJiang Good idea :)
 
@IvoWetzel It's fine, though a bit more whitespace might help
Also, have you considered using a fixed width instead of the flexible one it is using currently?
 
@YiJiang Well I didn't think much about HTML.... 95% of the time I seem my lovely mardown
 
For the 'Clearing all timeouts' section, maybe suggest the use of a global array to keep track of timeout ids?
 
1:09 PM
We should get someone to handle the CSS part
@YiJiang Uh... global array... I think that's a bad idea
 
True... just some sort of structure to keep hold of the ids
Really, the programmer should have a good idea of what to do with the id himself
 
My opinion is to make sure that you don't loose the timeouts in the first place
Otherwise it's like punching into memory just because you lost your C pointers..
 
1:46 PM
I think I'll give it a go, yeah
 
btw: I just changed the built script to that it generates the #hash linking
it now no longer uses the titles of the sections
instead it uses stuff defined in nav.md
(that file could probably use haml, and we could switch to Node.js for generating the html...)
 
How long does it take for the changes to take effect?
@IvoWetzel I'd rather keep it simple
 
The repo is updated
But I need to push to gh-pages
@YiJiang I'd rather keep it maintainable :D
Yay more people trying to emulate sleep in JS...
0
A: html5 canvas draw

Ivo WetzelYou have to use setTimeout instead of your loop. // JavaScript is single thread, and this BLOCKS the re-rendering and display of the canvas do { curDate = new Date(); } while (curDate - date < 550); Also I'd rather use context.clearRect (See MDC) instead of the resizing, there's no perf...

Wonder who's going to argue against setTimeout this time :D
 
2:13 PM
gosh...
using the canvas
but not even knowing loops >_>
0
A: javascript: how to loop a drawLine so it repeats its self 10 times

Ivo WetzelAs you already stated, you have to use a looping construct. The Mozilla Developer Network has good documentation on these. But honestly, I think you should rather read their JavaScript Guide before trying to write a Game, otherwise you'll end up bumping into a ton of dead ends and you will soon...

and now up vote me for the last sentence :P
:kitten quote
 
> "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan
 
@IvoWetzel Is he trying to join the game competition Mozilla is holding? :P
 
2:30 PM
@CodingKitten that was a time when debugging was printf() based
 
@AugustoRadtke Anyone have experience with a droid now)
 
@AugustoRadtke Often it's still faster to throw in a print, especially if you just get a wrong value
Of course if there's a crazy bug... use the debugger, everything else is insane
 
visual studio debugger and firebug took me to the dark side
everytime a breakpoint is hit a kitten dies
 
@CodingKitten Did you hear that?!?!
 
@IvoWetzel Another one of course there are YOU IMPLYING!!! I KNOW WHERE YOU LIVE!!!!!!
 
2:32 PM
:kitten java
 
Everytime you say Java, I kill a carpet. Twice.
 
@AugustoRadtke See, it's coming for you...
 
@CodingKitten D:
 
@YiJiang literally, something that will not process each byte, but still it does string is different??
 
I can't find the source for that 'I KNOW WHERE YOU LIVE' comment. Oh god, kitten is becoming sentient...
 
2:35 PM
0
A: about on C language.

Mark ByersHashing: A hash function is any well-defined procedure or mathematical function that converts a large, possibly variable-sized amount of data into a small datum, usually a single integer that may serve as an index to an array (cf. associative array). The values returned by a hash function are...

 
@CodingKitten Have mercy on us. I for one, have never killed a kitten before.
 
horray, I started another comment discussion...
 
@YiJiang Normally it should do that == would not be most efficient... but it is
 
@CodingKitten == is not the most efficient comparison operator.
 
@YiJiang I don't care about the actaul question?
 
2:37 PM
@IvoWetzel amazing, there is 5813 questions tagged "homework"
 
Man, you won't believe how many people misspell 'actual'
 
@AugustoRadtke But there are differences
They range from "what is X?" over "gimme the codez" to "I have try such and such, what am I doing wrong?"
the first 2... close them, the last one, yes I'll happily point someone in the right direction
but SO isn't google
 
@IvoWetzel Indeed, there is good ones like this stackoverflow.com/questions/563198/…
This is a pretty interesting topology problem
 
Hm, don't know, he could have at least shown that he did try something :/
In the end, it's all about opinions
Of course you can help anyone who asks
But I rather point them on a way where they learn how they can help themselfs
But maybe that's just my attitude, since I had to teach everything myself
!!!!!
RAGE
0
Q: javascript: how to loop a drawLine so it repeats its self 10 times

Beth MI am currently trying to create a sudoku grid in javascript, to do this i need to set up a loop so one line re-appears 10 times with a gap of 20 pixels between each one. so far i have: var canvas; canvas = openGraphics(); var x; var y; var gap; x = 20; y = 20; gap = 25; canvas.drawLine(20, 20,...

Now this is really -1 for linking w3schools
> (Not really sure what the problem with the w3schools website is)
 
@IvoWetzel Can we create a list of 'What's wrong with w3schools' and pin it somewhere so that we can point to it whenever someone says that?
 
2:47 PM
That would be a splendid idea
We need to hack google and purge everything besides MDC from the index
@CodingKitten Go hack away!
 
@IvoWetzel Im assuming he wants to a string, or vice versa.
 
@CodingKitten Yes, it should be a string, though a boolean 'Should I use W3Schools' is also good
 
@YiJiang oh god commit has to wait a day or 5 from 5 different users
 
@YiJiang The answer is neither true or false, it's "MDC"
I hate it when people use setInterval...
yay
another one to close
 
@IvoWetzel There is any way to get node.js to work on a regular browser?
 
3:04 PM
@AugustoRadtke Uh, how would you do that? It's a standalone application
With tons and tons of C++ code
Most of it is even *NIX speicific
 
Anyway, about that list... where should we write it on?
 
@IvoWetzel So the client side of chat.nodejs.org isnt running on node
 
Good question, hm
@AugustoRadtke Uh no, that's just plain Browser JS
 
@IvoWetzel seeing that right now
good old setTimeout
 
> JavaScript statements can be grouped together in blocks. Blocks start with a left curly bracket {, and ends with a right curly bracket }. The purpose of a block is to make the sequence of statements execute together.
^ WTF!?
 
3:12 PM
@YiJiang w3schools?
 
@AugustoRadtke Yes
 
global aaahhhhhhhhhhhh
 
^ NO THEY ARE NOT THE SAME!!!
 
That reminds me, I need to write about global scope and globals
 
> Example: Use the for...in statement to loop through an array:
Wow... they make it sound so easy: w3schools.com/js/js_events.asp
Sigh... why did they ever...
God... the JavaScript tutorial is ridiculously simplified.
 
3:27 PM
;_;
What?
0
Q: how to stop perl or javascript from showing default image and only text for link?

tokyowpThe perl or javascript below has a default image, but I would like display text "only text url" for this link instead of this button at this link http://developer.mixi.co.jp/wp-content/uploads/2010/09/bt_check_1.gif that this script defaults to. Is this possible? div a href="http://mixi.jp/s...

@YiJiang Added a link to MDC Guide to the garden
 
Hmmmm... Etherpad doesn't have code blocks. This is unacceptable. Are there any alternatives?
 
@YiJiang Hm
Well don't ask me... anything that's not VIM....
 
I'm looking for something that does online collaborative writing as good as Etherpad does
@IvoWetzel Hehe... the script he's linking to does protocol sniffing, which is really unnecessary - using // will give you protocol independent URLs
 
4:14 PM
:kitten quote
 
> "A Netscape engineer who shan't be named once passed a pointer to JavaScript, stored it as a string and later passed it back to C, killing 30." - Blake Ross
3
 
Hi!
if (Horse instanceof Gift) {
  allowLookAtTeeth = false;
}
 
@Nyuszika7H Hi there
 
> onMouseLeave and onMouseEnter events are present in IE but not in other browsers
That isn't true. I'm using Chrome and both of them work fine.
 
@Nyuszika7H It's not consistent. I believe Firefox doesn't support it.
 
4:22 PM
@Nyuszika7H Source?
 
Anyway, if you're talking about that events table at quirksmode, that's not regularly updated
 
@IvoWetzel Experts Exchange (not Expert Sex Change! :P)
 
AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
He said the EE word
!!!!!!!
Red Alert
Prepare for chat lockdown
 
No, that isn't an image of an Ajax loader. DummyImage.com is slow. (okay now)
 
@IvoWetzel hovers finger over offensive flag
But yes, ppk also said so here: quirksmode.org/dom/events/index.html#t28
 
4:24 PM
@YiJiang Click it fast! That's our only chance
 
OMG
> I do not understand the real purpose of these events. However, when the user calls up a context menu that contains cut, copy and paste actions, beforecut, beforecopy and beforepaste all fire. (Source: quirksmode.org/dom/events/index.html#t28)
 
Did anybody call the Thought Police?
 
:kitten quote
 
> "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
 
@badp Yup. (Points)
 
4:29 PM
Done; an intubation associate will take care of the rest.
 
jQuery.fn.smartGet = function(index) {
  if (index) {
    return $(this).get(index);
  } else {
    var nList = $(this).get();
    if (nList.length === 1) {
      return $(this).get(0);
    } else {
      return nList;
    }
  }
}
 
@Nyuszika7H What problem does that solve?
 
@lonesomeday If you use $('.obj').get() it returns a NodeList (so you will have to use a jQuery.each or a for loop) even if there is only one element.
 
@Nyuszika7H shrug Personally I'd prefer to know what type will be returned from a function. Every time you call that function, you'd then have to check to see if the return value was a NodeList or an element.
 
@Nyuszika7H And... so? The extra overhead of a for loop is definitely not as big as that for an additional function. Of course it can be easier to use if you're going to do this often, but still... why?
 
4:36 PM
:kitten quote
 
> "You can’t have great software without a great team, and most software teams behave like dysfunctional families." - Jim McCarthy
 
function () {
  return document.querySelectorAll.apply(document, arguments)
}
Why not just use this?
function (a) {
  return document.querySelectorAll(a);
}
 
Maybe you want to support older browsers?
 
@Nyuszika7H The apply version lets the native function handle what arguments are passed, rather than dealing with them yourself. Future proofing, perhaps?
 
@lonesomeday A bit unlikely, but then again the whole thing is a little weird, since why would you need a wrapper for a native function?
 
4:46 PM
var x = {},
    y = new Object();

x === y; // false
Huh?
 
...
Those are two different objects
 
And?
 
Why should the compare?
 
I don't understand why JSON.parse only accepts this syntax: '{"foo":"bar"}'. You can do the same thing in JS with {'foo':'bar'} or {foo:'bar'}, and you'll get the same result.
 
5:07 PM
Anyone there?
Is there any difference between i++ and ++i?
 
^ lol
 
best quest with respect to i-- still is i-->x "What does the --> operator do?"
 
Another thing against using the new constructor:
 
waiting...
 
5:18 PM
var i = 10,
    o = 10;
i === o; // true;

var i = Number(10),
    o = Number(10);
i === o; // true;

var i = new Number(10),
    o = new Number(10);
i === o; // false (!)
 
I can't think of any reason against it, unless you hate .prototype
 
Strange.
 
new Number returns an object
Number acts as some sort of strange casting
That's more a reason against Number
use + to cast to a number
@CodingKitten What does the scouter say about my rep level?
 
@IvoWetzel changed, commit has to wait till tomorrow since it's essentially a factory
 
Hmm. If I don't use the new constructor, everything is fine.
 
5:20 PM
Didn't I just post what happens?
@CodingKitten Wrong. It's over 9000
 
@IvoWetzel Wow, it 2nd try not bad at the form level but that doesnt seem to available
 
What?
new String("foo") // "[object Object]"
 
new Number() returns an object
 
Good morning|afternoon|evening|night
 
that objects happens to convert to a number when type coercion is in play
 
5:22 PM
@ircmaxell 'night. Off to bed :P
 
Have a good one :-D
 
@YiJiang Good night then
 
@IvoWetzel If I use ==, it still returns false.
 
> new Number('10') == 10
true
oh, you mean the two new Numbers
again, those are objects
Object ==(=) Object is always false
since this will check for the same instance
and not equality
 
== doesn't check for equality?
 
5:23 PM
Not in the case of Objects
it works like is in Python
 
I understand === would check for the same instance, but I wouldn't expect == to (after all, what's the difference then)
 
or a pointer compare
@ircmaxell Don't blame me, blame the stupid == rules
Objects + Number = compare as number
Object + String = compare as String
 
I just never realized that
 
@ircmaxell I completely agree with you.
 
Object + Object = compare for the same instance
 
5:25 PM
So, (new Number(10)) + 0 == (new Number(10)) would be true?
 
yes
> (new Number(10) + 0 == (new Number(10)))
true
I need to write all that into the garden >_>
 
And people say PHP's type mangling rules are stupid and arbitrary.
 
@ircmaxell You can read the EcmaScript spec...
well you can try, they have like 10 pages on all the conversion rules
 
lol
 
That's number one reason to only use ===
 
5:27 PM
And that's the source of the problem.
 
That's why Python3 has it right
 
it seems to me a result of design-by-committee...
 
strong typing
 
Oops, I've just overriden the JSON object.
 
@ircmaxell No, just they guys at netscape being forced to make it a "success"
 
5:27 PM
Yes, dynamic and strong typing are a good combination...
 
+MS copying the broken parts
and then they gave it to a standards commitee
rest is history
The worst part... knowing all that mess from the top of your head >_>
 
fair enough
 
Crockford gave a really nice talk at MIX '10 on the history of JavaScript
 
As I've said before, I don't use JS enough to really know it that well...
 
If you want to see more strangeness
As said, I need to add the casting / number stuff
and those 25+ pages only cover the quirks
 
they will most likely grow to something around 40
@YiJiang "Install Silverlight"
 
interesting
 
Oh there are also some really good ones at yahoo
 
@IvoWetzel Take it literally. Install Silverlight. :P
 
@IvoWetzel Yeah, but there's a downloadable version, and also his slides are available
 
And seriously, major web design conferences don't usually give out their videos for free
 
Huh? Crockford works at Yahoo? Another thing I learnt today.
 
That series is really great, he gives a lot of details of the origins of the web and programming languages too
It's really long but of great quality a must watch
 
Oh, I was thinking about this Code-Bowling-Friday thing. We should each take turns creating and posting the challenge. We could do something in the beginning either like a rotation (Where we take turns), or whomever of us gets the highest rated answer on the prior week's gets to do it...
 
Don't forget that one should have a good idea :P
What about... implement a working RSA...
 
5:34 PM
oh god
 
Can i do
$('.photoSaved').click(function () {
<?php $_SESSION['setme']=true; ?>
 
(read: there's no word about it being secure)
 
or would i need to make a ajax call
 
But I guess that's to security focussed
@Karem Read up on the different of client vs. server side, in other words you need an ajax call
 
i expected answer like that, thank you
 
5:36 PM
Or, what about: Write the most complicated * encryption* method you can that's also trivial to decrypt (the exact opposite of modern encryption)...
 
:D
That's a great one
I really like security by obscurity!!!111
@CodingKitten I can haz encypticons?
 
@IvoWetzel oh the comment chain it compares b to b god already did one that directly answers the info provided is not... Typical I didn't understand why was that answer accepted? It's SO I know, but still..
 
Yeah, like a 500 line method that takes like 2 seconds to run, but only winds up doing rot13
 
@ircmaxell Can I start writing now? :P
I'll do a complete framwork with passing (bugged unitests!)
Of course more low level languages will be way more fun on that one
 
<?php echo "MEOOOW!"; kill CodingKitten; $CodingKitten = ""; ?>
 
5:39 PM
It's there for someone else to post (and come up with the details)
so I don't care...
 
I'll think about the details on that one
 
Oh, I also created a code-bowling-friday tag... That way we can separate the weekly game from other random posts...
 
Hm guess I'll provide some bad "key" to encrypt the message with
 
I've got an idea... Time to get out the white-board and start sketching out how to do it...
 
can i have a ajax request to the same page i am on?
$('.photoSaved').click(function () {
var savedPhoto = $(this).attr('id');
$.ajax({
url: "status.php",
type: "POST",
data: { mode: 'use', name: savedPhoto },
success: function(){
$.fancybox.close();
$('#status_upContent').hide();
$("#image").append($(document.createElement("img")).attr({src: "images/users/status/"+savedPhoto})).show();
}
});
});

with:

if($_POST['mode'] && $_POST['mode'] == 'use'){
$_SESSION['status_attachedImage'] = $_POST['name'];
echo 'ok';
}

I can see it make the request, but it doesnt give me the response "ok"
and the success: doesnt execute
 
5:47 PM
@IvoWetzel: Check this out: fora.xkcd.com/…
 
god
we created a monster
 
@ircmaxell Oh man it made the xkcd fora!
 
hehehe
@YiJiang: It was me who posted to XKCD fora...
 
> Write an encyrption method that takes the input string
"I can haz encrypticons too! Theys are reallys stron g ya kno!" and the key
"e4c4fa05fbf6fe251ddec4fe81503bed" and encodes it.

Also provide an decoding function that decodes the "encrypted" version when
supplied with the key.

Of course, make it as obscure and **unsecure** as possible, want to add random
garbage to make the output 256mb in size? Great idea! Produce output that when
run with brainfuck interperter prints out the original message? Go ahead!
 
@ircmaxell Noticed, yes. But still...
 
5:54 PM
Dude! Great idea about the BF implementation!
 
haha
 
Man I'm glad I switched to VIM
 
@IvoWetzel What were you using before?
 
@YiJiang gedit
 
5:59 PM
Hey Ivo, this is Rafid. When did you switch to Vim? :-)
 
and back on windows Notepad++
 
02:00 - 18:0018:00 - 00:00

« first day (85 days earlier)      last day (4856 days later) »