« first day (3146 days earlier)      last day (1808 days later) » 
00:00 - 18:0018:00 - 00:00

6:01 PM
it's really easy to find the answer in the manual when you know the answer
 
sure. but if someone says "the answer is pages 42 through 48" ...
why would I spend time to explain half-assed what docs already explain full-assed
 
I would just link to the manual. no need to explain it
 
we have
 
right
 
ok..
well i have a funny question. if you can do margin-top, why does margin-bottom not exist? XD
 
6:05 PM
margin-bottom does exist
 
? it doesnt work for me.
 
@ThomasTallman Got any code?
 
when css doesn't work, rightclick and inspect element
find the css style that should be affecting the element, make sure it isn't invalid and isn't being overridden
 
oooooooooohhhhhhh
 
6:08 PM
you don't have to do it all with css by the way. which is why I was trying to get you to break it down and show us
make it JUST fade
 
i already have it just fade
yeah i made a style that makes it margin left 300px
 
show you can do that, then we can work on making it fade and move
 
i guess i should just stop at that
 
then we can make it fade and move and work with multiple instances
 
6:09 PM
like I'm serious. take baby steps
 
ok. my main problem is that the crit is constantly visible before and after the animation stops.
 
over the weekend i "earned" 120 rep from one answer, and i don't know why
 
@ThomasTallman show us.
 
someone may have linked to it in their medium article
 
I shouldn't be asking this at this point
Broken frikkin record
 
6:11 PM
ill put my code into a jsfiddle
 
Thank you
 
Side note, AP comp sci probably isn't gonna be very fun or very useful
 
ill put my code into a jsfiddle
theres so many things wrong with it.
how do i get the margin left to stay and also edit the bottom margin
i think i should give up with the crit. theres too many things to do i wasted an entire period of working on this project to get nowhere and its wasting my time. to be honest screw the crit its not working and has way to many problems that i can't even fix.
 
it's all my fault
May 24 at 15:29, by Kevin B
i would do it with an element per crit
 
Also, this maybe just my opinion. I wouldn't make games in browser using JavaScript.
 
6:17 PM
it doesnt even matter
 
I have always found it to be a huge PIA.
 
No more a pain in the ass than anything else
 
<p style="margin: 0px 0px 0px 300px" id="crit">
might your problem be here?
 
yes kevin it is there but i kinda ditched it already
i dont have the time though when im at home. well i could make time but i really have other more important things to do. i usually code at school. this is a science fair project anyways so what if theres no crit i didnt use it in the last game why am i still typing
 
research CSS Specificity
it's not a very complicated subject, but it is what was causing your problem
and is something that will happen again if you're workign with html and css regularly
 
6:20 PM
Quick question. How would one calculate the combination count of an alphanumeric string?
 
@user10198470 combination count?
as in, finite maths?
 
thats not my only problem though. theres still other things that i have to deal with that ive already lost enough time to deal with. ive spent a full 80 minute period and gained nothing so i think its better off to just get rid of the idea in general. sorry for bothering everyone about this.
 
Yes, sorry. I'm not sure how to call it
If you have a string like: 0a7ce19d
 
so calculate every possible position of elements in a string?
 
How many combinations could one make
Yes
 
6:22 PM
o/
 
@user10198470 I would ask math.stackexchange.com
 
The string can consist of numbers and small letters
 
no canadians allowed
 
@user10198470 I'm not a maths person, but I believe the term is permutations
 
Ah ok, thanks!
 
6:23 PM
(although people here can prob answer it as well )
 
lol
 
@user10198470 geeksforgeeks.org/…
 
119
Q: Permutations in JavaScript?

pepperdreamteamI'm trying to write a function that does the following: takes an array of integers as an argument (e.g. [1,2,3,4]) creates an array of all the possible permutations of [1,2,3,4], with each permutation having a length of 4 the function below (I found it online) does this by taking a string as ...

 
6:25 PM
@rlemon Perfect, thank you!
 
