« first day (1175 days earlier)      last day (3767 days later) » 

m59
12:14 AM
I just realized I don't like jQuery's ajax.
Or I'm dumb.
Inclined to think I'm dumb..
If a RESTful resource isn't found, it should respond with 404, but then jQuery won't show me the response data...
 
BAH WORDPRESS NO ONE LIKES YOU
 
@m59 Isn't that in the error callback?
 
m59
@PeeHaa still no data
 
That would be immensely stupid
 
m59
Every api I know of can do this.
Just because the resource isn't found doesn't mean you get a blank screen. You get something, it just isn't what you want.
 
12:21 AM
uuuhhhm it does return the data
 
m59
Right, and jQuery won't give it to me.
 
m59
@PeeHaa I see. I guess I'll use always(data)
 
I don't really like the "overloading" of always tbh. But I can see it might make sense in your case
 
@m59 always use always
or done
 
m59
12:51 AM
@rlemon yeah, I do with angular. I didn't even know about promises back when I used jQuery.
 
user1125394
1:05 AM
function Person(gender) {
  //this.gender = gender; // why do people usually store it? it's not needed
  this.getGender = function(){return console.log(gender)};
}
 
user1125394
hmm yes it's needed
 
user1125394
function Person(gender_) {
  var gender = gender_;
  this.getGender = function(){return console.log(gender)};
}
 
user1125394
1:21 AM
nah it's not, I did crap declaring some vars after they're used
 
2:06 AM
Uh oh, I think I'm about to get bitten by lack of version control.
 
Omnomnom
 
@RyanKinal You've got some balls, coming back here after what you did.
 
are they bitten?
 
2:35 AM
I wonder why OSs have only 1 clipboard by default
 
s/OSs/Windoze
 
user652649
 
Thanks to OSs, I am used to using 1 clipboard !!
 
@EnglishMaster Weren't you looking to get YC funding for an 'innovative porn site'?
 
Yeah
BTW, is it true most people get laid before your 3rd date with a girl?
 
2:38 AM
I can't tell if you were trolling or just didn't understand why that was such a bad idea.
 
user652649
@EnglishMaster if you need help i'm on board
 
2:51 AM
Are you interested in porn sites?
 
user652649
i'm interested in the porn business, i always wanted to be a porn actor
 
user652649
then they bought me a computer and childhood dreams gone away
 
user652649
xD
 
@Wes So you are not really a tech guy but an actor
male actor *
 
user652649
i was kidding lol xD
 
2:57 AM
I'll take "Conversations I'm sorry I brought up" for 500
 
user652649
what "for 500" means?
 
@Wes It's a reference to Jeopardy
 
user652649
!!urban for 500
 
