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

08:01
@SterlingArcher You pass the disposer to Promise.using and it returns a promise.
Promise.using() then handles clearing the resources for you
crl
crl
08:17
var a=document.createElement('a');
a.href='http://ok.com/ergerg/regreg?q=2#rfregerg';
[a.protocol, a.hostname, a.pathname] // ok but a.querystring? a.fragment? I don't see them
nvm doesn't matter
.search .hash?
var url = new URL("whatever.com/theheck/you?want#")
crl
crl
ah right, thanks
Morning
crl
crl
08:32
hmm, how do you replace only the left side of the first occurence of // with an empty string:
'http://ok.com//ergerg//regreg?q=2#rfregerg'.replace(/.*\/\//, '')
should give 'ok.com//ergerg//regreg?q=2#rfregerg'
user3119231
simple split it off?
crl
crl
hmm right
crl
crl
well, it sucks a bit
'file:///C:/ok/com//ergerg//regreg?q=2#rfregerg'.split(/\/+/)
user3119231
You have to check which url/path format it is. Otherwise there won't be a simple way to remove the first "part"
user3119231
08:36
if url simply search for "//" and replace by ""
user3119231
for file "///" do the same. Don't forget to remove everything before the slashes, aswell
user3119231
result = subject.replace(/.*?:\/\//g, "");
user3119231
I think it would be better to take into account all possible protocols.
crl
crl
a.href.replace(new RegExp(a.protocol+'\/+'), '')
well, right, it's ok with 2 slashes, I shouldn't worry for file
with a '^' too, thanks Maurize
@Luggage btw, I'm the first to admit that Lisp tooling sucks. The only real option is emacs + slime, and since people working on Lisp get used to it, there's no incentive to do something else.
08:49
In this code, Can I use module pattern to optimise it?
Basically to avoid those hardcoding
of values
09:04
Oh man, im lost. Why is this wrong?
var x = document.getElementsByTagName('div')[0];
var xSplit = x.textContent.split('');

for(var i = 0; i < xSplit.length; i++) {
  x.appenChild(document.createElement('span').textContent = xSplit[i])
}
x.appenChild is not a function
user3119231
appen > d < Child
oh crap
Thanks man, didnt see that : )
user3119231
No problem. :)
Pro tip: Paste your code in MS Word to check for typos.
By the way, would you use textContent or nodeValue?
user3119231
09:05
Bonus tip: If you do this mistake once, you will rather find it next time.
Thanks for the bonus tip : )
user3119231
for your question :)
user3119231
*Summary

nodeValue is a little more confusing to use, but faster than innerHTML.
innerHTML parses content as HTML and takes longer.
textContent uses straight text, does not parse HTML, and is faster.
innerText is IE specific and also takes styles into consideration. It won't get hidden text for instance.
*
Yep saw that. Proves again that innerHTML sucks :D
user3119231
09:07
Good luck with coding you have, young padawan :)
Thanks :)
Also, don't listen to Maurize. Or should I say "Darth" Maurice? I'm on to ya!
Become my apprentice, instead. I'll teach you to shoot lighnting and all that cool stuff ;-)
user3119231
how bout no? I be tha lil hustla of zeus. Born ta bust a funky-ass big-ass fart lightnings!
user3119231
Gizoogle strikes again :)
I've read that 3 times over... What?
user3119231
09:10
I wrote: How about no? I am the son of zeus. Born to fart lightnings.
user3119231
And Gizoogle translated it in this... :D
Born from a lightning fart, you mean? :D
user3119231
Maybe... :D
Whic is still epic, one could argue
I voted to close this one as too broad but you might have an insightful answer to propose instead:
0
Q: What are some real world scenarios where ES6 generators can be helpful?

jkrisI'm looking for an answer form a front-end perspective, can this be used for building better/faster/cleaner front-end UI frameworks? If so what would be a real world scenario for a front-end framework/library? Looking for a real world scenario where generators are used in frameworks/libraries?

