« first day (2577 days earlier)      last day (2387 days later) » 

10:00 PM
Why does typescript throw object can be undefined ?
am I missing something?
 
ha! that game is actually pretty cool! xD
 
@HeribertoLugo 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 am using React-Router to create routes for a simple web application. Currently, the layout is such that there is a sidebar and then there is the router component which displays different views based on the route. So, no matter which route the user goes to, the sidebar will always appear. However, I want to create special routes that go one level up and replace the entire container (which includes the sidebar and router) with a page. Is this possible?
 
shrek = i think its because you checked it there is something in that list, but didnt check to see if after you shift it - there is still something there.
 
but I am literally doing
this.tasks.length > 0 on to of it
 
10:05 PM
what if this.tasks.length is 1. and when you shift it, you are now in nothing
i dont know about typescript, but just in general - i know shifting something with length of 1 will take you somewhere where there isnt anything.
 
then i am calling the function
javascript is single threaded
there is no way someone else is going to change that data
b/w the call and the check
!!> Number(null)
 
@ShrekOverflow 0
 
!!> Number(undefined)
 
@ShrekOverflow "NaN"
 
10:12 PM
what are those extra parens for btw? shouldnt it be this.tasks.shift(); ?
 
@towc Why do devs so often insist on making a game get harder as you progress?
 
are you against that?
 
interesting
 
    const task = this.tasks.shift();

    if (task === undefined) {
      this.currentTask = null;
    }

    this.currentTask = task();
    this.currentTask.then(this.next);
 
10:15 PM
I think it gives increasing reward of completing each level
 
Same error :D
@KendallFrey I guess I found another case :P
it says task can be undefined
 
I eventually just said "fuck it" and moved on
 
@ShrekOverflow case?
@towc To me it's not a reward, it's a fuck you
 
Similar to what you discovered in TS
@HeribertoLugo tasks is an array of functions that return promises
its a rudimantary task queue
 
@KendallFrey well, what other games do you play?
 
10:16 PM
@ShrekOverflow Are you saying it can't?
 
queue.add(async () => {

});
 
@towc fun ones
 
ksp doesn't follow that, sure
 
@KendallFrey Afaik it cant
 
terraria allows a non-linear thing as well
 
10:17 PM
@ShrekOverflow What's preventing it?
 
anything else?
 
I need a game.
 
most rpgs are like that I think
 
@KendallFrey I literally checked if its undefined 1 line above it
 
ok...
 
10:17 PM
const task = this.tasks.shift();

    if (task === undefined) {
      this.currentTask = null;
    }

    this.currentTask = task();
It's warning task can be undefined when I call it
 
@ShrekOverflow So?
 
@Luggage I have a suggestion for a really hard one
gives you a rush
 
Doesn't mean it can't still be undefined
 
and actually allows you to do good in the world
 
How can it be undefined ?
 
10:18 PM
I don't want to do good in the world.
 
If it's undefined
1 min ago, by Kendall Frey
@ShrekOverflow What's preventing it?
 
it's about solving a complex puzzle at increasing levels
 
Oh xD
shit I see now
 
Nope. I don't like where this is going.
 
weird,
 
10:19 PM
the plot is that a kid left for dreamland to follow his dreams, and some evil people back in evilland are trying to take him down
 
const task = this.tasks.shift();

    if (task === undefined) {
      this.currentTask = null;
      return;
    }

    this.currentTask = task();
 
I won't kill your parents.
 
the longer you manage to let the kid stay in dreamland, the more points you get. It gets incrementally harder, but has a nice pace to it
@Luggage damnit :/
 
@towc So, the timed survival genre
 
don't starve
 
10:20 PM
@KendallFrey if you lose, the game mechanics change and you're resurrected in a completely different context
 
I printed tiny net cups
\o/
 
some key mechanics named "physics" are the same though
@rlemon nice :D
 
@rlemon why?
 
I want a don't starve type game but all new so I get to experience a new game.
 
@Traitor for tiny plants
 
10:21 PM
@rlemon it's gonna be so hard to take shots from
 
duh
 
@rlemon Or a really tiny laundry basket.
 
i.stack.imgur.com/7vanF.png < I wonder why its giving me the same error here though
 
@rlemon cute
 
@KendallFrey thanks :D
 
10:21 PM
@Luggage Inevitable loss, or...?
 
but i still don't get it why the .length > 0 makes it freak out :|
 
I also printed a tiny watering can
 
no, perpetual growth is fine, too
 
for my tiny plants
 
is that spray metal?
 
