« first day (2155 days earlier)      last day (2800 days later) » 

7:05 AM
@rlemon It really is, I already have one :) It's being used for home automation atm
You can get a really nice case for it too, which fits the screen and the pi, has wall mounting holes too
 
@Ming Looks like you're trying to return from an asynchronous call.
 
hey guys, does anybody know if there is support for rgba in jQuery ?
for example this selector is not working :|
 $(".sir").css({'background': 'rgba(255, 255, 255, 0.3)'})
 
@mcmwhfy Try background-color
 
@Cerbrus nope, not working :|
 
i ended up doing this. but
var request = require('request')
function downloadImageBuffer(url, callback) {
	let params = {
		method: 'GET',
		uri: url,
		encoding: null
	}
	request(params, function (error, response, body) {
		// body is the decompressed response body
		console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))
		console.log('the decoded data is: ', body.length, ' and type is ', typeof body)
		return callback(body);
	})
}

var result = downloadImageBuffer('https://upload.wikimedia.org/wikipedia/en/d/d2/Gears_of_War_logo.PNG', function(a) {
@Cerbrus any advice how to make it better?
maybe using some library?
 
7:11 AM
2307
Q: How do I return the response from an asynchronous call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable inside the function and return that one, but none of those ways actually return the response. fu...

Read that.
 
good morning ^^
 
That var result = will never contain the result from a.
 
@mcmwhfy that should work, perhaps there's something wrong with your selector
 
^ agreed
 
@Cerbrus yes i know that. but thats what im hoping to do. any ideas how?
 
7:14 AM
My point is that you're still not "getting" it.
The function you pass to downloadImageBuffer is a callback. You can't "return" from a callback.
 
u mean like this
downloadImageBuffer('https://upload.wikimedia.org/wikipedia/en/d/d2/Gears_of_War_logo.PNG', function(a) {
	console.log(a);  // this works
})
is that the only way.
 
Yes.
(Basically)
 
im sure there must be some other way. like generators? or async library?
 
Promises. But they're basically callbacks
Why do you want a different way?
 
@ bitten nothing is wrong with my selector
see the fiddle
 
7:17 AM
because i want to be able to put it in a function and use it in other functions
 
What fiddle
 
make it modular.
 
like functional style.
 
Then you're not getting the difference between asynchronous code, and synchronous code.
@mcmwhfy Inspect the <a> elements there.
 
7:19 AM
@mcmwhfy your fiddle works
 
The .css call is working just fine.
 
i get the difference. but clearly its not the best way.
 
I forgot to put pseudo :hover
$("a:hover").css({'background-color': 'rgba(0, 0, 0, 0.7)'});
:|
 
just thought if anyone knew a better way to fix that problem
 
@mcmwhfy That won't work.
 
7:20 AM
why ?
 
Hi all, as per the accepted answer (stackoverflow.com/a/4899046/5936814) , I should not be encoding any user input data. Then if I inject some malicious javascript, lets say the comment section of a forum, the server would encode and save the data. The same data would be decoded and sent back to client, which means every client will get infected . How to get around this problem ?
 
Because there's no a being "hovered" the moment the script runs.
 
@mcmwhfy a psuedo class isn't a selector
 
@bitten Also that xD
 
@Cerbrus maybe you have explained it more cogently for him :P
 
7:22 AM
@FlyingGambit You sanitize the data server-side
 
i'm off, good luck @mcmwhfy!
 
@bitten
ty
 
@Cerbrus yes but thet .hover is deprecated
:\
 
@Cerbrus Thanks that answers my question
 
7:23 AM
@mcmwhfy That's not what the docs say.
 
hmmm let me recheck
yes you have right
:)
thank you :)
 
Hi everyone?
 
@JaganaathJayakumar 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.
 
been reading github.com/tastejs/todomvc/tree/gh-pages/examples/vanillajs to get a better understanding of plain javascript, does anyone else here find this complicated?
I am particular interested in building stuff without a framework to cement my skills
 
7:26 AM
Why is completely acceptable for someone to walk around with a barking dog, but when I walk around barking, it's suddenly "weird"?
 
lol
would love to hear anyone's take on this
 
@Leyth: Reading a JS file isn't really the best way to learn JS, imo.
Get a good book that actually explains what's going on, I'd say.
 
everyone's been telling me to read code in order to learn fast !!!!
 
What's your basis? Starting from 0, or do you have experience working with JS?
 
I've read several textbooks but I don't fully understand how to build MVC application with plainJS
I am some experience
 
7:32 AM
Books would be easy to understand the concepts but to get good practices we need to look into the codes
 
A proper book gives you plenty of assignments to practice.
 
I understand the syntax
 
With explanation and a solution to compare it to.
 
