« first day (1193 days earlier)      last day (3770 days later) » 

5:02 PM
@BenjaminGruenbaum what now?
 
@Cicada3301 now without d or c :)
Like I said, you may use prev too if you need it.
functions in the real world don't have access to globals :D
 
@BenjaminGruenbaum I don't even know what prev is... lemme google it
 
@Cicada3301 prev just means the opposite of succ , that is prev(x) is the number whose succ value is x
 
@BenjaminGruenbaum What you trying to teach him?
 
@SomeGuy numbers
 
5:05 PM
@Cicada3301 zomg now c and d
 
The lesson that most assignments are stupid
 
@copy oh hey there.
 
Hi cutie
 
asl-codegolf?
 
function suc(n){return n+1};
function add(a, b){
	var c=0;var d=0;
	function addMech(a, b){
		if(c!==b){
			c=suc(c);
			d=suc(a);
			addMech(d, b)
		}
	}
	addMech(a, b)
	return d
}
console.log(add(2, 3))
now it has no global variables
 
5:06 PM
Hahaha
 
@Cicada3301 no closures please :)
 
@BenjaminGruenbaum awwww
then I have no clue
 
user1596138
Still trying?
 
@Zirak when are you due?
 
5:08 PM
@Cicada3301 keep trying, the next thing is multiplication when you figure addition out :)
 
@Cicada3301 lol come on
 
what's the goal of this exercise? :P
 
having mutable hidden state is wrong on so many levels
 
lol... just figured it out
 
18 mins ago, by Bartek Banachewicz
*Main> let five = Succ(Succ(Succ(Succ(One))))
*Main> let three = Succ(Succ(One))
*Main> add five three
Succ (Succ (Succ (Succ (Succ (Succ (Succ One))))))
 
5:09 PM
nope...
 
I think I'm gonna need new strings soon
#effort
btw @Cicada3301 Haskell solution has 3 lines total
 
@BartekBanachewicz if I do add four seven...
it won't work
@BenjaminGruenbaum got it!
 
@Cicada3301 does it have mutable state?
 
@BartekBanachewicz sure it has
 
@Cicada3301 then you haven't "got it"
 
5:12 PM
XD
 
a=(x,y)=>y?a(x^y,(x&y)<<1):x
 
@BartekBanachewicz I think he thought that going "yes!" was the correct answer there because he didn't know what you were asking
 
function suc(n){return n+1};
function prev(n){return n-1}
function add(a, b){
	if(b!==0){
			b=prev(b)
			a=suc(a);
			add(a, b)
		}
	return d
}
console.log(add(2, 3))
@SomeGuy mutable state = arguments can change, right?
 
@Cicada3301 not at all.
 
user1596138
@copy I finally started using the ternary operator. Are there any performance gains/loss?
 
5:13 PM
@Cicada3301 What is d?
 
@Jhawins No
 
user1596138
You seem like the guy to ask in this room.
 
And don't overuse it
 
@Jhawins Nope
 
user1596138
Sweet.
 
5:14 PM
@Cicada3301 what is d?
 
@nderscore 3
 
You probably should never use the ternary unless you're codegolfing
 
I really hate libraries that use callbacks , over promises
 
user1596138
@copy Define "overuse" please?
 
function suc(n){return n+1};
function prev(n){return n-1}
function add(a, b){
	if(b!==0){
		b=prev(b)
		a=suc(a);
		add(a, b)
	}
	return a
}
console.log(add(2, 3))
 
5:14 PM
are we spoiling already?
 
!!>function suc(n){return n+1};
function prev(n){return n-1}
function add(a, b){
if(b!==0){
b=prev(b)
a=suc(a);
add(a, b)
}
return a
}
console.log(add(2, 3))
 
@Cicada3301 "undefined"
 
user1596138
@SomeGuy Why?
 
wth?
 
@Cicada3301 stop spamming god damn it
 
user1596138
5:14 PM
Is there a reason other than "dont"
 
@Jhawins Any nesting or combined with large expressions inside
 
user1596138
!!tell Cicada3301 sandbox
 
@SomeGuy I disagree
 
@Cicada3301 You know, there was this funny idea once upon a time that people were supposed to test out commands and "play" in the sandbox
 
wait... if add is predefined... really?
 
5:15 PM
@Jhawins Just my opinion, but because your code should explain its intent by itself
 