@Wes Nothing in that index. The last one is:
[for](http://for.urbanup.com/2644196) The most common misspelling of fro.
 
!!urban Jeopardy
 
2:59 AM
@SomeKittens Jeopardy Ken Jennings. Enough said.
 
user652649
got it @SomeKittens :P
 
3:26 AM
Hola
!!urban shaggin wagon
 
@monners Shaggin Wagon Pimped out 60's - 80's van usualy comes with a couch, waterbed, strobe lights, lava lamps. Used for the specific purpose of getting laid and/or high.
 
Nice.
 
stackoverflow.com/questions/20893354/… read the question comments.. inline css is good for readability when presenting code? ..I can't
 
@RUJordan Welcome back!
 
Thanks!
 
m59
3:33 AM
@rlemon any idea where I went wrong here? JS HMAC: pastebin.com/zBwhyxMW PHP HMAC: pastebin.com/WJbAp4Xq
(or anyone that feels like looking at it) just a few lines of code in each file.
 
If you don't know that there's a difference between sha-256 and sha-512, maybe you shouldn't be doing low level crypto
 
m59
?
 
Exactly
 
m59
@copy all I know if 256 is faster, so I was going to switch to that
ah heck, and I just read that that isn't even true haha
I just realized i had the php arguments out of order, but that didn't matter.
@copy OH LOLZZZZ
I had 256 on one of them
gotta be kidding me
 
Why don't you just use HTTPS?
 
m59
3:42 AM
You gotta forgive my occasional oversights like that....narcoleptics are really prone to it.
Doesn't HMAC prevent other attacks also?
CSFR?
 
Absolutely not
 
m59
@copy sigh.
There's so much outdated and wrong information around. I don't know what to think.
 
m59
I know that it doesn't prevent all attacks, but it seems like it has to prevent some..
 
That's not how security works
 
m59
3:49 AM
Like, the email ones.
 
If you don't have HTTPS, all JavaScript crypto is worthless anyways
 
m59
if the user is logged in and clicks a link in an email, that's not going to do anything because the data isn't hashed and all
Well, yeah, because they could steal the key when the person logs in, but it's better than nothing
 
No, it's not better than nothing
 
m59
If I did always have HTTPS, then what?
 
Then (and also in the non-HTTPS case), you just send a token in the form
 
m59
3:58 AM
@copy so, If you require a secret key with each message and an attacker doesn't know that key, CSFR is impossible?
 
If you're not doing something wrong, yes
 
m59
and then I guess there's XSS
 
You should read up on all of that on owasp.org or a book or a security course
 
m59
@copy I have, and am currently =D
 
what the fuck?
 
4:06 AM
Does anyone else naturally need to sing "twinkle twinkle little star" when you read alphabets in order?
 
@EnglishMaster Yes.
 
You too? ^_^
 
Fuckin' mnemonic teaching techniques
 
5:02 AM
@m59 What church do you belong to?
 
m59
@BadgerGirl I only identify as being with "the church"
Some people call my meetings a house church or bible study
 
The problem with Haskell is that it's a language built on lazy evaluation and nobody's actually called for it.
3
 
@Feeds Makes sense
 
m59
We just say that we have people over for dinner and friendships. All of the pastoring, worshipping, teaching, etc just happens because that's what we do =D @BadgerGirl
 
m59
5:07 AM
@BadgerGirl why do you ask?
 
@copy told me to ask
 
m59
Also, I totally support everyone that does the more traditional thing.
My disassociation with buildings/names etc, if anything, is to say that my focus is on unity in Christ.
 
I believe in Satan though
And pray to him
 
m59
Oh, wait. I believe in Satan also.
But, he sucks.
gosh I thought Luigi was hard to control. copy.sh/iw
 
Satan gave me the power to make that game
 
m59
5:15 AM
the apple killed me?
apparently so.
Forbidden fruit and all.
 
It's more like a giant cherry
 
m59
dang I can't pass it
LOLZZZZ
get over the cherry = spike death
 
You've gotten pretty far though
 
m59
lol
 
@copy @copy @copy come back pls
 
m59
5:31 AM
If anyone feels like discouraging the accepted answer, please, please do it.
0
Q: passing parameter to javascript onclick function

max liI am having problem with getting parameter from javascript onClick function title = "as" $('<li onClick=pushRight('+hello+') class="item"></li>') and my console log print this Uncaught SyntaxError: Unexpected token }

I'm so horrified I can't find the words.
 
user652649
@m59 you haven't see nothing yet
 
user652649
there are tons of accepted answers that are just wrong
 
m59
A lot of my best answers are not-accepted and 0 score.
 
user652649
ha, same is for me :P
 
user652649
s/best/lucubrated
 
5:53 AM
!!s/my //
 
@JanDvorak That didn't make much sense. Use the !!/help command to learn more.
@JanDvorak A lot of best answers are not-accepted and 0 score. (source)
 
m59
6:05 AM
@JanDvorak there's something awfully philosophic/poetic about that =D
 
0
Q: Simplified Dynamic Arithmetic Operator

RUJordanI'm revisiting this old project I tackled a while back where I wanted to avoid using if statements and switch blocks to render say a simple calculation where the operator ( + / - / / / * ) could be anything. I am retrieving data from a database (securely inserted), along with a beta case of use...

clarity on eval would be awesome.
 
6:50 AM
Any fbapi ninja around ?
 
@AbhishekHingnikar I can't see any, but that doesn't mean anything
 
7:02 AM
@JanDvorak Well i sent tons of photos to my girlfriend over the course of 2 years
on her facebook chat.
and i mean tons of them !
and :-/ its kind of impossible to actually go back and get them all just scrolling
so is there any code solution to fetch all the images back from the convo ?
Most of what i guess ,,, it shall be just a filter no ?
 
m59
7:27 AM
Goodnight!
 
8:11 AM
abhishek!
is anyone there?
 
8:38 AM
While developing a userscript for SO:
//yep, even deleted questions are `.deleted-answer`s.
 
jan can i ask a question please? :)
its probably something really simple, but im currently learning js on Code Academy and think ive done something wrong, even though it works lol
 
