« first day (2357 days earlier)      last day (2584 days later) » 

12:03 PM
keh, co-worker just asked me to aid him
he's getting "undefined" constantly
if (!_saveButton) document.getElementById('saveEventButton');
...
_saveButton.value = b.name; // undefined
had to grin
 
had he used jQuery it would have worked.
 
@Mosho Back. Sorry, had to get some ice for that burn.
 
hi all
0
Q: Node JS - How to use URL query strings?

zeddexHow can you use URL query strings in NodeJS like PHP's $_GET["query"] command? http://php.net/manual/en/reserved.variables.get.php Say for example you wanted to extend the code below to use a ?option=1 on the /page001 part. So visiting ServerURL/page001?option=1 would write "Page1: Option 001 ...

 
12:23 PM
@MadaraUchiha that was self-directed actually :D
 
@Mosho I'll ship the ice to you
 
just ship him back here
 
I've taken a look at the headphones you've sent the other day
@Mosho ^
If it actually works like they say it does, it could be really nice
 
like what
 
@Mosho Reminds you to focus when you need it
 
12:31 PM
oh those
 
And not randomly pinging you because it thinks you're distracted.
 
yeah I imagined myself sitting at tipranks specifically while wearing those :P
 
I know >_<
 
but then again
you kinda know when you are distracted
 
12:32 PM
I get sidetracked badly all the time
Like right now, for example, I should be working :D
 
and isn't it too late to be reminded at that point anyway
 
@HatterisMad iRacing has dirt track sprint racing now, in case you care.
 
enabling strictNullChecks teaches you some hard lessons about your code
 
cheeky lawyers
 
@Mosho Yup
@rlemon Heh
Whenever I see things like that I get reminded of the dump of stupid lawyer questions
 
12:38 PM
I'm allergic to clickbait.
 
this is outstanding
 
Yes
I know that one
 
2:00 will amaze you!
 
Lawyer: Have you checked the victim's pulse before starting the autopsy?
Doctor: No.
L: Have you checked for breathing or any other vital signs before starting it?
D: No.
L: Then how, doctor, could you have been sure that the victim was dead before you started the autopsy, potentially killing him?
D: His brain was in a jar on the table across from me.
L: And could it have been possible that they were alive?
D: Yes, it's possible that they were alive and practicing law.
 
12:41 PM
@MadaraUchiha bathroomreader.com always had a chapter or two about dumb lawyers and dumb crooks
excellent little fact books if you're into that kinda thing
 
I recall a similar case in a court. Something that logically was evident wasn't evident for the judge ...
it was about a burglar and a dead body in a house. The forensic expert said that the burglar was there. But he couldn't prove that the burglar murdered the victim. To enter the house, he has opened a hole in a door with a glass to open the door. His fingerprints and hair was present there.
 
@MadaraUchiha can you think of a way to take undefined "out" from T | undefined
 
but the front door was open when the victim got found
 
@Mosho Example?
 
judge thought that the burglar opened that door to leave the house
 
12:45 PM
const fn = <T>(...args: T[]) => {
    return args[args.length - 1];
};

fn(undefined, '0');
 
but the expert said that there was fingerprints of the burglar, so how could there not be any fingerprints of his one at the door. More... there is a footprint in mud near the front door while the burglar wore socks (how did he figure out that ...)
 
@MadaraUchiha ^
 
apparently he just broke into a house with a dead body and got more deep in shit
 
@Mosho T extends {} and strict null checks.
 
undefined not assignable to type T
 
12:48 PM
@Mosho Yes, that's the point, wasn't it?
That T would not include undefined?
 
no, I want to be able to call the function with undefined
I want the return type of the function to not include undefined
 
@Mosho You can't, if you accept undefined as parameters, the last argument might be undefined
And thus you return undefined.
 
I'm going to do something horrible
 
Cast?
 
I can't, it's generic
it's all I have
and it includes undefined
no I can't do what I want
damnit
hmmmmmmmmmmmmmmmmmmmmmmmmmmmm
:OOOOO
 
12:53 PM
@Mosho That seems to work well ^
No, actually it doesn't, really :(
 
I can't have {}
but I think I got it
but I'm not sure why it works
what the function does, is the same as chaining || but only for actual undefined values
so aggregate(1, undefined, 3) === 1, aggregate(undefined, 2, 3) === 2 etc.
 
@Mosho As in, it returns the first non-undefined value?
 
yes
but the return can't be undefined unless all of the arguments are undefined
or T | undefined
 
What do you return if all of the arguments are undefined?
 