user1596138
add is not predefined.
 
I'd use it for simple things
Like really simple ones
 
!!> add(1, 2)
 
@Cicada3301 "ReferenceError: add is not defined"
 
now I'm confused...
 
5:16 PM
@BartekBanachewicz You think it's perfectly alright to use them?
 
!!> add=(x,y)=>y?add(x^y,(x&y)<<1):x; add(3,5);
 
@copy "ReferenceError: a is not defined"
@copy 8
 
@SomeGuy disagree! ternary is great. ternary is best. all praise ternary! bow before it's operational glory!
 
user1596138
@Copy it seems to throw warnings sometimes where an identical seeming if...else doesn't. So I've wondered...
 
!!> add=(x,y)=>y?add(x+1,y-1):x;add(3,5);
 
5:17 PM
@BenjaminGruenbaum 4
 
@BenjaminGruenbaum 8
 
Can someone please help me ? I'm trying to send alert to a browser via nodeJS but it says : Resource interpreted as Document but transferred with MIME type application/javascript: "http://127.0.2.1:1337/s?type=script".
 
@nderscore did you see my last message?
 
What am I missing ?
 
5:18 PM
!!>function suc(n){return n+1}
function prev(n){return n-1}
function adding(a, b){console.log(a);
if(b!==0){
b=prev(b);
a=suc(a);
adding(a, b)
}
return a
}
console.log(adding(2, 3))
 
@RoyiNamir show us your clientside request..
 
@Cicada3301 "undefined"
 
user1596138
@RoyiNamir 2 questions: 1, what editor is that? 2, What screenshot program are you using that leaves those jagged edges because it's cool as hell.
 
@RoyiNamir Wireshark
 
@Cicada3301 can you do that in the sandbox? It's getting a lot of messages.
 
5:19 PM
@Jhawins Oh, I'd use the ternary if I had a function that did the conditional check though
 
@Cicada3301 "undefined"
 
@copy chrome headers is ok ?
 
a = checkSomething() ? a : b; would be fine by me
 
@BenjaminGruenbaum just callingit from url
 
!!ban Cicada3301 5m
 
5:19 PM
@Shmiddty User Cicada3301 added to mindjail. Cannot find user 5m.
2
 
@BenjaminGruenbaum 127.0.2.1:1337/s?type=script
2
 
@BenjaminGruenbaum ok... but wanted to show you something... that's why I did it here
 
@SomeGuy need help
 
@Jhawins editor : notepad , screen: screencapture(fastone)
 
Wasn't there a duration param?
or am I thinking of mute?
 
5:20 PM
this is english any gurus are welcome
 
@AbhishekHingnikar Just going for dinner
 
@RoyiNamir all I see in that link is porn. Am I pregnant?
 
What's up?
Hurry up!
 
@SomeGuy use a brain worker to think
 
@RoyiNamir Don't you need to include it into <script></script>?
 
5:20 PM
@BenjaminGruenbaum can you get in sandbox plz?
 
GET TO THE CHOPPA NAO
 
@SomeGuy can you think a punch line for snapick ?
 
@Oleg no.
 
Snap a pic, anytime.
 
its an app to take and see photos across LOTSS OF CLOUD SERVICES
 
5:20 PM
@RoyiNamir why?
 
@RoyiNamir You stole my website
 
caprica just told me you iz in mindjail...
 
@copy so it's your porn I'm seeing there?
 
Guys ,
 
5:21 PM
@BenjaminGruenbaum It's art
 
I imagine a document coming to my browser where it's just written alert('lalala'). Why should it even run?
 
PORN ??!??!!?
 
@Cicada3301 yeah, it annoyed @Shmiddty - ask him for forgiveness.
 
I just created a simple webserver to serve samples of types
that's all
 
5:21 PM
@Shmiddty no, what's up?
 
(for my testings)
 
@nderscore teebee is at 76 characters
 
it's just that the script part is not alerting the browser.
 
@Shmiddty saw that... the bastard. I haven't come up with any ideas of how to shorten yet :(
 
Here is the result :
 
5:22 PM
guys, I moved in sandbox...
 
@RoyiNamir Have you tried to create a valid html document that has <script src="yourlink..."... ?
 
!!unmute Cicada3301
 