ask
 
ok so im doing if and else statements
and i declared this variable
var age="18";
var age = prompt("How old are you?");
and i want to write the if statement that if its less than 18, then its a different message
i put this
if (18)
but then its not going to take into account if a user is less than 18
so would it be
if (var age > 18) ?
 
should do
 
comes up with a syntax error :S
 
8:44 AM
var age = prompt("how old are you")
if(Number(age) > 18){...
 
ah... didnt teach me that bit :S
 
since prompt returns a string, you should convert to number for clarity
 
ok, so u know the (age) bit, would that be the variable i have declared?
 
It's not a syntax error to compare a string to a number, but I'm not sure which one is converted here.
you can name variables any way you like, but declaring the same variable twice normally signifies an error.
 
8:47 AM
// Check if the user is ready to play!
confirm("I am ready to play!");

var age="18";
var age = prompt("How old are you?");

if(Number(age) > 18)
{
console.log("Play On!");
}
else
{
console.log("You Are Allowed to play but we take no responsibility");
}
console.log("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.");

console.log('Batman glares at you.');
 
here, var age = prompt(...); overwrites var age = 18;
 
ARGH :S
yea it told me to declare a variable of var age
 
not twice, however ;-)
 
@mikedidthis @rlemon Actually, read this entire article cracked.com/…
 
lol,... i think its when it follows on the actual tutorial :S
 
8:49 AM
link?
 
Using prompt to ask the user for their age. You can do it like this: var age = prompt("What's your age?"); and the variable age will hold the user's response.
i think i done this bit wrong :S
 
just drop var age = 18 because it's not being used
 
yea i just did
 
the rest looks good
 
var age = prompt("How old are you?");

if (age > 18)
that seemed to work
 
8:52 AM
It probably does, but you're relying on implicit conversions here
 
it confused me as it told me to declare a variable, :S
 
the shortest way to convert explicitly to a number is +age.
 
also, there is parseFloat(age)
 
i hope they teach me this later lol! im only just getting my head round boolean!
you are speaking to someone here who knows NO JS lol
it doesnt help when they said declare a variable first, so i kinda double declared it, then i were left with the if statement to see if the age was less than a number to say a different message...
plus i want to shoot the person who decided to use poor batman statements... Are you ready punk... 0_o
 
8:55 AM
Javascript tries to convert to compatible types whenever you do an operation... but number + string is a string, so it's better to convert explicitly and early
 
hello everyone. first time ever to get in to this chatroom with experts. can anyone help me about my problem? :(
 
right ok, noted :)
 
!!welcome cecil
 
@cecil Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
i dont think these tutorials REALLY go into a massive amount of detail for people these days...
 
8:56 AM
I believe the tutorial wanted to see this:
var age;
age = prompt("how old are you?")
 
oh...
it didnt say that :S... well not to me lol
 
Okay, uhm, can one have a dynamic required input attribute in one js function?
 
@Cecil can you clarify with a code sample?
!! tell cecil format
 
@cecil Format your code - hit Ctrl+K before sending and see the faq
 
sorry, i did not know i have to format it
<script type="text/javascript">
		$(document).ready(function(){
		$('#fac').hide();//div fac
		$('#stud').hide();//div stud

		document.getElementById("student").attributes["required"] = ""; //input 4 student
		document.getElementById("faculty").attributes["required"] = "";//input 4 fac

		$("#thechoices").change(function(){
		$("#all").children().show();

		$("#" + this.value).show().siblings().hide();
		});

		$("#thechoices").change();
		});



		</script>
 
9:02 AM
1 message moved to recycle bin
you can edit previous messages by pressing the up key
wait, you have the elements #fac and #faculty? Sounds like a bad choice
 
honestly this tut is naff
 
@KirstyHarris Yes needs to be quoted; otherwise it looks for a variable with that name
 
yes. fac is for the div, faculty for the input field.
@JanDvorak divs are for hide and show while the input fields are for required attribs
 
now, what is the question?
 
9:06 AM
morning PeeHaa!
 
@PeeHaa flagging the link as offensive in 3..
 
:D
 
(good morning, by the way)
 
