« first day (2045 days earlier)      last day (2886 days later) » 
00:00 - 13:0013:00 - 00:00

12:36 AM
@taco It is quite cool
my kids favorite app
You can use Vive apps with the Rift if you happen to own Razor Hydras
leap motion also works but it's not as stable
I own both (Hydras and Leap Motion) the hydras work pretty well, but you have wires which sucks.
 
 
1 hour later…
1:41 AM
@Loktar I showed VR to my sisters today. They were impressed.
My little sister described VR as "the coolest electronic [device] there is." She knows what's up.
 
I used css to position a <ul> but when I set all the children to draggables and to be contained in them, they are offset by ~75 px on each side
Now I need to know how to screenshot on a pc with a mac keyboard to create a question lmao
 
@ROom want to play Civ5 the coming sunday? Ping me :D
 
@Abhishrek There's a guy from C# who bugs me to play sometimes.
I pinged him
 
Oh wow what a roast
Why does jquery-ui draggable containment have padding?
 
@KendallFrey @Loktar Is in :D
 
1:50 AM
in where?
 
he says he will join (:
 
oh
don't expect me to play
unless I'm at home and bored
 
lol
civ5 can be long :-|
 
also that
 
Anyway whats the best way / strategy
to handle a rapid expanding buffer ?
I cannot pre-allocate it could be anything from 10 megs to 400 megs
The data is piped out
 
1:53 AM
@Abhishrek the normal way?
i.e. when it's full, double the size
 
@KendallFrey I also have to slice it rapidly
I am trying to convert a stream of unequal samples into chunks of fixed size
 
Wife got me the SI swimsuit issue and it came with a cardboard VR insert. the SI app worked fine on my iPhone, too. About as good as my Oculus DK1 and less bulky
 
there needs to be a bank buffer which can rapidly shrink and expand
the naive way of doing Buffer.concat and buffer.slice resulted in process using up 8 GB memory :P
and then GC madness
 
lol I've pretty much gotten over the side effects of VR except for one. I still see my monitor as 3D sometimes.
it's like the chat has text hovering over the background
 
2:09 AM
Is it unrecommended to implement a dynamic map by translating an html canvas based on the player location?
Or should I just draw the objects relative to the player?
 
I should just keep a ringbuffer
 
2:23 AM
Why does node.js not have buffer.shift() ?
 
@thepiercingarrow Are you talking about procedural generation?
oh wait you can always re-draw relative to players position, thats what I'd do
 
@Abhishrek What is procedural generation?
@Abhishrek oh. its not good to just keep translating the canvas? XD
 
Ignore it, IDK why I thought about it.
@thepiercingarrow translating can be efficient only upto a time :P
 
@Abhishrek okay.. thanks XD
 
2:29 AM
Idk for sure though @Loktar @rlemon will have way more to share about canvas than me
 
Okay, thanks a lot :)
 
 
3 hours later…
user4947868
5:03 AM
Hi, anyone in here?
 
@JackGaray Welcome to the JavaScript chat! Please review the room 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.
 
user4947868
May I ask on what this one means?
 
user4947868
var args = [].slice.call(arguments, 0);
 
user4947868
5:18 AM
Aight, I got it, nevermind.
 
6:02 AM
didn't know a live chat existed, nice
I'll be learning javascript in a few weeks after finishing up some php stuff, so this will come handy I suppose
 
7:13 AM
look at this completely wrong REST tutorial ... a bunch of RPC endpoints with HTTP methods as if that is REST
addUser listUsers lol
fast.com got my speed cap exactly correct
@Abhishrek don't try to make it all one. use an array of arrays and start a new one every so many
 
Alternatively, just have a circular buffer
 
yeah, or implement circular in terms of throwing away oldest whole array when you start a new one
idea is not to make modifications to giant ones, cap the size it has to deal with in one go
 
Smells of std::vector
 
wrong language?
 
How about a linked list of arrays?
 