Ew recursion but
570
A: Generating all permutations of a given string

SuperJuliettapublic static void permutation(String str) { permutation("", str); } private static void permutation(String prefix, String str) { int n = str.length(); if (n == 0) System.out.println(prefix); else { for (int i = 0; i < n; i++) permutation(prefix + str.charAt...

 
recursion is not ew
there are some things that make way more sense to do recursively
 
@SterlingArcher I figured out the issue, my JSON was malformed, I had to run it through a utf8_encode() over on my php haha
 
Glad you got it figured out @SpencerCole :)
 
@ndugger such as...
I have always found recursion could easily be replaced by a loop
But I guess maybe in very complicated things it could be more readable
 
6:31 PM
against my better judgement. I've created yet another demo I shouldn't be creating.
😉
 
the crit text keeps getting selected
 
don't click so fast
 
Idk what that's for, but I am into it.
 
@JBis such as navigating a tree structure
 
@rlemon 5 bonus points if you don't use magic numbers, and calculate the offset need XD
 
6:35 PM
that's easy
but unneeded for static text
 
there's probably other examples too where recursion makes more sense than iteration, but I don't use it for much else
 
there is probably an easier way to even do this now
 
thinking that recursion is too difficult or bad, though, is closing yourself off to a very useful tool
and with proper optimized tail calls, which JS still doesn't have, recursion becomes even better
 
fail
 
why fail
that works
 
6:38 PM
@rlemon neat
 
neat? lol
it's a script that puts an element where you click
 
with a longer string it doesn't center
 
yeah but you could tether that to stickman attacks
 
you forgot to remove the static dimensions
 
how does it magically wrap when you click towards the edge? That's some next level shit, bruh
 
6:41 PM
@rlemon oh, I'm just fucking retarded lol. thanks.
 
@ndugger doesn't for me
 
@rlemon does for me
 
@rlemon now make him crit
 
I figured because the div was absolutely positioned, that it wouldn't wrap
 
@ndugger how's work treating you?
 
6:43 PM
 
I was thinking the right side, not the left. Shame on you for not reading my mind
 
well shit that's neat
right side wraps
 
why does it do it for right but not left?
 
left doesn't
 
@SterlingArcher it's meh... feeling kinda shitty lately, not sure if I want to quit, or if I just need to get out of the mental hole I'm falling down
My mental health is always a roller coaster, so who knows
 
6:44 PM
css magic
 
@ndugger ride the waves bro, I'm going through a work funk as well, but after I restarted my game at home yesterday I'm feeling much more code motivated
It's already much cleaner, but I decided to go with redux because there's no mobx in jobs around here, so getting better at redux is just smart. But I abstracted my server from the client, updating security with JWT, and just cleaner architecture
and it gave me a little umf at work today
 
I don't really have personal projects anymore, because I obsess and it pretty much kills my mental health and makes me extremely depressed
so I think my problem now is that I feel like I don't have any real purpose
I have one project that I dabble in, but it's a small typescript library. The projects I really want to do are C++ and Rust, but I just can't do it or I'll end up at rock bottom and doing something dumb
 
Sounds like you should demote yourself to cashier, get a trailer home and become stupid
 
it all comes down to the fact that I got a bad brain, bruh
 
stupid people are never stressed
 
6:51 PM
it's summer time. my project is my backyard
and it's freaking fantastic as a stress relief
 
I know; I tell my mom i wish I was stupider sometimes lol
 
Like sure I might not have an audi if I was stupid, but I wouldn't have any work stress
I could totally build sandwiches all day
 
the stress doesn't come from the job.
it comes from the unpaid bills
because you're making $7.25/hour
 
You can probably get over $12/h here at subway
 
can someone please help me with this? I know its the most basic thing but it's completely escaped my mind and I've been trying to figure it out for a while now lmao
I have an array with 4 different items I want to loop through and console.log it so it goes 0, 1, 2, 3 etc based on number of items in array
how do I do that?
 
6:54 PM
So you're just logging the index, and not the actual array contents?
 
for( const index of arr.keys() )
 
yes I'm able to get the contents but I just want the index
Thank you :)
 
!!> [1,2,3,4].forEach((_, i) => console.log(i));
 
@SterlingArcher "undefined" Logged: 0,1,2,3
 
.keys() bruh
 
6:55 PM
I rarely use for..of/in
 
You should not use for..in
 
I guess I should, I sometimes do like Object.keys().forEach and I hate it
 
For..of is beautiful
 
You’re beautiful
 
I used to avoid for..of back when it was new and very slow, but now I use it a lot
 
6:56 PM
> slow
 
it used to be slower than array.forEach bruh
which is just bizarre
 
You are well aware in 99/100 it is more than fast enough
 
but it was the case
 
native for loops are always faster, and that applies to of/in i believe as well, iirc the jsperf results
 
of course it's "fast enough"
 
6:57 PM
Slower I will accept. But slow? Nahh it's still fast
Just not as fast
 
@SterlingArcher for..of was slower when it first came out, because the Iterator back end wasn't optimized yet
 
it was kind of slapped together just to get the syntax out the door
 
@IraKloostraNathan Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
is that a bot?
 
6:58 PM
@ndugger wasn't that discouraged before Symbol.iterator() was supported?
 
@IraKloostraNathan yes
 
I have no idea what I'm talking about
 
it's ok me either
 
neither
 
7:00 PM
Hello.
 
with that said, where speed is a concern, I'll probably still use for(;;)
but I haven't run into that situation in years.
 
7:15 PM
@SterlingArcher What is _?
 
it's an underscore
 
@JBis it says "this is an unused parameter"
since we don't use the actual array contents, we just want the index, note the first param as _ so other developers know it's not a used param
 
replace it with "jQuery"
 
unofficially* there is no actual notion of an unused var in JS.
 
didn't know _ could be a variable name, thanks
 
7:17 PM
it's meant to denote "I'm not using this"
@JBis any character can
 
!!> [1,2,3,4].forEach((jQuery, i) => console.log(i));
 
@KevinB "undefined" Logged: 0,1,2,3
 
!!> const 💩 = 123; console.log(💩)
 
@rlemon "SyntaxError: illegal character"
 
bah
screw you it isn't
 
7:17 PM
!!> [1,2,3,4].forEach(($_jQuery, i) => console.log(i));
 
@ndugger "undefined" Logged: 0,1,2,3
 
@rlemon I get SyntaxError: Invalid character '\ud83d'
 
probably because of how I convert the point in the chat
 
!!> [1,2,3,4].forEach((!@#$%^&*, i) => console.log(i));
 
@JBis "SyntaxError: illegal character"
 
7:18 PM
!!> [1,2,3,4].forEach((@#$, i) => console.log(i));
 
@JBis "SyntaxError: illegal character"
 
some of those things have relevance
^ and * are for math
! is an operator
 
@JBis "SyntaxError: illegal character"
 
thanks
!!> "ha" === "ha​"
 
7:23 PM
@JBis true
 
damn it
 
?
 
tried to trick it with zero width
 
!!> 'ha' === 'ha';
 
@rlemon "SyntaxError: illegal character"
 
7:24 PM
:)
@JBis have fun
 
I'll move to sandbox to have fun
 
no I meant, have fun figuring out what I did to make that invalid
if you wanna play these games.
that is
 
yes, I'll go test stuff in sandbox to figure out
 
1 message moved to Trash can
@Richard Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@Richard Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
<script id="chat-content-template" type="text/x-handlebars-template">
   {{#each messages}}
    <div class="event">
      <div class="label">
        <i class="icon blue user"></i>
      </div>
      <div class="content">
        <div class="summary">
          <a href="#"> {{ username }}</a> posted on
          <div class="date">
            {{ postedOn }}
          </div>
        </div>
        <div class="extra text">
          {{ message }}
        </div>
      </div>
    </div>
  {{/each}}
Any ideas how to rewrite this with jQuery ?
 
7:32 PM
@rlemon I give up. I got false, but no syntax error.
 
$.each(messages, function(key, message) {
  // the rest of the code
});
 
ahhhhh
nice
 
you wanna piss off a co-worker. replace a single ; with that in his codebase
4
and hope his editor is dumb
 
if only i had co-workers
 
like if u cry evertym
2
 
I'm more upset in the fact that they used comic sans
actually, that might not be comic sans, judging by the "s"
just another equally shitty font
nevermind, it's def comic sans
 
I'm only upset by this
fun fact. that's not his arm to the right
 
there's so many lines there htat could be either one of them's arm
 
user1596138
8:02 PM
@rlemon Reminds me of the zero-width characters in jsfiddle
 
user1596138
Noob comes and says > I wrote this code and now it dont work
 
user1596138
No... You copied it from JSFiddle
 
user1596138
I guess both can be true.
 
Can someone help me test something real quick? Can you enter the following chat room and just say any two messages?

Test My Bot

A room for discussing and asking questions about SO/SE bot cre...
 
8:04 PM
@ndugger you still into rust?
 
 
1 hour later…
9:24 PM
I have, finally, accepted in my heart that node is the superior server side environment
 
@FélixGagnon-Grenier I'm so sorry
 
it literally graphql's all teh thingsâ„¢
such versatility
very require'd
 
I'm going to have to take you out back and shoot you now
 
I know you're jealous of my fanboism over graphql
 
it's okay son, no need to speak, it'll all be over soon
 
9:28 PM
:P
orthogonally, flow.js kinda made me realize I have no idea what most of the constructs I use are, or where they come from.
 
interesting. I've never used it
 
TIL mostly about node stream lib
 
@FélixGagnon-Grenier what makes Node superior?
 
If I'm requiring a .js file that has nothing inside of it but an API-Key how do I get it to display?
If I do console.log(apiKey) it just returns {}
 
is the api key assigned to a variable?
 
9:40 PM
No it's not
I've tried that but then the code becomes apiKey.variablename
 
how do you export it
 
var exports = module.exports = {};
 
and you have module.exports.apiKey = somekey?
 
no I don't
where should I have put that?
 
you have to export it if you want to require it
module.exports = {
  apiKey: 'your-key'
}
then
var key = require('./your-file.js').apiKey;
 
9:44 PM
1 message moved to Trash can
@JBower Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
highlight the code block then press Ctrl + k to format it
 
no need to highlight.
 
lol thanks
 
ctrl + k toggles 4 space code blocks for the entire message
if it's already there. it undoes it
 
oh yea, never knew
 
9:46 PM
I've been playing around with pupeteer if you've used it
 
what I really suggest is dark mode +'s code mode
 
I'm trying to understand how they got the apiKey to work just by requiring it alone
 
how do you get the dark theme?
 
9:47 PM
they don't provide an example so I'm not exactly sure
 
I've linked the extension
 
yeah dark theme is nicee
 
@JBower ohh it's the same way
I just wrap everything in objects so you can easily expand on the exports.
 
awesome
 
just export a string if you don't want to access it from an object.
@HelloWorldPeace watch out tho. your clipboard is now fair game to paste urls and images into the chat directly.
I mean to change that
but don't go frivolously pasting here.
2
😉
it is useful tho because you can now take a screenie or something and directly paste it into the chat. drag and drop images too
but yea. I need to change it to just put the url in your input. not send it
 
9:50 PM
ok , gotcha
so you made the extension?
 
figure I'll warn you before you encounter it by mistake. a few people have complained already
I'm just super bad at updating things
 
if you want to disable any one feature there is an options page for it as well
 
lovely
 
:46344381 Thanks
I just tried it but I dont think it is the same way they're doing it..

If I
console.log(apiKey);

it returns it
 { apiKey: 'key-here' }
but if I do
console.log(apiKey.apiKey)

it returns just the api nothing else which is what is needed
 
9:55 PM
yes. I said if you want just the string export just the string
module.exports = 'your-key';
 
ohh sorry i must have completely skipped over it!
 
uhhhh, this really shouldn't surprise you.
 
anyone familiar with testing react-loadable components that are connected to redux with jest?
 
Thank you!! That was what I needed :)
Now I just need to figure out what
Unexpected token E in JSON means 😂
 
means your json isn't json
:D
 
9:58 PM
@rlemon great work. They should add the theme as an option on the site.
 
!!> JSON.parse('Error: some crap here');
 
@rlemon "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"
 
well, in other browsers that'd be different
 
@rlemon oohh that makes sense actually 😂😂 thanks
 
9:59 PM
I think if I make the apikey json format that'll fix it then
 
10:18 PM
@HelloWorldPeace using javascript
I mean, this was 80% serious, 20% fanboism over node and stuff. Lately, I've had multiple projects where I both do frontend and backend, a mix of react and graphql, and node programming was... refreshing, as far as backend go.
... that might very well be because I mostly shamelessly profit from everyone doing open source work and creating libraries
 
can't deny that Express + Mongoose is a ridiculously fast api + database
 
How does one go about debugging a PromiseRejectionWarning?
console doesn't seem to give me much info about it
 
you mean that thing where node says it will simply exit the thread with a non zero error code when you have an unhandled promise rejection?
 
Place console.log("Got here")'s everywhere
 
or breakpoints ^
 
10:28 PM
@FélixGagnon-Grenier yes
 
or ascii bananas
 
in case you don't know, writing debugger; will trigger a breakpoint when run in chrome with the console open.
 
and lol okay I was hoping for a better way than console.log as I've got them everywhere already haha
 
@JBower correct answer: handle your promises. no joke.
 
10:28 PM
easy answer: replace your promises with bluebird and enable long stack traces
 
like in php you can turn error warnings on/off etc
 
the thing about breakpoints is you can't run promises in the debugger (or at least I don't know how). Is there a way to do this?
 
@JBower yeah... and we mostly advise against it because it's really not a solution :)
 
is the stack trace not giving you anything useful?
 
@FélixGagnon-Grenier oh yeah I wasn't asking to turn them off was merely saying how php has a method for defining the level of warnings to help developers with debugging
 
10:30 PM
oh I see
 
was hoping node would have something similar i could set to development for example
 
node will show you the errors you encounter that crash the process.. normally.
besides that, you have to handle error logging yourself.
 
Okay, thanks for your help!
 
now if your program is small. you can post the relevant bits that use promises
we can probably help you with that
 
I'll call it a night and come back with fresh eyes tomorrow I think... My heads starting to go all cloudy haha
Thanks :).
It's small but I'll try look at it again tomorrow before asking for more help lol
 
10:36 PM
@JBower very healthy take
 
delirious coding is the best coding
change my mind
 
try lsdcoding
I've meant to try microdosing for a few months now. never got around to.
 
nahh I'm good there. for a while I tried code drunk, debug sober. it did okay for a bit
 
How do you move messages in chat (as a chat owner)?
 
10:46 PM
You click on "move messages"
 
from the "room" menu
 
I don't think it's possible to do that on mobile version of the chat though
 
Ah. Thanks.
 
11:07 PM
posted on May 28, 2019 by Bethany Nicolle Griggs

Notable Changes deps: update ICU to 64.2 (Ujjwal Sharma) #27361 upgrade npm to 6.9.0 (Kat Marchán) #26244 upgrade openssl sources to 1.1.1b (Sam Roberts) #26327 upgrade to libuv 1.28.0 (cjihrig) #27241 events: add once method to use promises with EventEmitter (Matteo Collina) #26078 n-api: mark thread-safe function as stable (Gabriel Schulhof) #25556 repl: support top-level for-await-of (She

 
00:00 - 18:0018:00 - 00:00

« first day (3146 days earlier)      last day (1808 days later) »