« first day (1629 days earlier)      last day (3305 days later) » 

12:02 AM
@SecondRikudo @Shmiddty @OliverSalzburg it has begun
 
Every time someone uses <h1>&nbsp;</h1> as a clearfix somewhere in the world @SomeKittens die.
 
12:22 AM
@Obvious I am.
I know knockout quite well. I use it daily and have for over a year.
 
12:39 AM
some major changes in dark theme:
- color selection is now in the user popup
- in chrome://extensions there is now a options page for you to select the border positions.
- the options page will continue to grow
- options are stored in chrome.storage so will sync between computers (color selection will be next)
permissions did have to change for this, so you will likely have to re-enable the script at some point.
v 0.0.3.1
 
12:58 AM
Can someone explain why HTML forms automatically submit?
 
@metal.slime.angel 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.
 
@metal.slime.angel what do you mean?
i've never see one do that without some js
 
I have an HTML form that has a "onSubmit="runfunction()"
 
^ that's why
 
In the function, there is a document.getElementById(id)
Wait, why would that autosubmit?
 
1:00 AM
that alone wouldn't but it's a start
go on..
i bet the story ends with a return true;
 
ok, so I print a js string to my HTML <p> tag using the getElementById
Lol no
And the print stays on the page
For three seconds
Then the form and the <p> tag refreshes itself
 
jsfiddle please @metal.slime.angel
 
Uh... What's jsfiddle?
 
find out and setup one
 
1:10 AM
Automatically submit when the page loads or whn you hit enter?
 
When I hit enter
Or, more specifically, three seconds later
So it submits once, then again three seconds later
Also, jsfiddle is giving me issues
That's supposed to be my code lol
 
0.0.3.3 is published!
everything is now in chrome storage
 
because fuck you sem-ver?
 
because chrome
 
1:23 AM
the docs 'recommended' 4
 
same thing i said
but then if they reccoment, you could just fuck it and use a single number as a version
 
I probably could
next major update I will .. maybe
basically that means dropping the first 0
it is meaningless
 
@metal.slime.angel change the type of the submit input to type="button"
 
Uh, actually, I added a 'return false' in the onSubmit="createperson()" method
 
that cancels the submit.
so you want createperson called when you hit enter, but not the form submit?
or just when you click the button?
 
1:36 AM
idk, but it worked, and I'm too tired to figure it out. I could change the '<input>' to be a button, and say 'onClick="createperson()' but I'll just stick with what works
 
That sounds like what you want.
 
Wait, if you '.push' an array into another array, does it come out as a nested array, or does it push each value?
 
nested.
 
!!> var a = [1,2,3]; a.push([4,5,6]); a
 
@KendallFrey [1,2,3,[4,5,6]]
 
1:45 AM
Thanks.
 
that feature is so useful in this room
 
!!> var a = [1,2,3]; var b = a.concat([4,5,6]); b;
 
@phenomnomnominal "ReferenceError: assignment to undeclared variable b"
@phenomnomnominal [1,2,3,4,5,6]
 
fuck you strict mode
 
the fact that .concat() returns a new array is troublesome
 
1:51 AM
I love the internet
@Luggage Why?
 
just because you can't use it like push. If you only have a reference to the array you want to modify you might noth be able to use it.
 
@Luggage well, what if you have a reference to the array and you don't want to modify it?
 
true.
 
If you want a good explanation of why immutability is a good thing, use Three.js for a few days.
 
push and concat both have caes where you'll prefer the behavior of the other
 
2:02 AM
but in almost all those cases, the immutable approach is trivial to use in a mutable situation
just assign the array
 
Does Three.js doing somethign unsavory?
 
very
it takes two lines to copy a vector, FFS
 
I've only done 3d graphics in non-JS languages, but mutating state is mandatory for performance
as opposed to creating new objects 30+ times per second
 
You shouldn't be using objects in the first place
value types
 
objects = blocks of memory
 
2:06 AM
well you shouldn't need to allocate new blocks of memory
 
i didn't.
nevermind, i'm not sure we're talking about the same thing :)
 
2:26 AM
ahhoy nettlegems
 
Why does var string; return "undefined" but var string =""; return empty?
 
because a var statement returns the assigned value
 
So by default, every string looks like var string = "undefined'?
 
no
var a; <- you didn't define anything;
undefined.
 
2:30 AM
no, you declared a. it isn't defined.
 
But if I don't initialise a, it equals "undefined", which is a string. If it was truly undefined, it would return a null character, no?
 
because the result is calling .toString()
it is actually undefined
 
Ahh. Got it.
Is it possible to print something like "Hello \n World \n" to a single <p>?\
I tried, and I got it all on one line
 
