« first day (1529 days earlier)      last day (3419 days later) » 

10:04 AM
So how's the weather today?
 
My today's todo list is weirdo. Write a heck lot SQL and make it the best of the best. And PHP Oauth from scratch.
btw, morning everyone
@SecondRikudo oooh. cooold.
 
@SecondRikudo I am now seeing everything without the capitalization of the first letter of sentences. Everything.
 
@AwalGarg Does. That. Include. Dots?
 
@SecondRikudo dunno what you typed but as I see it, there are no capitals in it.
 
10:08 AM
WHAT ABOUT ALL CAPS?
 
They remain all caps.
 
Including the W?
 
Yes.
Only lowercase the first capital letter of sentences. Like the L in here.
This is so that if someone posts code (which is case-sensitive) or things like "WTF". They have to remain as it is.
Lemme see wikipedia with this...
!!wiki google
 
Google /ɡuːɡ(ə)l/ is a U.S. headquartered, multinational corporation specializing in Internet-related services and products. These include online advertising technologies, search, cloud computing, and software. Most of its profits are derived from AdWords,an online advertising service that places advertising near the list of search results. Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University. Together they own about 14 percent of its shares but control 56 of the stockholder voting power through supervoting stock. They incorporated Google as...
 
ok... now I see the difference.
 
10:27 AM
facing a little problem with onload...
function drawInlineSVG(ctx, rawSVG, callback) {
	var svg = new Blob([rawSVG], {type:"image/svg+xml;charset=utf-8"});
	var domURL = self.URL || self.webkitURL || self;
	var url = domURL.createObjectURL(svg);
	var img = new Image();
	img.src = url;
	console.log("URL : "+url);
	img.onload = function () {
		console.log("image onload");
		ctx.drawImage(this, 0, 0);
		domURL.revokeObjectURL(url);
		callback(this);
	};
}
onload never fires...
url log : blob:myWebsite.net/27a1b1bb-60ee-42f1-a323-c12d549cec0d
 
@Julo0sS you don't attach it to the dom
the image
 
@phenomnomnominal well, i just use it to "pass" the image data and convert it to a file, then i don't need it anymore... you think i have to attach it? i tried to do "document.createElement("img")" but same result...
 
I'm pretty sure that the load won't even happen unless it's actually inserted into the DOM
same with create element
 
@phenomnomnominal so what would be the good way to do it? just .append?
 
appendChild
 
10:32 AM
@phenomnomnominal jsfiddle.net/tj75hjzj
False
@Julo0sS blob:http://?
 
huh. Ignore me then
noob.
 
@SecondRikudo yes, createObjectURL
looks right, isnt it?
 
Joke alert I think majority of chatters in this place haven't utilised appendChild function on woman instances before.
 
sexism alert
 
@SecondRikudo it should return something else? (like base64 or? )
 
10:35 AM
No, I probably just don't know it.
 
@Julo0sS Just summing up your questions, do you want to read local files in JS?
 
@EnglishMaster no
 
I need advice regarding API capabilities.
I have an endpoint /items for item operations
GET /items will list all items, and I want to supply with search functionality
 
why not just /item?
but go on
@EnglishMaster if all your messages are trashable, please consider not posting them, or posting them somewhere else
 
10:50 AM
@EnglishMaster that was strike two
Strike three and you're out
(First one was the sexist joke btw)
Anyway @FlorianMargaine, I'm using Mongo in the backend, which is capable of more than a simple equals search
 
ah.. not familiar with mongo's search, but go on
 
And I'm wondering if there's a semi-standard way of providing these more advanced searching capabilities in a GET request
 
yes, there is
usually using query parameters
 
I mean, right now all I can come up with is &search=whatevs=dude&search=foo=bar
 
oh
why not ?filter1=dude&filter2=bar&limit=10&offset=0&filter3[]=foo&filter3[]=bar?
 
10:52 AM
But for instance, I want to add greater-than, smaller-than, array contains, etc.
 
It's difficult to evaluate if a comment that I'm about to post is trashy or not. I need a system like FML.com otherwise I won't be able to enjoy freedom of speak-out.
 
op_order=greater etc
@EnglishMaster just post things on topic and it should be fine
 
@FlorianMargaine Eh?
 
@SecondRikudo example of what you want?
 
I want to only fetch items where quantity is greater than 10
And order them by quantity desc
 
10:56 AM
?quantity_greater=10&order_by=quantity&order=desc
 
