« first day (2011 days earlier)      last day (2951 days later) » 

I don't follow you
 
In computer science, a fiber is a particularly lightweight thread of execution. Like threads, fibers share address space. However, fibers use co-operative multitasking while threads use pre-emptive multitasking. Threads often depend on the kernel's thread scheduler to preempt a busy thread and resume another thread; fibers yield themselves to run another fiber while executing. == Fibers and coroutines == Fibers describe essentially the same concept as coroutines. The distinction, if there is any, is that coroutines are a language-level construct, a form of control flow, while fibers are a systems...
 
yes, I know what a fiber is
but I still don't understand what you want to say
 
@FlorianMargaine I would think about Fiber, when my program want to schedule it, unlike pthread_create where OS takes care of scheduling
 
Regarding usage, if I have a game loop in the worker thread, can the render logic (main thread) request status updates in a synchronous manner?
 
8:02 AM
@JanDvorak afaik, it's the other way around
(the worker notifies to main thread of updates)
 
But then the worker needs to have some timing logic inside
 
and it needs to know the frame rate
 
I think you're trying to use web workers where they're not supposed to be used.
 
Basically, I want to perform computation as fast as possible (~10000 iterations per frame) while updating the graphics once per frame.
 
8:05 AM
I am saying that mainScript.js and workerScript.js can run on two different CPU cores at same time
 
Currently I have a fixed-size loop inside an RAF loop.
 
@overexchange maybe. maybe not.
@JanDvorak yes, use that, don't use a web worker for that.
 
@FlorianMargaine but then the logic won't run as fast as possible
unless I measure the time spent per frame and increase the iteration count until I consume 100% CPU.
 
@JanDvorak ?
 
It's a CA simulation. I want the results of that simulation as fast as possible. The visualisation is just a nice bonus but it should still happen at a decent frame rate.
 
8:12 AM
0
Q: Can worker thread run on different CPU core, parallely?

overexchangeJavaScript introduces window.Worker that allows the script to run parallel. Would like to further understand parallelism. If the OS follows 1-1 thread model, then, Is the web worker thread assigned to a dedicated kernel thread?

 
6 mins ago, by Florian Margaine
@overexchange maybe. maybe not.
 
@FlorianMargaine here's the CA simulation in question: github.com/honnza/drops/blob/master/margolus-ca.html
 
Free for all to review
 
hi I want to get those input values and put them into a new input"s name and type attributes plnkr.co/edit/5FjOTfAND7lMqXSeN1nA?p=preview
 
8:35 AM
can you suggest me a good mvc tutorial .basically i cannot understand mvc
 
Hi guys. I am new to js. Is it possible in js to write a code for textarea that auto expands to fit the size of content to be displayed.
 
@GauravMahindra Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
okay :)
 
Kez
Can some one please help me with linking to nested bootstrap tabs?
 
8:51 AM
@GauravMahindra yes
@GauravMahindra though you'd do better to use a div with contentEditable="true"
 
I need it. I have a code but its not working properly. It expands only for first element.Here it is var observe;
if (window.attachEvent) {
observe = function (element, event, handler) {
element.attachEvent('on'+event, handler);
};
}
else {
observe = function (element, event, handler) {
element.addEventListener(event, handler, false);
};
}
function init () {
var text = document.getElementById('text');
div is not displayin formatted ouput.
 
Where does that come from?
 
I copied it from some website.
 
!!mdn attachevent
 
8:58 AM
ok
 
Supported until IE10. Drop it.
 
Kez
Hi people
 
Kez
thanks.
 
9:10 AM
@Kez Post an example of what you are trying to do and someone will help if the can
 
OK, how do I display an HTML file on Github the way HTML files are meant to be displayed?
without cloning the repo, I mean
 
Kez
@Will Trying to link (by url) the nested tabs, works with non-nested tabs. jsfiddle.net/adzvS/3
 
Not too sure but I would imagine that you would need the hash of tab 2 and then the hash of the nested one to get it to display. So you can activate tab two then the selected nested one.
 
Kez
that's what i thought. but keeps replacing the first hash.
 
@JanDvorak yeah, you'd think they'd have added some sort of editor for viewing things "as is"
 
9:20 AM
"as us" = admin view? :-D
 
United States army scope ;)
 