10:22 PM
yes
 
planning to do some hydroponics with the net cup or...?
I genuinely don't know of other uses for it
 
nahh, gonna use them for splitting some aquatic plants I have growing
 
my print just popped off the glass
 
@Luggage I was having all sorts of issues :/
 
awh :/
 
10:23 PM
tape seems to be the only sure fire way to get them to always stick
just a pain in the ass
 
this is the first time
 
did you 3D print that at home?
 
this cat is destined to not get a head
 
@Luggage my first like 5? prints were fine, no issues lifting.
then like every second print lifted
sucked
started taping the bed, no more lifting
 
yea, gotta clean the glass or treat it. I idid some on tape, then went glass
I can tell the tape is stronger. I'll be back to that type of surface, i think
 
10:25 PM
can you 3d print new human beings to replace obsolete ones?
 
@rlemon How much would you say each net pot costs you in raw mats?
 
@towc tiny ones only
 
1kg = $25
 
they'll do
 
the pot is like 18g of material
 
10:26 PM
i don't know what to change to make cura output gcode that prints this cat as well as the one that came with it
 
@Luggage still set on not playing that game?
 
@david aka the net worth :P
 
the original gcode looks better (until it goes corrupt)
 
@KamilSolecki v.v
 
@Luggage layer-height to .1
 
10:27 PM
@ShrekOverflow Is it supposed to be smart enough to link length and shift together?
 
that's probably all you'll need to adjust to make a higher quality print
if you have more flat surfaces, adjusting the surface layers will help there
 
yea. i found that. the original still has better defined "hair texture", though
 
Can anyone help with a js problem i'm having?
this code: https://jsfiddle.net/cs2eu18e/
Crashes google chrome every time i run it, its supposed to run onclick when a dropdown option is selected, but as soon as i choose an option it just freezes. I'd like to know if there is anything wrong with this function but the new chrome update has been dodgy lately so it could be that
 
@ShrekOverflow You could have an array with undefineds in it. It will have length >0.
!!> (x = [undefined, undefined], Length: ${x.length}, Shifted: ${x.shift()})
 
@david "Length: 2, Shifted: undefined"
 
10:28 PM
@Luggage what original? link?
 
the one on the sd card.
did you print that cat?
 
@rlemon so 45c?
 
@Luggage mine came with a shot glass
 
oh
 
@Luggage Fun fact: Cura has a fuzzy skin option for adding texture to prints
 
10:30 PM
this is just the shape of the model, i am referring to
 
but.. noted..
 
disclaimer: haven't tried it
 
ohh well. i just need to settle on some benchmark object to fiddle with settings..
 
everything is a benchmark
just start printin
 
10:33 PM
For a benchmark, the obvious choice is 3DBenchy
 
i have been 'just printing'.
 
but not painting
 
I'm a terrible painter
 
you don't have to be good to paint that
 
10:35 PM
@rlemon my dragonfruit seedlings: imgur.com/a/hf7XK
 
i mean, it looks good
 
@david nice
 
@david father of dragons
 
something like that
 
in what increments can i change the layer height?
 
10:37 PM
Probably depends on your printer
In theory, anything
 
i bet the servo has some resolution. I am googling
or another limitation
> full step of the Z stepper motor the Z travel is 0.04mm
but.. incomplete so far
 
It'll go down to the step size (IIRC mine was 1/400 inch)
but it still makes some sense for fractions of a step, though the layer sizes are gonna be slightly inconsistent
 
> Finally the CR-10 has a four start, 2mm pitch, 8mm lead screws which means that for a full step of the Z stepper motor the Z travel is 0.04mm. Although our printer can certainly hande 0.01mm Z steps it is most accurate on full steps. At full steps the stepper motor can hold/lock the Z axis better and there is less chance of a slight Z shift while the print moves around in the X and Y (which causes shaking).
> Because of that you should get maximum precision on the Z axis when your layer height is an even multiple of 0.04mm. Use these values with the stock nozzle for layer height for best print quality, regardless of your choice of thin or thick layers. 0.12mm 0.16mm 0.2mm 0.24mm
full answer.
sounds believable.
 
Never imagined 3D printers bothering with microstepping
‘No Way To Prevent This,’ Says Only Nation Where This Regularly Happens https://trib.al/FvW3DaP
 
btw, how would you prevent it?
better education and stricter gun control?
 
10:46 PM
That seems plausible to me
 
I feel like the problem is deeper :/
 
education your joking. Maybe it would work. I feel like education is everyone's fallback response.
 