7:25 AM
it would be Buffers anyway probably, so it would be a simple array of those imho
shift/push
if you have a massive number of something, Buffer will be a big performance boost
it wont have to maintain the facade of properties
 
Gotta try it out in my existing CA simulation
 
8:04 AM
@doug65536 the codes are correct, but the text is not. You're right that it's wrong. The author probably c/p the REST defs from somewhere else
without understanding it
@KendallFrey Didn't know that you're on twitter. But not going to follow you.
 
8:18 AM
Hey is the above tutorial mentioned by doug65536 really wrong?
Dont know much about REST, but I thought http://www.tutorialspoint.com/ was a good place for beginners
 
@Arnab They have a tutorial on JSON. Categorised under Java. o-O
 
@JanDvorak Java's Stupid Object Notation?
 
Not quite :-D
The "programming" category holds many languages, but not Javascript
 
so they got atleast one thing right
 
@JanDvorak that's indeed strange. But did you have seen the examples menu at the left side ?
JSON with PHP
JSON with Perl
JSON with Python
JSON with Ruby
JSON with Java
JSON with Ajax <------
 
8:35 AM
The JS tutorial's first example contains doc.write. And that weird comment thingie to hide javascript that was last relevant in Netscape Navigator
Plus, they specify both type and language as attributes, while the spec says you shouldn't do both and don't need to do either.
Plus - no head, really?
"integrated with HTML" - really?
Bonus points for admitting that client-side javascript isn't the only option
"you might use JavaScript to check if the user has entered a valid e-mail address in a form field" - O_o o_o
 
\o/ for noscript
 
Noscript? I feel old.
The only real use of <noscript> is to dump a GTFO message to overly paranoid users
"Client-side JavaScript does not allow the reading or writing of files. This has been kept for security reason." - not quite, even though there are limitations
"JavaScript cannot be used for networking applications because there is no such support available." - huh wat. Apparently AJAX doesn't use networking
"JavaScript doesn't have any multithreading or multiprocessor capabilities." - outdated at best
!!caniuse webworker
 
Even Internet Explorer fkn 11 supports webworkers
All three text editors / IDEs suck
"The ECMAScript Edition 5 standard will be the first update to be released in over four years." - the f?
"HTML (and XHTML, its successor)"
 
I remember when I first came here - with a similarly silly site. Jan devastated it in exactly the same way.
 
8:47 AM
"the language [attribute] has been phased out .. your script tag should include it anyways"
Devastating sub-par tutorials is my hobby
" We added an optional HTML comment that surrounds our JavaScript code." - hell, even Lynx knows better than to dump javascript to the user, and it doesn't even give a damn to CSS.
"JavaScript ignores spaces, tabs, and newlines" - bs
"NOTE − Care should be taken while writing variable and function names in JavaScript." - duh.
"JavaScript also recognizes the HTML comment opening sequence <!--. JavaScript treats this as a single-line comment, just as it does the // comment." - blatantly false. This only applies to the first line. x<--x gives you a bool.
But really.. We don't even bother to include a noscript tag where I work
Neither do they, so let's sin them for hipocricy
Fck, they don't even bother to HTML-comment their javascripts, despite shoving them into every example
 
@JanDvorak compile a medium post
 