i cannot put required atrribs in all my input fields because once i press the the submit button other hidden fields are required too :(
 
@Cecil all that are not hidden, then?
Why do you set that attribute from javascript instead of the inputs being required from the start?
 
9:08 AM
Hello can you suggest me which should I choose ember or angular they both looks same to me.
 
think i slowly got my head round the var bit... 0_o.. lol
 
they are not. they are toggled through the js above.
 
oh. So, you want to validate that all shown inputs are filled in?
 
okay, uhm, I want to have alternate required inputs. My goal to my form is to hide and show the inputs regarding with what position (Faculty Member or Student as options) and store to the database. Different input fields for the Student, as well as different fields too for the Faculty Member.
However, when I choose Student (so Student input fields appear now and Faculty Member input fields are hidden),fill up the fields, and click Submit button, I can't proceed to the form action I put because the hidden fields for faculty member are also required to be filled.
And if I eliminate the required attribute on each input, my database could be destroyed (such as multiple inputs, blank inputs).
 
When hiding them, clear their required property, and when showing them, set it?
 
9:11 AM
@Cecil Wut? no
Validate serverside. always
 
The server needs to do verification in any case. You cannot trust the client machine.
!!google addback polyfill
 
I hate it when I have to polyfill for ancient library versions in my userscripts
SO uses jQuery 1.7.1
 
Yeah they are slow
 
!!jquery addback
 
can u give me an example of a simple js code that gives a required attrib dynamically to two input fields? please?
 
If anybody feels like they want to contribute hipsters for my latest project that would be awesome (I suck at photoshop) :-)
@Cecil elem.setAttribute('required', 'required')?
 
@Cecil $(...).prop("required", true)
yoou want to set the property, not the attribute
 
set property.. okay.
 
hi
 
9:19 AM
can i merge that in one js with toggle function?
 
you can, but it will be better to use a condition
 
pastebin.com/8J6csRjA How can I pass a label text value to this function for filter ?
filter: ["DeviceID", "=", 325283298] I can filter like this (manually)
filter: ["DeviceID", "=", Label text value] ?
I need some help
 
okay @JanDvorak..
 
@Mehmet you can't set two filters like that, but I don't know how you can.
 
No I want to one filter
["DeviceID", "=", 325283298] I can filter by DeviceID=325283298
 
9:24 AM
thanks too for all of you guys.. i really thought expert people are snob. ;)
 
I'm pretty sure DeviceID is not going to be equal to your label
 
I want to be DeviceID=lblDevice.text value ?
 
@Mehmet I don't think it's going to be, but that's just my guess
 
@Cecil There's no "expert people". Some people just happen to know things in a specific field.
Does that question make sense ?
0
Q: How does the JavaScript function .style() apply the styles?

XeroSo, seems like a legit question, but the question is, how does the .style built-in function work? A better understanding: how would: .style.color="red"; make the text red? This seems like a really open and not well-known question because when I looked it up I got nothing. I'm not asking how ...

 
@JanDvorak.. yikes... functions :S
 
9:25 AM
in c# lblDeviceIDText.Text =this.Page.Request.QueryString["DI"].ToString();
 
<<< is definitely no expert
 
@KirstyHarris What's wrong with functions?
 
lol its my next lesson lol!
its like this is the greeting i have to call :S
 var greeting = function (name) {
console.log("Great to see you," + " " + name);
};
so i put :S
console.log("Hello" +  greeting );
 
console.log("Hello" +  greeting() );
 
console.log("Hello" +  greeting('PeeHaa') );
;)
 
9:31 AM
oh.
 
ah, they wanted this
 greeting("Hello" +  name );
ffs.. honestly... this is proper messing with my head :S
i feel dumb for not knowing this lol
 
hm.. the function isn't returning anything, yet you want to append the return value to some string
 
lol didn't even notice it :P
 
well it returned Great to See you and it said i got it right lol
 
Maybe it thought your name was undefined?
 
9:34 AM
maybe, it didnt ask me to put in a name
 
then what's name?
 
not a scoobie :s
 
are you using a variable to which you haven't assigned yet?
 
0_o
maybe... who knows! argh im gonna come back to this... its playing with my head
ah!
 var foodDemand = function (food) {
console.log("I want to eat" + " " + food);
};
foodDemand("Cheese");
returned I want to eat Cheese
 
looks reasonable
 
9:39 AM
Why are you concatenating the space separately?
 
except, ^
 
its what its teaching me on CA :S
 
I guess not ;-)
 
I'll review the tutorial once I'm done making my userscript
 
9:42 AM
yay! i wrote my own! i am sooo proud lol! and debugged it (geek moment)
var greeting = function (name){
console.log("I want to eat" + name);
};
greeting("Kirsty");
 
