« first day (1539 days earlier)      last day (3412 days later) » 

8:08 PM
@KendallFrey Working code isn't always necessarily the "best" code. New technologies provide different benefits. :) Making intelligent and informed decisions is what really matters.
 
@Shmiddty working code is always better than non-working code
 
@KendallFrey True, I don't think anyone would argue that point. However, that doesn't mean new code should never be written
 
WHOOOOOOOO, Just got preapproved for a 20k vehicle loan. Booyes bitches
 
user1596138
Hmmmmmmm
 
I'm gonna try getting it switched to a ford fiesta so it's not gonna be 20k, but I'm just glad I was even approved lol
 
user1596138
8:17 PM
I'm hit with the dilemma of using negative numbers in JS
 
what's wrong with using negative numbers?
 
that's not a dilemma, it's just a single bit flag
 
user1596138
Ya know what I'm just gonna wing it and see how it works out
 
I try to avoid using -1 as a flag, but sometimes you jsut can't get around it
 
user1596138
Yeah it was the application of it. I can't really word the question right right now
 
8:18 PM
because 0 can be a value
 
What if all integers are valid?
 
then Number.isNAN or whatever it is?
or something
 
pi :)
 
user1596138
Like a crankshaft in an engine would revolve between -180 and +180 degrees
 
I am trying to use the solution from the top answer in this post, and it is not working as expected.
2
Q: Angular js - isImage( ) - check if it's image by url

sbaaaangIs it possible to check if by a given url the image exists and it's an image resource ? for example: angular.isImage('http://asd.com/asd/asd.jpg') Or it's just a stuff for the server side ? NO JQUERY please i'm not using it

I will explain a bit.
 
8:19 PM
@Jhawins ooh, modular arithmetic
 
!!>Number.isNaN(Math.PI)
 
@NickDugger false
 
I am adding a chat pane to a page that is powered by AngularJs. I want URLs that are images (but not necessarily have the image extension in the URL) to be put into a dynamically created img element.
 
why is PI not a number?
 
it's not
> false
 
8:21 PM
@BenjaminGruenbaum I may have gone a bit overboard with the challenge suggestions...
 
my life is a lie
 
@Zirak maybe :D
 
your life is cake
 
!!>Number.isNaN(3.14159)
 
@NickDugger false
 
8:21 PM
I have other code that is handling URLs that are not images, turning them into links, but when I run the page, no matter what the link is, it is always interpreted as not an image.
 
user1596138
@KendallFrey yes
 
cake == lie
 
@NickDugger How is it not perfectly obvious that pi is a number?
 
because I'm dumb as fuck
 
8:23 PM
@BenjaminGruenbaum I only really like the one I just posted. The other two were meh.
 
@Zirak which?
 
pi is a real transcendental number
 
0
A: JS Room Monthly Challenge January

ZirakRuby Task: Write an http exploration tool. Input is something like this: GET http://api.openweathermap.org/data/2.5/weather?id=2172797 Output: { "main": { "temp": 299.552, "temp_min": 299.552, "temp_max": 299.552, "pressure": 1004.77, "sea_level": ...

 
cool
will read soon :)
 
ohai
 
8:24 PM
It's a project I wanted to do for some time. Now, people may do it for me!
 
holy crap, what if pi is completely arbitrarily defined for our universe? What if pi would be, say, 2?
 
New question, if a value can be null, undefined, NaN, or anything falsey, but you're looking for an integer, Number.isNaN(null) === false so how do I check if it's a number? This should be common sense, but I'm having a brain fart
 
NaN is Not a Number
 
yes
 
If it's not nan, it's not not a number
First not cancels the second not, resulting is: If it's not nan, it's a number
 
8:26 PM
if it's not not a number? if it's a number?
wat
logic
 
user1596138
!!> isNaN(Math.PI)
 
my brain
 
@Jhawins false
 
@Zirak If it is NaN, it's still a Number.
 
javascript y u so javascripty
 
user1596138
8:27 PM
!!> val = Math.PI; isNaN(val) && isFinite(val)
 
@NickDugger maybe Number(n) === n
 
@Jhawins "ReferenceError: assignment to undeclared variable val"
 
user1596138
Psh strict
 
Since when is eval in strict mode
 
user1596138
Idk lol oh well
 
8:27 PM
@KendallFrey makes sense, actually
 