in french word ordering
 
Ah yes you will only be able to have one string as the hash value. You will need to construct a string with a character in it so you can split it into two values.
location.hash = hash1 + '&' + hash2;

Then get it with something like
var pairs = hash.split('&');
var lVal = pairs[0];
var vVal = pairs[1];
 
@Will how about JSON?
 
Yeah you could do that. Seems overkill for two values to me.
 
9:26 AM
Meh. You'd be future proofing it should you ever need to add anything later
 
How much can you add to the location.hash?
 
@Will I suppose the limit is that of the url length: 2083
 
Fair amount then.
Up to him if he wants to use JSON then :P
 
Kez
@Neil any good tutorials with JSON?
 
@Kez no, certainly not without knowing what he's trying to do
 
9:36 AM
Hia dudes. Quick jQuery question reminder. How do I get a quick check to see if a $ query returns anything? like ($("youHaveThisClass")) ? take it : suck it;
 
Kez
@Neil Trying to jump to nested bootstrap tab by url.
 
Also, how's my buddy @Neil ? ;)
 
@Thaenor In general, best practice is to check the .length
 
1 message moved to Trash can
@Will Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
if( $("youHaveThisClass").length ) { yaayyy }
 
9:37 AM
something like that
 
@jAndy like this? ($(".viewAllCssClicked").length > 0) ? alert("aye") : alert("nay");
 
@Kez var something = {
			step1: 2,
			step2: 1
		}

		location.hash = JSON.stringify(something)

		var getValues = JSON.parse(location.hash);
 
you can skip the > 0, but yes
 
Kez
@Will Thanks, will give it a go.
 
@Thaenor o/
 
9:39 AM
@Neil hoy?
 
@Kez no problem
 
@Neil oh yeah, that... lost context for a sec... it happens.
@jAndy Muchas Gracias
 
@Kez let me just pull that code out of my ass pocket ;)
 
De nada!
 
@Neil @jAndy one bug down thanks to you guys... and Chris from work, he's my buddy.
 
9:45 AM
@Neil What do you mean by that?
 
Kez
@Neil I'm ok. don't fancy code thats been up someones ass :P
 
@rlemon how do I get x, y coordinates of a pixel position inside an image buffer?
 
@Kez good, man. :)
@Will I mean, I am at work and I have no obligation to help. That said, I mean nothing personal by that
 
Kez
@Neil Personal or not it was funny :P
 
@Kez I am glad that you didn't take it the wrong way. I almost immediately regretted writing that
 
Kez
9:58 AM
lol, too many people don't have a sense of humour.
 
Ah ok.
 
Kez
anyone American here?
 
@Schoening A pixel in JS is usually the x,y coordinate in the context of an image data/canvas. How did you end up getting a pixel without the coordinate? Do you mean you have its colour value?
 
I got a buffer. which is r, g, b, a for every pixel. And since it is a 1D array, I am not sure how to convert the array position to a x, y coordinate. Coz of the 4 values per pixel thing.
 
@Schoening 1D graphical data is usually arranged by x then by y. You need to know the image's width to convert 1D index to 2D coordinate or vice versa.
 
10:11 AM
I got the width, I got the height. I just don't know how to apply the basic formula to a buffer since there are 4 values per step, not 1.
 
1st pixel [0,0] = data[0,3], 2nd pixel [1,0] = data[4,7], 3nd pixel [2,0] = data[8,11]
Is this your case?
 
I am iterating my array buffer, if the r, g, b is correct I need the x, y coordinate of it.
 
1 message moved to Trash can
@Schoening Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
for ( var i = 0; i < img.image.length; i += 4 ) {
  if ( img.image[ i ] > 200 && img.image[ i + 1 ] > 200 && img.image[ i + 2 ] > 200 ) {
    // get x, y position
  }
}
 
@Schoening Just take i, divide it by 4 to know the n in nth pixel / nth loop. With the n, the rest is same as conversions for 1 step array.
 
