« first day (1908 days earlier)      last day (3056 days later) » 

3:01 AM
@niceman incomplete fiddle.
and so is your description of the problem :)
 
@Luggage the autocomplete dropdown menu doesn't show, as for the fiddle I'll update it with the html code
anyway the fiddle's run won't work because the server side is here(my computer :) )
 
hello?
 
@haloyoba 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.
 
if(!query.length) return callback([
    { sample },
    { data }
]);
 
3:07 AM
am I allowed to ask question about html here?
 
@haloyoba there is another channel for that, but sure.
 
@Luggage err, there isn't that many dependencies
I mean, I added one (there wasn't any before)
 
well, more things got downloaded when i ran make.
 
thank you
my question is
 
new error now in both linux and osx.
 
3:09 AM
I updated the fiddle : jsfiddle.net/0u1c1s00/1
 
very simple
 
Hrm, onreadystatechange is never firing
 
@SterlingArcher how are you listening
 
i don't even know what the important part of the error is, yet.. i can paste
 
3:10 AM
you know when you enter a website like snapzu.com and golfledger.com , the background color is grey but the one that has content has white background
 
@Luggage I don't understand your code, why should I pass that array to callback ?
 
please do :)
 
Is that html and css?
 
let xhr = new XMLHttpRequest();
xhr.open("POST", "/createAccount");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
let data = {
		user: username,
  	pass: password,
  	email: email
};
xhr.onreadystatechange = () => {
  	console.log("ready state", xhr.readyState);
  	if (xhr.readyState === 4) {

      } else {

  	}
}
 
3:11 AM
use .onload
 
Instead of readystatechange?
 
export function xhr(args) {
	return new Promise((resolve, reject) => {
		let hr = new XMLHttpRequest();
		hr.open(args.method || 'POST', args.url);
		hr.onload = () => {
			if( hr.status >= 200 && hr.status < 300 ) {
				return resolve(hr.responseText);
			}
			reject({
				message: hr.statusText
			});
		};
		hr.onerror = () => {
			reject({
				message: ht.statusText
			});
		};
		hr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		hr.send(args.data || null);
	});
}
 
anyone?
 
@haloyoba yes that's html and css
 
@rlemon hrm, still no log message
 
3:12 AM
@Luggage your code has syntax errors !!
 
xhr({
  method: 'POST',
  url: '..',
  data: '...'
}).then(res => {...})
.catch(err => {...});
 
@niceman can I ask how that's being done?
 
@niceman it was psuedocode..
 
omg I wasn't xhr.send'ing
I'm so bad at ajax without jquery lol
 
lol
 
3:14 AM
This is the first time I've used native JS xhr
 
@Luggage my fault
 
@niceman what does the server respone look like?
 
@SterlingArcher I always write a nice util for it
like the one I posted above ]
 
@SterlingArcher you xhr like my dad
actually
 
Basically a function(s) that takes a request type, url and data object?
 
3:14 AM
my dad can't even spell xhr
 
I forgot to compile this bit, clearly
 
@Luggage my condolences
 
[{"_id":{"$oid":"568bee09421aa908fe000009"},"depth":0,"name":"name","parent_id":‌​null,"parent_ids":[],"picture":{"url":"/uploads/category/picture/568bee09421aa908‌​fe000009/Screenshot________________.png","thumb":{"url":"/uploads/category/picture/568bee09421aa‌​908fe000009/thumb_Screenshot________________.png"}}}]
 
2 mins ago, by rlemon
xhr({
  method: 'POST',
  url: '..',
  data: '...'
}).then(res => {...})
.catch(err => {...});
 
3:17 AM
wow
 
ahhh now I know what's the issue, thank you, I think I know what to do
 
@Luggage when developing, you can compile functions individually, I forgot to run make tonight
 
@phenomnomnominal that lil rat lookin thing just got ate. damn nature, you scary
 
the fuck right
I was like aww, it's gonna be scared of the water
 
3:21 AM
then NOPE
 
cats > dinosaurs
 
@FlorianMargaine er, ok. I'm not sure I follow. I thought buildapp was compiling when i ran make?
 
@Luggage buildapp is a program that loads the environment, think opening python repl and loading a module, and then "dumps the image", aka saves all the runtime in a file
but you can load the environment in another repl
(and you should)
I don't use buildapp most of the time, I develop in the repl
write some function, compile it, test it, fix it, compile it, test it, move on, etc
buildapp is when you want to make a binary
(and since you can run functions in the repl, making a binary is not really needed during dev)
 
