« first day (2300 days earlier)      last day (2871 days later) » 

00:01
I have one checkbox that is supposed to act as a checkall checkbox, I have all the other checkboxes in the array checkboxes... So I have the onclick attribute set to onclick="toggle(this);"
and the toggle function..
function toggle(source) {
	checkboxes.attr("checked", source.checked);
}
if (require) {
    let oldRequire = require;
    let fakeRequire: NodeRequireFunction = (id: string): any => {
        if (id === 'sander') {
            return new FakeSander();
        }
        return oldRequire(id);
    };
    let { cache, extensions, main, resolve } = require;
    require = <NodeRequire>Object.assign(fakeRequire, { cache, extensions, main, resolve });
}
I am a bad person.
Which checks them all the first time, then from then on it will only uncheck all checked boxes, but not check them all again :/ Anyone know why it would be doing that?
00:13
^^ The element still adds checked="checked" but it doesn't actually check it
don't set the attribute, set the property
Ah great thank you!
00:34
Any of you guys Bluetooth devs? Tracking sensor data?
Jordan tracks satellites; does that count?
I dunno.
Jordan can't track his lunch.
hi guys
does someone work with react?
Jordan can't track his goldfish.
00:36
yes, lots of us work with react
react is for boobs.
yay boobs!
s/is for/is for money to see/
<Boob />
00:38
could u please help me? i am trying to run react in webstorm ide, i've tried to run react script inside the jsx tag from the webpage - it works, but when i put this code in a separate .js file, transform it using babel under dist, the code is not shown on the webpage. Why?
@Mosho doesn't work in the browser
valid Haskell that I have even used
not shown*
00:39
> i've tried to run react script inside the jsx tag
@user4447655 you can edit your comment
^^ huh?
@phenomnomnominal has a note on that at the top
also
@taco ty ^^
why would you need it in the browser?
you can use whatever you use for module loading
00:40
@Mosho you don't even want to know
cuz i wanna load context into my divs
webpack/systemjs can do that with aliases
I need to use sorcery
Well fuck, now I do want to know
sorcery does source-mapping back through multiple maps
it has a hard dependency on 'sander'
so I'm shimming the readFile function with a sync xhr call
00:41
why would you need to load that in the browser O_O
why would you load that in the browser wtf
I have a friend who is looking for a Bluetooth dev (iOS, Android for v1 and then iOS/Android/PC/Mac for v2) of an app. If any of you are interested, let me know.
@user4447655 error message?
karma is what you use to load mocha or whatever in browsers
00:42
I'm working on some tooling for automatically mocking objects from TypeScript
which is also redundant if you ask me
Agreed, but it's a requirement for what I'm doing
why karma then?
@Luggage no errors, it generates source maps but when I link it to html it shows nothing
Because we currently use karma in our testing tooling
00:43
and what does mocking objects mean
yeah, but why do you need it in the browser
@user4447655 you need to do more debugging. I can't work with "shows nothing"
Because karma runs in the browser, and this code runs in tests.
is the script executing, etc?
@phenomnomnominal that's a nice idea
but
karma running the tests doesn't mean it needs to be in the browser
00:44
it does
karma is the runner, all it does is open browsers for you to test on
script is executing if i put in under script type="text/jsx" directly into html
yes, but the actual test runs in the client
right
but it has nothing to do with karma
it creates a HTML file with all your js files included
this tool already works in node
00:45
you wouldn't need karma at all to run in node
i like the concept of karma :D
you don't need it in the browser
If you ran it through babel, it's a js file, not a jsx file.
but if someone wants to use this tool in karma tests, it does have to run in the browser.
00:46
not karma
karma only runs in node
to run your tests in browsers
The karma client then.
@Luggage yep, and i link it as src="path-to-js", it gives nothing
Either way, I can't do fs.readFile
look at the file. was it transpiled?
please explain again why you load karma in the browser
karma doesn't run your tests
you use mocha?
00:47
type="text/jsx won't help unless you have some other JS that re-compiles it in the browser.
browsers don't know jsx.. so your story sounds odd.
well, for starters, we're using jasmine
karma bundles all the test code up, sends it to the client, where jasmine runs the test
the test contains code that looks like let hero: Hero = ineed.a<Hero>();
except transpiled to js.
inside ineed.a, it throws an error, parses the stack, works out the file that made the call
and then uses sorcery to read the source maps for that file
which all happens in the client if you happen to be using karma
@KendallFrey the flag design TED talk is hilarious. the nebraska flag I believe breaks many of those rules
@user4447655 is this somethere that I can see?
this all works fine in jest or mocha
you would already have sourcemaps when running
from the transpilation
do you transpile in the browser?
00:50
in most cases yes we have the sourcemaps
but not when run through webpack and coverage
I'm trying to not tune this to our particular set up too much
it's more than I can wrap my head around without seeing it, but I want to say that you should lose karma and use sorcery directly
karma has 0 business running in the browser
my code doesn't touch karma
karma isn't running in the browser
that's what you said
10 times
we got wires crossed there somewhere
00:52
> Because karma runs in the browser, and this code runs in tests.
Because karma runs (the tests) in the browser.
:|
Sorry, I figured that was implicit.
it almost is
but you said you have to take over something that does readFile
so I assumed you are running something in the browser that isn't supposed to run there
which I still assume :P
yeah I am haha
sorcery
although, I think it's reasonable to run there
00:55
I wouldn't bother with sourcemaps at all
in fact, I don't
because it sucks hard and gives you almost no benefits
@user4447655 ok.. if that it loaded into a browser, it looks right. Are you SURE it's executing? did you put in a console.log or something?
In this case I need them
why
because I need to see the original source
so I can see the name of the interface
and work out where it was imported from
ehhh
00:56
so that I can request that file and parse it
wait
that's how you do it :O
@user4447655 oh.. "require('react-dom');" are you using a module loader?
that sounds a little too hacky
@Luggage yes it is, i can see it from page source. I've also tried to load this code into jsfiddle, it does not work there either
@Luggage yes
It's not too bad
do you have a better suggestion?
00:57
TS emits metadata that would save you doing all that
what nope
well, if oyu have a fiddle.. share that..
It only emits for like object
or boolean
not complex types yet
All that code will go away when it does that
which is why I want to pick an API that works now, and change it underneath later
hmm, alright
I wanted to do something like that myself
00:58
that won't work in jsfiddle with the require(). what module loader do you use?
but I deemed it not that crucial
I just have methods that randomly generate each thing
doing it your way would be cleaner but I don't know if it's worth the trouble
it's an interesting problem, however
one solution I can think of is to not use interfaces, only classes
but I doubt you would do that
though I think replacing all interfaces with classes wouldn't break anything
I would go a step further and create a library that extracts all metadata at runtime in some hacky but working way
I would use the fuck out of that
Sie
Sie
I have a potentially stupid question. If I only intend to use JavaScript for client side (ie nothing web based) is there any real reason to learn it over something like C#?
well, there is the fact that c# isn't available for client-side
Hi guys. Someone knows a JavaScript framework that has very similar features to the Ruby on Rails?
Also.. you said you intend to use it. Doesn't that kind of imply learning it?
Sie
Sie
01:09
What do you mean? I'm probably using the wrong terminology.
I read it as: "I am going to user JS on the client side. Should I learn JS?"
Sie
Sie
I am currently learning it as part of a program but for what I do (mostly game dev with Unity and sometimes Unreal) I don't really see the benefit of it for my application(s).
Then don't use it?
I still don't follow. Are you going to use JS or not?
Sie
Sie
I am learning JS for the sake of the degree but I'm trying to see what sort of upsides it has over something like C# if any.
It's one of the most popular languages and used for more than just browsers. That's a reason.
But.. if you want to learn just what you need to pass a class, then.. only you know what that is.
01:11
my implementation of sprite in javascript for a client to create game jacobian.xyz/HMAU
C# and JS are not mutually exclusive
one benefit that c# has is that during interviews you can tell people that you use "c pound in the code behind"
yea.. I can't think of ANY sexual innuendos involving JS. That's a reason to shun it.
Sie
Sie
True.
@Luggage It fits where most don't?
What else is JS used for?
Sie
Sie
01:13
That is actually kind of dissing it though if we're comparing... huh.
@Alesana everything.
except systems programming
Sie
Sie
Even some vending machines.
Ah I thought it was exclusive to browsers
Vending machines using JS??
@Sie hey baby. It's minimized. It's usually bigger.
Sie
Sie
lol
01:14
possibly vending machines.. It's used for back-end. non-web apps, various devices and services.
almost anything you would want to make in c# can be done in JS
(though C# can be a better choice, sometimes, of course)
It can be used as your server back end? That's interesting
Of course. node.js
Where have you been the last 5 years? :)
Sie
Sie
But can it blend?
npm install blend
01:19
blender make nice sound
@Mosho we do that too
But you still have to pull in the file to get the type annotations
yeah, I would just add static methods on each class to do that
Yeah fair
we have interfaces generated from our API though
so we can't rely on classes all the time
and having hundreds of mock classes around is just yuck
If you're not using karma, then my thing should work for you fine
you use systemjs, right?
also, what if I want more context for mocks, like a valid email for an email field rather than just a string?
On some projects, but this should be agnostic
it currently just returns empty string
I guess I could make it more pluggable
but currently the idea is basically to be able to provide a mock for a service or something
a mock model will be very basic
but it probably makes more sense for it to be in your test anyway
01:30
perhaps
Maybe mock the class of the thing in a before, then overwrite values in the test block
01:42
@rlemon I wonder what answer joel spolsky will select as his accepted answer? It's been 2 days now, and he has 44 to choose from.
the one that fits his narrative I suppose
I'm pretty neutral on the post tbh
I don't think SO should be political. but if I had my own soap box I would use it
so idk. w/e
I feel pretty strongly that this isn't the place for it at all.
It's also not a question... so he can't actually select an answer
I'd be fine with it if they put it as a banner or something... it's their site so they can do that
but putting it as a question in the community moderated section is wrong
and then disregarding the community's overwhelmingly negative response just compounds the problem
It's also possible I just love the shitfest it's generating and only have a strong opinion because it makes it more exciting... kinda like supporting a team in a sport you have no intention of ever playing
is this on meta?
@david I actually agree with this
or you know, stackoverflow.blog
If you are OK with that, then.. why not a question. It's theirs.. who cares.
who reads that.
Also.. i can't find this question by searching.
01:55
I mean I'm okay with it as a question too
but it seems they could've saved themselves a big fuss
@Luggage Because it's not a question, it's off topic, it's potentially even subjective.
what?
I thought it WAS a question and that was the controversy
Nope, there is not a single ? in the entire post
it's a political rant
essentially
one that most people agree with
but it's still a rant
Then where is the post? If it's not a question..
1598
Q: Time to take a stand