but I am struggling with putting things together
 
what do you actually want to build?
 
7:34 AM
My point is that you need to understand the concepts of a MVC application. You need to understand what needs to happen to make it work.
That kind of understanding can't be gained from staring at code.
 
I want to build a todo list using firebase as backend
in plainjs
in MVC
or local storage is fine
as long I can put it together using MVC
 
Also, please stop calling it "plainjs"
 
are you sure you dont want to use any modules, For network requests it would be easier to use existing libraries and at the same time if you want to use ES6 syntax then you have to use transpilers.
That should be easy
It all starts with a Javascript file
 
vanillaJS
 
@RandomUser Thanks, captain.
@Leyth It's just "JavaScript".
 
7:38 AM
ok, thanks for the correction
 
"plainjs" and "vanillajs" are joke names.
 
didn't know that
 
you can start by creating an array to hold all the todo lists, let todo = [];
 
@RandomUser: Do you have a clue of how to build a MVC application from scratch?
 
open this link, and just start coding.. whatever you can think of.. instead of just talking about it jsfiddle.net
 
7:40 AM
@RandomUser That'll surely end in a massive mess of spaghetti code.
 
Doesnt matter... we're here to help.. but write something
forget about MVC, just write a working Todo list first.. and then you can consider optimizing the code, re-structure it.
 
@RandomUser: You're not helping.
 
@RandomUser not really, but it is what I am trying to learn now
@RandomUser I've already done that
 
@Leyth: The tutorial I linked has a basic MVC example with some explanation. See if that helps.
 
my next step is to learn mvc
@Cerbrus thanks,
 
7:44 AM
If you already have done that, then you try to follow the concept.. where's the code? Lets try to use the code you have already written
 
4 mins ago, by Cerbrus
@RandomUser: You're not helping.
 
@RandomUser I don't think you've understood a thing I said
 
This is so awesome, I'm not even going to try to hide it
npm i rebecca
 
@Leyth I do understand it, but what i am saying is since you already have the non MVC code, use that same code and then try to convert it into MVC following the tutorial link provided by @Cerbrus
 
An approach like that will not end well.
Translating a non-MVC application to MVC is usually a headache. It's usually easier (/faster) to re-write it as an MVC application, from scratch.
 
7:51 AM
another good question :P
.row:nth-child(-n+3) .cell:nth-child(-n+3),
.row:nth-child(-n+3) .cell:nth-child(n+7),
.row:nth-child(n+7) .cell:nth-child(-n+3),
.row:nth-child(n+7) .cell:nth-child(n+7),
.row:nth-child(n+4):nth-child(-n+6) .cell:nth-child(n+4):nth-child(-n+6) {
    background: rgba(7, 7, 7, 0.2);
    color: #555;
    box-shadow: inset -3px -3px 7px rgba(0, 0, 0, 0.25);
}
how can writh this selector with jQuery
?
 
@Cerbrus But his question is How to rewrite it in MVC, from scratch., If he knew how to do it he would have already done it.
 
@mcmwhfy Why would you want to?
 
@FlyingGambit Please go and play in the Sandbox
 
@Cerbus thanks
 
@Ben Fortune I want to give a different background to some elements
 
7:53 AM
8 messages moved to Sandbox
 
@Ben Fortune and element as like in a table with row and cells
 
@rlemon: Looks like the JS trash room was frozen due to inactivity.
 
@Cerbrus do if I want to put code into modules like controller.js, model.js, etc. How will they communicate ?
 
and insetead of adding that ugly css selecter I'm wondering if there is another better way to itterate
 
@Leyth That question is too broad to answer in chat.
 
7:55 AM
@mcmwhfy Without seeing any other code, I would instantly assume that there is a better way than that
 
@Oliver Salzburg and that would be ?
 
Using a named class and putting that on the elements
 
@Oliver Salzburg not possible that :|
 
8:48 AM
 
:))))))
 
-8
Q: Javascript script to remove all semicolons

Ville Miekk-ojaI have a nodeJS project where I want to use ES6 without semicolons (through babel traspiler). Unfortunately, my project is full of semicolons, and I wonder if someone has already made a script that would remove all semicolons in the files except for the files inside node_modules folder?

._.
 
9:08 AM
Omg whats the deal with electron and my work pc. I cant install electron
 
@mcmwhfy Is that trying to colour four corners and the center region, but not the borders between the corners?
 
I can install any module with npm but I can't install electron
 
Try it in the command prompt instead of powershell
 
@Paran0a Because their postinstall task tries to download a file from a server that is down
Or blocked by your company firewall
 
hi anyone there?
 
9:12 AM
@VigneshwaranT 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.
 
Or something of that sort
 
I've been unable to install it forever, so It's probably that we are blocking the site that it's trying to download it from.
 