@Luggage getting a bootstrap theme was a terrible waste of money. The one I bought has a TERRIBLE codebase. no use of any sort of package management, and the files are just scattered about. I won't even be using it. Waste of money.
 
fun fact of the day: Robin decided to skip dinner and sleep instead. So he woke up at 4am for breakfast. it's 4:30am here right now.
 
3:32 AM
the one i got was ok. i didn't use the scripts. they were messy and outdated but the css was well organized and definately saved me enough time to justify $10
 
Fuck it, I'm not even gonna do this project then. It's too much of a headache to sift through all this stupid garbage
 
he usually wakes up at 8am.
 
@FlorianMargaine i was jsut running make, assuming it was a needed step.
but the scripts were usless anyway, i just used bootstrap and a handful of the other libraries that it had styles for (e.g. select2)
 
@Luggage yeah np, you can do that to develop, but compile times are slow and the dev workflow is not as smooth as it should be
 
Hey guys, for a discoverable service, does it make sense to have a swagger like spec
attached to it ?
 
3:34 AM
some kind of HATEOAS at least
 
Please don't flag swear words. In and of themselves they are not offensive.
 
@Danack you know that we usually don't :)
 
user5704717
@Danack then dont curse :P
 
^ Ironic
 
(probably some random user being offended by php wanting to have a CoC.)
 
3:36 AM
@Shi-ii don't turn up in a community and impose your moral standards on them.
 
@FlorianMargaine yeah....there is apparently someone new who needs to be told not to do it....
 
no one can see who flags. you just have to let it happen.
 
user5704717
:( @phenomnomnominal
 
@Shi-ii Historically, it hasn't turned out well.
 
Can you not send an Object in XHR post?
Does it have to be a JSON stringified object?
 
3:37 AM
you can send anything you can serialize.
 
you can only send a string
 
or some of the new fancy shit
but send a string
 
it's like @SterlingArcher is discovering web development
reminds me of the intern I had
 
@SterlingArcher you can send an ArrayBuffer :p
or a Blob
 
3:43 AM
still need to serialize into one of them.
 
@Luggage you should skim over "practical common Lisp"
 
Aye. I played around in the repl earlier, but no idea how to load existing code and play with that
 
look at the git-zed file
err no, sorry
 
xhr.send("user="+username+"&pass="+password+"&email="+email);
This is so ugly. Is there a better way to send form data?
 
3:46 AM
yes.
 
@Luggage install quicklisp and then you will just have to run "(ql:quickload :zed)"
 
ah, ok. quicklisp is installed in thie project, but i think i also installed it into the default location ~/quicklisp
 
@Luggage wanna elaborate? lol I tried new FormData but that sent over some weird shit
 
@Luggage cool, did you run the "add-to-init-file thing?
 
@SterlingArcher i thought there was a built-in function, but I can't find it. String interpolation will look a little better
 
3:49 AM
if not, I'll give you some instructions tomorrow
 
@Luggage in node there is util.format
 
xhr.send(user=${username}&...) is ok-ish.
but you could which up an object-to-query string in a reduce.
 
I'll just use interpolation
 
3:53 AM
for now. once I throw everything into a single JS file I'll write a reduce
 
let query = {
    user: 'bob',
    otherThing: 42
};
let queryString = Object.keys(query).reduce((prev, key) => prev + `${key}=${query[key]}`, '&');
damn, too late to edit. I messed up the & and ?
 
@Luggage there's no ? in a post body
 
ohh, post body.. i was thinking query string
 
4:09 AM
I'd just do a map/join personally
 
yea.. simpler.
System "zed" not found
 
put the zed folder in ~/common-lisp/
restart the repl, try again
@Luggage the repl you're using is just "sbcl"?
 
yup.
 
the best experience is using the slime repl in emacs... I can find you some resources if you want. Not now though.
 
i've seen some. i still haven't gotten used to emacs, so i stuck with this for now
 
4:13 AM
for now you can go by in sbcl repl, but it's very limited (no auto completion, no easy recompilation of single functions, etc)
 
hello
@Shi-ii hi
 
well, the errors are looking less cryptic, now
 
@Shi-ii you here?
 
sorry that there are errors.
 
well, i don't know what's my fault, so we'll just blame the tools
 
4:15 AM
the next error should be my fault
(the initialize-instance one)
 
looks like it. it references function names that are yours :)
 
@Shi-ii are you here?
 
oops, missed a line
 
@Luggage delete this function and quickload, you should be able to play with functions at least
and see why you can't call any zed function without knowing a bit about packages
 
roger that. i'll read.
 
4:22 AM
anyway, I'm going back to bed
 