@Oleg If jquery.js had only alert('1') and you set that url in the browser , would you see alert? YES
 
@Shmiddty User Cicada330 not found
 
that's what im trying to do
 
5:24 PM
@Shmiddty Unmuted user 3161092
 
@nderscore for(a in b=(r=readline()).split(''))for(;+b[a];r=b.join('')+'\n'+r)b[a]--;print(r) is my current solution
 
@SomeGuy yep
 
my desk is unusable it is so cluttered
time to clean
 
@rlemon try not to poop on it
 
(guys , I really need help here please)
 
5:25 PM
function add(a,b) {
    if (isOne(a)) {
        return succ(b);
    } else {
        return add(prev(a), succ(b));
    }
}
that's mine /cc @Cicada3301 @BenjaminGruenbaum
 
@Shmiddty aha, now I understand what you meant by building the string backwards
 
I can't use caprica anymore...
 
@Cicada3301 you've already been unmuted
 
@BartekBanachewicz isOne is not defined
@Shmiddty look:
 
@RoyiNamir well looking at the differences between how you set the headers for each.. try to not deviate for the last and see if it works.
 
5:27 PM
!!tell Cicada3301 afk derpy
 
!!> console.log(1)
 
Meh, this is taking too long, @Cicada3301 read chat.stackoverflow.com/transcript/message/7626603#7626603 @BartekBanachewicz you're welcome to too.
 
@Cicada3301 isOne = function(x) { return x === 1; } now it is
 
!!are you alive?
 
@rlemon Certainly not
 
5:28 PM
!!ban
 
@rlemon 895174 (?) 1355043 (?) 1858108 (?) 10 (?) 1005250 (?) 1941949 (?) 990192 (?) 2428683 (?) 1947276 (?) 3161092 (Cicada3301)
 
Oh, I did unmute instead of unban
oops
!!unban Cicada3301
 
@Shmiddty User Cicada3301 freed from mindjail!
 
ban doesn't have a duration either
 
ban should have a duration
 
5:29 PM
takes multiple user id's as an argument
!!unban Cicada3301 Dead m59
 
@rlemon User Cicada3301 added to mindjail. User Dead added to mindjail. User m59 added to mindjail.
@rlemon User Cicada3301 freed from mindjail! User Dead freed from mindjail! User m59 freed from mindjail!
 
something like !!ban user1 5m, user2 10m, user3 1h
 
make a PR
or an issue
 
user1596138
!!ban CapricaSix //durrrrr
 
@Jhawins Registered; need 0 more to execute
 
user1596138
5:31 PM
Ok. I'm fixing the damn vote count today. All it needs it +1 added somewhere haha.
 
@Jhawins banning her does absolutely nothing
she already ignores herself.
:P
 
user1596138
Oh I forgot @rlemon is a machine so he ignored the "//durrrrr"
 
user1596138
As with all comments. Rlemon does not parse comments. Watch.
 
user1596138
@rlemon is sexy //rlemon is a dirty skanky whore
 
user1596138
Annnddd... I must be running with an outdated humor framework. Because no laughs.
 
5:35 PM
your sarcasm module is out of date. Please run lpm update && lpm install sarcasm
 
!!doge laugh,funny,humor,chuckle,chortle,guffaw
 
    wow
                  very laugh
                      so funny
such humor
               much chuckle
                       many chortle
much guffaw
 
user1596138
@rlemon I'm a apt-get man ;)
 
lpm === lifes package manager
 
user1596138
Haha. Anyway. Content is created based on what's in a database. There are buttons on each and every row's data after it's rendered. Is it a better idea to add event listeners to these buttons as they're made (i.e. before appending the div) or to add them all at once after everything is already created?
 
5:39 PM
@Jhawins event delegation
 
m59
Man it stresses me when people don't accept answers and don't comment.
 
@Jhawins what @Shmiddty said
 
m59
The "why" is what gets to me.
 
user1596138
Nvm
 
@RoyiNamir Will I? Proof!
 
5:41 PM
@rlemon no , I didnt succeed.
0
Q: Node.js Cannot send script ?

