« first day (2137 days earlier)      last day (3035 days later) » 

01:15
@rlemon he's slower than me lmao
Mornin all
01:32
How to check for undefined property in shouldJS as obj.pro.should.equal(undefined) will throw error as should is not a function
 
1 hour later…
02:39
morning~
Sitting with the guy who made passportjs
2
@Abhishrek cute
@jarvis oop is one letter away from poop, true. That also means when the client/boss hands you poop, it is easiest to chop it into oop.
@Sheepy lmao
morning guys.
02:54
Just trying to see it from another angle. I do code most of my js, php, and python in functional style. But not Java or C#.
im having this problem. Im not able to convert my buffer data to String. it keeps on giving blank in my output.
any ideas?
py.stdout.on('data', function(data) {
	console.log(`Data : ${data}`);
	console.log(data.toString('ascii'));
	console.log(data);
	console.log('receiving data from py script.........')
});
<Buffer 72 65 61 64 69 6e 67 20 64 61 74 61 20 6e 6f 77 2e 2e 2e 0d 0a 70 72 69
6e 74 20 6c 69 6e 65 73 20 66 72 6f 6d 20 70 79 20 73 63 72 69 70 74 20 30 31 ..
. >
receiving data from py script.........
the first 2 console.log output blanks.
@Ming If toString doesn't work, I am quite at a loss of what kind of object the data is... any clue?
im assuming its a buffer object.
so what are the current mvc javascript web frameworks
@Sheepy these are the 3 scripts im using. u can run it and see if u get a problem?
http://hastebin.com/uzuqorabev.js
http://hastebin.com/abiwojulal.py
http://hastebin.com/akequsikel.py
03:04
@phenomnomnominal well I work with him (:
@Ming Sorry I don't run node. If it is an array buffer I expect it to says "[object ArrayBuffer]". But you can try their string conversion code anyway: stackoverflow.com/questions/6965107/…
03:22
@Sheepy no worries. actually i realised i was reading my output wrongly. it was working all along. lol
Glad it is solved :)
 