9:05 AM
"JavaScript is untyped language" - bs. What they follow to define is a weakly + dynamically typed language.
"You should not use any of the JavaScript reserved keywords as a variable name" - the law of gravity is not just a nice idea.
"loop labels" - actually, yes, such a thing exists in Javascript. Have I ever used it? Once.
"Conditional (or ternary) Operators" - really? I only know about one ternary operator...
Plus a missing apostrophe on the next line
Their list of comparision [sic] operators fails horribly to include === and !==
"If both the operands are non-zero, then the condition becomes true." - that explanation is not only wrong, it's confusing.
They feel the need to explain "exclusive or" but they assume what "each bit of an integer" means
"Shifting a value left by one position is equivalent to multiplying it by 2" - let's test that on 2<<31
The whole section is kinda confusing to say the least
plus a grammar error soon after
"if( age > 18 ){
document.write("<b>Qualifies for driving</b>");
}" - yeah, let's fuck the idea of a driving licence
Including a newline in } else \n { I have seen. Including two consecutive ones I have not.
 
9:23 AM
it's just too outdated
 
You can't attribute to outdatedness everything above
 
:P
you have found a new W3schools
 
" you would need to write loop statements to reduce the number of lines." - chuckles, then laughs out loud
"Don’t miss the semicolon used at the end of the do...while loop." - why not this one specifically?
 
posted on May 22, 2016 by Axel Rauschmayer

In this blog post, I show six tricks enabled by new ES6 features. At the end of each section, I point to related material in my book “Exploring ES6” (which is free to read online). Enforcing mandatory parameters via parameter default values ES6 parameter default values are only evaluated when they are actually used. That lets you enforce that a given parameter be provided: /** * Ca

 
Oh and... storing flowcharts as JPEG is a sin. No, I haven't checked the file extension. It's obvious even without that.
"The break statement, which was briefly introduced with the switch statement, is used to exit a loop early, breaking out of the enclosing curly braces." - ...
soon after they are bold enough to bolden document.write
 
9:35 AM
since when is the break from switch similar as break to stop loops ?
@JanDvorak link ? i would like to read that myself
 
@KarelG Sorta is, actually. They terminate their respective enclosing statements.
 
true, but the process flow is different between switch and a loop
 
"A function is a group of reusable code which can be called anywhere in your program." - sure, an anonymous function is not a function until you store it in a global variable.
"It helps programmers in writing modular codes." - and the hindishism of the year award goes to ...
 
           if (x == 5){
              continue; // skill rest of the loop body
           }
let's skill rest of the loop
ugh, it even has a section which is about labeling loops to control it
that is bad practice IMO
 
@JanDvorak "hindishism"?
 
9:41 AM
Is it? I'm not ashamed to label my loops when it actually makes sense
or, indglish?
"[The return] statement should be the last statement in a function." - nope
"void is an important keyword in JavaScript" - FALSE!!!
 
eh @ that last
 
<a href="javascript:void(alert('Warning!!!'))">Click me!</a>
"f you do not want to keep an extra copy of a page, then you can mark your printable text using proper comments like <!-- PRINT STARTS HERE -->..... <!-- PRINT ENDS HERE --> and then you can use PERL or any other script in the background to purge printable text and display for final printing. We at Tutorialspoint use this method to provide print facility to our site visitors. Check Example." -- yeah, because @media{print} is not reliable enough.
Their explanation of OOP is really WTF as well
new Array, new Object, lowercase constructor name, setter for price named addPrice
That tutorial is a piece of garbage
with introduced without a hefty "do not touch" sign, or even as much as a note that it's often a bad idea
"Use the prototype property to assign new properties and methods to the Number object in the current document" - actually, no, don't.
"The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type." - blatant lies.
[a-Z] - not only [A-z] matches more than just all letters, they have reversed the cases, and [a-Z] is a syntax error.
"p$ It matches any string with p at the end of it." - nope, it matches p at the end of a line.
 
10:16 AM
 
<b>(.*)</b> - \_/O\_/
 
<li class="view"><a href="#FIRST">FIRST</a></li> Trying to get it look like this.
 
10:34 AM
Finally... Now I just need it to be inserted within the parentnode, or replace existing li inside
 
10:57 AM
Guys a bit of halp please
I have this result.replace(/(\.trc_header_left_column(?:.|[\s\S])*?display:) inline-block;/, "$1 inline;");
I'm running it on a semi-large (1-2k) string, and it completely freeze the process
Its purpose is to find display: inline-block inside of a class-name based CSS selector, and replace it with display: inline
Any idea why it blocks?
 
@MadaraUchiha I can do it, your project starting from 7th (:
 
You should drop CSS replacement and use jQuery
 
I lost my 85-day streak
 
@doug65536 I ended up writing this nifty little helper pastie.margaine.com/56ac1ad4-876d-4f0f-a243-ca1fd43f4ead
works better than bliss :D \o/
 
@MadaraUchiha string allocation is not cheap. also I presume you have the g flag in your original code to replace all?
 
11:08 AM
I don't, one replacement is enough
But it's not guaranteed that it'll find anything, so effectively the same as g flag.
 
Can't you just add the new style?
 
hmm... weird. should not freeze then
 
@JanDvorak I don't make the requirements, the entire system is utterly retarded
 
Still, can't you just override the style instead of rewriting it?
 
It's not better. Especially in this case
 
11:11 AM
@MadaraUchiha I tested it on a 5k file with 5 instances of strings that would be matched by that regex and it didn't freeze. Are you running this on a raspberry pi? :P
I ran with node though, not browser..
rest of the file is 42424242...
 
@MadaraUchiha If you can Madara please use this github.com/reworkcss/css :->
 
Awal try to run it on a large string that doesn't match
 
sec
 
Or even, that the first part (class name) matches, but the second does not
 
nvm
 
11:17 AM
Hammer - anyone used it for touch? How reliable is it?
 
@MadaraUchiha takes 3.7s according to time but it doesn't freeze.
 
Node Version?
 
6.1.0
sec lemme gist my code for generation and replacement
 
@BenjaminGruenbaum I used it 3 years back, never let me down
 
Try with 6.2 as well?
 
11:19 AM
2-3
 
@MadaraUchiha use a CSS parser? Why are you doing it with RegExp.
I'd actually write a CSS parser before that RegExp, it's probably easier.
 
@MadaraUchiha pacman is updating. ~20 minutes left
 
5 mins ago, by Abhishrek
@MadaraUchiha If you can Madara please use this https://github.com/reworkcss/css :->
@AwalGarg get NVM it will cache node versions, good for rapid switching
 
no
 
Use nvm?
 
11:21 AM
node version manager :-| an old node install script lets you quickly switch node versions
 
@AwalGarg the RegExp is slow because it's running into a pathological case in the file.
 
@BenjaminGruenbaum what?
 
@BenjaminGruenbaum yeah I am guessing it depends on the input. it probably hangs due to some weird state of the automaton
but still... he said 2k file
 
11:22 AM
@AwalGarg try generating random data for your 5k file
 
@Abhishrek that won't work
Run it against the actual file with a function replace and time every time the callback is being called.
 
good trick @MadaraUchiha ^ do that on the actual file and stream out the logs?
oh and also log RegExp.leftContext and RegExp.rightContext at every call
 
@BenjaminGruenbaum Run what?
 
str.replace(re, function(_, $1) { logSomething(); return `${$1} inline;`})
 
I think I'll do the investigating later, CSS parsing might be a better solution in this case
Here's the file I'm running against btw
/* override bootstrap default span definitions */
.hybrid-text-links-a [class*=span] {
    float:none;
    margin-left:0;
}

.hybrid-text-links-a .trc_rbox_header {
        line-height: 1.2em;
        position: relative;
        display: inline-block;
        width: 100%;
	background: transparent;
	height: auto;
}

.hybrid-text-links-a .trc_rbox_header_span .trc_header_right_column {
        position: absolute;
        width: 48%;
        left: 52%;
        top: 0;
	background: transparent;
	height: auto;
 
11:30 AM
@MadaraUchiha reproduced
 
What I'm thinking is that the first part is matched .trc_header_left_column which makes it follow into the 2nd part, in which it freezes up
Trying to limit (?:.|[\s\S]) to {0,10} makes it run OK, {0,50} still freezes
And this doesn't happen in 6.1
So this means there's a regression in 6.2
@BenjaminGruenbaum
 
no I can reproduce in 6.1 as well
 
@AwalGarg now I'm even more confused.
I'm consistently getting it on node 6.2, and consistently not getting it on 6.1
No, now I'm getting it on 6.1 as well
very odd.
 
@MadaraUchiha why (?:.|[\s\S])*? and not just (?:.|\n)*?? doing this replacement has the same effect and doesn't freeze at all in both 6.1 and 6.2
 
blame caching
 
11:41 AM
@AwalGarg Not sure why I went with [\s\S] honestly
Your suggestion probably works just as well
 
AND IT DOESN'T FREEZE. I WON THE INTERNET.
happy dance
 
slaps Awal
 
So anyways, I gave up on making the SSG. I think SSGs should be replaced with simple servers and caching layers. Limiting the scope to "static" is only going to harm, and adding too much server magic to an SSG will make things confusing.
Hence, I am going to focus working on JSHP instead today and add vhs helpers to it. I'd later make another layer which can use the JSHP server to generate static sites using the same semantics of JSHP.
 
JSHP? Go back to SSG. Now.
 
What I really need is a way to to make node listen to a unix domain socket now instead of a TCP port.
So some kind of TCP->UDP abstraction for HTTP.
Anyone knows of one?
@JanDvorak you are probably partly trolling and partly serious, but if you have some fair criticism for PHP's http abstractions, please tell.
Other than "hiding too much" or "false impressions on newbies". because frankly everything we use does this one way or the other. Picking up on PHP for that is gonna be unfair.
 
11:48 AM
@AwalGarg doesn't support websockets
or any kind of inter-user interaction
 
@JanDvorak node doesn't either. neither does any other HTTP server.
websockets are only initiated with the HTTP protocol. the communication happens over a different channel. and PHP sure as hell supports this.
 
!!google ssg
 
@MadaraUchiha static site generator (jekyll and the likes)
 
Still no google on cap?
 
cap isn't getting googling until someone ports it to node. or someone ports cap's features to my node bot. nobody is gonna do either of this :P
 
11:53 AM
@MadaraUchiha open an issue against node and against v8, but honestly just use a CSS parser.
 
watching that bro ?
 
@KarelG yeah while waiting for libffmpeg to compile
 
!!xkcd compiling
 
@JanDvorak Something went on fire; status 403
 
12:05 PM
@JanDvorak No not that one
I am compiling ffmpeg from source including most of its libs that takes a decent time in an old pc
its currently doing something with liblame
Does anyone in this room has a queue implementation? (The queue can have well over 100k elements)
 
You can make one out of two stacks
 
@JanDvorak you have to supply with id instead of string
!!xkcd 303
 
Petka does
 
@Abhishrek I've done that on a PC without networking or gui
 
12:13 PM
@littlepootis :D how was the experience? (I am doing it on a server vm with 256 Megs ram)
 
@Abhishrek ffmpeg takes 20 minutes to compile on a $5 DO server.
you didn't hire a guy for that yet?
 
K!
 
lol oops, deleted the wrong message by accident
My bad
 
@Abhishrek It took me a few days.
 
@littlepootis lol, I have done it in past on a Celeron D with 128 Megs ram
 
12:16 PM
I didn't even have gcc :/
 
my first dev machine for puppy linux
that made me install windows xp and weep in the corner [My first attempt at Linux]
 
So, I had to get that compiled for my arch first
 
Wait @littlepootis how old are you O_O ?
 
class Queue{
  constructor(){
    this.front = []; this.back = [];
  }

  pop(){
    if(!this.back.length){this.back = this.front.reverse(); this.front = []};
    return this.back.pop();
  }

  push(el){
    return this.front.push(el)
  }
}
 
@Abhishrek ah, puppy. I can build installable packages for puppy
 
12:17 PM
He will be 12 this year
 
@Abhishrek 17.5
 
@littlepootis that was about 7 years ago
 
@Abhishrek untested, test please
 
@Abhishrek Ah
 
@JanDvorak I just installed Petka's double-ended-queue
 
12:18 PM
I said "test please"
 
@JanDvorak doing
 
@JanDvorak that design is mostly useful for immutable stuff.
The inbox/outbox stuff like in that one article about immutable DASTs
 
@Abhishrek puppy linux isn't (and never was) for beginners
 
I'm a functional type of guy :-)
 
Okasaki IIRC
 
12:19 PM
@littlepootis on that processor Ubuntu just froze on bootup
 
@Abhishrek hah, dont run X
 
@JanDvorak why don't you use linkedlist ? (or a form of it). It will handle push/pop more easier
 
While doing srs bsns, my RAM usage doesn't exceed 80 megs
 
@littlepootis I am doing audio encoding and keeping 2- 10 seconds of buffer in memory
if available my code dynamically figures out how many frames and audio to keep in memory
so just testing how much difference does it actually make if It doesn't have enough ram to put more than 1 song in RAM :P
 
@KarelG so that I'm reversing smaller fragments?
Or perhaps the back stack should be read front to back instead of reversing and popping?
 
12:25 PM
@JanDvorak didn't work
 
That's not an error description
 
gimme a sec I will debug
I just put it in petkas benchmark
Not your fault :P, my bad
λ node thousand.js
double-ended-queue x 19,498,549 ops/sec ±1.29% (96 runs sampled)
node-deque x 2,116,425 ops/sec ±6.68% (45 runs sampled)
built-in array x 2,326,209 ops/sec ±0.92% (97 runs sampled)
jan queue x 16,489,714 ops/sec ±0.54% (94 runs sampled)
Works (:
double-ended-queue is petkas.
 
Built-in array is the fastest? FML.
 
No
 
Oh, wait, misread the orders of magnitude
 
12:31 PM
yeah
 
Cool, I'm just slightly slower than Petkas :-D
 
@JanDvorak he is using a ring
@KarelG node-deque is a LinkedList
IIRC
 
never heard of node-deque
 
Not bad. A circular buffer reallocates when it grows, a double-stack queue reallocates everything once.
 
is it part of the core or added by an extension?
 
12:33 PM
@KarelG its just a linked list implementation of deque
12 mins ago, by KarelG
@JanDvorak why don't you use linkedlist ? (or a form of it). It will handle push/pop more easier
 
hey guys. morning.
 
@JanDvorak you shall publish that as an npm module es6-tiny-fast-queue
 
Mine has the benefit that it releases memory when it shrinks
 
quick question. How do I import data into my postgresql docker container. Can't seem to find any instructions.
 
12:34 PM
I am more tempted to use yours, the slight disadvantage is nothing.
 
I should also try using a pointer instead of reversing. It uses more memory, but it does shrink and it might be even faster.
(theoretically)
 
Have a try :D
 
class Queue{
  constructor(){
    this.front = []; this.back = []; this.backPtr = 0;
  }

  pop(){
    if(this.backPtr > this.back.length){
      this.back = this.front;
      this.backPtr = 0;
      this.front = []};
    return this.back[this.backPtr++];
  }

  push(el){
    return this.front.push(el)
  }
}
go for it
 
@JanDvorak also get length() { return this.front.length + this.back.length; }
(not in this one though)
 
-this.backPtr
 
12:42 PM
yeah
double-ended-queue x 19,798,766 ops/sec ±0.36% (94 runs sampled)
node-deque x 2,340,091 ops/sec ±3.26% (55 runs sampled)
built-in array x 2,266,379 ops/sec ±0.78% (97 runs sampled)
jan queue x 14,805,858 ops/sec ±2.12% (88 runs sampled)
 
So, the double stack with reversing is faster?
 
@JanDvorak yeah it is
@JanDvorak git clone github.com/petkaantanov/deque
I gtg.
 
fewer derefernces?
 
vOv
 
00:00 - 13:0013:00 - 00:00

« first day (2045 days earlier)      last day (2886 days later) »