Joel SpolskyI am extremely upset by President Trump’s executive order on immigration. I feel it is immoral, unconstitutional, and fundamentally un-American. The community on Stack Overflow is made up of users from all over the world. At least 100,000 posts on Stack Overflow were written by users from the se...

that's it
01:57
> but putting it as a question in the community moderated section is wrong
there it is, not a single ? (except in the section that was added as an edit by a different user)
yea. That's a question.
Is it? then what's the answer?
noo.. I mean question on SO.
you spent all those lines of text saying it should not have been posted as a question
so.. i searched the questions
are you really actually saying you got confused by the distinction between a "question" in the general sense of the word and a "question" as it's used on the SE network as an alias for post?
02:00
No. you changed definitions.
You: "they should not have posted a question, but a banner", Me: "I can't find the question.", You: "It's not a question"
Ah, i see why you were confused, i just did @ your name instead of the actual comment i was responding to
When I said it was not a question I was replying to :35413690 not to :35413692
ok.
i never use that anyway in a one-on-one conversation
It shouldn't have been posted as a question (in the SO sense) because it's not a question (in the "answerable" sense)
i'm not sure why you can't find it
right.. I understood that part of all of this.
It's an announcement
02:04
well, searching meta for "trump" or "Time to take a stand" didn't return it
yea.. got me
I did something stupid
or failed to notice it
unless you searched meta.stackexchange
which would have been a slightly better place to put it
ohh, i did
still had that tab open. it was meta.stackexchange
yeah... he made it on the SO specific meta ><
02:26
can anyone here help me with a snake game, ive done most of it just need some sudo code for the last bit, thanks if anyone can
sudo code!
what do you need help with?
lmao i know i spelt that wrong its like phewdo code or something
pseudo :D
i think
yeah that's it
but i have a snake but its just squares at the moment and i want to replace the squares with images but idk how i would tell what direction the tail is going if u get what i mean
yeah that makes sense
02:30
so i can change the head image on keypress because its isntant, but the body and tail trails behind
i did think of a way that i could check what blocks are around it, if theres one above the tail, put the image of a tail going up
whenever you add a segment, set a 'direction' field on the previous section that points in the direction that you just moved
if you check the surrounding blocks then you get situations like a 2x2 block and you don't know if it's a n shape or a u shape or c or >.
hmm im not sure i can do that with my code
can i post a link to my question, it has the code in there and tell me if its possibile
do you have a link to it somewhere?
yeah
The snake doesn't move
that would be helpful
02:33
0
Q: Assigning images to head, tail and body in right direction (Snake game) javascript