undefined
const aggregate = <T>(...args: (T | undefined | null)[]): T => {
    const len = args.length;
    for (let i = 0; i < len; i++) {
        if (typeof args[i] !== 'undefined') {
            return args[i] as T;
        }
    }
    return args[len - 1] as T;
};
this works
fulfills exactly all the requirements
but I'm not 100% sure why yet
 
1:02 PM
@Mosho Then.... you accept either T's or undefineds, and you return either a T or undefined, yes?
You can use function overloading, probably
 
it's trickier than that
because the return type including undefined depends on whether the argument types all include undefined or not
I tried overloading but what I posted works perfectly as far as I can tell
but it might be due to a bug in TS...
it's a little weird
 
@BenjaminGruenbaum any changes in law :D ?
 
@Mosho Yeah, so you do something like
function fn(...args: undefined[]): undefined;
 
@Shrek no, killing someone for using php is still illegal
 
@MadaraUchiha and then? how would you have an overload for a list of args where they can be either T or undefined
 
1:10 PM
@Mosho I think the only issue would be in that case if the first argument would be undefined
Then it would have be inferred to be undefined, and you'd have to specifically tell the type.
 
@MadaraUchiha try implementing it
I don't see how it could work
 
@MadaraUchiha lost me at <string>
inferring the type is the point
 
hello again
 
@rlemon lol, I'm probably gonna die though :)
 
1:18 PM
we all are
such is life
 
@rlemon Come @ me
 
s/@/on/
 
75% of my job is PHP, i'm in the wrong room
 
@rlemon!
 
@BenFortune just because you work with shit doesn't mean you can't enjoy a flower every now and then
 
1:19 PM
after all those years
edit: you never left
 
never left
 
@rlemon lol, I love you so much :)
 
Non-objective question:
What library do you prefer to manage tables in angular 2? Why?
 
angular-2-tables
 
it's so damn good weather outside
!! quit job 1h earlier for jogging or keep working
 
1:33 PM
@KarelG keep working
 
@KarelG haha
@BenFortune don't find this exact name
can you filter objects with this one?
 
@SteamFire I was being sarcastic, sorry
 
What do you need your table to do? It might be easy to write one.
it's just a few loops outputing <tr>s and <td>s
 
Filtering, sorting, paging, showing dates in different formatting...
 
1:44 PM
if you know how to filter and sort and filter dates in JS already, then you are half-way there
 
actually I'm using ng2-table but having some trouble with...
 
just bind a few header click events to functions that re-sort...
OHh, I don't know angular.
I am speaking abstractly.
 
yeah yeah but it already exists, don't want to recode the world
 
When I load page My hidden Div using Jquery are able to see for milisec ? Can anybody tell me why this happens ?
 
jQuery probably only applies the styling after JS is executed, JS execution takes some time and in the mean time the "hidden" div won't be hidden.
 
1:48 PM
Look up the term "Flash of unstyled content"
FOUC
 
@SvenvandeScheur Any Solution for this ?
 
Don't style using JS
Only control state using JS
style using CSS
 
@AbhiBurk Don't just ping random people, that's rude.
 
He was replying..
 
1:50 PM
Oh lol
I'll give you one free hit
 
yeah sorry for that i was confuse for replying got so many reply
 
ohh, extensions.json. a nice feature of vscode.
 
Don't be sorry, my fault
@Luggage Extensions for each project?
 
@MadaraUchiha I have a challenge: do what you did in the presentation (I think?) with pick only for omit
 
can i get solution for my problem ? it flashes when I load my page
 
1:53 PM
yea. It just suggests the user installs them
 
@AbhiBurk Long story short: Try to set the initial state of your application in such a way that CSS can pick it up easily: <div class="thing thing--hidden"></div>. Add or remove the class "thing--hidden" with JS depending on your needs.

The default scenario (before JS gets executed) should be the one presented in HTML.
 
> "this project suggests eslint"
It means I can just tell a new dev "install vscode, clone repo, npm install, open the directory in vscode, install suggested extensions."
and bam, full dev environment
one of those extensions is EditorConfig, of course
 
@BenFortune do you have any other non-sarcastic ideas? :P
 
double dashes, sven?
 
ol' BEM syntax
 
1:56 PM
Is there some meaning that I am missing?
 
Basically component__elementofcomponent--state
Where state is always presented in an additional class
 
i see.
 
Block: Some reusable standalone component.
Element: A building block that's part of a Block
Modifier: A theme or state the Block/Element's in
 
gotcha. I just structure my less/sass that way
.someBlock {
    > .element1 {
        &.state1 { color: red; }
    }
}
 