!!>function bla(n) { return n*n }
 
@CSᵠ "undefined"
 
2:40 AM
how could a func declaration return something else?
 
html doesn't use line breaks, it uses <br>
unless, it's inside a <pre>
 
or textarea>
 
if we abstract "text" based programming into something higher and more efficient,
what would it be?
 
coffeescript (ducks)
 
@CSᵠ You can't return something from a declaration
 
2:43 AM
Is anyone here experienced with JS coupon code validation?
 
@Luggage Then can i do "Hello <br> World <br>"? in js?
 
@StevensHaen In a word, "Don't"
 
coupons? to get discounts on arrays?
 
@SomeKittens It will use SHA-512 encryption
 
If you've got a "Coupon code" input, the first thing all your customers will do is google "$SITE coupons" and find either nothing or invalid codes.
not a good customer experience.
if you want to give discounts, use GET params and set a cookie
@StevensHaen SHA-512 isn't encryption, it's a hash function (but I'm just being nitpicky)
 
2:45 AM
Just tried, "Hello <br> World <br>" is valid. Is this what HTML injections look like? lol
 
@SomeKittens Will consider
 
@metal.slime.angel no, it's just html. html that's created by JS or changed by JS, but just html.
 
@metal.slime.angel A) No need for lol at the end B) Not sure what you mean by injection. Are you talking about XSS?
 
I think it was a joke, but I'm not 100% sure. :)
 