And parse the key?
 
yeah lot of ifs in your code
for each key you support
 
craploads of them :|
 
not so many actually
maybe 20 or so I think
 
@FlorianMargaine Yes many so, there are at least 50 searchable fields on an item
 
10:58 AM
ah
then
 
Multiply that by 3-4 operations on each item and you get a crapload of ifs
 
?quantity=10&op=greater&order_by=quantity&order=desc
or something like that
you get the idea
@SecondRikudo ok for you? ^
 
@FlorianMargaine Looks good
 
or maybe ?field=quantity&value=10&op=greater..
 
@FlorianMargaine Yeah I'm thinking more in this direction
Probably filter[1][field]=quantity...
 
11:08 AM
just be careful to validate the field
 
Indeed
 
I'd hold a static list of fields
in some json file for example
 
The idea is that I'm schemaless
So that kind of defeats the purpose
I don't mind users inputting nonexisting fields because mongo will ignore them
 
ah right it's mongo, my bad
 
I'll just need to make sure that non searchable fields are indeed not searchable.
 
11:09 AM
@FlorianMargaine You've become a kinda forgiving person than last time I saw you. You used to go mercilessly on trolls.
Is it due to having a baby soon (I'm just guessing here)? (getting ready to become a good-father?)
 
what don't you understand in:
16 mins ago, by Florian Margaine
@EnglishMaster just post things on topic and it should be fine
?
 
Hello, I need load vote up with LocalStorage. Any know?
 
@UlisesContreras 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.
 
@UlisesContreras localstorage is pretty easy to use, there's just a get and a set method. What's wrong with what you tried?
 
Yes friend, I have this broken.
http://stackoverflow.com/questions/3357553/how-to-store-an-array-in-localstorage
 
11:12 AM
@BenjaminGruenbaum @m59 github.com/Ralt/newerror
@UlisesContreras yeah... only strings
 
I don't know why I cannot load my +1/-1 when I refresh page.
 
the link has a correct answer, what's wrong with your case?
 
Oh, is ok? I know, I can save, but ""when I refresh page this not show my +1/-1"".
 
I don't understand what you're saying
user image
2
user image
2
the difference between best korea and south korea ^
 
in HTML / CSS / WebDesign , 3 hours ago, by Some Guy
http://theoatmeal.com/comics/north_south_korea
 
11:16 AM
I say, I save Item in localStorage, and after I do a function loadVote to show my +1 and -1 "when I refresh page".
 
@SecondRikudo well sorry I'm not in this room
 
1
Q: localStorage loadVote when refresh page?

Ulises ContrerasI have a vote up +1 one time by user, now I'm watching. I need loadVote when refresh page, because saveVote is running ok, I think of my solution is in return votes; of the loadVote function. And Where is ok the saveVote();, in the function once or after of return votes; var voteUp = documen...

 
@UlisesContreras sorry but you have to fix your english, it's hard to understand you
 
Yes, I'm so Spanish. :)
My program is about VOTE, this is ok, one vote by user.
https://github.com/ulisescontreras/Votes/blob/master/js/votes.js

I can saveVote, but I don't know show this vote when refresh page.
 
11:32 AM
@FlorianMargaine You understand me, now? :)
 
user3949359
Is there an analog of the Wordpress Milestone widget in jQuery, js?
 
@nosille That depends on what the Wordpress Milestone widget does
 
@nosille keith-wood.name/countdown.html something like that?
 
Any know show data when refresh page using localStorage?
 
Kicked @EnglishMaster
 
11:47 AM
Any know show data when refresh page using localStorage?
My program is about VOTE, this is ok, one vote by user.
github.com/ulisescontreras/…

I can saveVote, but I don't know show this vote when refresh page.
http://stackoverflow.com/questions/27342069/localstorage-loadvote-when-refresh-page
 
:20612572
`var votes = localStorage.getItem("votes");`
`document.getElementById("votes-box").innerHTML = votes;`
 
1 message moved to Trash
 
@SecondRikudo did you kick him?
Cool hat btw
 
15 mins ago, by Second Rikudo
Kicked @EnglishMaster
 
@UlisesContreras well, you can fetch/store data on localStorage when a page is refreshed simply by listening to its load event
 
12:01 PM
gtg meeting
 
@SecondRikudo Ah, thanks for that.
ttyl
 
Hi, I need help from angular js routeprovider service
 