10:18 AM
@Schoening if you knew the width of the image, then you can calculate the rest
 
I give it a shot. Thx :)
@Sheepy it worked, thanks mate
 
@FlorianMargaine You saw this yet: ssh chat.shazow.net?
2
 
@AwalGarg hadn't :)
fun
woa
even has auto completion
 
@FlorianMargaine can also do /nick foo and /me bar baz etc.
@FlorianMargaine also run /about
 
10:32 AM
It's fully written in Go.
 
Is there any particular situation you use "let" keyword over "var"?
 
@Thaenor Yes, all situations
 
@Thaenor When you want to limit the variable to a block scope, and when you want to make your code easy to refactor so.
 
hey everyone, does anyone here ever used phonegap push notifications before? i´ve been seeing some tutorials but i´m trying to understand if there is any "special needs" if the info that we want to push is coming from server
or if there is any key or something...
 
@MadaraUchiha So let beats var because it can be more "private", obviously depending on how you use it. Right?
 
10:39 AM
@Sheepy What if I want to make it easy making it easy to make it easy to refactor?
@Thaenor It's not more "private", it's stricter
 
@MadaraUchiha Buy IntelliJ. ;)
 
(and const is even more strict, which is why it should be favored)
 
@MadaraUchiha yes, indeed, you're right.
 
Prefer const +1
 
@Thaenor Here's the workflow: use const, if you need to mutate the variable's value, think hard if you really need to, and if you do, let.
var should not be used anymore in new code under ES2015, and is considered legacy.
 
10:41 AM
@MadaraUchiha really? did not know that...
 
@MadaraUchiha that's too strong of a statement to make. saying "var is legacy" is saying "function scope is legacy".
 
I remember that let (and const) was slower than var. Does that still apply?
 
@Sheepy Only with babel, and only under some cases
But that performance penalty is so insignificant, no one really cares.
 
I am using lots of lets and const and the debugger (no babel) is full of block scopes which I don't really like but can only accept.
 
@AwalGarg That's how I'm treating it.
And the sooner it goes away the better (I mark usages of var as compilation errors in my project)
 
10:46 AM
Wow. That reminds me of jslint...
 
@Sheepy ESLint
 
The javascript world seems to change everyday...
 
@MadaraUchiha While I agree that you can and should use let and const where possible, I object to the saying that var is now "legacy". That's it. Function scope matters and JS is lucky to have had it since long.
 
I mean the jslint. Which eventually complain on every little deviations from the author's style. That's when I stopped using it.
 
10:49 AM
@Sheepy Yeah, I'm not bothered by a tool that's complaining and keeping my code tidy
What I didn't like about JSLint is that you couldn't change the rules
 
Exactly.
 
ESLint allows me to determine what I want to enforce, and even create my own rules
Which works splendidly for me.
One of the rules I have enabled is the one that complains about using the var keyword over let and const.
@AwalGarg I've found that, at least in the projects I'm working on, that if you have var and can't convert it into let, you have some sort of a bug you aren't aware of, or you have a bug waiting to happen
 
Yeah, that's just the same as using eval or Function or innerHTML etc. Using them sounds like code smell, but they are not, and will never be legacy.
 
@SomeKittens Ooh, game night? What do y'all play?
 
11:19 AM
@AwalGarg for eval and inner HTML, there are valid things you can't do properly without. For var, there isn't
@Sheepy yes, so?
 
i am trying to install http-server using npm
after install where this file will be available any idea guys
npm install http-server -g
i am getting proxy issue as well how to resolve the same
 
!!s/sa/ga/
 
@jAndy i am getting proxy issue as well how to resolve the game (source)
 
:(
i tried so many expreiments from google nothing working
:(
i am trying to install cordova and http-server
 
11:53 AM
0
Q: subscriber is not working properly using ajax

Waqas_aamerIn my footer i have a subscriber form in which any user can subscribe to website. Form is <form id="newsletter-signup" action="?action=signup" method="post"> <input type="email" name="email" id="email" placeholder="Email" required/> <input type="submit" id="signup-button" value="" /> </...

 
@Waqas_aamer Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
user5992646
hello, my friends. Another good day I get to talk to you guys.
 
Someone sounds grateful
 
any suggestion for my question guys
 
@TodoPertin any day that you can talk is a good day :)
 
12:09 PM
aww
 
user5992646
@Neil :)
 