@NickDugger How is it to do with javascript?
 
@Zirak since fuck-you-o-clock
 
how many times must I tell you guys, I'm dumb as fuck
 
You calling fucks dumb?
 
totes
 
8:28 PM
Just think of the people that hired me
I'm glad they don't know that I'm so dumb
 
user1596138
One of you guys suggested isFinite(String(val))
 
user1596138
And I remember I had to go quickly but there was screaming
 
sounds like diarrhea
 
user1596138
You're poop
 
It's a bit trickier than that. Is Infinity a number? Why not? Also, why the String call?
 
8:31 PM
actually, I'm scientifically food - poop
 
isFinite calls Number anywhoo
 
hi all, does anybody know how to use this plugin jqueryvalidation.org/remote-method, how to build the customize the request
 
> isFinite(you.mom)
> false
 
if I add in the success call everything gets validated, even though I return false
 
user1596138
@zirak exactly it calls it anyway
 
8:33 PM
any help would be appreciated
 
user1596138
Idk I was only asking because I remember not hearing the reasoning whoever it was had behind it
 
how do you represent infinity in programming?
 
Whadya mean?
 
Well now we're getting into physics or something... is infinity a number?
 
That's a very good question
57
Q: Is infinity a number?

PopsIs infinity a number? Why or why not? Some commentary: I've found that this is an incredibly simple question to ask — where I grew up, it was a popular argument starter in elementary school — but a difficult one to answer in an intelligent manner. I'm hoping to see a combination of strong citati...

It has some fancy words in the lists, you can skip them and still understand what he's saying
 
8:40 PM
I wish I had a higher IQ and was good at maths...
 
You know, you're constantly dissing yourself, but haven't shown the corresponding level of stupidity yet.
 
Some might beg to differ, I'm sure
 
@NickDugger In physics, infinity traditionally doesn't exist
 
Nah, I just understand that everything is a process of learning new things. I am always learning new things and seem to always be many steps behind everyone else in this room
@KendallFrey was physics the wrong term, then?
 
maybe?
 
8:46 PM
@someoneSmarterThanMe please help me understand the universe
 
Math is a hack, and that's the truth
It's a bunch of made up rules designed to match what we observe in nature
 
I can't even do long division
 
I barely can either
since when is long division useful?
 
Since when is anything computers can do trivially useful?
 
They never properly taught me in elementary school, and after then, they just thought you knew it, so they moved on
 
user1596138
8:48 PM
Sometimes social media reminds me of just how stupid 9/10 people in my area are... Everyone is freaking out over ecig regulations and saying "big tobacco" is trying to eliminate ecigs so they'll buy cigarettes...
 
what if we get hit by a massive EMP?
 
We'll still have math
 
@NickDugger What if you got hit by a flying ice cream truck?
 
yes, but not computers, which is why long division will be useful
@SomeKittens I did
 
@NickDugger Even when I do math by hand, I don't do long division
I do algebra mostly
 
8:50 PM
I can't even do algebra... I never understood math until I learned programming logic. Now I understand it a lot better, but I can't go back and take those classes
 
user1596138
@NickDugger khan
 
take some personal time and learn algebra
it's tremendously useful
 
is khan any good?
 
> 6. Instead of asking the waiter how the chicken is, he says, “What’s your poultry story?”
 
8:52 PM
@NickDugger in my experience it's extremely slow
 
slow to learn?
 
yeah
But it might depend on the course
 
Any other resources worth looking at?
 
Just inhaled saliva and swallowed air. You had one job, throat #dying
 
This looks neat edx.org/course/…
Seems high school level, that would be a perfect intro for me
 
8:57 PM
When I was stuck with differential equations I found the dummies book extremely useful, I could learn everything I didn't learn in class in less than a week.
If you find the videos slow, get an easy to read book.
 
@NickDugger Khan is pretty good
It is a bit slow, though. Very useful when the concepts are very difficult
 
user1832583
Hi, I am trying to retrieve JSON data with a XMLHttpRequest but I get errors like "Same-Origin Policy", but looking around on stackoverflow questions, it appears people are able to retrieve the data using JQuery. Is their a native JS solution?
 
has anyone here used edx? I found them a while ago, and they do have an upcoming algebra course...
 
I usually watch them at at least 1.5x the speed
(Khan)
 