This is exactly what they want from me:
"after entering the code js is checking the code if it's matching; if the result is ok coupon code is accepted; if not you should display error message,
coupon will change the price of ticket (I don't know the price yet, but it should just be smaller), you have to cross current price and show new one, you also have to change the price in JS script,
codes have to be stored in hashed array (SHA-512),
use crypto.js,
whe you compare code from form with the codes in array, you have to hash user input with crypto.js."
 
2:49 AM
hey
 
@StevensHaen rly??? how can one be experienced in that
!!>var bla="declared";
 
@CSᵠ "undefined"
 
@SomeKittens ^
 
@CSᵠ It's ambiguous. I don't know what to compare the code to
 
validation @StevensHaen
 
2:50 AM
@StevensHaen Who is "they"? That just sounds weird.
but if you've got a client, they're the boss.
 
@SomeKittens let's say "they" are an employer.
 
Well, I can talk your ear off about hashes
which kinda make sense in this situation, except not at all. Are they expecting client-side validation?
 
@SomeKittens That's a good question. I guess yes.
 
js can be server side
 
!!>bla="asdf";
 
2:52 AM
@CSᵠ "ReferenceError: assignment to undeclared variable bla"
 
it's a homework assignmwent for a job, they just want proof he can program himself out of a wet paper bag
 
damn strict
 
@Luggage The purpose of hashing would be to obfuscate the actual codes.
@Luggage ah, ok
so this is more of a "strut your stuff" thing (and thus all my comments about security and customer happiness are moot)
 
@SomeKittens I have to come up with something.
 
That's my assumption.
 
2:54 AM
hmm
 
It sounds like they want your to store an array of codes to check. You store just the hash of the code (like passwords are stored)
and then when a code is entered, you hash that and check the list
 
@Luggage <mutter>Passwords shouldn't be stored with SHA-anything</mutter>
 
!!>function bla(n) { return n*n }"declared"
 
@CSᵠ "declared"
 
@Luggage I don't know what to compare the coupon to
 
2:56 AM
!!>function bla(n) { return n**n }"declared"
 
@CSᵠ "SyntaxError: expected expression, got '*'"
 
@StevensHaen Do you know how hashing works?
 
@SomeKittens not exactly
 
there, that works
 
What's wrong with sha for passwords?
 
2:57 AM
@StevensHaen lemme give you the overview - Hashing is a way to take some data, and turn it into different data (most importantly, it's nigh impossible to take that different data and figure out the original data.
A really simple hash function would be to sum all of the digits in a number
 
@SomeKittens Well, this much I actually know
 
1642 => 1 + 6 + 4 + 2 => 13. You can figure out the hash easily, but it's impossible to go from 13 to 1642
@StevensHaen Ah, cool. Where are you stuck?
 
@SomeKittens I don't know what to compare the coupon to, how to validate.
 
@SomeKittens s/impossible/hard(or very hard)/
 
1. Hash it. 2. Search the array for the same value
 
2:59 AM
you should just send it to the server via XHR, get a boolean return
 
@CSᵠ Given the collision-full nature of my hash, I'd say impossible.
 
don't say that please
trying to fight my ocd now....
 
@CSᵠ Have you been diagnosed with OCD?
 
i'm affraid to go ask
 
s/OCD/Pedantic nature/
 
3:01 AM
@Luggage Speaking of pedantic nature, you forgot the trailing slash
ah, ninja edit
 
people undersell the obsession and the compulsion of OCD
 
Hah, beat you (according to my screen).
 
damn, if i zoom in, i can't stop, sometimes i shouldn't zoom in but yet i do
sounds ocd, quacks ocd, must be ocd
 
@Luggage So I have an array of coupon codes?
 
sounding more lsd
 
3:02 AM
@CSᵠ That doesn't sound like OCD at all.
 
good! what does it sound like?
 
@StevensHaen According to the instructions you posted, "codes have to be stored in hashed array (SHA-512), ".
 
I'm assuming it means "Array of hashed values", not hashing the entire array
 
hash all the values, then hash the resulting array. Then do it again
super secure you guys
 
No, don't do that.
:)
@StevensHaen How are you to turn in this assignment?
 
3:06 AM
@Luggage pardon?
 
@SomeKittens what i mean is, there are a lot of reversed solutions to your key(13), and are easily computed, but i won't know the one you sent unless i bruteforce send each of those
 
What's the end product here? A .js file that you email to someone? what?
 
@Luggage it's a already coded page that I have to add a coupon input field in and make it validate
 
@SomeKittens Call to action: I suggest we perma-pin the Developers, entrepreneurs and depression talk.
 
@Shmiddty what's that talk? link?
 
3:09 AM
It's pinned already. I'm just suggesting we leave it pinned permanently. Sticky it, if you will
 
damn, not an eye catcher :P
 
Yeah, we may need to do something about that
 
queued
 
But I think everyone should watch the video when they get a chance
 
has some big names...
 
3:12 AM
room topic changed to JavaScript: Boycotting April Fool's day.: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | WATCH: Developers, entrepreneurs and depression [cereal] [david-programming] [ecmascript] [es17] [javascript] [we-so-excited]
room topic changed to JavaScript: Boycotting April Fool's day.: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | WATCH: Developers, entrepreneurs and depression: vimeo.com/78419167 [cereal] [david-programming] [ecmascript] [es17] [javascript] [we-so-excited]
@Shmiddty there you go
 
!!urban david-programming
 
@CSᵠ No definition found for david-programming
 
Good thinking!
!!afk night timing baby
 
So whats the best strategy for StackEgg?
 
@Sam7 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.
 
3:22 AM
@Sam7 hitting reset over and over
 
@rlemon Cool. I'll look into how to implement the quick-bar when I get a chance
 
I just downloaded Google's cryptoJS and it has 2 folders and around 50 files.
 
@StevensHaen Yeah, I wasn't sure if they wanted crypto.js or node's crypto module
 
Do I import just SHA-512?
 
My work's been with node's crypto, so I can't help you with implementation specifics.
where are you applying?
 
3:29 AM
@SomeKittens Not sure what you mean. I have to do this coupon code thing.
 
@StevensHaen oh, I thought this was a work-sample thing for an interview?
 
What are "rollups"?
@SomeKittens It's a real task
 
@StevensHaen for college?
 
@SomeKittens For work
 
don't worry, we won't insta-ban you if it's for an interview, etc
!!kerbal or cryptopals
 
3:32 AM
@SomeKittens cryptopals
 
aw, but I just started KSP
@StevensHaen In what context?
 
@SomeKittens I have to validate a coupon code via comparing to an array of hashed ones
 
!!urban rollups
 
@SomeKittens roll up to arrive
 
oh
So, the archive I downloaded has 2 folders - components and rollups
Which SHA-512 should I import?
I'm looking at them right now and they clearly differ
@SomeKittens Which one should I go for?
 
3:51 AM
Whichever one works in the browser?
 
4:04 AM
@SomeKittens Now I have the script imported. How do I go about hashing the input with jQuery and how do I make the array of hashed codes?
 
you don't hash it with jQuery, you hash it with the crypto library
you can get what the user typed in with jQuery, though, $('#couponInput').val()
 
@Luggage That's what I meant. How do I pass it to crypto via Jquery/
 
I don't know. read the instructions for the crypt library.
 
@Luggage davidebarranca.com/2012/10/…. In here they mention the rollups come with core.js. Do I have to import the rest however?
 
never used it
 
m59
4:52 AM
@Mr_Green Not trying to rep whore, but stackoverflow.com/questions/29248116/…
accepted answer doesn't even answer your question (there's no watch behavior). It's also technically wrong.
 

« first day (1629 days earlier)      last day (3305 days later) »