« first day (2274 days earlier)      last day (2899 days later) » 

00:01
@monners so i've checked out some stuff on promises and kind of get the idea on how they work, but when trying to apply to my own code i'm still a little clueless...
@Ekin pong
So your first request will get your friends IDs, you'll .then to make your second request with the data from the first, and .then pass on the results of the second request to alexa. From there I have no idea. Never used alexa
firstRequest(url)
.then(data => {
    const secondPromise = secondRequest(data.IDs);
    return secondPromise;
})
.then(data => {
    doSomethingWithAlexa(data);
})
.catch(err)
@HatterisMad daft?
I may be returning that second promise incorrectly
link ?
we can definitely profile it :D
00:09
first(url).then(data => second(data.ids)).then(data => { dosomething(data) }).catch(err)
@rlemon Ah k, so I was right, just more verbose explicit returns
the second then returns nothing tho
in both examples
Assuming the second request also returns a promise, doesn't that become the next thenable in the chain?
yea I'm just saying, if dosomething was meant to return
it doesn't
Oh, well yeah. Based on the question this is in answer to I have no idea what's supposed to happen at that point
00:15
@rlemon would you check that gitamp link and tell me what you think?
All rest is nice but this is probably the worst file here :P
saw it earlier when peehaa was trying to fix some css
looks neat
thanks for the help guys, will keep trying
that's some scary shit @ndugger
00:36
what's the best thing to do if you are in a data silo in your company?
it's a new company that I started 4 weeks ago lol
They do not give me any task to do so I have to find things to do on my own
and no one wants to listen to my idea or share information
find another company to work for
Assuming, of course, that the problem isn't actually on your end
well, I personally do not blame anything to others. I am personally not 100% entertaining and social person. But it does not mean I have done something really bad in this company (considering that i've been here for 4 weeks now) or made someone pissed off
user6438653
Hey guys!
user6438653
How could this be simplified? Math.sin(Math.round(Math.random() * 360))
actually i was very pissed off all the time because no one respects me. when I ask a question and if someone else speak to the person, they immediately stop answering my question
00:41
with Math{ sin(round(random()*360)) }
you're doing it wrong
firstly ,sin takes radians and not degrees
user6438653
@david hahaha, that eould be cool.
user6438653
@towc okay....
secondly, that will end up being a distribution which is much more easily computable. And it will be just that, a distribution
what exactly are you trying to achieve?
user6438653
00:42
It's meant to generate random angles for ctx.rotate.
Math.random() * 2 * Math.PI
user6438653
Ahh right. thanks @david :)
unless you're joining the tau manifesto, like most of us
fuck tau
i'd rather have 2 pies
But PI Day has such a nice ring to it
user6438653
00:43
hahaha, lol, but PI tastes better.
if tau was like... 1/2 pie
you ungrateful bitches
then maybe
although you still lose your pie
user6438653
watetmelon pie...
user6438653
apple pie is the best pie to have ever existed.
user6438653
00:52
by by pie pie
user6438653
thanks gor your guys' help :)
user6438653
I hate mobile chat
you're welcome, have fun
01:36
Hello.
Anybody want to play Between with me?:
This is an older, free, low budget indie game by Jason Rohrer. He makes non traditional games that push the boundaries of the medium. This one is 2 players only. As in you you literally can't play it with only 1 person, or with 3, but only with 2. You cannot save, so the idea is to complete the game in one go. The last time I played it I figured out what I was supposed to do, and I got decently fast at doing it, but we weren't finished when the other person had to quit, so I lost my progress.
Anyway, I selected join with a stranger, so just waiting for another person to do that.
02:03
did you find a stranger?
02:43
Ah yah, is that you?
if they joined around the time I posted
I need more magenta blocks
I've been trying make sure I have at least 4 of each whole color in each dimension or whatever they are
Even if they are colors I started with, just in case that creates something useful for the other player
But yeah, I'm stick in the same place, need more magenta
is there a way to delete blocks?
yes
You have to build up a huge stack of them
far left or far right
and then try to carry one you want to get rid of past the other ones
then it will disappear
I'm not sure how I got any magenta to begin with
If you like games that push the boundaries, try Lost in the Static
Here's a screenshot:
02:54
looks cool
I just realized I'm not completely stuck even though i still can't make more magenta
03:05
wow I finally planed another block
game is progressing really slow now haha
how many levels up are you?
first 4 are done
5 is partially done
6 is partially done
wha... eh
snap, my brain stopped working...
03:11
ouch
rip
ok back after a water and bathroom break
GF: My disk is full, I need more space for my games. Uninstalls Steam.
Me: Facepalm -_-
guys
is updating query string in URL bar slow?
slower than DOM update?
This is a dream, right? Shoots myself
03:22
@JasonMarsh It depends on what are you trying to do
let's say you build a library called jQuery's Brother
and you hold states in your URL bar
do you think it will be a fast library?
@JasonMarsh Unless you're performing tens of thousands of operations you shouldn't even be thinking about the minute differences of internal actions. Write what makes sense to others who read it, and aim for maintainability/reliability/sensibility
@Shmiddty How make more magenta?
if you have 4 magenta in any realm, you can make a magenta block in other realms
and loop through
you're not removing blocks from my towers are you?
Only if I need to... Althought that aspect of things is quite confusing...
03:28
please don't remove from the main/puzzle tower
I can't make more magenta
I don't have 4 anywhere
does one player start with rgb and the other with cmy?
I have rgb
I started with RGB
we must be playing with strangers
@Shmiddty new season started :D
03:31
cool beans
I hopped on earlier today to test out the new patch
it's running really slow for me
@Shmiddty download or the game?
the game
oh heh
I'm stuck there for past 30 minutes
I know my life sucks
03:47
another block in place!
lol
I'm t-3 blocks
the last level is annoying
I seem to be completely stuck now. More of my magenta disappeared
user2620028
@abhishrek what does daft mean?
@Shmiddty Now I only have one magenta block
Now I have 3...
got another block in place
got one more in place
Wow tower is randomly very messed up one dimension...
Fixed the tower in that dimension. It had never gotten that messed up before, but at least the pieces were still around somewhere, they just got moved around.
04:05
@HatterisMad da fuck on safari
user2620028
you really need to stop using that thing man
user2620028
at least for this instance turn off autocorrect
okay
so can you show me your game :D?
user2620028
let me get a little bit further on it
user2620028
want to get the players drawn and the collision detection working before i link to it :P
user2620028
04:12
it shows like 5% cpu usage currently running at 60fps though... and not much lower for 30fps. its not going to be efficient enough to be playable without eating resources
@Shmiddty is the necro paid?
user2620028
i wonder how much resources canvas eats up though... will have to look into that.
yeah
@Shmiddty ok got another block in place that I think was a critical one I was missing...
Ah fuck
@Shmiddty will it be free?
04:14
probably not
how much is it?
i don't see any place to buy it
not sure
not out yet
@still_dreaming_1 I've got all my blocks in place but nothing is happening... does the stranger have to do the same?
@Shmiddty I'm guessing so
I just got one more in place
I think my partner might be just making silly art
04:30
got one more in place
Somehow I still suspect we are partners even though it doesn't seem to make sense...
I left my game
Hmm.. Well min is still going in any case
Ah man, I'm gonna have to dismantle my tower to use a piece of it to build another piece of it...
oh wait, no I don't
hm, now it says other has been silent for 10 minutes
weird
ooh, I have more magenta!
04:51
only top level left in one of the dimensions
05:06
wow this game takes forever...
user6438653
05:17
Hey guys!
user6438653
How can I simplify this code:
1 message moved to Trash can
@WATERYMEL0N Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
user6438653
app.use((req, res, next) => {
  var ir = req.path.replace(/\/$/, '') == '/index.html';

  if (ir || req.headers['x-forwarded-proto'] == 'http' || Object.keys(req.query).length !== 0)
    res.redirect('https://' + req.get('host') + ir ? '/' : req.path);
  else
    next();
});
user6438653
@CapricaSix Yeah yeah @CapricaSix I'm on mobile! Ctrl+K doesn't exist! retarded bot! Gimme 5 mins to sort out the code, impaitient, much. Bot. faq off.
user6438653
Anyway... The code is node.js & express, running on heroku.
user6438653
05:23
@Shmiddty Make it $1000, thetmre was an app that price, heaps of people got it, and all it was, was a glowing red gem.
user6438653
The I am rich app.
user6438653
nv byby
05:38
Anyone here who knew Hitler ? o
@still_dreaming_1 it saves a lot of time if you make the same block in each dimension, in sequence
06:11
Question - do the posts marked as "put on hold as off-topic" get deleted from StackOverflow eventually?
06:25
@MadaraUchiha ^---- check
06:39
@RahulDesai It depends
If the question meets those criteria it gets deleted, regardless of wether it is closed or not
I did it! But nothing happened :(
@Shmiddty I guess I will have to try again with a friend and make them stay. Maybe will have to pay them with pizza or something.
or write a bot to play it
07:11
@RahulDesai Under certain criteria, yes.
They first go from "on hold" to "closed" automatically, if no one edits them and reopens them though
But the roomba doesn't care if the question is on hold, closed or open though?
The roomba straight up doesn't give a shit is my impression
Current status: micro-optimizations
@ivarni It does
Rooma would take a closed question after 9 days, but not an open one
Ah, I see
It took one of mine recently, RIP question
07:33
oww
googled to see if you can get parent form element by input element
115
A: How to get the form parent of an input?

Paolo BergantinoNative DOM elements that are inputs also have a form attribute that points to the form they belong to: var form = element.form; alert($(form).attr('name')); According to w3schools, the .form property of input fields is supported by IE 4.0+, Firefox 1.0+, Opera 9.0+, which is even more browsers...

"w3schools" lol
anyways it does the job
And jQuery too because wtf not
user6438653
How can this be simplified? (_ = ~~(Math.random() * 4 + 1)) * 15 + ((_ - 1) * 15);
user6438653
(removed)
user6438653
nv
08:04
oh boy
that's a nightmare for the QA in me
but why do you assign in a statement ?
just fyi, it can be shortened, (2 * (~~(Math.random() * 4 + 1))) - 1) * 15
or even (2 * ~~(Math.random() * 4 + 1)) - 1) * 15
what does this mean _ - 1 ?
!!> _-1
@FlyingGambit "ReferenceError: _ is not defined"
_ is just a variable, JS allows a lot of garbage in variable names
ah I see, ty
user6438653
08:23
I found a good solution: 15 + 30 * ~~(4 * Math.random()) math.stackexchange.com/questions/2085743/… Thank you guys for your help.
OMG, I registered an account on Pluralsight, but I forgot to cancel the preapproved payment. Just now, I received a message telling me that the payment has been made.
Could I ask them for a refund? I just forgot about that.
yeah try asking
Do you have any experience for that?
I have had the same experience before with freelancer.com, they were deutsche though
they didn't refund. then I deleted my account
Ask. Worst case they say no, best case they say yes
You've literally nothing to lose
08:30
ok, i'll try
heh, coworker just yelled why there is no NAND operator in js
3
gotcha send him back to school
hey
:)
@Redplane 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.
08:52
@KarelG isnt NAND = XOR ? then (foo ? !bar : bar) is a valid nand operation
you need to go back to school either
although you can construct a XOR with 4 NANDs
@KarelG me packs his school bag :D
09:35
!!> const a = (new Date('justNotValidInput') ? 't' : 'f' ); a;
@KarelG "t"
invalid dates are being evaluated as true. D:
!!> const d = new Date('justNotValidInput'); isNaN(d.getTime());
@KarelG true
user6438653
@littlepootis errr
user6438653
!!> true
user6438653
09:41
!!
user6438653
!!> const f = true; f;
-1
Q: Image preloading function testing