> I want to eatKirsty
 
console.log("I want to eat " + name);
 
its the simple things in life lol
 
@PeeHaa still weird
 
@JanDvorak :)
 
9:44 AM
yea i had to fix this really bad function, and write my own.... hand on heart? i feel like ive gone over a mountain lol
 
Welcome to this peak
 
add a default name... so that greeting(); would also get an proper output... yes?
 
i got a bit bored now... i think i should actually do some real work
 
" "+"out" should be " out". Similarly for the other side.
 
9:47 AM
oh right, ok, it told me to put the extra bits in for the spaces to form lol
 
@KirstyHarris click through the link to see a terrible answer
 
oh! 0_o
 
9:51 AM
well the rating has taken a bit of a battering then on his end
 
sh*... found one more bug in my older userscript... I'm not going to do the review soon.
!!afk doctor + lunch
 
@JanDvorak Can you pick up some milk on your way back?
 
10:15 AM
argh anyone there?
im trying to do return keyword in js and failing :s
 
user652649
@KirstyHarris pong? how can anyone fail with return? :P
 
user2579865
lol
 
10:40 AM
lol i can wes lol
@wes im failing bad with this one :S
 
user652649
so? :P
 
Define a function called quarter which has a parameter called number.
This function returns a value equal to one quarter of the parameter. (i.e. number / 4)
Call the function inside the if statement's condition (and put in a parameter value!) such that "The statement is true" is printed to the console.
im lost lol!
im actually head screwed
maybe its just me or they dont explain these tuts very clearly for dumb fecks like m
moi lol
 
user652649
number / 4 is 4/4 which is 1
 
user652649
so 1%4 !== 0
 
but im lost how that fits in :S
i think im gonna leave js for a while till i can get my head round it better
 
user652649
10:46 AM
if(quarter(4) === 1){ console.log("statement is true"); }
 
user652649
i'm not understanding the point of that actually :\
 
i think i got to get it to equal 0 though.. argh... i will go do html... something i can control
 
user652649
if it's a division it can't never return 0
 
:-/
Kirsty Harriss tell me you were not dating in primary school.
 
lol why u say that lol
 
10:49 AM
this is primary school maths :-(
 
user652649
unless the operand is 0 of course
 
user652649
if(quarter(0) === 0) {
 
oh i know that much, im just trying to work out this function... im just not getting my head round it :S.. its more the code side :s
 
maybe you should try learing python for a while [ and i mean learn it for 2-3 months completely]
 
hmmm i think i can learn that on code academy
 
user652649
10:50 AM
@AbhishekHingnikar i think she doesn't understand the point of the question... and same i do :P
 
lol! bingo!
 
user652649
@KirstyHarris there's more or that's the actual complete question?
 
^
^^
^ ^ ^
^ ^ ^ ^
^ ^ ^ ^ ^
 
yea it is, its on code academy im trying to get my head round how to get to that point lol
ive done enough js for today... lol
 
user652649
lol :P
 
10:51 AM
honestly once it sinks in, it probably will!
 
user652649
@AbhishekHingnikar xmas tree?
 
@Wes was trying to but failed did i
the force is on the other side
 
user652649
haha i knew it
 
i am an asp.net developer... does anyone know how to get the value of hidden field which is in repeater in javascript
 
@RonakBhatt nope..
but we know how to get a value of feild in javascript
 
10:58 AM
that i also know...
using cssClass i can get that.. but the problem in hidden field is that it dosent contain Cssclass
 
0
Q: Facebook app - Javascript SDK, Getting the user id or e-mail of the page owner in which page tab app is added

DaniI'm working on Facebook app, javascript sdk, C# SDK, Developed a Facebook app as page tab. The user can add the tab to their page. Once the tab is added to the page. The user who adds the tab to their page ie., the page owner becomes admin. Whoever adds the tab app to their page becomes admin...

 
 
1 hour later…
12:13 PM
Is it a bad practice to attach extra properties to an array?
 
@JanDvorak Turns out I already have milk. Oops.
 
(non-numeric)
 
how about javascriptcoin ?
the crypto coin for this room ?
 
12:31 PM
@mikedidthis en.m.wikipedia.org/wiki/Toba_catastrophe_theory Read the genetic bottleneck theory too!
 

« first day (1175 days earlier)      last day (3767 days later) »