12:27 PM
@SecondRikudo I am always fucked up whenever that guy comes :/
!!>[1,2,3].forEach(console.log)
!!>[1,2,3].forEach(dir);
 
@AwalGarg "ReferenceError: log is not defined"
@AwalGarg "undefined" Logged: 1,0,[1,2,3],2,1,[1,2,3],3,2,[1,2,3]
 
Good morning
 
ok...
Why does this not work in chrome console? :(
^^^
 
@AwalGarg "ReferenceError: dir is not defined"
@AwalGarg "undefined" Logged: 1,0,[1,2,3],2,1,[1,2,3],3,2,[1,2,3]
 
console.log.bind(console)
 
12:33 PM
@FlorianMargaine I know... but why does this not work?
 
Because this
 
@FlorianMargaine then why does replacing console.log with dir work?
 
In console. Type [1,2,3].forEach(dir)
 
Gotta go, sorry
 
12:36 PM
later
 
12:48 PM
Hmm, got it. The console api documentation describes that dir is ultimately bound to the console object. So it would work anyways.
I wonder why they didn't do this with the log function :/
 
Go do the challenge people
I just did, sort of :D
 
which means, instead of console.log, I can use the shorter word dir everywhere... (but it only works in console) :(
 
Took me around 30 minutes, was fun, I'm far from knowledgeable in go now but I know it at least a bit better.
 
well, useless.
 
ASR
can any one tell me meaning of this
objJsonObject:....{"objJsonArray":[[10147,"Organization User"],[16883,"Site Admin"],[18139,"Student"],[18146,"Parent"],[18153,"Faculty"],[27701,"SchooloneSt‌​udent"]]}
 
12:54 PM
@AwalGarg {"objJsonArray":[[10147,"Organization User"],[16883,"Site Admin"],[18139,"Student"],[18146,"Parent"],[18153,"Faculty"],[27701,"SchooloneSt‌​udent"]]}
 
Go is pretty fun
 
Coworker downloaded a virus and sent it to everyone in the multicountry company
Big round of applause
 
I assume coworker is no longer a coworker?
 
lol
 
People here download viruses pretty consistently. Blows my mind.
 
1:00 PM
@BenjaminGruenbaum go has no semicolon :(
 
I don't get the fuss about Go :P
 
@BenjaminGruenbaum I think everyone loves it because of the savvy logo
So gopher. So chic. So design.
 
Oh hi HostileFork
 
Happy holidaze
Red 0.5.0 released if you ever are getting tired of this...Javascript, and want to join the rebellion. :-)
 
Oh cool, you have objects
 
1:10 PM
Compiled or interpreted
Demo to large famous investor just a few hours ago, so fingers crossed, but no promises of course
 
@HostileFork I won't use a programming language that is a misspelling of my programming language.
 
@KendallFrey Many Erd users have felt the same way.
 
Erd?
 
It may be an irreconcilable difference.
Oh. You don't program in Erd? What did you mean, then?
 
REBEL
 
1:15 PM
kek
 
That's bad SEO
Red is incredibly bad SEO, the main reason I'm trying to keep Rebol alive :-)
"objects in red" ... dangit... ah, heck "objects in rebol"
 
I don't really care about SEO, since I never need to use a search engine
 
This is my keyboard
user image
5
 
noob
I only use one key
(There's a subtle REBEL reference in there)
 
Oh, you actually are the person who made REBEL.
 
1:21 PM
;)
 
@KendallFrey Well I made Rebmu
 
does it have regexes?
 
@KendallFrey It has PARSE and is homoiconic.
 
homoiconic like justin beiber?
 
@BenjaminGruenbaum I'll review your code when you push it and I have some time
 
1:25 PM
@Mosho In someone's universe, Bieber is iconic, perhaps.
 
I've seen very non idiomatic code in the repo ftr
 
hey all, I have a technical css problem I can't seem to figure out. would you mind taking a look? stackoverflow.com/questions/27620851/…
 
@kenhimself 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.
 
iConic - Orbit different
 
@Mosho Assuming you were making a joke, but Homoiconicity is a technical term.
 
1:27 PM
Lisp is a famous homoiconic language
Does red provide macros, which homoiconicity easily provides?
@HostileFork
 
dammit I suck at userscripts!
 
@HostileFork ELI5
 
@HostileFork uuuh yeah that's a parser... But it doesn't run at compile time to generate code using thus syntax, does it?
 
nvm
 
1:34 PM
anyone here have any experience with opengl?
 
@FlorianMargaine Looking for good links, but what can be achieved at compile time vs runtime varies. The trick is to compile what you can, and jit-compile what you can't compile ahead of time, and embed an intepreter runtime for what remains.
 
@SecondRikudo I am wondering if I would ever revert from this or not. But I am trying to access a lot of proper reading material today... It is a bit "new", but I haven't yet encountered something that makes me want to revert.
 
@FlorianMargaine It's all over the factory floor, but you can download it and use your imagination for what it might be able to become. I think it's an interesting vision and enjoy participating.
 
1:52 PM
Charge a one-time fee of $0.01 or a similar, trivial amount for the privilege of asking questions, accepting credit card only (also grant that privilege to anybody earning 100/200 rep with answers). Extend question-ban to ban every account associated with that credit card, and blacklist the card number to disallow future account creation. Way harder to get a new credit card than a new OAuth ID. If the quality problem still persists, raise the price of asking questions. — l4mpi 4 hours ago
Yea, require a credit card to ask on SO. Good idea -.-
 
So egalitarian. So libertarian. So Visa.
 
@Cerbrus It's a shame that it isn't easier to pay for things online
 
@Cerbrus wat
probably hold all reputation from answers until a question is established to be a "good" question (by it passing the triage queue), according to the SO standards? — Awal Garg 2 mins ago
Do I make sense?
 
@Neil: here in the netherlands we have iDeal
Easy payments online
Directly handled by your bank
@AwalGarg: Bad idea
Plenty of questions don't get votes
 
@Cerbrus I meant, via the triage queue.
 
2:00 PM
@Cerbrus It can't be more simple than say paypal
Even paypal is painful to use
Fine for buying games, but for 1 cent
 
@Neil: it is
You do your basic online shopping, select "iDeal" as payment method
Login to your bank account, enter a validation code you get on your phone, and the payment's done
 
paypal is nice, but in my country, paypal can't hold funds. RBI doesn't allow so. And we can't pay from paypal online, we have to link it with a bank account.
 
@Cerbrus That's the kind of hassle you get with paypal :P
@AwalGarg Even in america paypal has to be associated with another bank account
But maybe that is only because paypal wants to be able to have a backing authority for purchases
 
At least iDeal requires something like a phone or a hardware token
 
@Neil can you pay from paypal directly, online? Because I can't.
 
2:06 PM
And to use paypal, I have to add money to it
with iDeal xD
 
@AwalGarg It's been a while since I've used it, but last time I tried I could
It is kind of a hassle to setup right though
 
yeah, in India, we can't.
 
It's always tricky when companies try to handle money
There's a lot of legal muck to wade through
 
hey :)
 
A lot of games have to add policies to prevent people from selling in-game items for real currency
 
A_l
2:08 PM
I have a constructor like
function Constr(){
this.value=3;
}
I want to call inside this function to another function that change also the object 'this'
how can I do this cause if I call to a function inside this function the this will be different
 
The risk otherwise is that someone launders money with expensive items in the game that can be liquidated later
 
@A_l Depends
 
A_l
function Constr(){
this.value=3;
num();
}
function num(){
this.number=5;
}
 
Why will the function modify this of the object?
Is it a method on the object?
 
what
You don't change this like that... ._.
 
A_l
2:10 PM
so how?
 
!!tell A_I format
 
@A_I Format your code - hit Ctrl+K before sending and see the faq
 
A_l
OK
 
how can I push values in array with named keys ? like (array.push(["name"=>"julos","id"=>"1"])) ?
 
1 min ago, by Second Rikudo
Why will the function modify this of the object?
 
2:11 PM
!!tell Julo mdn Object
 
@Julo0sS There are no arrays with named keys in JavaScript
Those are called objects.
 
A_l
because I want to make an object
 
oh no, wrong link
 
A_l
make an object that have constructor
 
2:12 PM
Okay, let's take it a step back
 
function modify() {
    this.value = 42;
}
function Obj1 {
    this.value = 12;
    modify();
}
assert(new Obj1().value == 42);
You mean like this?
 
@A_l What are you trying to do?
 
A_l
yes
@second I want to create an object by consructor that will conatin properties
 
What do you guys do to remove all console.logs from your code, when pushing it to production? Just manually?
 
@AwalGarg I don't have console.logs in my code
 
2:14 PM
function modify() {
    this.value = 42;
}
function Obj1 {
    this.value = 12;
    modify.bind(this)();
}
assert(new Obj1().value == 42);
 
At least, not ones I intend to remove later.
 
I typically remove console.log the second I'm done with them
 
This will work, though I'm not convinced this is a good idea
 
It's not
 
A_l
so how can I do this?
 
2:15 PM
Which is why I'm asking, what are you trying to do??
Don't tell me "how" you're trying to do what you're doing
 
3 mins ago, by Second Rikudo
@A_l What are you trying to do?
 
Tell me what you are trying to do
 
A_l
OK OK
 
A_l
create an object by constructor (using new) that this pbject will have some properties
that I initialize in the constructor
 
2:16 PM
No, that's how.
Take a step back.
 
He means to say, fill in the blanks: I want to make a program that ______.
 
Yes ^ thanks
 
@SecondRikudo I have some of them scattered around just to ensure my code is doing what I intend, and to identify any possible edge case.
 
@AwalGarg That's what tests are for.
 
@Neil inb4 "that creates an object by con...."
 
2:17 PM
If anyone has any clue about this...
-1
Q: Custom Facebook login button not working

Rahul DesaiI know this question has been asked a few times earlier but the solutions (most of them answered in 2010 - 2012) did not work for me. I guess this is because Facebook has changed something at their end. The problem is that the login popup is opening onLoad and the browser is blocking it, there i...

 
@AwalGarg ;)
 