yea, good idea :)
 
@KendallFrey you dont need the money tomorrow
Rift preorders are different from most of the games industry. You don't get charged until we ship - no deposit lock-in, no bonus pressure.
 
oooh
 
i saw a video the other day, and was wondering why it's better to build event listeners than function calls
any ideas?
 
did you try searching on Stack Overflow?
 
4:31 AM
@ajaxGuru link to the video?
 
not what i meant
i mean javascript is intelligent enough to know how things are set up when you load something, but what if things inside changes
 
wat
 
javascript isn't smart enough to figure out that things have changed
 
it isn't
 
4:35 AM
if you do an <input onchange> it's smart enough to know that it should be triggered even if it initially dies
 
@ajaxGuru context?
@ajaxGuru dies?
 
dies - error=function-death
 
I never used mutationObserver
seems like a scepter for framework creators
 
why couldn't you do it when you know the html has changed enough to need it called?
 
speaking of misleading event names..
 
4:40 AM
if the html is changing that much that you need to worry, you're probably doing something wrong
 
why don't they change "node" in the doc to "item" or "id"
 
also addEventListener('onchange', functor) is valid syntax
because they're nodes not items
nodes are living things, items are nonchanging
 
people at first think nodejs
 
then they probably don't know that much about JavaScript
 
