« first day (895 days earlier)      last day (4045 days later) » 

7:04 PM
Benchmarks don’t lie, but liars do benchmarks.
 
@dystroy he didn't. You're using [], he uses Array(). The edit is definitely invalid, though.
 
Hey, does anyone know how to create a sublime text 2 snippet or plugin that will auto-input a bunch of specific elements such as the current file name, current date, etc?
0
Q: sublime text 2 keyboard shortcut or tab-complete to enter the current file name in the file

alisamiiI am trying to set up a snippet in Sublime Text 2 that will expand to the following: /** * @version $Id: ${1:current_file_name.extension} ${2:random_4_digit_number} ${3:YYYY-MM-DD} ${4:time_in_UTC_24} ${5:current_logged-in_user} $ * @author Company http://example.com * @copyright Copyright ...

 
no idea, sorry
 
Would be pretty useful for adding copyright headers to files, don't you agree
 
i dont know how sublime text 2 works but if you cannot find a way to write a plugin, you could write a tiny program that prints that to stdout
so you could execute that program from within sublime and put the stdout to your current cursor position
 
7:14 PM
quick jquery question: for what reason are these lines not working?
$('#console input[type="checkbox"]').on('change',function(){
console.log('test');
});
 
okay i gave up on sockets
 
@captainrad I'll guess: the inputs are added after you bind the event? If so, use event delegation
 
its do-able but i dont like the hacks involved... use a custom driver....
 
@captainrad " within "
oh wait.. its " within ' right?
 
@captainrad $(document).on('change', ..., function(){...})
@Jan-StefanJanetzky right; there's no bad nesting
 
hmm lets see
 
the best answer scares me
:-(
C++ is a superset of C ? wtf
 
@Darkyen kinda. its just an extension.
 
you cant call it a superset though
 
usualy c++ gets compiled to c, then to asm and then to machine code
 
7:18 PM
as-much-as i know about C / c++
 
@Darkyen lmfao
 
@Jan-StefanJanetzky not sure asm is a compilation step
 
@JanDvorak would not make sense. true.
 
AFAIK, C++ is compiled directly to machine code.
then linked later
 
you sure it internally is?
gosh i dont know. that scares me.
 
7:20 PM
@Darkyen since you can write completely valid C in C++ but not the opposite, C++ is literally a superset of C. Doesn't mean one is better than the other.
 
What would obj be, if not machine code with metadata?
 
@JanDvorak That is true, yes.
 
@FlorianMargaine it has nothing to do with being better
 
There is actually some C that is not valid C++. Mainly obscure syntax things.
 
@FlorianMargaine what?
5
Q: What prevents C++ from being a strict superset of C?

Mike Possible Duplicate: “C subset of C++” -> Where not ? examples ? I'm aware that C++ is not a strict superset of C. What language features prevent C++ from being a superset of C?

37
Q: "C subset of C++" -> Where not ? examples?

n00ki3I read in a lot of books the claim that "C is a subset of C++". Actually some (good?) books say: "C is a subset of C++ except the little Details". I am interested what these details are. I've never seen one.

 
7:20 PM
@FlorianMargaine learn C :D
 
C and C++ are identical
Except one has ++ in the end
 
(x
 
Also C and C#
Objective C is a superset of C though
 
@BenjaminGruenbaum hahaha
 
:P
 
7:22 PM
@BenjaminGruenbaum i can see what you did thar
 
@BenjaminGruenbaum yeap... both kill you when you wanna write code
 
There is only one good programming language, that language is jQuery.
 
@BenjaminGruenbaum troll
 
!!/choose node.js_for_pong_wars turboC_for_pong_wars visual_studio_for_pong_wars windows_8_for_pong_wars
 
@Darkyen windows_8_for_pong_wars
 
7:23 PM
jQuery is not a language
 
oh, c#... Cannot assign to 'dir' because it is a 'foreach iteration variable'
 
@alisamii you got trolled
 
@alisamii it was a troll
 
@alisamii THAT'S A LIE!
 
@alisamii Of course it is... jQuery is the best programming language
 
7:24 PM
@SOChatBot you dont love me do you ?
 
@Darkyen You know there's better choose syntax
 
@Zirak that's your fault, not C#'s
 
oh!
 
!!1 or 2 or 3 or 4 or 5 or 6
 
what i hate about c# is the way it threatens pointers
 
7:24 PM
!!node.js for pong wars or TurboC for pong wars or visual studio for pong wars or Windows 8 for pong wars
 
@JanDvorak 4
@Zirak visual studio for pong wars
 
now you need to do bullshit like (out int blah, ref int lol) to forward pointers..
so uggly.
 
@alisamii proof:
!!/best_programming_language
 
@BenjaminGruenbaum jQuery
 
@BenjaminGruenbaum But whyever should that be? It threatens my understanding of foreach! Now I have to use an extra variable
Actually...I can inline it.
 
7:26 PM
@Zirak What are you doing? It makes no sense to change a collection when iterating it. If you want to get a mutated copy use lambdas like map (Select), reduce (Aggregate), filter (Where) and such
 
I'm not changing a collection, I'm re-assigning to a variable
 
@Zirak code?
 
foreach (var dir in something) {
    dir = blarg(dir);
}
 
ohai @copy
 
foreach (var dir in something.Select(x=>blarg(x)) {
   //whatever
}
 
7:28 PM
HAI
 
@Zirak i know i will lose but still wanna write a pong :D
 
@Jan-StefanJanetzky hi
 
@Darkyen DEN WRYY R U STILL HERE?
 
@BenjaminGruenbaum Yeah there're workarounds, but I'm curious as to why it happens
 
@Zirak Are you iterating the collection itself, or a collection where every object is blarg applied to it?
 
7:29 PM
I don't quite understand that question
 
@Zirak Why are you changing the iterated variable?
 
@copy Just bought a compatible SD card for the Pi. Do you have one already?
 
Because it's in format A, and I want it in format B
 
@Jan-StefanJanetzky !!english
 
Put into more concrete term: It's an absolute path, and I want it as a relative path
 
7:31 PM
@Zirak So you want to iterate through the relative paths and not the absolute paths?
 
Correct
 
@Darkyen then why are you still here? if you want to create pong, DO IT (and host a livestream)
 
nah i am thinking big :P
who wants to write just a pong -_-
barely 100 lines
 
@Zirak Which means you are in fact not iterating something, but every element of something mapped to blarg. Even more compactly as:
 
i am thinking how to pimp it (XD)
 
7:31 PM
foreach (var dir in something.Select(blarg) {
   //whatever
}
 
@Darkyen Do it.
 
do it in 100 lines
 
in js :D
sure
 
@OctavianDamiean Ordered one
 
with correct spacing, intendation, linebreaks
 
7:32 PM
@Jan-StefanJanetzky js :P okay ?
 
and you are allowed to use { without a linebreak before
do it in what ever language you like the most
 
@BenjaminGruenbaum Yes, correct. However, my feeble brain told me what n < n^2. Unless there's voodoo in place and Select returns an enumerable.
ha, it is an Enumerable
 
@Zirak It's O(n) to begin with and O(n) = O(2n) , the compiler optimizes it to a single for (not for... in) loop anyway.
 
@Darkyen do it as 1k js file :D
 
Now just need to convert an absolute path to a relative one...
 
7:34 PM
@copy Which one did you get?
 
@Zirak C# has a MakeRelativeUri method built in iirc
 
Not URIs, file paths
 
@OctavianDamiean The one from the official website
 
Which can be URIs. I've tried fucking with the Path methods.
 
@Zirak aren't file paths URIs ?
 
7:36 PM
I miss nodejs' path
sniff sniff can you smell that? Smells like a porting is on the horizon.
 
73
Q: How to get relative path from absolute path

faultyThere's a part in my apps that display the file path loaded by the user through OpenFileDialog. It's taking up too much space to display the whole path, but I don't want to display only the filename as it might be ambiguous. So I would prefer to show the file path relative to the assembly/exe dir...

 
You ruin all the fun with your answers
 
@copy Just sent you an email.
 
@OctavianDamiean What does it say?
 
@BadgerGirl Dirty things. Too dirty to tell here. :D
Nah, just forwarded some support information from Edis regarding the RPi hosting.
Things he might want to know.
 
7:40 PM
Actually, it's not absolute=>relative I really need. Just the last dirname. That should prove easier.
 
@Jan-StefanJanetzky you know my css3d visualizer can be js1k
 
@Darkyen silence! i'm trying to write a 1k pong! same shall you do!
 
@Zirak System.IO.Directory ?
System.IO.Path.GetDirectoryName or something like that
 
That returns the same as dirname, everything but the file.
new DirectoryInfo(path).Name should do the trick
 
@OctavianDamiean you took my email address from my whois, altough there is one on my website?
But thanks :P
I will definitely pay for it anyway
 
7:48 PM
@copy because I'm a bauce h4x0r
:D
I can read whois output. I'm so 1337.
 
@OctavianDamiean You should have called him.
 
is toString(16) the shortest way to get a hex string from a number?
 
@Shmiddty Yes.
 
@BadgerGirl Next time I'll write him a postcard. He'll be my new pen pal. :D
 
7:53 PM
I can't figure out how to cut two characters from this:

for(;;)print(readline().replace(/\w/g,function(a)(15-('0x'+a)).toString(16)))
 
@OctavianDamiean Send him a dead badger.
 
What's readline ?
 
Why would I ... you are gross!
 
@Shmiddty also, what does it do?
 
halp
my node program is eating all my ports
it's breaking the internet
how do i tell node to release them v.v
 
@BadgerGirl Or did you mean a dead badger with Linux installed?
 
@david pkill node
...or something of the sorts
reboot
 
v.v
 
rm /bin/node
 
7:56 PM
@OctavianDamiean Yeah, I totally meant that.
 
i meant like, from inside the node program :p
 
!!Will you go to the bathroom for me?
 
@Shmiddty Of course!
 
ip link set eth0 down
 
Oh, sweet.
!!liek nao. go!
 
7:57 PM
and while it's doign that i can't type :D because chrome can't use them either :D
 
@Shmiddty Y U NO MAEK SENSE!? Could not understand liek nao. go! (perhaps you meant to execute a command? If so, prepend the command name with a /)
 
i need it to send a buttload of rest calls, but it gets stuck and has to wait for ports to release v.v
 
server.close() should, well, close the server
 
@Shmiddty that seems like invalid syntax to begin with (with the () instead of {} and no return
 
oh, not a server, but a pending request? You're probably screwed
 
7:58 PM
@BenjaminGruenbaum It's a function expression (JS 1.8.5)
 
i don't have a server running, i'm making http.request calls
 
er expression closure*
 
@Shmiddty Can you use ES.NEXT syntax?
 
i figured out that it was choking on the responses because i never 'read' from the response stream, and i fixed that
 
@Shmiddty Of cofeescript?
 
7:59 PM
but it still seems to be eating up ports faster than they are released
 
Maybe req.destroy? Was there something like that?
 
@BenjaminGruenbaum I'm not sure.
 
No, req.abort
 
@BenjaminGruenbaum And I don't believe coffeescript is supported (yet)
 
@BenjaminGruenbaum No it already exists in Firefox
Sort of lambda
 
7:59 PM
@copy I meant or
 
@BenjaminGruenbaum golf.shinh.org/version.rb
 
@copy I asked to know if he could use the more sensible JS version for lambdas () =>
 
i don't want to abort the request, i just want to release the port after it's done rather than waiting for the system to notice it's not in use anymore
 
brb pissy-fag
 
8:01 PM
@Zirak Yeah, but that will never be used anywhere except for there. They'll probably switch it to the version accepted by the ECMAScript committee which is (x)=>x*x instead of function(x) x*x
 
Most likely. But that's what's on SpiderMonkey
 
That looks like it could be shorter in sed than in JavaScript
 
Back to Community. o/ everyone
 
They also support Rebol, interesting
 
!!should I continue working or should I do benjamin's suggestion
 
8:04 PM
@Zirak You should do benjamin's suggestion
 
What did I suggest?
 
Excellent idea. Once the song's over.
@BenjaminGruenbaum The welcome message
 
Oh cool :)
 
!!let windows install updates like a bitch or not?
 
@Zirak sigh Remember laughter? I don't. You ripped it out of me. Heartless bastard.
 
8:05 PM
o.O
...what?
 
I don't remember adding that
....WHAT
 
Maybe @rlemon got all dark and shit
 
Anyone know where to download cracked datadirect xquery?
 
@user2213396 yes
but will not tell :D
 
8:14 PM
@Shmiddty Think of different ways to bitwise invert a number
 
@copy I also have for(;;)print(readline().replace(/\w/g,function(a)(('0x'+a)^15).toString(16))) but it's the same number of characters
 
Now rethink operator precedence
 
der
I thought I'd tried that
 
Guys, sorry for shouting all of a sudden and chaning the topic, Can someone tell me why I am getting undefined the length in this fiddle
http://jsfiddle.net/LUXwT/1/
I am adding to the DOM the table via js and I need to check the length at every button click
 
Because tb is an element, there's no reason it should have a length attribute
 
8:17 PM
OOOH
Flag's x3!!!
 
DOM nodes don't have a length. Perhaps you meant tb.children.length?
 
@Zirak: how would I get the length of tab.e. I need to know how many tables have been added
 
If you want to know how many tables there are in the document, you can do document.getElementsByTagName('table').length
 
Or just count them in a variable
 
Or that
 
8:19 PM
or hold a list of them
 
Hello, I am having a JS problem that I can not seem to understand.
In the following fiddle I keep getting a "Uncaught TypeError: Cannot read property '1' of null "
http://jsfiddle.net/Dt5yQ/
 
Also, I heavily advise that you format your code; proper indentation goes a long way
 
Thanks @Zirak, I agree .. I was in a hurry
 
Enjoy
@zeel First of all, you forgot to close the second span
 
@Mike Tables don't have a length property.
 
8:20 PM
@JanDvorak: thanks buddy to you and @Zirak. I wish I could +1 you here
 
@zeel perhaps pars didn't match?
 
Perhaps you want tb.children.length
oh, nvm
 
@Shmiddty: but tb.children.length wont increment beyond 1,
 
oops, but that was not the problem. And if you look at the HTML, it should match.
 
I tried that and I always was gettting 1
 
8:22 PM
@zeel try without the global flag
otherwise you'll be trying to get successive matches of that regex.
 
@zeel Ah yes, you've fallen victim to a vicious regexp "feature" (I'll call it a bug)
 
@Zirak well, if you set the global flag... what would you expect?
 
@JanDvorak No, that isn't fixing it.
And it needs to have that the first time I use it to get all the matches (right?)
 
@zeel exec returns null for some reason. Try debugging.
Break on exceptions, investigate the variables in scope, toy with the console...
 
Or, you can rewind the regexp manually
 
8:27 PM
So why dose that work?
 
I see, that solves it. Thank you!
 
Enjoy. It's bitten me before.
 
Thanks
 
@Zirak Sorry to trouble again, but do you know how do I call a function only specific no. of times. I know about setInterval() and setTimeout, but I need to call a function only 3 times, is that possible
 
8:31 PM
for (var i = 0; i < 3; i++) { fun(); }
Or do you want a function that can be executed a maximum amount of times?
 
e-g In my case I just want the table to be generated 3 times
 
Then the loop should do
 
fun();fun();fun()
at this count, you could easily unroll the loop
 
You've sprung the Friday trap
 
@copy Any ideas on Decimation? golf.shinh.org/p.rb?Decimation That bastard clock has 2 bytes on me, and I have no idea what he did since he has two whitespace.
 
8:34 PM
My scenario is a Little different, @Zirak, it doesn't work
 
Yeah, because there you're declaring the function inside the loop
Declare it outside; inside the loop, call it.
Since you're wiring it up as an event handler, use a wrapper; event handler does the loop
 
@JanDvorak; I am calling my function from html so I doubt if your Idea would work
 
Or you can do the uglier thing and inline the function into the loop
 
@Mike you could make a generate3Tables function
 
can you elaborate on wrapper?
 
8:37 PM
Interesting one :
0
Q: when to call XMLHttpRequest?

tomIs there a difference in browser behavior between: var xhr = new XMLHttpRequest(); xhr.open('GET',url); xhr.onload = function(){/*various things*/}; xhr.onerror = function(){/*various things*/}; xhr.send(); and var xhr = new XMLHttpRequest(); xhr.onload = function(){/*various things*/}; xhr.o...