user5992646
@SomeGuy lol
 
@Mahadevan npm has a configured spot to put global modules
Depends on how it is configured
You should never need to care though
 
Just don't install them with sudo
 
@BenjaminGruenbaum when do they release the video of your talk about async iterators?
@littlepootis Sometimes you have to.
Depends on where npm is installed
 
12:13 PM
Sudo make me a sandwich
 
@MadaraUchiha you can just npm config set prefix /path/
 
Can bald people be emo?
 
@rlemon they exist already. They're called manchilds
 
> I think if you just cry enough about being bald it will all balance out.
 
@Neil but the problem is i was not installed any framework like cordova or ionic framework etc
 
12:16 PM
Or should one say "manchildren" I wonder
 
is there any way good way to solve the proxy issue
 
@Mahadevan the module may install dependencies.
 
no my question is i was not able to install the modules :)
 
Ok, so the real issue is that you're dealing with a proxy?
 
yes :)
i have tried all the research
from google and SO
getting fedup with the proxy
I tried changing this
npm config set https-proxy proxy.company.com:8080
 
12:19 PM
Ok, please be more specific. What exactly is not working?
 
nothing working
sorry for that @Neil proxy was the issu
 
any errors?
 
@littlepootis you are asking me
 
@Mahadevan you and I have very different definitions of the word "exactly"
 
@Mahadevan yes. do this too.
npm config set proxy proxy.company.com:8080
 
12:21 PM
i did that also
 
without the https-
 
As anyone heard of Marfeel? I looked in Glassdoor but they only have one interview review.
 
npm config set registry "http://registry.npmjs.org/"
 
How do you run your javascript files while developing. Do you use any Javascript engine to run or just the browser console?
 
12:22 PM
@MadaraUchiha I'll ask
 
@IndrajithIndraprastham I don't run them. I test them.
 
i tried this two statement
npm config set proxy proxy.company.com:8080
npm config set https-proxy proxy.company.com:8080
 
@littlepootis yea.. if at all you are developing something big in javascript. Do you just type all in firebug or the browsers console?
 
still i am getting the proxy error
 
in PHP, 2 hours ago, by Fabor
I wonder what the thought process was for the first person to discover cow milk.
 
12:26 PM
@IndrajithIndraprastham firebug is old. And Google "JavaScript testing"
 
@littlepootis there is something deeply satisfying about making a change to the code, running the tests, and coming up with all green
 
@Neil it is very satisfying, yeah
 
Maybe it's just the obsessive compulsive side of me
 
(cover shows fly)
 
12:28 PM
@FlorianMargaine and how did they know that that didn't work for bulls? I suppose the guy never lived to tell the tale
 
@FlorianMargaine good lord ahahahahahahahaha this is too frigging funny when you see it from the "cows are holy" Indian POV :D
 
@AwalGarg that's what I was thinking
 
@AwalGarg original image is even funnier paintraincomic.com/wp-content/uploads/2013/07/…
 
@rlemon I honestly wouldn't have caught that had you not said anything
 
12:51 PM
did you ever used - datajs ?
 
@FlorianMargaine ahaa
 
@rlemon I doubt these bees produce honey !
 
@rlemon how's the finger bro?
 
@SterlingArcher sore
 
@SterlingArcher looks broken to me
 
12:55 PM
looks better today tho
still can't use it
 
@rlemon how can u type then
 
I have nine other perfectly fine fingers
 
@rlemon where's rest of 3 gone ?
we usually have 12 isn't it ?/
 
please stop talking
 
stopped.
 
12:57 PM
lol what a sour lemon
;)
 
I have 10 fingers. I wonder what happened to the other 1000
 
why everyone has 12 fingers and me 10 ?
 

« first day (2011 days earlier)      last day (2951 days later) »