9:00 PM
I've used EdX, but every course would be different, so can't be of much help there
@coding_corgi jQuery can't do anything that plain JavaScript can't do
 
user1832583
@SomeGuy That's what's confusing me
 
@SomeGuy jQuery can solve the Halting Problem
 
What are some common things you guys check for when Cannot set property 'onchange' of null is thrown. I make sure the script is loaded below the html which is using it. That about it...
 
depends what is null
 
user1832583
@SomeGuy On some of the questions I found on SO people said a browser extension would allow you to retrieve data from another host, but I still got a Same-Origin Policy error
 
9:06 PM
@coding_corgi Greasemonkey is a browser extension that can do that
 
@coding_corgi Why are you trying to get around same-origin policy?
What are you trying to do?
 
user1832583
@SecondRikudo I am trying to use the Bing Maps REST API
 
Given that I use the Bing API for my apps, I know for sure that they have proper Allow-origin headers.
 
(Although admittedly I don't use the Maps API specifically)
@JanDvorak That's long. Time?
 
user1832583
9:08 PM
@SecondRikudo So is it possible?
 
@SecondRikudo near the beginning
 
@Zirak What did you do to learn Go? (i.e. tuts suggestions)
 
@coding_corgi There shouldn't be a same-origin problem with bing's API
 
(also cc @BenjaminGruenbaum )
 
@SecondRikudo 0:10
 
9:09 PM
Yeah, I saw :P
 
user1832583
@SecondRikudo Let me try it again, I'll tell you the error
 
Please do
Although I may be mistaken, like I said, never tried the Maps API.
 
@BenjaminGruenbaum 10/10 would click again
 
do you have to do memory allocation in Go? I know hardly anything about it
 
9:12 PM
@SomeKittens I didn't really learn Go tbh. Blazed through tour.golang.org once, revisited sections of it over and over, coupled with reading the sources of the libraries I was using (goquery and tablewriter)
 
Any self-respecting language will spare you from that
 
user1832583
@SecondRikudo Ok, I'm using the Geocoding REST API
 
@SomeKittens the golang tour is pretty good
 
Interesting. in chrome, n/0 === Infinity, but I'm reading that it doesn't make sense for it to be infinity
 
9:15 PM
@coding_corgi Yeah, I don't see the appropriate headers there.
 
@FlorianMargaine I was looking for stuff post that.
 
@NickDugger also in C, Java, Python and any other language with doubles.
!!> 1.0 / 0
 
@BenjaminGruenbaum "Infinity"
 
!!> -1 / 0
 
@FlorianMargaine null
 
user1832583
9:16 PM
@SecondRikudo ?
 
@coding_corgi Okay, and what are you trying to do with it?
 
Visibly, n is limited, @NickDugger
 
user1832583
@SecondRikudo Get a JSON response
 
@coding_corgi What for?
 
user1832583
@SecondRikudo For geocoding
 
9:18 PM
@coding_corgi You're missing my point...
Let's back it up
What does your application do?
Is it a website? A server? A stand alone application? An extension?
 
user1832583
XMLHttpRequest cannot load ... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
 
user1832583
@SecondRikudo Just a .html file on my computer that I am using to test out the API
 
@coding_corgi You won't be able to do it properly.]
There are applications that are made to send API requests for testing
(Look up Postman)
 
@coding_corgi - the API supports JSONP -> http://dev.virtualearth.net/REST/v1/query?jsonp=callback_fn&key=BingMapsKey
 
@adeneo Why the hell do they support JSONP but not set the appropriate headers? That's simply idiotic.
 
9:21 PM
Many API's do that
 
user1832583
@adeneo What's JSONP
 
-1/0
-Infinity
?
 
@adeneo Why the hell would they do that? :X
That baffles me, what actual reasons do API vendors have to do that?
It's a simple matter of adding one header...
 
@SecondRikudo - They support JSONP, so they don't supply the allow origin headers needed for CORS, not that uncommon
 
@adeneo Yes, but why?
In what way is JSONP better than CORS?
JSONP is a hack to overcome CORS
 
9:22 PM
It's webscale
 
@Zirak Explain
 
And it supports Netscape 5
 
@SecondRikudo - JSONP isn't ajax
 
@SecondRikudo Just bullshitting, there's no reason
 
@Zirak That I can understand.
Although supporting dead browsers is still beyond me, but I can understand nevertheless.
 
9:23 PM
Any self-respecting API will send CORS headers
 
user1832583
@adeneo Oh, so just by changing my url it will work?
 
@coding_corgi I think it's time you did some reading about JSONP
 
@coding_corgi - Not really, unless you're using jQuery, it does all things
 
9:26 PM
@Zirak Why is that not a Stack Overflow canonical? This should be a Stack Overflow canonical.
 
@Zirak why?
A lot of APIs don't want you to consume them directly.
 
@BenjaminGruenbaum That is just bullshit
 
@SecondRikudo it's linked to as a comment as a canonical.
 
I can set up a "proxy" sort of server in under 5 minutes
 
So why are my bind once expressions being re-evaluated?
 
9:28 PM
@SecondRikudo why would they send CORS headers if they have no interest or concern with browsers directly consuming them?
 
@BenjaminGruenbaum Okay Mr. Where's Captain Obvious, any API which wants any web accessible client to access it
 
@SecondRikudo yeah - which means you usually won't be exposing your API key to the outside directly
 
In other words, any API which considers adding JSONP support
Which was the topic
 
@BenjaminGruenbaum It's an API, it shouldn't know or care who's consuming it, it should support every client that wants to consume it, given appropriate credentials.
 
Yeah, if you do JSONP you should definitely do CORS anyway.
 
9:29 PM
Don't expect too much, it's Microsoft ?
 
And abusing CORS, that's meant to protect the user from unauthorized calls from the browser to prevent clients from directly consuming your API sounds pretty horrifying to me.
I'd much rather believe it's either lack of knowledge or laziness.
 
@SecondRikudo why? There is a damn good reason the cross origin policy is there. Circumventing it by blindly sending CORS headers is the dumb and lazy bit if you ask me.
 
@BenjaminGruenbaum CORS is there so that I can't AJAX my way into your bank account
It's not a tool to be used to block certain clients from consuming your API
 
Right, or circumvent rate throttling by proxying requests through unsuspecting users on a site.
 
{{::commit.attrs.commit.author.date | timeAgo }}
Why is Batarang telling me this is still running?
 
9:32 PM
If you're stack exchange and have a 200 query rate limit and I have a site and you're exposing 200 per user I can circumvent your limit by proxying your API through my users effectively creating a bot net.
 
@BenjaminGruenbaum If I wanted to botnet you through that, I'd just submit a form to a hidden iframe
No CORS limitations.
So that argument is pretty moot.
 
@SecondRikudo how would you get the data from my API back?
 
Who cares? I only want to DDoS you.
 
No, you don't want to DDOS me, you want to scrape my entire database or bypass query limits.
 
@BenjaminGruenbaum In that case I can block you via the referer header.
 
9:36 PM
Not to mention submitting forms through a hidden iframe wouldn't work for stealing stuff form your bank account because sites have anti CSRF protection.
@SecondRikudo if the browser is exposing it, the referer header is extremely unreliable.
 
@BenjaminGruenbaum Most browser expose it by default, which means I can rely on it to catch and filter 99.5% of all requests
 
For example - if my site is in HTTPS (as plenty of sites are) the browser won't send an HTTP header.
Which means you'll filter exactly 0 of the requests.
 
iFrames are subject to the same-origin policy as well, you wouldn't be able to access the iFrame if it was cross origin
 
Not to mention rel="noreferrer" but oh well.
 
Who is Eva, and why did she send me an Algebra for Dummies book? @BadgerGirl??
 
9:37 PM
@adeneo he was making the point you can still DDOS a site, but I'm making the point you can't scrape it.
 
@NickDugger Yes
 
How do you even have my email address?
 
@BenjaminGruenbaum True enough
 
I'm saying exposing * CORS headers by default is a bad idea.
 
nevermind
it's on my profile
durr
 
9:38 PM
@NickDugger Welcome to the stalker list
 
But the Bing API shouldn't really care about those attack vectors.
 
I want a book!
 
Especially APIs that are more than likely to be used in the browser.
 
@SecondRikudo why is that? There are plenty of good reasons to scrape bing - search engines are some of the most valuable scrape targets.
 
user1832583
@adeneo I tried using the jsonp parameter, but I still get the Same Origin Policy error
 
9:39 PM
@BenjaminGruenbaum - I agree, it's a horrible idea.
 
14 mins ago, by Second Rikudo
@coding_corgi I think it's time you did some reading about JSONP
 
Exposing a JSONP API is even worse :P
 
@BenjaminGruenbaum And regardless, exposing JSONP while not exposing CORS is just plain stupid.
 
It doesn't solve the * CORS problem but it introduces a security problem if your endpoint is HTTP and not HTTPS and can be MITMd
@SecondRikudo oh, that much I agree with.
JSONP is something you generally don't want to expose unless you have to support IE7 and below which should rarely be the case in 2014.
 
@BenjaminGruenbaum - are you serious ?
 
9:41 PM
@BenjaminGruenbaum Well, it is Microsoft
 
@BadgerGirl thanks for the book. Will give it a chance
 
And there are still plenty of businesses that support IE7 because.
 
@NickDugger Try everything and see what works best :)
 