09:19
Hello Guys, I am Mohit, Can you please help me in this code
I had created a promise but when i call this promise
RetrieveAddress(latitude, longitude).then(function(dataAddress){...}, function(dataErr){console.log(dataErr);})
it always give me error
[TypeError: undefined is not a function]
@Mohit Where do you get that error ?
Is Promise defined ?
yes link in pastie
pastie.org/10672898
@Mohit No, I mean: do you have Promise ?
What's the precise line of the error ?
well i had added promise library
var Promise = require('promise');
same no description
only [TypeError: undefined is not a function]
let me add full code pastie
here is the full pastie code
You must find a way to know where are your errors
09:29
after hitting line 35 it reaches line 52
crl
crl
man.. I don't even know the difference between a byte and an hexadecimal character
user3119231
But google knows :D
crl
crl
o stupid me, byte=[hex,hex] 2^8=2^4^2
@DenysSéguret cv, definitely.
Did anyone stumble upon the issue with autocomplete and angular? That the model isn't updated when one selects and fills fields by means of autocomplete. (Talking about browsers autocomplete and not some sort of plugin)
09:41
@DenysSéguret got it, i was directly using formatted_address instead of retrieving from the array. Thanks for the help.
10:11
Use css transitions?
user3119231
yep but which?
user3119231
width does not work
user3119231
nevermind, forget it. bad thoughts :D
user3119231
Think about 100 cells doing a transition. -> Firefox = Deadfox
crl
crl
10:26
Friedfox
@crl A byte is a unit of storage, a character is something you can store in that storage
crl
crl
you can still represent a byte value as 2 hex characters?
@crl The value of something that is stored within a byte can be represented by using hexadecimal characters
Which, yes, usually requires 2 hex characters, assuming your byte has 8 bits
10:44
is there any usecase in which one need to use construct new Promise(), i dont see it
crl
crl
function ajax (url, opts) {
  var xhr = new XMLHttpRequest();
  xhr.open(opts.method || 'GET', url);
  xhr.send(opts.body);
  return new Promise(function (resolve) {
    xhr.onload = function () {
      resolve(xhr.response);
    };
  });
}
@crl, you can just use Promise.resolve()
crl
crl
yeah, seems clearer like that I guess, well show me how you'd write it
crl
crl
10:49
Range is my girlfriend
Having trouble understanding what the difference between startContainer, startOffset etc is
Its kind of like chinese to me : (
crl
crl
Conainers are Nodes
Im learning how to use startContainer, startOffset, setStartBefore, setEnd
setEnd and SetStartBefore is self exlainatory.
but I am not sure what startContainer and startOffset do.
function ajax (url, opts) {
  var xhr = new XMLHttpRequest();
  xhr.open(opts.method || 'GET', url);
  xhr.send(opts.body);

  xhr.onload = function () {
    Promise.resolve(xhr.response);
  };
}
@srle clean ajax
10:53
@BenFortune there are hundreds
@Srle This won't work
crl
crl
@Asperger just play with it, you'll figure out jsfiddle.net/crl/ea9x8otg/11
@BenFortune i see your point, ajax will not return promise in this case
@crl I dont get it. Saw the jsfiddle. Im reading about it now.
One of the things:
startContainer — The node within which the range starts (the parent of the first node in the selection)
@Awal An English teacher in my state got suspended because he couldn't read English.. lol.... so sad
10:56
What is the parent of the first node in the selection?
I mean lets say we have "Hello World is cool" as a text
What would the parent of the first node be?
crl
crl
first node?
        $.post('http://chat.stackexchange.com/ws-auth', {
            roomid: 17,
            fkey: "secret"
        }, function(data){
            url = data.url;
        });
how does one use Node.JS' request with that object parameter?
request.post('http://chat.stackexchange.com/ws-auth', {
	form: {
		roomid: 17,
		fkey: "secret"
	}
}, (error, body, response) => {

})
11:09
sorry
new in node.js:

MEAN.io or MEAN.js ? Which one should I use? Which one is more stable?
crl
crl
but I'd use ws rather than websocket module seeing how difficult it is to install on windows :)
@user3037960 probably neither
oh noooo
crl
crl
mean is bullshit, use node, some decent js lib for the UI, and mongo or postgre
so should I go for Meteor?
crl
crl
11:10
even bullshitter
user3119231
is bullshitter a word? :D
oh thanks @benfortune and @crl
@crl how is MEAN bullshit?
user3119231
*much more bullshit
crl
crl
11:12
it was invented by some angular fanboy I guess, doesn't make sense
@crl So express is out of the picture?
sails,
@crl what's wrong with angularjs, in your opinion
crl
crl
express ⊂ node
everyone is saying some other bullshit about node.js and its frameworks
11:16
@user3037960 Well, except that the modules I use are actually really awesome, compared to the other bullshit that is out there
@crl I see angular as a very powerful viewengine, which is also very flexible cuz it uses REST to communicate with any backend
@OliverSalzburg was für module verwendest du?
crl
crl
@Ronin I don't mind it for simple things, but don't find it handy for complex things (I'm trying to do a CMS)
which modules do you use?
crl
crl
trying with react rather now
11:17
nvm
-E-N instead of MEAN :D
@crl what do u like about react which angular doesn't support?
crl
crl
simplicity, you change the state, everything gets updated, if you want binding, you use handlers like in pure javascript
in terms of?
@crl same goes for meteor
@crl just like in meteor
crl
crl
11:19
meteor use uncessarily websockets right? I just don't need websockets there in my app
@crl I'm not familiar with react, so how is reactivity implemented there? not using websockets?
crl
crl
!!google reactjs
@Ronin don't google it! Its a trap!
11:22
@crl meteor is for marketing and HR people, not programmers
@user3037960 try sharepoint
@Loktar oh cool, but that doesn't affect me (much)
@Ronin I rather go with PHP
@pootis Thankfully government officials can't easily verify CS/Programming professors that way, else we won't have more than 10 of them in the entire country.
11:26
"I'm not familiar with react, so how is reactivity implemented there? not using websockets?"
This is valid question, dont redirect him to google :D
crl
crl
it's just local DOM reactivity, it's not saved in DB, yet
@user3037960 give sharepoint a try. trust me, I'm an engineer
user3119231
Bitte
this chat bot is giving me way more grief than I anticipated...
11:35
wat
crl
crl
he's trying to do like you I guess
yeah kinda
@AwalGarg yup
@MadaraUchiha don't you think that's way too polite for that article :P
I was just intent on printing the chat events to console, but the fkey business is giving me issues
I was being gentle.
Very gentle
@Quill It was a heck lot easy than I thought, actually. Assuming you have all the dark forces of devtools and basic HTTP networking knowledge, you can do it in an hour or less.
@crl ws is nicer.
Fuck windoge, and all its users. YOU are the reason Take Two Int. doesn't develop for linux.. :(
@Awal 1 day with windoge gave me.. [insert disease here]
@pootis read up or risr, cases...
crl
crl
11:39
@Quill check Awal's code, I made this a while ago, don't think it stll work tho
or do it alone, good too
12:04
what's up with all the .jar stuff
> request.jar()
Ved
Ved
Hello All
I am facing some weird issue in async javascript call.
0
Q: JavaScript Async not working Wordpress

VedI am new to Wordpress. I have just started the blog in which I can run my HTML / JS code properly. However, When I enter the affiliate code in my post, its not working. Then I tried it on Local machine simply by just inserting that script but It is also not working. This is my code - <div da...

Well wordpress is just a tag. nothing to do with it.
Ved
Ved
anyone ?
I need this to be made
YES
Ved
Ved
@rlemon @Quill Can u guys please help me ?
I don't know about async calling script files sorry
@Ved no
Ved
Ved
I think without async also, its the same issue
You may ignore async and just place src = ""
<script type="text/javascript" src="http://affiliate.flipkart.com/affiliate/widgets/FKAffiliateWidgets.js"></sc‌​ript>
its not able to include this script
crl
crl
@Quill cookies
12:16
Oh, okay. thanks
I really ought to learn node properly ;-;
crl
crl
my code is kinda bad tho, bad usage of promises, gotta learn rxjs soon
12:38
@crl if you ever want a Code Review there's a place for it on SE <--
I need to refactor this entire site's javascript, but I don't even know how to write well structured js ;_;
10 mins ago, by Quill
@crl if you ever want a Code Review there's a place for it on SE <--
@Cereal just practice you know
12:57
@Ved If it has nothing to do with wordpress, don't use
13:08
hala madrid
13:25
Hi guys, can someone explain to me why $("#id").on("click", ".class", function (e) { e.stopPropagation(); } could be undefined?
Is there a better way of doing this, paste.ubuntu.com/14419982
Creating a new variable from a class and then into the array automatically.
@FlorianMargaine I've been meaning to learn emacs anyway. I'
I'm not scared off, yet.
This is a good specific reason, as opposed to just 'learning it to learn it'. That always increases my chances of followthrough
and since i consider myself fairly knowledgeable about the git internals, I can focus on emacs and lisp. If I didn't also know WHAT yo uwere doing then this would be a monster of a project to learn with
user3119231
var people = [];

function Person (a, b){
    this.name = a;
    this.age = b;
	people.push(this);
};

var p1 = new Person ('Alpha', 20);
var p2 = new Person ('Bravo', 40);
console.log(people);
user3119231
@Waxi something like this? jsfiddle.net/62qdyhb1
13:33
now.. to get my work windows environment more to my liking.. git-bash is a pretty good start.
crl
crl
I've git integrated in the windows console
user3119231
this is taking fallout 4 to a whole new level: imgur.com/gallery/lspkB
@Luggage don't hesitate to ask for help then :)
(especially for the lisp-related setup.)
there are some shortcuts to make it easier
1ms silence for those have to use windows for work
I wanna learn git internals too ^_^
where to start easy and quick
13:37
There is a book: Mastering Git or something
But all you need to know is that repos are like folders on your system
@FlorianMargaine I understood that part. But is that it?
@AwalGarg + look at what's in .git/
and you basically get it, yeah
then it's stuff on top of this
the fourth type I don't use is tags, which is stored like commits
user3119231
@rlemon very much code for a simple task. But looks professional. BTW arrays in an object in an object in an object?
13:40
> man git
if you don't have to unfold like 4 levels to see your data it isn't cool enough
user3119231
huh I meant: array in an object. Nothing more :D No need for repeating
crl
crl
!!> [] instanceof Object
@crl "true"
13:44
@Maurize Oh that's perfect. I didn't even think about pushing from within the class. Thank you sir.
Talk to the hand.
crl
crl
Listen to the foot
@Luggage when you want to install the full repl in emacs, tell me
or
that'll be at home. i'm at work, now
13:46
and you'll need M-x package-install <RET> slime in emacs
noted. yes, i have a few different emacs version on my mac. not sure which is 'best'. i plan to put slime into one
you use text-mode or 'gui' emacs?
at present i'm being annoyed by lack of man on windows
@Luggage gui
user3119231
whats wrong with this method? Did I miss something? jsfiddle.net/cazywua1/1
forced to use mysql and need to learn it's commandlien tools :(
@Luggage \G is a lifesaver
(at the end of your queries in mysql cli)
13:49
ahh, noted, but looking up mysqldump options.
crl
crl
@Maurize do you var bro?
this project uses way too many stored procedures and <gag> triggers..
crl
crl
ah nvm it's to shitty
putting it all into git, at least.
goodmorning guyws
13:54
@Luggage well...
if it does it properly, why not?
jquery noob here... i have an issue i am trying to append something to a right click context menu... but i can only do it once the menu is visible because the code that somebody wrote always regenerates the context menu each time it is loaded depending on where you clicked... So i did an if:visible function but it only works if its visible. So if i have the menu open and i use chrome inspect and run the code it works if the menu is closed my else function says there is no context menu.
@FlorianMargaine I see
now javascript is everywhere .. i think i should shift from java to node js.. right?
@AniketKarne 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.
@pootis that's just the standard guide, I was hoping for something exotic :D
user3119231
13:55
@crl aight. got it.
@AwalGarg if you want something exotic, do what florian said. tree .git and vamp your way through on irc
@pootis not really because the most interesting files there are stored in binary. And I already know how references are stored...
13:58
@AwalGarg use git cat-file -p and git ls-tree to see the contents
anybody can provide an algorithm to sort an alphanumeric array. so that string text should be only in the last(with alphabet sorting
(the binary is just zlib iirc, so nothing special.)

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