2 hours later…
04:58
@BadgerCat Ow. Thought the form will generate a virtual online card showing off some google doc integration.
@jvk 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.
1 message moved to Trash can
@jvk Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
jvk
jvk
How to calculate next prime number after current prime number for(var i=2; i<=input_value.value; i++){
if ((input_value.value%i)===0) {
break;
}

}
if (i==input_value.value) {
document.getElementById("error").innerHTML=input_value.value+"is a Prime Number";
document.getElementById("error2").innerHTML=text+"is a Prime Number";
document.getElementById("error3").innerHTML=sum;

return false;
}else{
document.getElementById("error").innerHTML=input_value.value+"is Not a Prime Number";
return false;
05:16
// A short simple prime number program
var maxPrime = 1000, primes = [1,2], primesCount = primes.length;
nextCandidate: for ( var i = 3 ; i < maxPrime ; i += 2, ++primesCount ) {
   for ( var j = 2 ; j < primesCount ; j++ ) if ( i % primes[j] == 0 ) continue nextCandidate;
   primes.push( i );
}
alert( primes );
@Sheepy Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
@jvk see above
jvk
jvk
06:09
@Sheepy Thanks you Dude
07:07
Hi
how can I load xml file to browser, just like I do js or css
<script src="example.xml"></script> ???
user5503464
0
Q: How to add muliple roles in auth.hasRole('') in node.js?

ko001I have list of roles like admin superadmin manager user Here i want to make routes like if roles is admin he can access all api but superadmin means can do only 'get' and 'put' , if manager and user can only do 'get' below is my routes how i need to add muliple roles to access that api's...

user5503464
helpme out
@ko001 Bad question. This has nothing to do with roles or express. You simply want to expand something that was previously looking for a single value, to now accept multiple values. Most of the code and examples in the question are useless
07:36
Why is god punishing me , why do i have to work on an application that uses all of the jquery libraries
jqueryUI jquery jquerymobile omfg
@Paran0a Obviously, God loves jQuery
it seems that if I do this:
import CircularProgress from 'material-ui/CircularProgress';
webpack bundles the entire material-ui library
how do I avoid that
@Mosho Rewrite CircularProgress so it doesn't depend on any other code from the library
it doesn't
that's the point
and I don't want to edit material-ui
In that case, I have no idea. I don't use either library
07:56
@Paran0a Oh, tempt not the Lord your God. He may ask you to consider leaving your job and go to a biblical college instead.
Do you even know how a goddamn button markup looks
 <div data-corners="true" data-shadow="true" data-iconshadow="true" data-wrapperels="span" data-icon="null" data-iconpos="null" data-theme="c" data-inline="true" class="ui-btn ui-shadow ui-btn-corner-all ui-btn-inline ui-btn-up-c" aria-disabled="false">
<span class="ui-btn-inner ui-btn-corner-all">
	<span class="ui-btn-text">POVRATAK</span>
</span>
<button id="B22004376604570098" type="button" data-inline="true" onclick="apex.navigation.redirect('f?p=170:6');" class="ui-btn-hidden" aria-disabled="false">POVRATAK</button>
You can only imagine how easy it is to change styling
08:15
Is my chrome going nuts? Scrollbar is thinner in some tabs and focus color is also different
morning guys
@Paran0a Everything as usual over here
o/
'Ello
08:16
how come this nodejs script only allows me to post a request to http server ONCE
const http = require('http');
const path = require('path');
const server = process.argv[3];
const options = {
	hostname: server,
	port: 8080,
	method: 'POST',
	headers: {
		'Content-Type': 'text',
	}
};

const req = http.request(options, res => {
	console.log('Server response: ' + res.statusCode);
});

process.stdin
	.on('data', (d) => {
		req.write(d);
	})
	.on('end', () => process.stdout.write('End of stream\n'));
any ideas? need help. thanks
after the first post, it ends. :EG does not response anymore
Hello, has anyone ever used p2.js ?
@AntoineGuillien 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.
Could someone explain the collisionGroup and masks ? It seems that I done it wrong, you can see my running code here : pgg-sladix.c9users.io/index.html Since I added the collision groups, no collison occur anymore. I don't understand what I did wrong.. Thanks !
I got it fixed. no worries guys.
@Ming what was it ?
08:27
@AntoineGuillien nice game
@AntoineGuillien oh. the problem was on my server side
@Ming A callback issue ?
was a stupid problem. i wrote response.end
instead of response.write
oh ok haha
Thanks for the game, but well I'm a little lost with the collisionGroup and collisionMask as I said ^^
yeah. i noticed that u can pass through walls
would like to help but ive never used p2.js before
Hope someone will be able to help ^^
08:44
Hi all..
On clicking the generate whole report button, it does nothing. But on clicking the corresponding request call, it starts downloading the corresponding file..
I want my file to download on button click.
make the button an <a>?
@FlorianMargaine with a download attribute :)
@AntoineGuillien related code looks like
<button type="button" class="btn btn-primary" id="whole-report">Generate Whole Report</button>
@SterlingArcher you heard the news about Tom Searle? :(
@AvinashRaj So it's inside a form ? could you provide a working jsfiddle ?
08:55
@GNi33 one year too late...
pardon?
dark humor about the "27's legends"
user5503464
i am new to this roles, i dont know anything thats why i asked .i didt get u what you are trying to say @OliverSalzburg
oh, that's what you mean
@AntoineGuillien No it's not inside a form. It would create an ajax request on button click
    $.get( "/whole-pdf/", { vehicle_nos: arr.join(';') } );
08:59
@AvinashRaj Then maybe you want to take a look at this johnculviner.com/…
You don't need a jQuery plugin to download files......
No, you don't "need" it, but it's easier to set up IMO and provide useful features
This isn't possible without any third party pulgins?
@AvinashRaj You can also do something like window.location="/whole-pdf/params..."
09:13
@FlorianMargaine You are right
how can you not shoot yourself between your eyes after writing that
WOAH
@FlorianMargaine Consider it done lol
I'm all for jquery plugins when they help cut down on development times.
but, seriously.
skim through the source to make sure it's sane at least.
Yeah I guess I learned the lesson
@FlorianMargaine Which method would you recommend for @AvinashRaj problem ?
09:16
30 mins ago, by Florian Margaine
make the button an <a>?
So on click you would change the href of the link ?
rewrite its href on click if you want
or better: rewrite its href when you change the form's inputs
Nice solution !
or use a form's submit button
so that you don't rewrite the href manually, the browser will send all the inputs in the URL, like a normal form
Even cleaner, nice
09:22
@BenFortune I also think download files is best done with a plugin. As soon as you want to set the filename (which is pretty basic) browser variations kick in and gave me headaches.
@Mosho that's the intended action
you need to "tree-shake" your app if you want to avoid things like that
i.e. remove unreachable code
DCE wouldn't remove that
and it's not tree-shaking
the modules are simply not imported
but webpack includes them regardless
@Mosho that's what it's designed to do
@Mosho that's tree shaking...
webpack just imports everything, so i would recommend looking into tree-shaking if you want to effectively "only import code you use in the build"
09:28
Started using Rollup for small projects, it's pretty good.
@BenFortune yeah was about to recommend it, it treeshakes by default
they have an interactive demo on their homepage too
so @Mosho have a look at the demo on their homepage, it does what you are looking for
import { cube } from './maths.js'; and it only bundles cube
that is tree shaking
I'm talking about import something from 'module/nested/something'
module should not be imported
has nothing to do with tree shaking
@Mosho that is treeshaking :3
the author of rollup said that dce !== treeshaking
"..dead code elimination consists of   taking the finished product, and imperfectly removing bits you don’t want. Tree-shaking, on the other hand, asks the opposite question: given that I want to make a cake, which bits of what ingredients do I need to include in the mixing bowl?"
from here
hi guys, is there anyone here who are experts about x-editable plugin?
@emo_noel10 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.
09:40
I think of it as "live code inclusion". It's not immediately apparent to me what "tree shaking" means, in fact I'm not even sure I would google image search it
unless something relies on module, then it does need to be imported. webpack just "naively" imports the whole package
hi guys, is there anyone here who are experts about x-editable plugin?
@ivarni yeah it's silly. it's at least a bit more descriptive than karma, mocha, chai, sinon, enzyme, or istanbul :p
@emo_noel10 i'm not familiar with it sorry. just ask away and someone may be able to help though
True, those mean nothing. This is literally wrong. Have you ever tried shaking a tree? All kinds of useless crap falls down from it and you have no real control over what lands on your head.
okay @bitten
just leave my msg here if there's sum1 knows x-editable plugin. i'm so stuck right now
09:46
Hi guys , Anyone one knows how to Insert Json data's into Google SpreadSheet using javascript ?
@Becky 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.
@ivarni yuck :(
10:00
@AntoineGuillien On clicking the button I have to make an ajax request. But if we do like this
    document.location.href=$.get( "/whole-pdf/", { vehicle_nos: arr.join(';') } );
It redirects me to 404 page.
Could anyone help me with disabling jQuery UI tab right click event
@AvinashRaj that doesn't look right
I tried this
document.location.href="/whole-pdf/?vehicle_nos=" + arr.join(';');
but it fetches only the single record because of ; character.
is there any way to do html escape?
@AvinashRaj encodeURIComponent
Thanks all. And finally this works for me..
document.location.href="/whole-pdf/?vehicle_nos=" + encodeURIComponent(arr.join(';'));
10:15
Well done :)
10:44
@Sheepy What's your address? :)
I'll send you a sheep card
a cute sheep card
11:05
send his son a baby sheep card
Sheep are adorable, I have one myself
Eeveeeeeeee
Yeah, I have two of those
2 sharks, 2 eevees, 1 sheep and 1 ebola
please tell me that ebola is a pokemon name
11:13
Hahahaha is that a cuddly strand of ebola?
oh wait, no. Now I remember that they sold those as plushies, haha
That's cute as fuck
yeah, @copy got it for me
haha, this is great
I thought it was the actual virus in a container...........
11:14
is there anyway to get closest 10 results in case of greater than when using mongodb
Yes, greater than limit 10.
This is what is happening with me
@BadgerCat Later. Got to go now. >_< Baby sheep is saying goodbye everyone~
Aww :D
11:17
My lecturer didn't knew what %zu format specifier was for. She nearly humiliated in front of a class of 60.
@BenFortune there are 27 records. Each with different timestamp.

On initial load I am sending latest 10, now forward push is less than query where I am sending the timestamp and it works just fine

now when I am on 3rd page, I have 20-27 records and now while performing back operation I am doing greater than on the 20th element, I want 10-19 records but I am getting 1-10 instead
I lectured her about size_t and sizeof.
Is she hot?
She's 45+.
Not sure if she's in your league.
Certainly not!
11:18
Also
yesterday, by little pootis
Like.. never in my life. I am that kind of person that doesn't care when a 10/10 walks by
You should get yourself checked I guess
Did you read what I posted regarding the db issue?
I probably should. This is getting on others' nerves.
Yes, I did. But I don't mongo db.
Well...man is a social animal
There's $gt and $limit.
I know I am using that only
11:19
@GandalftheWhite I am an antisocial plant.
It is giving me first 10 records
I want 11-20
Can you even do that in Mongo?
Logically what would you do
as in?
I am missing some logic I guess
Postgres has LIMIT and OFFSET that lets you do this. Not sure how you'd do this in Mongo.
There's no logic. Your other option is to stream stuff.
I just wanted the word
but it isn't that efficient
there is page option in mongo as well
11:22
Streaming?
oh
What is streaming?
I have used SQL only in college
I have not used pipelines and stuff
Joins, Efficient Codes, Triggers, That routine thingy and undo etc
this is what they had in syllabus
I have forgotten the terms
*Stored Procedure = Routine Thingy
and undo etc = Transaction stuff
commit and rollback etc
these are the things we basically did
What college, if I may ask?
Indian College
you might not have heard about it
11:31
You might not have heard of my college either because it's little known even to people in Hyderabad.
So which one is it?
IIIT Hyderabad?
hahaha, no
11:32
That's for people who've scored 290+ in JEE Main.
this one
IIIT Hyderabad is the bomb
I wish I was not an idiot in XII
I like how every college claims to be the best in {City}
Your Career looks as fucked as mine
xD
I like how all their sites are terrible.
And have some form of marquee.
@GandalftheWhite lmao
11:34
Even the good colleges here have fucked up websites
that is how things are
The computers here run Windows XP.
And have Turbo C++ 3.0 installed.
xD
Ditto again, but we ha Visual Studio as well
had*
SHE TAUGHT EVERYONE THAT INT IS 2 BYTES WTF
What is this? 1991?
There is only 1 difference between good colleges and the bad ones in India
MINDSET
I was in IIIT Allahabad for some time
> If you want to pass the examination, you have to write short as 1 byte, int as 2 bytes, or you want get marks!!!
start up thingy
The college's idiocy is there as well but students with help of alums prepare themselves in right direction
The difference between the peeps at IITs and my college is that..
the greatest thing that the most at IITs ever do is get into one.
@GandalftheWhite That's nice
But the education sucks.
They fill your brain with steel putty.
11:38
And oh, flow charts
@littlepootis you know, I think stolen stock photos would be better than the slideshow in there...
@littlepootis What did you get sent down for?
Oh, no, I wasn't sent down.
11:48
!!urban sent down
@BenFortune sent down to be committed to prison
Wew, getting a 4k screen for work
then that's a question I ask myself everyday
and every night before crying myself to sleep (jk)
11:54
That's not the college I'm in, though. IIT-Kgp is considered (by plebs) to be the best college in India.
Woah my investing fund just grew by 13% SHOULD I SELL SELL $$$
no, buy more while the price is high
Hmm that doesnt sound right
12:33
@SterlingArcher youtube.com/watch?v=D2SwmLT37ss super generic, but I kinda like it, especially his voice
about once a year or so I remember people rip off lemonmeme a lot so I search for one meme I created to see how many people use it now
I've gotten over people just ripping it and removing attribution, but this dude actually listed it on his profile as "My Work"
@bitten if I have a module with an inner folder, requiring the inner folder without requiring the whole thing is not tree shaking
it is completely ignoring spec and inventing buggy ways to do things on the fly
which pretty much defines webpack
How can someone manipulate google's material design componentry to use multiple tab bars on the same page? I've got the styling and markup down and some of the script, but I'm not quite there yet. Anyone have any experience with google's mdl?
morning guys
morning @Ming
12:47
just to clarify how can i pipe data from one node js script to another? cant seem to get it working.
this my code
const spawn = require('child_process').spawn;
const fs = require('fs');
const js = spawn('node', ['inputs.js']);

js.stdout.on('data', (data) => {
	console.log(data);
})

process.stdin.pipe(js)
got this error
_stream_readable.js:555
    var ret = dest.write(chunk);
                   ^

TypeError: dest.write is not a function
    at ReadStream.ondata (_stream_readable.js:555:20)
    at emitOne (events.js:96:13)
    at ReadStream.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:172:18)
    at ReadStream.Readable.push (_stream_readable.js:130:10)
    at TTY.onread (net.js:542:20)