Yes, we do that as well only with BEM names.
 
2:00 PM
1 message moved to Trash can
@SvenvandeScheur Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
1 message moved to Trash can
 
ctrl-k is only reliable when it's all at indentation level 0 when you hit it
but I saw it.
 
The cool thing with BEM is that the components are structured/parsable. When we need to do stuff with the DOM in JS we use a little library we've build: npmjs.com/package/bem.js
 
neat, but I would never read state out of the classnames of dom nodes
i write only.
I'm a react fan, you see.
 
Not the complete "data" state, more like the "visual" state
Thing of examples like "menu menu--open" or "button button--primary"
 
class Menu {
    open: boolean;

    render() {
        return <div className={{ "menu--open": this.open }} />;
    }
}
 
2:05 PM
Oh yes, react is very neat
But we don't use react for everything
 
An elided example just showing that I keep my own state and bend the DOM to my will.
 
If react, then yes thata a better solution. But for regular content websites we don't use react (or any single page framework) because of SEO and stuff, we then still want a component base approach and use our own little bem.js for that.
But even when reacting we use the BEM methology for naming things.
 
Right.
 
beer!chatstat Luggage
@rlemon Luggage has a total of 64155 messages. Their top three rooms are: JavaScript & Jordan: 63100 messages.
@rlemon Where in the world is Carmen Sandiego?!
lol what??
still bugs to work out apparently.
 
TIL BEM and interesting reads
 
2:14 PM
and that SvenvandeScheur likes dog food
 
dog food?
 
!!define dogfooding
 
@Luggage dogfooding present participle of dogfood
 
damnit.
 
god that fail
 