@SecondRikudo I am too lazy to write tests :P
 
@AwalGarg You suck.
 
xD
 
@SecondRikudo i did it from php to js, with json_encode(["key"=>value,"key2"=>value2]); i'd like to do this within js... no "easy" way to do this, like php way?
 
A_l
2:19 PM
@Second this is what I trying to do.. :) the program does not do something spacial
I have to create an object by constructor that contains some properties
 
@Julo0sS var obj = {key: 'value', key2: 'value2'};
 
so this is where we have arrived. PHP way is the "easy" way, and JavaScript way is the "difficult" way.
 
@AwalGarg no, just meaning that php is the "way i know" ^^
@SecondRikudo thanx
 
@A_l You are perfectly capable of doing so without creating a sophisticated system like you described
 
I have tried to push myself a lot, and get started with writing tests... but, I just feel it would be a waste of time :( I just try to make the code as simple as I can. Any tips?
 
2:27 PM
@AwalGarg They say writing code is 90% thinking and 10% actually typing it up
Writing the unit tests helps you form an idea about what it should do based on what inputs it gets and what is the expected return amount
 
I wrote a test. Once. But it was at the backend. It passed, nothing else. I knew it would pass, because I wrote the code, and I knew it would work.
 
It is a good habit to get used to test-driven development
The test helps you later, not when you write it
 
@Neil those tests are also "code", right?
 
@AwalGarg Well it can be, conventionally yes
 
@Neil so the same thing applies to those "tests" as well? Write tests for tests?
Or I am missing some point? :(
 
2:29 PM
@AwalGarg Wait wut?
You write the test that defines what you expect a method to do
Initially when you write it, the test should work. As you make changes to the program, if the test is written correctly, it will tell you whether or not what makes a method "work" has changed according to your new modifications to the program
 
@A_l Is this for homework?
 
In other words, as the idea in your head of what the program should do changes, the tests remind you of that your original requirement wasn't that
Thus you either fix the test or you fix the program according to which is "right"
 
@Neil hmm, May I pull in a real word example?
 
@AwalGarg ok
 
Say I want to write a method for smoothscroll.
The way I would do it is write some comments which are essentially pesudo code.
And then convert that pseudo code to real code.
And run. It works. Cool.
Now do I need to replace the pseudo code with tests?
 
2:36 PM
No, if you're doing test-driven development, then the test already exists before writing a single line for smoothscroll
 
So I write test, then write pseudo code, then write code... now run the tests? But I still don't see the need of tests here. I have that pseudo code which framed the idea for me, and also works as a guide... no?
 
@AwalGarg Write tests, run them, they fail. Write code, run tests, make them pass. Refactor code run tests again. Write tests, run them ....
 
@SecondRikudo u on miaou
 
@darkyen00 link plz
 
o_O ?
i pinged
 
2:59 PM
I have to do some stuff on a collection, i'm doing it with .each, but in this stuff, i have to make a $.ajax... I don't want to set async false... is there any other way to do that pls?
 

« first day (1529 days earlier)      last day (3419 days later) »