In angular, must we always list dependencies for a service as in eventsApp.factory('eventData', ['$http', '$q', function($http, $q) {..}
because I'm watching Pluralsight vids here they just eventsApp.factory('eventData', function($http, $q) {..}
and everything works fine. But my code, no, not without listing the dependency.
 
4:45 AM
@rism If you put a $static property on the function being passed to the factory (or service etc) with an array of those dependencies that will also work too.
 
I guess you could assign those dependencies to the global level, or the eventsApp level
 
s/static/inject
 
if you do: addEventListener('onchange', functor)

it will die when you do an "ajaxed" load
 
function factory($http, $q) {}
factory.$inject = ['$http', '$q'];

angular.factory('eventData', factory)
If you're using gulp grunt or webpack you could use ngAnnotate to insert that information for you automatically.
But you will need to do one of those 3 approaches otherwise your code will break when you try & minify your code.
 
@Quill you should add the bubbling boolean to addEventListener. Not required, but good practice.
 
4:46 AM
^ that too
 
why couldn't it automatically do the change with innerhtml?
 
don't use innerHTML
access the DOM elements instead
 
What's the question?
 
i'm delving heavily into the problems like "if I don't have js turned on".
 
21 mins ago, by ajaxGuru
i saw a video the other day, and was wondering why it's better to build event listeners than function calls
14 mins ago, by ajaxGuru
i mean javascript is intelligent enough to know how things are set up when you load something, but what if things inside changes
 
4:49 AM
@Quill thanks
 
That's the thing they are writing the code, right before my eyes and I don't see anything like that. I wondered if it was a new / old version change?
 
But thanks for answers will go away and read up.
 
4:50 AM
@rism I'm writing a proposal on writing dynamic html on the client side from server requests
 
I'm expecting sharp white teeth and blood soon, should probably be prepared to use garlic
 
@Quill for me, or someone else?
i think people are doing it wrong from what i've seen
believe it or not HTML does have two states:
scanned/rendered
unscanned/unrendered
 
that's four states
it can be in two of any possible four states ;-)
 
@DanPantry how so?
 
4:57 AM
@DanPantry when you scan something javascript can render it, but if javascript doesn't scan something it doesn't get rendered
 
really?
I can run <html></html> in my browser with JS off
it will render
 
yes, but it can't be rendered, like an accordion with javascript turned on if it isn't told to do so
 
@ajaxGuru JavaScript has nothing to do with rendering. Read up on DOM.
 
in one sense, yes
 
JavaScript doesn't build the page, JavaScript's toolkit is manipulation not inception (although after the fact it includes that)
 
5:00 AM
but if you want "cool stuff" you need to do something special
@Quill you're thinking low level
i'm thinking "specncy"
 
then use those words and not it doesn't get rendered
 
He's thinking the way it is....
 
i'm thinking about it on the very low level
 
Well, thinking in a different level doesn't change the truth, does it?
 
no, very low level, JavaScript has nothing to do with the browser's engine constructing the page
you're thinking high level page manipulation
 
5:04 AM
@pootis yes, lower than the average person would care about (javascript kernel)
 
it's not 'rendering'
 
javascript sits on top
 
yo @DanPantry you wanna weigh in buddy?
 
@DanPantry the topic is "javascript kernel level rendering"
 
is there like swagger for events ?
 
5:06 AM
i am not educated enough to know about this topic.
 
the JavaScript engine compiles and runs the JavaScript on the page and 3rd party JavaScript added like Userscripts.
If there's no JavaScript, the engine has nothing to compile and the page is not changed by the engine
there is no kernel level javascript rendering
 
@ajaxGuru javascript kernel???
 
@Quill unless
hes talking about re-implementing linux kernel in javascript :? (just messing up)
 
if you have javascript turned off you can't run javascript, but the "html" version will still run
 
@Abhishrek actually just windows 95 kernel
 
5:09 AM
vOv
Why would you even do that ?
there exists copy.sh/v86
 
@pootis how the javascript works with the "user"
 
@Abhishrek some people like to watch the world burn
 
that should run your windows 98
with ease.
 
yes I know, IIRC archive.org runs old C64 games
 
"user" - html
 
5:11 AM
I suggest you learn how a browser works and how rendering engine, javascript engine work together..
 
also you watch the rise and fall of javascript talk
 
Watch all of Crockford's talks
 
i know how it works when working with javascript very in depth, especially when it comes to ajax
 
apparently
> I am one with ajax.
> Ajax is my brain, my brain is ajax brain.
> I write talks about ajax.
 
watch all facebook's talk too
they are doing some excellent stuff in javascript these days
 
5:14 AM
@pootis i'm using linux terms because it's easy to relate to
 
well stop because they're not javascript terms
 
Don't get me started on linux now
 
the kernel is what everything runs on
 
> In computing, the kernel is a computer program that manages input/output requests from software, and translates them into data processing instructions for the central processing unit and other electronic components of a computer
 
@ajaxGuru your "kernel terms that are easy to relate to" are confusing everyone.
 
5:16 AM
JavaScript does not interact with the CPU or electronic parts in a browser
I'm assuming node does though, but that doesn't count (because there is still no javascript kernel)
 
@Quill " translates them into data processing instructions"
 
JavaScript -> Chrome -> V8 -> OS -> C -> Assembly -> CPU
At no point does it go JavaScript -> CPU
 
@Quill true, but javascript interacts with the "hardware" of the code
 
there is no hardware of the code.
 
i'm using "hardware" in the terms of each block being a card
 
5:20 AM
¯_(ツ)_/¯
 
@pootis what?
 
@pootis i cant even
 
don't like the metaphores?
 
I'm running a mysql query, and the result is: Database returned RowDataPacket { count: 0 }, however, when I do the following code, the result doesn't show any count
var check = `SELECT COUNT(username) AS count FROM players WHERE username=${mysql.escape(user)}`;
        return db.query(check).then(result => {
                console.log(result)
result logs:
 
@ajaxGuru Why use metaphors when you can use the actual terms?
 
5:23 AM
@SterlingArcher sounds off topic, but there's no results, since you're not getting werrors
 
FunctionDisposer {
  _data: [Function],
  _promise:
   Promise {
     _bitField: 0,
     _fulfillmentHandler0: undefined,
     _rejectionHandler0: undefined,
     _promise0: undefined,
     _receiver0: undefined },
  _context: undefined }
 
@SterlingArcher that's very dangerously close to a sql injection attack.
 
That's what result is logging.
@ajaxGuru that's what I thought, but my mysql table has results that should return
 
ok, what does javascript run on?
 
@DanPantry I know, I'm sanitizing once I can get my queries working
This is Node.JS
 
5:24 AM
@ajaxGuru A javascript engine? Or a compiler
 
@SterlingArcher thanks
ok, javascript engine rendering
 
@SterlingArcher you can use template strings in a fancy way to aid dwith escaping btw (and not in that way)
 
I'm already escaping
 
@SterlingArcher Oh, yeah >.>
 
@SterlingArcher do you have a sanitizing engine avalible in node?
 
5:26 AM
A javascript engine instructs a rendering engine (which is developed separately, and is different from a javascript interpreter/engine) to re-render the page accordingly
 
But there's a different way of doing it! :p
someFunc`.... WHERE foo=${bar}`does something fancy, though I forget the details entirely..
function sql(string, escapedArguments) {
  console.log(arguments)
}

const username = 'bar'
sql`SELECT * FROM accounts WHERE username=${username}`
This will spit out:
{"0":["SELECT * FROM accounts WHERE username=",""],"1":"bar"}
 
@pootis so why doesn't the javascript engine update some code when it's doing the innerhtml?
 
wat
 
@ajaxGuru I understand what each of those terms mean, but your sentence makes little sense.
 
should i watch these videos: youtube.com/watch?v=RO1Wnu-xKoY
 
5:31 AM
@ajaxGuru yes
 
@pootis thanks
@pootis where were we on the low level discussion?
oh, why doesn't javascript run on things that get changed by innerhtml properly
 
what
 
if you're changing stuff with ajax, and innerhtml it doesn't get changed properly to view as if you had loaded all the html properly
@Quill if we already went over this where should we start up again?
 
well ajax is after the page load, so the base html will have already been rendered
ajax has to call to post or get from wherever which takes time
that's why it doesn't immediately change the content
 
5:47 AM
but you can change the html with ajax, and it will render that section again, and the javascript doesn't update it
therefore there's 2 main states
 
what do you mean the javascript doesn't update it
 
it doesn't rerender that section
 
if you want to provide a quick gist I can actually help you out
 
i have it solved, but i'm asking "why hasn't it been patched"
 
where's the ajax?
 
5:54 AM
oh, you want an example
 
well yes, if you want to know why that is the case
 
run it in a php engine
 
What the shit
This is driving me nuts
After I spread my query results and return a promise, the results don't show up
 
i wrote it as a "bugs i've ran into", and "bugs i've solved"
 
@ajaxGuru what about it? it looks like you're having jQuery issues with jQuery UI
 
5:59 AM
connection.queryAsync(sql).spread((rows,fields) => rows) // console.log(rows.count) returns 11 (correct)
Then in my next file, where I handle the promise
return db.query(check).then(result => {
       console.log(result.count);
is undefined
 
maybe you should write our own
take a jquery accordion
request it from a page with an ajax request
it isn't presented as an accordion
 
@SterlingArcher it's messy but use a global maybe
 
What is PHP?
 
They're in different modules, a global wont help
 
my server side language
 
6:00 AM
And I'm trying to avoid messy lol
 
you're using sql in javascript and you say no messy
mongodb is better off for that
 
What's wrong with using MySQL with NodeJS?
 
mongodb sucks
 
meh, it's not wrong, I guess
just like, sql queries with string concatenation gives me the heeby jeebies
anyway, have you checked if the data is being passed in as an internal this value?
 
@pootis let me know when you rewrite the proof since you didn't like mine
 
6:04 AM
result shouldn't be undefined, empty at best
 
@ajaxGuru wat?
 
@pootis
http://chat.stackoverflow.com/transcript/message/27942564#27942564
 
Mongo and sql are quite different
 
@ajaxGuru do you actually want something, or are you just going to ping random people for no reason?
 
@ajaxGuru I don't think it has anything to do with me
 
6:06 AM
@pootis see the link
 
I can't write code now because I am on windoge and downloading GTA V
 
that's what i'm asking for a "why doesn't javascript run on it"
 
@pootis had nothing to do with the conversation about accordion
 
Also I'm so excited to play it's almost done downloading
 
as for why, I can't find a single thing in your 'proof' that supports it
 
6:07 AM
should i ask tomorrow?
 
Try asking on Stack Overflow, not in chat
 
did i forget it
@Quill i did, but people said things like "soft loading" vs "hard loading" doesn't make sense
 
link?
 
it's too old
as in deleted too long ago
 
Hi stackoverflow.com/questions/34609719/… can some one advise on implementation?
 
6:33 AM
@BenjaminGruenbaum when you get this -- you told me to use a disposer for my bluebird connection -- however this returned a FunctionDisposer to my resolved Promise. When I switched back to finally, the results returned correctly. Why would changing finally to disposer break my returned results when they are returned in the spread function, not the disposer?
 
6:55 AM
Fucking finally got the query working.
 
user3119231
7:21 AM
morning!
 
7:33 AM
@SterlingArcher @Quill nothing wrong with using SQL in nodejs, don't drink the kool aid that SQL is bad, because it's not. It just so happens that the vast majority of apps these days aren't needing a relational database and are document based instead.
ultimately you want to choose the database that suits you best. If you have lots of complicated relationships, Titan might be best. If you have just blobs of data, then Mongo might be best. And if you have something in between then maybe you want SQL.
data storage isn't as simple as "Using Node? use NoSQL".
Case in point, a few months ago I was working on a project that needed a graph database (Titan).
SQL just didn't have the ability to handle the relationships the way I wanted it to, and storing the entire tree in NoSQL would have been a surefire way to kill performance.
if you are going to use SQL, use an orm like sequelize to make stuff easier on you.
 
@SterlingArcher a Disposer isn't a promise, it's a disposer - you use it inside a Promise.using.
 

« first day (1908 days earlier)      last day (3056 days later) »