a lot less guns do help, but it seems like something rooted in american culture
 
gun control is the answer, obviously
 
and school education can only go so far
 
10:48 PM
the only country without gun control is the only country where this happens, hmm I wonder what the solution could be
 
0
Q: Don't render component on specific route

DemCodeLinesI have a React-based web application that utilizes React Router to map pages to different URLs: export const Container = () => ( <div> <SideNav/> <div> <Switch> <Route path="/login" component={LoginView} /> <Route path="/route1" com...

 
there is something in our culture deep down that causes one in 100 million of us to fire guns into crowds.
but i'm for education and stricter laws.
 
@Luggage this didn't used to be a problem.
I believe columbine was the 1st
 
don't get me wrong, I do think gun laws are a huge problem
and it needs to be fixed
 
@Luggage I suspect it's a positive feedback thing
 
10:49 PM
but I feel like there's more to it
 
the first you remember on the news personally?
 
mass shootings are something people do, which is why people do it
 
@Luggage hmm I just remember a chart suggesting it has started since I have been born. I barely remember 9/11
 
not much prevents you from picking up a chemistry book and cooking up a grenade
even less so now that there's tons of youtube videos on it
and tutorials and stuff
 
okay u want some kind of solution?
allow purchase of guns but they cant be in peoples possession
they will be locked in a storage at a gun range only
 
10:51 PM
how do you hunt then?
 
keep the guns at ranges/hunting grounds
 
again, taking that aside
 
gun owners will pay for that
 
@Traitor have you hunted before?
 
@Traitor I take it you don't know much about hunting
 
10:51 PM
so, say for example: john buys a gun, cant take it home, and has to pay monthly storage fees
 
I think massacres in america would still happen quite often, even if at a much slower rate
even if noone had guns except police
 
so when john decides to hunt, has to go to storage and withdraw it and go direclty to hunting gorunds
and the gun is chip/gps enabled
john has to pay those gps fees too
@towc yes we know that
 
@Traitor my grandfather owns 20+ guns and lives in the middle on nowhere. There is not a gas station in their town nor any stores.
 
but people want a 'solution' nonetheless
 
@Traitor well, I'm asking for ways to fix that problem now
 
10:53 PM
whether banning guns or not, there STILL will be mass murder, the question is what would be easy
we want a 'gun' solution because our emotions get to us
summary is that emotions make us not think rationally
@William right, argue that with someone that lost a family member to a mass shooting
honestly i dont support banning guns, there are already strict background checks as it is
thers already good gun laws
but because the media is playing with out emotions, people want to just ban guns without thinking rationally
 
@Traitor its not an argument. He hunts for food often. With nobody that lives in the town how do you expect to allow him to continuing hunting and have them stored somewhere?
 
my opinion ur grandfather can do what he wants
but you are talking about emotionally driven people that dont care about ur grandfathers situation
 
11:07 PM
@rlemon Simon Sarris just called corn "crap" on twitter.
 
@William does he have a hunting license?
 
I think you gotta have extensive training to be able to own a gun
 
because over here it's "hunting license? yup, you can have a gun"
hunting because you feel like it? nah
 
mass murders can happen whether guns are banned or not, example: In France guns are banned, a year ago a terrorist murdered 34 people using a truck that ran them over
states in the US already have good gun laws
 
@KendallFrey only bad thing about corn is that they feed it to chickens
 
11:12 PM
not arguing that
 
@Traitor yeah, because their security protocols were shit
 
@GNi33 yeah hunting and fishing. Honestly he is getting older such that he doesn't hunt as much as he used to.
 
and it was a lot more than 34
 
@Mosho you're thinking about a different incident
no truck involved in that one, but a lot of assault rifles :/
 
On the evening of 14 July 2016, a 19 tonne cargo truck was deliberately driven into crowds of people celebrating Bastille Day on the Promenade des Anglais in Nice, France, resulting in the deaths of 86 people and the injury of 458 others. The driver was Mohamed Lahouaiej-Bouhlel, a Tunisian resident of France. The attack ended following an exchange of gunfire, during which Lahouaiej-Bouhlel was shot and killed by police. ISIL claimed responsibility for the attack, saying Lahouaiej-Bouhlel answered its "calls to target citizens of coalition nations that fight the Islamic State". On 15 July, François...
 
11:15 PM
jesus christ, okay
 
-_-
 
did remember it incorrectly, yep
 
@Traitor your argument is that "shit happens anyway, so lets enable more of it to happen because meh"
 
no, "how much resources are we putting in to mitigate mass murder"
 
in 2001-02, there was a suicide bombing in Israel literally every 3 days
 
11:17 PM
i dont want to pay more taxes so a governmental department works on preventing mass murders
i dont want guns banned either
 
ah, we're at taxes again
fine
 
here's the solution
 
My solution is to not live in america
 
because even with all the government lies and corruption and shit, it's still about the people's safety
 
exactly my point
so yea we can spend time coming up with solutions but in reality we're not preventing shit
 
11:18 PM
and no one except the government can solve these things
@Traitor that wall was extremely effective
even though people said it wouldn't be
 
this in Israel?
 
yes
 
it didnt stop the zombies in WWZ though
 
what does this have to do with preventing gun shooting sprees?
you know that u can buy ak-47's through drug dealers right?
 
@hsimah that was actually a different wall
 
11:20 PM
you dont need to visit a gun store to commit a killing spree with a gun
 
@Traitor but it's harder than going to a legal shop
 
@Mosho and a fictional movie too 😛
 
@Mosho so what's ur point again?
raise taxes?
 
that argument is dumb af
 
pay for a solution?
 
11:21 PM
@Mosho and that's the whole point. If anything, it makes it harder for the odd "lone wolf" or whatever they're called to grab one of his guns if he's having an episode
 
yeah, that's what I'm saying
"people will kill anyway" might be true
but they won't easily kill 25+ people
@Traitor if that is required, then sure
 
On the evening of 14 July 2016, a 19 tonne cargo truck was deliberately driven into crowds of people celebrating Bastille Day on the Promenade des Anglais in Nice, France, resulting in the deaths of 86 people and the injury of 458 others. The driver was Mohamed Lahouaiej-Bouhlel, a Tunisian resident of France. The attack ended following an exchange of gunfire, during which Lahouaiej-Bouhlel was shot and killed by police. ISIL claimed responsibility for the attack, saying Lahouaiej-Bouhlel answered its "calls to target citizens of coalition nations that fight the Islamic State". On 15 July, François...
 
I could totes go for a killing spree if I'm forced to italy
 
rent a truck?
 
or if people's lives aren't worth it, that's fine too
 
11:22 PM
that was a terror attack, dude
 
cheaper than buying guns, and going through the whole gun owning process
 
@Traitor so, prevent that too?
I don't see what that has to do with guns
 
k bye
 
strong argument
 
@towc this is a public chat crawled by google, just saying
 
11:24 PM
yes, I hope the italian government won't allow me in the country for a while
I keep having a suspicion that my parents are in this room reading what I write
sounds like something they would do
 
anyone use VS with react.js?
was wondering if it's difficult to set that up
 
everytime I set out to actually check, the usernames check out as either people I already checked, or with SO answers that my parents wouldn't know about
 
i looked at this and got intimidated:
 
@Traitor you can write any text file with any editor
you can use react with bvi if you want to, without many issues
 
wait i didnt know i logged into chat last night
2
holy crap i was drunk
 
11:28 PM
'd you drop your memories?
 
no?
because you drop things
fine.
 
@towc yea just wanted it for VS because it's what i use
 
it shouldn't be difficult to write a file in VS, no
if you know how to use VS, expecially so
 
@david The array is defined to not have undefineds
@KendallFrey I'd hope for it to be able to figure that out vOv
 
11:34 PM
'write'? i mean adding react.js into VS
not writing code for VS
 
Does anyone know if browsers cache json files?
 
@Traitor you mean for intellisense?
 
currently using .js files as databases and the trouble is browsers keep using the old version and im wondering if .json files update every time
 
@ShrekOverflow That would require something more than a type system, and flow control like that eventually would boil down to the halting problem.
 
Kind like what flow aims to do?
 
11:36 PM
flow?
 
@finlx they do
if you get them through a http request that is
 
@ShrekOverflow Does it do static flow analysis?
Static flow analysis is pretty advanced, lots of languages do it, but no language does it as well as a human, and no language can theoretically do it perfectly
 
wait it might not even be giving a fuck
 
did you fix that thing you were working on? @ShrekOverflow
 
11:45 PM
yeah
i was stupid forgot a
 
what was the problem?
is there a JS lib that adds/subtracts time?
how many ours between 7:00 a.m and 1:00 pm?
should be 6 hours
im too lazy to write a function
 
@Traitor Check moment
If all you need is one function it will be overkill though
 
that's what i will have to spend time finding out
 

« first day (2577 days earlier)      last day (2387 days later) »