2:15 PM
dogfooding: v. (of a company's staff) use a product or service developed by that company so as to test it before it is made available to customers.
using something you make yourself
 
i'm in QA :/
almost drooled
 
!!chatstat KarelG
 
@rlemon KarelG has a total of 22098 messages. They are most active in: JavaScript & Jordan: 21300 messages.
 
better link : imgur.com/a/kuCiD
 
there, now I can flex my chat stat muscles.
!!chatstat
 
2:18 PM
@rlemon rlemon has a total of 461776 messages. They are most active in: JavaScript Games: 14 messages. NASA lied: 40 messages. The SO Tavern (Free Snacks): 94 messages.
 
dammit I reversed the freaking order of the filter
:(
 
noob
 
@rlemon rlemon has a total of 461778 messages. They are most active in: JavaScript & Jordan: 362000 messages. HTML / CSS / WebDesign: 63800 messages. C#: 11600 messages.
 
the message counts are rounded
I'm lazy
 
So when is JavaScript: The Movie being released?
 
2:20 PM
NEVAH
 
room topic changed to JavaScript: The Movie: Topic: JavaScript, ECMAScript. Read this: javascriptroom.github.io/rules. Before asking inform yourself on the XY problem goo.gl/taIqf | devdocs.io Documentation™ Helps. Room meta discussions: github.com/JavaScriptRoom/culture [ecmascript] [ecmascript-6] [javascript] [nodejs] [typescript]
 
there goes my statement
 
@corvid es 2020
> JavaScript The Movie: ES2020 - The Developers are seeing clearly now.
a quentin tarantino production
 
people ask me where I see myself in three years. I tell them I don't have 2020 vision
it sure is a good thing this room doesn't have downvotes
 
we have kicks
they're like downvotes
 
2:22 PM
errr
i cannot kick someone here. So i can't "downvote". not fair bro
 
user2620028
@KendallFrey enough to possibly download it... not sure about getting a wheel and whatnot
 
> JavaScript The Movie: ES2030 - npm modules exceed human population
2
 
@HatterisMad a wheel is probably cheaper than iRacing unless you intend to only play for a month or two
 
In a world where frameworks rule, one man will do the unthinkable: use vanilla js
 
user2620028
@KendallFrey nvm i just looked at the trailer and it this looks less realistic than the old ratbag game from like 2000
 
user2620028
2:25 PM
and they borrowed the sounds from the nascars and used them for sprintcars
 
I have no idea how good it is, I haven't tried it
I'd guess there's plenty of room for improvement, it's the first release
iRacing has been around for years and they're still fixing up the terrible tire model
they don't even have flat spots
 
user2620028
the cars aren't sliding up the track in the turns, they aren't ever losing traction when the guys hit the gas too hard, and the cars are handling like pavement cars in a turn
 
iirc iRacing is "expensive" .... ie not worth of the monthly price
 
user2620028
you have to pay for iracing?
 
If you want a hardcore sim, it's not iRacing. If you're looking for semi-competitive online racing, it's great.
@HatterisMad oh hell yes
One sprint car and one track will set you back about $25
There's one dirt track included with a subscription
 
2:29 PM
!!should I go workout even though the gym is packed with brats
 
just curious, which racing game would have "most realistic physics"
 
@Mosho Yes, absolutely
 
fine
 
okay dumb question: suppose you have a list of objects with some property at some key. I want to get all unique values for every object at that key as a list. Example: [{ "day": 1 }, { "day": 2 }, { "day": 1 }] outputs [1, 2]. What's a good algorithm for this?
 
@KarelG Contentious topic, there
 
2:30 PM
true :P
 
The best I've ever played is LFS
I hear rF2 and AC are quite good
 
@corvid uniqueBy and map
 
AC stands for "Assassin's Creed" for me :|
 
user2620028
yeah my opinion on this by looking at people race the sprintcar, it has way too much grip
 
Assetto Corsa
 
2:31 PM
uniqueBy isn't a native function, eh?
 
no
 
@HatterisMad Which video are you looking at?
 
never heard of that game
Yet i'm playing ... GT lol * hides *
 
@KarelG try it, it's... unique
 
user2620028
2:33 PM
@KendallFrey i watched the official trailer, and then i watched christopher bell trying it out
 
user2620028
christopher bell is a very good sprintcar driver, and he is driving the bottom of the track like he has it planted on the cushion at the end of the race and everything is dialed in perfect
 
user2620028
it looked like it was showing the track degrade as he drove which is nice
 
Wreckfest is fun if you like crashing things
 
wreckfest :)
 
very fun
 
user2620028
2:34 PM
that is a large part of the game, but even with the track deforming it didnt seem like it changed his traction much at all
 
successor of flatout
not the last ones but the first ones
 
burnout?
 
no flatout
 
function uniqueBy(arr, property, desc = false) {
  const unique = new Set();
  for (const item of arr) {
    unique.add(item[property]);
  }
  return Array.from(unique).sort((a, b) => (desc ? a - b : b - a));
}
 
@SvenvandeScheur burnout predates flatout
burnout was an outstanding game series
 
2:36 PM
@HatterisMad Yeah, those do look oddly boring
I was watching Jeff Favignano, he was way more out of control :P
 
user2620028
@KendallFrey the car always has 100% traction in that video, even when entering the turn way too fast sideways he still holds a line
 
I'm gonna try out the street stock on dirt this evening, see what I can do
 
user2620028
@KendallFrey yeah.... just for reference, christopher bell was entering the bottom at probably 20mph+ faster than the bottom should be able to be taken, and that is before the track deforms any. get 10-15 laps in on that and he should slow down another 10-15mph
 
user2620028
but he just hammered it in there at almost full speed and didnt break line lol
 
user2620028
and what settings do you get to make to the car before the race?
 
2:39 PM
god burnout ...
sometimes I had problems to get gold medals because you have to have a good chain of collisions or pickup the bonus multipliers damn precisely
one bit too left or right, aaaand got silver
 
@HatterisMad It varies based on the car. Generally you get basic suspension (springs, ride height, dampers etc.) and aero settings, with more advanced settings for higher-level cars.
I don't know what settings are available on the sprint cars
 
user2620028
yeah i meant for sprintcars lol
 
user2620028
cause they have almost no tech
 
user2620028
@KendallFrey i am watching the jeff guy you sent me drive a stockcar and the physics look much better on those
 
My guess is you'll get pretty much all you want with suspension, as well as gearing and steering ratios etc.
 
user2620028
2:43 PM
well the suspension tuning is nothing like other cars
 
user2620028
cause the tech is so far outdated lol
 
Is it bad that I loved Midnight club games ?
 
lol
I drove F1 exclusively for a season (3 months). Those things are a fucking beast to set up.
 
user2620028
i havent seen this guy try to hit the cushion yet, if the cushion doesn't exist i wouldn't even play.... do you know if the physics work for the cushion?
 
user2620028
haha yeah f1 is definitely more tech than it is driving
 
2:44 PM
What is the "cushion"?
Would that be the looser dirt outside the groove?
 
user2620028
uhh no
 
user2620028
we call that the marbles
 
lol ok
I didn't hear anyone mention that word so idk what it is
 
user2620028
in motocross it would be called the berm
 
user2620028
the cushion is the dirt that gets packed up like a berm
 
user2620028
2:46 PM
at the top of the track
 
user2620028
and you can go in 30mph+ too fast for the turn and put your right rear tire on it and just keep bouncing off of it around the turn
 
user2620028
cause it provides a shit ton of traction
 
user2620028
and a small wall so you dont jump over it
 
user2620028
until you jump over it and take a spectacular wreck
 
2:47 PM
ok, I am confused
 
I haven't seen it manifest itself, and I would guess it's not properly implemented. Don't take my word for it
 
user2620028
that is the only way that the top side of the racetrack is faster than the bottom in shorter to medium sized tracks
 
for some reason FetchAPI is only seeing 4 headers in the response: content-type, expires, pragma and cache-control
what could be causing that?
 
user2620028
that is the other thing, these cars have shit acceleration compared to the real cars
 
user2620028
the real cars have much more torque and acceleration, this stockcar shouldnt be struggling to get up to speed down the straight
 
user2620028
2:48 PM
ahh yeah the modified has the same traction problem that the sprintcar does
 
@HatterisMad I think they talk about slick tracks having less grip than loose tracks, but that's probably not the same thing
 
user2620028
well we have a thing called dryslick
 
user2620028
and that happens when a track gets run on and the dirt gets superheated and loses its friction
 
user2620028
and if you get your tire a few inches into the slick then you spin out almost immediately
 
user2620028
basically... its ice
 
2:50 PM
@tereško what header are you missing?
 
user2620028
its ice and you are driving a car with 900hp and over 600ftlb of torque lol
 
user2620028
and you have no downforce and weigh just over 1000lbs lol
 
You're definitely not getting confused at a smaller engine version, right?
 
@rlemon I am looking for X-Authentication header in particular, but there are 15 other headers there
 
I know there are different versions (not sure if they're different cars entirely)
The 410 is the only sprint car that doesn't bog down exiting a corner, I think
 
user2620028
2:52 PM
@KendallFrey the smaller engine versions still have enough ass to constantly break the tires loose and slide up the track and whatnot
 
could it somehow be related to CORS?
 
user2620028
@KendallFrey the 410 should be doing a wheelie if you give it more than 1/3rd throttle at once
 
user2620028
they are all detuned to shit and back
 
lol yeah
the 410 does a wheelie if you pop the clutch from a standstill
 
user2620028
clutch?
 
2:54 PM
Jeff did it
 
user2620028
they have clutches
 
eh, Fetch should have access to all headers
 
user2620028
real life sprintcars don't have clutches
 
@tereško maybe, I know fetch does different stuff with headers than regular xhr
 
2:54 PM
did you have iterated over that ? (just to check)
 
I think all cars in iRacing have a clutch
 
@KarelG "Headers" has a restricted list, but they're only for setting cookies
 
user2620028
wow.... they need to remove the clutch from the sprintcar
 
Not necessarily a real clutch, but at least a way to disengage the engine
 
content-type: application/json
expires: Mon, 26 Jul 2000 05:00:00 GMT
pragma: no-cache
cache-control: no-store, no-cache, must-revalidate, no-cache, private
I am getting only this
 
2:55 PM
did you check Headers.entries()
?
 
user2620028
yeah.... sprintcar is direct drive, you give someone a way to pop the clutch and it changes the car a lot
 
Does it have neutral?
 
@rlemon that was the output from entries()
 
user2620028
no
 
weird
 
2:56 PM
so there's no way to stop?
 
HAMMERTIME!
 
before you turn off the engine i mean
 
user2620028
we have a lever that actuates an in and out box in the rearend
 
user2620028
so we can disengage the engine from the rearend
 
user2620028
but its really hard to do it when the car is moving
 
user2620028
2:57 PM
and you cant put it back in unless the engine is off and the car isn't moving
 
Quick I need help naming a component: a horizontal scrolling box containing some boxy elements, kind of like netflix has, what call it?
 
In jquery, is there a way to see if MULTIPLE buttons have been clicked?
I know that in PHP and/or C# you could do:
if(button1 != null && button2 != null && button3 != null)
// do stuff

But I got no idea how to do it in jquery except to sit spamming .click() for every button.
 
Yeah so I think a clutch is a practical necessity, since you can't have the car moving when you get in it
 
user2620028
@KendallFrey the car isn't on when you get in it
 
@Xariez Target by classname and add a click listener?
 
2:58 PM
@HatterisMad It is in iRacing
 
user2620028
you guys don't do rolling starts?
 
Yes, but the game doesn't place you in the car while it's rolling
 
user2620028
lmfao oh
 
Problem is, when you got about 20 buttons and more to come, i don't think i can just add one "global" click listener and call it the day? @corvid
 
event delegation
 

« first day (2357 days earlier)      last day (2584 days later) »