@Mosho if you are using import CircularProgress from 'material-ui/CircularProgress' as an example, it does not include the whole folder, it's just a shorthand for import ... from 'material-ui/CircularProgress/index.js'
my input.js file is this
process.stdin.setEncoding('utf8');

process.stdin.on('readable', () => {
  var chunk = process.stdin.read();
  if (chunk !== null) {
    process.stdout.write(`data: ${chunk}`);
  }
});

process.stdin.on('end', () => {
  process.stdout.write('end');
});
tree-shaking would be to import CircularProgress and only it's dependencies
no superfluous modules/code from material-ui would be included
is that not what you want..?
I went ahead and made a codepen to (hopefully!) show what I'm trying to do. Any guidance would be appreciated. Never worked with something like mdl before. Such dependency on Javascript!
codepen.io/anon/pen/zBQKyk here's what I've got.
I put some things on partial opacity so I can demonstrate what I'm going for.
@bitten except it doesn't just bundle that
12:56
I've tried a couple times (you can ask to see my failed attempts) to get the drawer links to pull up each of their own sets of tabs, ON the same page.
it bundles material-ui/index.js
@Mosho are you using webpack?
yeah
yeah because that's what webpack does, it's intended behaviour is to include the -whole- module/library or however you want to call it
which goes against spec, reason, common sense etc.
I did not ask for the whole module
12:57
..because it doesn't tree shake :p
@Mosho don't use webpack then ^.^
use rollup
it's n-o-t tree shaking
sorry it is
lol ok
any thoughts?
12:58
tree shaking only includes/imports what is necessary
what is tree shaking to you?
it's importing only some of a module's exports
and it's not "to me"
material-ui is not a module
@Mosho and only one's that are necessary?
each file is a module

« first day (2137 days earlier)      last day (3035 days later) »