Rachel Dockteri have a working node js javascript snake game and i currently have squares as the snakes body, head and tail. I would like it to be somewhat realistic and have a image for each part for example if the snake was going up, its head would look up. This is easy enough for the head as i can assign t...

Its tail gets cut off and put on its head
in my game each body part moves up by 1
Yeah that's wrong
so the head stays in the first position always meredith
disturbing
02:34
That complicates the game a lot
(As you've found out)
what do u mean disturbing lol
> Its tail gets cut off and put on its head
actually this makes it a little simpler to do what you want
david do u have any ideas on how i would do it?
02:37
You need to add head.direction = this.Direction inside your MovePlayer function
that will propagate downwards to all the sections as the snake moves
then in the drawing section you need to check element.direction and use that to choose the correct image to draw
but what if i move up so the head is moving up but half of my body is still moving left
you can also do that with the head now, you don't need to set the src in the keydown event
@RachelDockter yes, but only the head will have direction up, the rest of the body will have their element.directions set to left still
each 'square'/'element' will have it's own 'direction' property that is set to the direction the snake was moving when that element was added
Probably not a good idea to store direction as a property of the head
@Meredith why not?
Since it should always be the same as the global direction
02:40
no it shouldn't
this isn't the direction the snake is moving, it's the direction that the section is oriented
Hold on what's the problem then
The snake should always face the direction it's moving
she doesn't have anythign storing that yet
she needs it for the tail
actually this is still slightly off...
The tail doesn't have an orientation
and the body because the body can either be going vertical or horizontal
so i need to know what image to use
Oh I see
Yeah you'll need to track that for each section
02:43
head.direction = this.Direction isn't actually right, you need to do this.elements[length - 2] = this.Direction
wait hold on i just realised something
i need corner peices for the body too
ffs this is more effort than its worth
Ok yeah derive it when you render
how would i do the corner peices
Just check where the neighboring sections are
if the direction of that body peice is up and the element next to it in the array is left, then use a left corner peice
02:45
Only like 8 cases
Actually 10 I think
something like that
Body pieces shouldn't have a direction stored
why not? i was about to try this.elements[length - 2] = this.Direction
02:46
You're gonna have a hard time keeping it up to date
& it's pretty straightforward to derive it
how would u do it meredith
left && right is horizontal, up && down is vertical, up && left is bottom right, etc
with the code i have in mind
how would i know the direction of the neibouring peices if i dont store their direction though
You just need to know their location
oh so u mean for every body peice, check left up right down to see where the neibouring peices are
and then go from there
02:49
Yeah
no, you should check forward and backwards in the array, don't try to check up/down/left/right
that was my idea at first but its a multiplayer game and updatres every 100ms
so if theres 10 people with a snake 8 bodys length that might lag
@david That's what I'm saying
so i do all of this when im drawing it onto the canvas?
The game logic should be very quick
As long as you don't move the body
02:51
in the function where i move the snake, i should leave that alone?
it moves first, then draws
Yeah
right ok let me have a go
Actually don't do that every frame
well i gotta do it every time i draw the snake
Have the client calculate it when it receives an update from the server
02:53
because it could move anytime
Then store it
wait i have to think if it moves every update
ok ur right, it draws 5 times for every 1 move
wait meredith, if everytime i draw on the canvas, there is something new to draw, should i put the function the checks every body peice there?
Yeah

« first day (2300 days earlier)      last day (2871 days later) »