What does exactly open ? does it open something or just set options ?
 
@Shmiddty Are array comprehensions allowed (since it's JS 1.8.5)?
 
!!>var bla={fun:function(){console.log("FUN!")}}; "fun,fun,fun".split(",").map(function(i){bla[i]()})
 
@Jan-StefanJanetzky ",," Logged: FUN!,FUN!,FUN!
 
8:39 PM
@BenjaminGruenbaum We do have access to for each(char in string)
 
@Jan-StefanJanetzky how's your code ?
 
@Darkyen currently have two players and a ball. right now i implement borders for that ball so the ball will not fly away
 
@Zirak; Thanks but it doesn't work as expected it creates 3 tables in one click. I need 3 tables to be created on 3 clicks and further clicks shouldnt do anything
http://jsfiddle.net/LUXwT/8/
 
though i'm above 1k right now. but thats.. post optimisation
 
@Jan-StefanJanetzky i am still around 100 lines
but i just have a ball that moves .. no collisions , but 20 of my lines are pure css
 
8:45 PM
i have 49 yet
including the wrapping html
 
@Mike So you do want a maximum amount?
 
even have a <!DOCTYPE html> line xD
 
@Jan-StefanJanetzky PS .. mine is :$
um responsive (XD)
it uses %
 
If that's the case then a simple counter will do
 
so u can scale it in realtime :D
 
8:46 PM
lolol
 
// when u lose the game just rescale to smaller 8-)
 
I am trying to see how a function can be executed a specific no. of times using event handlers
 
THE GAME!!! aargh!
 
like when it is called from markup
 
8:48 PM
@Jan-StefanJanetzky codepen.io/darkyen/pen/aIorc
i dunno why i end up with everything css , though this will have socket.io :D
and i will host it ;D
 
@Zirak; love you bro. but what is this concept called you used here. Is this wrapper?
sorry but I am trying to learn js so plz bear with nme
 
@Darkyen me has 7 kbyte / s bandwidth right now D:
 
It's a simple event handler and a counter
You can write a generic wrapper
 
@Darkyen lol. i use canvas and mouse movement
 
@Jan-StefanJanetzky one of mine will be mouse :P
dunno though keyboard makes more sense with pong
som1 with crazy mouse skills can win infinite
 
8:51 PM
any link to read about javascript wrappers. I did google but I am getting links to stackoverflow answers
 
@Darkyen true
 
not if you put a velocity limit on the paddle
 
i am still worried about the C++ thing :'(
 
so it just moves towards the mouse, rather than matching exactly
 
A "wrapper" isn't a very specific thing. Wrappers are simply functions which call other functions.
 
8:51 PM
@david with my version thats just a rule
transition:left 400ms;
the delay will be enough ;-)
 
that's not a velocity limit :S
 
@Shmiddty no idea right now
 
@copy for(i=0;;print())for(a in r=readline())++i%10&&putstr(r[a]) is 59 chars, but never stops running
 
@david the idea is the same ;-)
and you can calculate the limit using simple math ;-)
 
@Darkyen no it isn't :(
 
8:55 PM
transition-duration: /* set it on the fly */
 
@BenjaminGruenbaum Because of multiple rooms, it won't be as trivial as I thought. I need to hone how users are treated in regard to rooms in general.
 
The simplest solution is to greet only when reading messages from the JS room
 
I know, but passing the information that you're in room X down is the tricky part.
 
URL?
The javascript room has a specific URL that you can test
 
Bot may be in a different room
It can live in the sandbox and listen to the js room
I can make a hacky solution now, I think
 
8:58 PM
test the ID of the room you're listening to, then
 
Not that easy
 
why not?
 
Because of how the event system here works. I can't explain it in a sentence
 
design barriers?
 

« first day (895 days earlier)      last day (4045 days later) »