Max NjorogeWould like to know if the following is an effective way of preloading images and whether there is any way of testing the preloading function? Thanks. var images = new Array(); function preload() { for (i = 0; i < preload.arguments.length; i++) { images[i] = new Image() images[i].s...

Is it a good idea to preload images ?
user6438653
!!toolongdidintread
In node, I have a singleton object, that I'm importing into my script. When I log it out I can see it has the data I need. but if I access it directly it returns undefined. Why?
I'm logging it with JSON.stringify.
user6438653
JSON.stringify({})?
09:44
then access it normally, like if(config.debug == true) - as an exmaple
console.log(JSON.stringify(config,null,2)); returns the object correctly
console.log(config.CLI.workspace); - returns undefined...
you need to parse it first
user6438653
I dunno...
config is an object.
user6438653
@Thaenor Weird.
user6438653
even if object was just {} it shouldn't return undefined...
user6438653
09:48
the only way is if it's undefined, check it.
user6438653
config.CLI.workspace must be undefined.
user6438653
well, i'm going, byby.
10:15
@some js guru's
func = new Function("obj", strFunc); where strFunc is a string of js statements
I found that in an old .js file.
Does it not create a security risk?
why would it create a security risk, unless you don't know what's in strFunc ?
(but then it's like saying you import a js file and you don't know what it is)
i know what's inside the strFunc. But I didn't have seen this approach to create functions before.
it has many advantages over eval, but you don't often need that
it appears that it is used on some pages. The function body differs on this or that page.
these files are from 2009
lol
according to the mdn, the variables accessed in this approach are global ones if not present in the body
hi there
I'm a bit confused with the "mdMenu" item from material (angular2 : github.com/angular/material2/blob/master/src/lib/menu/README.md )
is there any way to make it display properly wherever the trigger is ? I mean, if the trigger (as in example) is located on the left of page, when clicking it, it displays the menu "outside" of the view, next to the page (left)
left, you can see the button, located on left of page.
right, it appears "out of view" when clicked.
10:45
@WATERYMEL0N turns out I was referencing the JSON incorrectly. things I assumed that were in config.something were actually just under config.
I misread the json
OH NOOOO!!
Someone in this chat was wrong!
You were my oracles or JS...
Turns out readfile in node doesn't work if you're trying to read a directory.
9
Q: Node.JS readFileSync() function

Xylonindex.js var server = require("./server"); var router = require("./router"); server.start(router.route); server.js //Script to start a server var http = require("http"); var url = require("url"); var fs = require("fs"); function start(route) { function onRequest(request, response) { ...

11:08
Hi Guys
@KHLIM 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.
Noted. Thanks
11:25
@Sheepy apologies for the delay. The example you set out worked fine. However, there was something wrong with the JSON format so i am opting to get that changed otherwise we will have issues later on. But thanks for the help :)
when using livereload how do I go about telling multiple instructions for it to do when something changes in the file?
11:50
Can node run two watchers at the same time?
Good. I just unaccepted my own answer of more than three years ago...
4
A: Detect the ID of the current user timezone using moment.js

Anthony Chuinardmoment now has the guess() API as described here

What, if any, naming conventions do you guys use for JavaScript function names? I try not to use anonymous functions and naming them is becoming a pain. E.G function submitButtonClickHandler(){}
Need help with angular again
Code stops working when I try to add a controller
(function () {
  'use strict';
  angular.module('BlurAdmin.pages.casemgmt', []).config(routeConfig);

  function routeConfig($stateProvider) {
    $stateProvider.state('casemgmt', {
        url: '/casemgmt',
        templateUrl: 'app/pages/casemgmt/casemgmt.html',
        title: 'Case Management',
    });
  }

  // project stops after I add below part
  angular.module('BlurAdmin.pages.casemgmt', [])
   .controller('casemgmtCtrl', function(){

  });
})();
v1.4
12:08
@bassxzero I don't think naming all anonymous functions is worth the pain and hindered readability. The only few times it's needed (i.e. debugging) is rare enough and you always can find them anyway.
@DenysSéguret That's interesting. I'm self taught and everything I read (and remember) said it makes debugging much easier so I just mindlessly did it and never looked back. Does anyone else share Deny's opinion? If so I'll drop it now cause it's a pain.
You easily see the time and pain you spent on it. What was the gain? How many times did it save your ass while debugging?
I will admit that it saved me quite a few times while debugging because a lot of my DOM elements have multiple handlers for the same event and were interfering with each other. I might be able to chalk it up to being new to the language though.
I've always found this a little annoying
> Learn Git and GitHub without any code!
it's the kind of thing I would expect wordpress.com to say
@Mosho where?
12:23
<h1> of front page of github
I don't see it
Maybe they think I'm interested in code
@Mosho Even I dont see it
wat
Maybe its a message only for you
12:25
> It's Mosho, he doesn't know what code is, let's tell him that GH is good for cat viewing
Sorry, no other explanation is possible
But yeah, this banner is retarded
I do enjoy cat viewing
@FlyingGambit congrats
XD
The power of a web designer is astronomical :D
12:29
Hello guys. Need help with Angular.... I have a collection coming from an endpoint. It contains Firstname, LastName and other details of an employee. I want to concatenate the firstname and lastname from the controller (not the endpoint). What should I be looking for . Is there any Angular builtin directives for this? is $resource used for anything like this?
oh cool, I can now hammer CSS questions
Now to get the gold hammer for regexes...
user3119231
Do you always use classes or do you use ids? (I use id's only if I interact via js)
user3119231
^I know random question, but I just want to know if I'm doing it right
@Maurize Are you asking the room ? If so I use both but your practice is OK.
classes if i want to mass select some elements, else ids
user3119231
12:36
For example: I create a userbar. I know it will be the only element of its kind. Use id, right?
Is it me or is most of the profile pictures really gone?
you
oh shit
But some are there. strange!
@bassxzero The program that I'm maintaining today still has every functions named. Like act_view_show_entries_each - which is passed to Array.map. When the program was first created in 2010, IE still commands the market and debuggers are not as mature or reliable,so it was important. Now I plan to rewrite them all with lambda in next major version.
12:43
@Sheepy thank you
@DenysSéguret thank you too
Do note that for now I still keep naming functions for consistency. It hurts more to mix different coding styles.
Noted :)
act_view_show_entries_each shouldn't they be actViewShowEntriesEach ?
camel casing instead of snake casing ?
13:00
@FlorianMargaine @Loktar @KendallFrey ITS FRIDAY FRIDAY GOTTA GET DOWN ON FRIDAY!
I am having a problem with twitter's api: twittercommunity.com/t/…
Please look into this.. :)
user6820627
13:19
is there anyone used webgl? i see tutorialspoint.com/webgl/webgl_cube_rotation.htm and it has numbers and letters that should be called icelandic. can anyone understand?
@LearnHowToBeTransparent I don't see any Icelandic
user6820627
@KendallFrey you understand?
No
I don't even understand what it is you want me to understand.
you know nothing
13:30
oooh ffs, the school computers run IE8, which still requires the experimental prefix for webgl, and doesn't have template strings to make shaders easily -_-
IE8 supports webgl?
^ that
it does, apparently
not out of the box it doesn't
just the experimental drafts though
@rlemon how do you mean?
I can type document.createElement('canvas').getContext( 'experimental-webgl' ) on the console and it returns a working context
user6820627
13:34
@towc he means not out of the pc case
oh wtf nvm this is IE11

« first day (2274 days earlier)      last day (2899 days later) »