@adeneo dead serious, anything newer than that can use CORS. JSONP is less secure more convoluted version of that that's a hack around script tags.
@SecondRikudo another case for JSONP is an old API, if you built your API a long time ago CORS might have been less common.
 
user1832583
@SecondRikudo Do I need to append the request to my html body or can I use an XMLHTTPRequest
 
9:43 PM
@BenjaminGruenbaum Yes, but adding it is as simple as adding a line in your configuration...
 
@BenjaminGruenbaum - JSONP is like including jQuery from Google's CDN, it's just a script tag ?
 
And don't you dare tell me it's not that simple in all cases, I managed to do it on our crappy Java legacy spaghetti, so can they.
 
@adeneo Even lisp separates code execution from data
 
@BenjaminGruenbaum Being 60 years of age or older? ;)
 
If you want to deliver data, there's no sane reason to do it by running javascript
It's a horrible hack
 
9:45 PM
@adeneo including jQuery from a CDN is definitely something I don't actually do - all research performed by Yahoo and others indicates that most clients hits the site with a clean cache (since there are so many versions of jQuery etc) and CDNs have been compromised before or misversioned - Google is also more likely trusted than my API "foo" that runs on mysite.com anyway.
 
!!s/from a CDN (is.+ -).+/$1/
 
@SecondRikudo it's quite possible they simply don't care.
 