how to display the text on the X,Y,Z coordinates using javascript?
 
Thanks for the help. (i've tried with cmd)
 
9:13 AM
@Abhinav 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.
 
i have tried var d = document.getElementById('yourScore'); d.style.position = "absolute"; d.style.color = "white"; d.style.left = x_axis+'px';// X position d.style.top = y_axis+'px';// Y position
 
@Abhinav Read the duplicate I linked.
 
1
Q: how to display the text on the X,Y,Z coordinates using javascript

Mani maranI have text and X,Y,Z coordinates.I want to place the text on the particular X,Y,Z coordinates using javascript alone. I have tried these things, var d = document.getElementById('yourScore'); d.style.position = "absolute"; d.style.color = "white"; d.style.left = x_axis+'px';// X position d.styl...

 
So what can I do in that case ? Turn off the firewall? lol
 
@VigneshwaranT Unclear. What problems are you having, any errors?
 
9:16 AM
the X,Y,Z coordinates?
 
i have x y z position and have one text how to place the text based on the x y z
 
I guess z-index also?
 
I don't see you using the Z component at all
 
sorry only x and y position only
 
9:19 AM
i have x y position and have one text how to place the text based on the x y
in java script
without using CSS
 
@VigneshwaranT Your code is already using CSS. position absolute belongs to the realms of CSS. If you don't understand CSS and DOM you won't understand why your code is not working.
 
@OliverSalzburg Regarding my electron install, is there a way to find out which page it's trying to download from ( the postinstall script)
 
9:25 AM
x and y is canvas position how i will print the text in canvas?
 
CANVAS? LUL GOOD LUCK WITH THAT
 
@VigneshwaranT Very, very easily
 
@VigneshwaranT google javascript canvas draw text at coordinate
 
but i am using 3d canvas , created in babylon js @BenFortune @Sheepy
 
9:30 AM
Nothing like missing out vital details.
I'm done.
 
@Loktar @rlemon lalalala...
 
I swear Ill strange a tree if I dont manage to install electron today
 
@VigneshwaranT You come here with a CSS positioning. Then you say you want canvas, which is different. Now it is a babylon 3d canvas, which is another system. Don't just randomly seek help; find long tutorials so that you know what you are doing, if only to equip yourself with the knowledge to ask the right questions.
 
@FlorianMargaine no effort 1/10
 
@Paran0a Let me check
 
9:40 AM
electron-prebuilt?
 
It's a bit complex, but, probably github
 
@Yes Ben , It's just electron now. Don't know when they changed the name. @OliverSalzburg Ok thanks !
 
Set DEBUG to electron*
It should print what they're trying
 
Doing that right now
 
9:59 AM
Do you think that answer is OK ? stackoverflow.com/a/39408761/263525
It came 4 minutes after mine
 
10:17 AM
I think its redundant
 
10:28 AM
@littlepootis Wheatley
 
@Clone 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.
 
Wait, what
 
he's not the real one but a clone, that's why
 
How do I get Chrome to not trigger this scrolling when I click the middle mouse button?
I used to have an extension for that, can't find it anymore
Found it
 
10:43 AM
1 message moved to Trash can
@Sid Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
Sid
ok got it
 
is there a way to compile bootstrap against a config.json without of going through their web gui?
this is the gui i mean
 
@BenFortune ah nice! that's exactly what i was looking for
i was wondering if i was going to have to write something to transform the config file into some kind of variables.less/sass file
but this does it :3
thanks a lot
 
11:00 AM
@rlemon Tell him that it's only possible when using semicolons
 
@SterlingArcher lol, really?
 
@OliverSalzburg how is he not q banned. Look at history
 
Smallnote for everyone , $amd dropped a lot, time to go all in
 
@rlemon Maybe comedic relief :\
 
@Paran0a price of amd processors?
 
11:10 AM
*amd shares
 
oh, the price of shares
 
this guy needs q banning too
Panic delete, haha
 
@Neoares oh my badness
 
11:43 AM
Hii everyone i have a problem in angular-nvd3 and need help asap anyone here experience with it ?
 
Exotic environment? Check! Asked to ask? Check! Apparently urgent? Check!
 
@FlorianMargaine @Loktar rb rebecca black so chillin
 
@rlemon npm i rebecca
 
Hi Everyone, im currently building a invoice form and after allot of learning and failures I have almost finished it. Its a dynamic form so you can add new rows of fields. I have got them adding up for each row. Now i need to figure out how to get the price from all the total form fields price, add them up and put them into the Total Ex GST form field. I have a working fiddle if someone wouldnt mind taking a look: jsfiddle.net/fhaao26c/8
 
@Mosho ?
 
probably not
 
happy friday @rlemon @FlorianMargaine!
man I finally woke up without a fever
was sick for most of the week, friggin sucked
 
12:21 PM
@Loktar Not cool of you to be sick
 
I know, I was just feeling selfish this week though :/
 
Did you at least not work, or were you happy to contaminate those around you?
Also, when will you adopt me?
 
@Loktar post-legion sickness
 
Also, play Overwatch with me
 
@Zirak yeah I took a day off and took it easy yesterday
I'd play overwatch with you
I love that game actually
@Neoares I don't play wow, but have heard good things about Legion
 
12:25 PM
@Loktar yes...
 
@Loktar Zirak#21929
 
adding you right now
 
<3
 
I can't play until later though today, prob not till after dinner like 7pm est?
but anytime tomorrow and Sunday
 
heh, no worries, we'll play whenever
 
12:27 PM
cool
part of my daughters halloween costume :p
the kids love overwatch as well
 
That's...impressive
 
actually found it on Ebay, didn't make it, that would be insane
 
Did she get a giant Mech!?!??
 
hah she was talking about trying to make one, but we're going to pass on it for now lol
the headset is on the way, and we are going to paint a nerf gun for her
 
soldier 76?
 
12:30 PM
Not Korean, but close enough: suidobashijuko.jp
 
@littlepootis DVA
 
I forgot she can play without the mech thing on.
 
@Zirak holy shit this is awesome
 
For her birthday
You'll be the best and the worst father at the same time
 
!!s/sa/ga/
 
12:32 PM
@jAndy You'll be the best and the worst father at the game time (source)
 
LOL, dude.. the smile shot feature?!
best feature ever
 
they name their variables in japanese
 
Inside an ES6 class, is there a keyword to refer to the class? Like this for the instance
 
The name of the class?
 
@littlepootis I guess
But, well, dynamic :P
As in static getInstance() { return new self(...args); }
 
12:35 PM
this.constructor.name
?
 
@OliverSalzburg super?
No wait, that's an extended one
 
Yo, has anyone hear used socket.io?
 
@ErraticFox 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.
 
@rlemon Will that work in a static method?
I would assume this to be undefined
 
?
 
12:36 PM
@OliverSalzburg no
 
here*
 
class Potato {
  constructor() {
    // blah
  }

  static getInstance() {
    return new Potato();
  }
}
 
@littlepootis Yeah, that's what I'm doing right now. Copy&paste would be a lot quicker for all of these adjustments I'm doing right now, if I didn't have to replace the class name every time
 
class Potatox {
  constructor() {
    // blah
  }

  static getInstance() {
    return new this();
  }
}
this worked. why, js, why
Because this.
 
12:39 PM
@Loktar It's also nice how they added a cute animation of the thing possibly exploding near the end
 
@littlepootis Hot!
 
Potatox is a function, which is an object. this inside a method called like Potatox.method() is basically Potatox.
So, yeah, JS sucks.
 
So, inside a static member, this points to the class?
 
Classes are a myth
 
I love it! It will keep my colleagues puzzled for days!
 
12:40 PM
Is that the same without the class sugar?
 
The above is equivalent to:
 
@littlepootis that's nothing new, is it?
 
function Potatox () {}
Potatox.getInstance() { return new this(); }
@bitten nope
@BenFortune yep
 
@littlepootis xbox instances?
 
11
Q: Confusing JavaScript statement: "var x = new this();"

user419125I thought I understood the concept of the JavaScript prototype object, as well as [[proto]] until I saw a few posts regarding class inheritance. Firstly, "JavaScript OOP - the smart way" at http://amix.dk/blog/viewEntry/19038 See the implementation section: var parent = new this('no_init'); ...

Heheh
 
12:42 PM
That's fucked up
 
@Loktar It also seems like Kuratas and an American giant robot maker, Megabot, will be dueling sometime soon
 
@Loktar No, chrome wouldn't let me redefine a class.
 
@Zirak nice I've been waiting for that actually
@littlepootis lol I was just joking about potato x :P xbox = potato box
 
Am I the only one thinking that those git plugins in IDE are mostly making bad practices easier, like big commits automatically containing all that has been done recently ? Seriously, why do they want to immediately add new files to the index ?
 
12:46 PM
git add src/
git commit -am 'stuff'
 
@DenysSéguret WebStorm?
 
no, but don't they all do the same ?
 
git in your build pipeline.
 
Rebecca Black "Friday" spikes in google trends every single Friday since it came out. google.com/trends/explore?date=today%203-m&q=%2Fm%2F0gh6jqd
 
@ndugger Never heard of it
 
12:53 PM
liar
 
@ndugger I like how it trends every black friday.
 

« first day (2155 days earlier)      last day (2800 days later) »