Royi NamirI have this simple node.js server code which sends alert : var sys = require("sys"), my_http = require("http"); my_http.createServer(function(request,response){ response.writeHeader(200, {"Content-Type": "application/javascript","Content-Length": "alert('');".length }); response.write...

 
user1596138
Yeah, I do that already. But my question still stands. Do I add it after I've appended all the divs, or do I add it to each div before it's completed and appended to content?
 
@RoyiNamir Is a script supposed to be executed when directly downloaded in a browser ? I don't think so (or it would be painful looking at raw files in github)
 
^ +1
 
yeah I guess im too tired you're right
 
@RoyiNamir is this only in Chrome?
ohh this was viewing the raw file?
 
user1596138
5:44 PM
I have functions: addRow() and addHelpers(). Currently, addHelpers() is adding autofill info/autocomplete stuff, along with a few other unrelated things. The event listeners are added during addRow() as the data is parsed from JSON and put in the appropriate fields/inputs depending on the output.
 
damn, I should have read that.
 
Yea, he's trying to load the file directly.
 
yes
 
yea then that is the expected behavior
 
forget what i've just said. thank you all . too tired.
 
5:45 PM
lol
it happens
 
(@Oleg sorry for arguing)
 
@RoyiNamir :P
 
@RoyiNamir Somebody made a correct answer. I don't think you should delete your question, this answer should probably be accepted.
 
By the way, why passing ?script in the url arguments?
 
user1596138
    So `addRow()` looks something like :
    function addRow(json) { data = JSON.parse(json);
        for (var i in data) {
            input.className = i; input.value = data[i]; /*this is BS I just wrote lol/*
        }
    //Now I define the buttons as well as add the event listeners
    MORE STUFF()
    //now I append the button's div to the row's main div, then append to content
    }
 
5:47 PM
@dystroy you're right. undeleted . tnx for comment
@Oleg just for quick testing for html , script,jsonp, plain etc
so I send the type token , and node should respond according to the type
 
@BartekBanachewicz Even for complex conditions?
 
Okay. Just wanted to suggest the Accept header.
 
@Oleg well , thats what the browser send in the request
 
user1596138
I'm thinking it may be better practice to append everything, then use addHelpers() to add the event listeners afterwards. Also, I have a bit of a lag I'd like to kill, so performance-wise?
 
would be good with ajax though
 
5:49 PM
Depends how you do the request. I'd go for accept header.
 
@Jhawins documentFragments + delegation === win
 
user1596138
Hmm...
 
user1596138
Thank you.
 
build all your buttons -> add them to a DF -> at the end add the DF to a container -> container.addEventListener('click', function(e) { if( e.target.className !== 'whatever' ) { return false; } ... handle shit }, false);
 
user1596138
Googled it and found John Resig's article first haha.
 
5:51 PM
hello
 
hey
 
user1596138
I believe I'll use a lookup table for the buttons event delegation. Not sure.
 
is it ok to ask a question about jQuery in here? Im stumped and searched all of stack for it.
 
are you using the beloved jQuery @Jhawins ??
 
user1596138
Yes, mostly for AJAX but some other areas it came in handy as well.
 
5:52 PM
@Gramps Just ask the question already :)
 
$(container).on('click', 'button', function() {
  // delegation made easy
});
 
user1596138
Holy shit I forgot.
 
:P
 
Im trying to fadein a button after 100% + 200px. Ive used .scrollTop() > 200) {} but I dont know how or know if its been asked before
 
    $(window).on('scroll', handle_scroll);

    function handle_scroll() {
        if ($(this).scrollTop() >= 200) {
            btn.fadeIn('fast');
            return;
        }
        btn.fadeOut('fast');
    }
 
5:55 PM
did i miss anyone ?
crap ryan :-/
 
why is my name underlined and not Loktars?
spell checker understands connor and loktar?
 
@rlemon loktar is in microsoft dictionary
it seems
 
lol wow
 
spelling mistakes can occur
 
look at me! answering jQuery questions like a mofo :P
 
5:57 PM
@AbhishekHingnikar I don't see any reason to be thanking me, but thanks for thanking me :p
 
you would begin to think I actually knew it!
 
@SomeGuy for dealing me for 2 years ?
heck i should just drop a link to this room there :P
 
You're not a card, man. I don't deal you.
 
@SomeGuy I mean helping -_-
 
@rlemon thanks I will test this out
 
5:59 PM
PS @SomeGuy its a college presenation to microsoft guys... hope it works fine now start praying :P
 

« first day (1193 days earlier)      last day (3770 days later) »