@SecondRikudo @adeneo including jQuery is definitely something I don't actually do - all research performed by Yahoo and others indicates that most clients hits the site with a clean cache (since there are so many versions of jQuery etc) and CDNs have been compromised before or misversioned - (source)
 
I got my first codepen pick!
 
9:46 PM
awesome.
 
Not what I was going for, but w/e.
 
@phenomnomnominal Congrats!
 
I don't know what a codepen pick is, but congratulations!
 
Also my first real codepen, but whatever :)
 
You are not as bad as I thought you were!
 
9:47 PM
cool :D
 
@SecondRikudo WHAT DOES THAT MEAN!?
 
@phenomnomnominal Congrats!
 
It means I thought you were x bad, and it turns out you were x-y bad, where y is a positive number.
 
It's like an infinite amount of cannellonis, rolling down a hill
 
This pen has a funny url codepen.io/MichaelArestad/pen/wBoobY
@SecondRikudo :(
 
9:52 PM
Anybody ever messed around with Julia before?
 
@BenjaminGruenbaum got time for an Angular question?
@Zirak Yes, until her dad kicked me out.
2
 
@SomeKittens sure
@Zirak just the tut
 
@SomeKittens I knew I should've written that inb4...
 
Seen it on HN a few times
 
@SomeKittens VERY well played
 
9:54 PM
Almost wrote an "inb4 someone hilariously interprets Julia as a female and makes a sex joke", but then thought "nah, these people are better than that". I was wrong.
 
@BenjaminGruenbaum tl;dr expression isn't binding once: gist.github.com/SomeKittens/16d7c3865b5f7d2057ca
it does bind once when I remove the filter
 
Who's TJ?
 
Coworker
 
Does he like to... party?
 
And yes, TimeAgo needs optimization as well.
The only thing I could find so far are $stateful filters, but those need to be set manually.
 
9:57 PM
@SomeKittens what version of 1.3?
 
1.3.7
 
Just for the kicks there was an issue about this 2 weeks ago - if you (for the lols) update to 1.3.8 does it persist?
 

« first day (1539 days earlier)      last day (3412 days later) »