« first day (1908 days earlier)      last day (3047 days later) » 

10:00 PM
then use let
 
const signifies that you won't change it
 
Ohhhhhhh
 
@Meredith reference
 
you all changed to const because @FlorianMargaine said to do that right ?
 
Literally everybody has been saying it
 
10:00 PM
I will use that routing method from now on
looks neat
 
yes, but there was a small discussion here that some were not using const as default
 
@SterlingArcher
const arr = [];
arr.push(123); // allowed
arr = []; // not allowed.
 
push is the worst method in javascript
 
Wait, so you can push to the array but not assign it?
aka it can be mutated
 
In node.js is there any direct and precise way to implement, domainname/profilename
 
10:01 PM
ahhh.push(it)
 
get out
 
Have you ever done
const arr2 = arr1.push(123)
And then expected arr2 to be the new array
 
why is it the worst method ?
 
Cuz I have
Like 50 times
 
ah :P
 
10:02 PM
why would push return the array?
 
PHP
 
ew
 
Cuz it's supposed to
But js is stupid
 
I quickly realized I literally have no changing variables. all consts now
 
There's no reason for it to mutate the array but it does
And returning the length is unintuitive as well
 
10:04 PM
it's a void
is that not better ?
 
Either return the updated array or return undefined
 
@SterlingArcher Welcome to Haskell-land
 
I never realized how little I manipulated variables
 
Let's saw I have 100 json entries of merchants, and they are uniquely identified by a merchant id. Now I want to implement this - mydomainname.com/merchantid to be profile page for merchants.
 
@Meredith why would you prefer a = a.push( ... ) over a simple a.push( ... ) ?
 
10:05 PM
How should I approach this
 
Yeah I basically never use let
 
logical solution please
saw = say* damn
 
@KarelG So that it doesn't mutate a
 
@KarelG purity
It's almost like cons that way
 
Same reason I'd rather have a = a.map(...)
 
10:06 PM
@GandalftheWhite create a route that intercepts /:merchantid, if the id exists show profile, else show 404
 
@Meredith Use concat then.
 
that's a valid reason. immutability ...
didn't have thought at that
 
github.com/RUJodan/SourceUndeadv2 shameless git push plug
starmie brahs
 
@KarelG It's especially annoying if you accept an array as a parameter
Then you push something to it and then you have a bug somewhere else in your code
You have to clone it or use concat
 
it's unfortunately a bit late to change it
code breaking change
 
10:10 PM
Yeah, that's why they added concat
But I still use push all the time accidentally
 
@KevinB This is where my tiny brain isn't helping me. That means whenever the server gets a request of domainname.com/merchantid_or_whatever_string -> then I must check if a user exists on that or not
 
With express(node.js) this is really easy, what are you using?
 
express and node.js - precisely
 
@GandalftheWhite so you go ask your database if they exist, then... 404 or reply?
 
.get('/:merchantid', handler) and in the handler merchantid will be a param on req.
 
10:12 PM
got it
My approach was correct that means
 
you can also make use of .param(), but that's usually not needed
 
I though there might be some other solution
.param() -> as in how
taking a request and the checking the param attached to the request in route
the = then*
 
router.param('merchantid', (merchantid) => req.merchant = Merchant.get(merchantid)).get('/:merchantid', handler) for example, to fetch the merchant before the route. This is useful if multiple routes require first fetching the merchant, to reduce redundant code. that code may not be correct, refer to docs.
 
module.exports = {
    db: {
        user: "foo",
        password: "bar",
        database: "baz",
    },
};
@SterlingArcher ^
 
I have never done routing like that. I will do some research on it ASAP
thanks a lot @KevinB
appreciated
 
10:16 PM
oh god
@SterlingArcher are you trying to have as much indentation as possible? github.com/RUJodan/SourceUndeadv2/blob/master/server.js#L44-L46
 
may not -> is not. the args are wrong, not sure what order they should be in for .param()
 
I will check on it
I just wanted to check if my approach or not
I will do some research on the new alternative at hand
my approach is correct or not*
 
@GandalftheWhite if you have a problem, why don't you solve it with .... magic ? YOU'RE A WIZARD
 
21st Century is Dark Age
Things aren't working
 
@FlorianMargaine shits complicated yo!
Secure passwords, and conditions
 
10:19 PM
@SterlingArcher use prepared queries yo
 
That's for tomorrow
was gonna do it tonight, but lady friend
making comments now
 
lady friend?
code before hoes yo
 
no
♀ > code
 
booty before boolean yo
 
booleans aren't even a real type bro
 
10:21 PM
Gandalf Agrees
Do you guys watch football
as in European Football
 
you find me a language with "booleans" and I'll show you a language lying about bytes
 
yeah, Zidane is my hero
@ssube haskell?
 
Zidane is best player ever that I have seen playing
 
@ssube but she is a type!
 
it probably has 3 types of booleans
 
10:21 PM
My type :D
 
I studies Haskell for a week to pass my tests in college
studies*
studied*
I studies Haskell for a week to pass my tests in college
 
@FlorianMargaine they look like they're mostly byte strings
 
you know you can edit chat messages here right? just press the up arrow. :)
 
@ssube there's no type, only bytes
 
Haskell is pretty fucked up
 
10:22 PM
there are a few languages that will pack multiple booleans into a byte
like that damn std::vector<bool>
 
it does that?
that's pretty cool
if you can fit 8 booleans in an uint8_t, go ahead!
or even 128 booleans, actually
 
@FlorianMargaine it's not, it's a huge problem
 
@ssube why?
 
@GandalftheWhite it's still very fast.
 
@KarelG wat
 
10:24 PM
every other vector can be accessed using sizeof(T) * n
 
gave errors to me because of indentation at times
 
it's probably that you are used with the OOP paradigm. Functional programming needs a different approach
 
I used notepad to code and some compiler of school to compile and run
 
ah that. but once you get used with that ...
 
vector<bool> cannot use sizeof(T), because it's 8 times long
@FlorianMargaine mostly the problem is that vector<bool> is the only exception
 
10:25 PM
which must be problematic when playing with templates :/
 
I hope, I will be smart enough for functional paradigm one day
and that'll be some day
 
@FlorianMargaine anything you do with foo <T> () { ... std::vector<T> bar; ... bar[sizeof(T)]} needs a specialization for foo <bool>
 
@ssube yeah got it, that sucks
@GandalftheWhite you don't "become" smart
you get more knowledge
but that's after getting your fingers out of your ass
 
could have been solved with no real overhead by just using std::bitset
 
@GandalftheWhite You can try elixir
The syntax is a lot more approachable
Same concepts, but 76gd76gsf78gashgf(TV)EBRA(B isnt a valid elixir program
 
10:35 PM
@FlorianMargaine Agreed sire!
 
Hello!
 
@keid Welcome to the JavaScript chat! Please review the room pseudo-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.
 
Namaste
 
@Meredith I know about Elixir of Life
 
@Meredith how's work going for you?
 
10:36 PM
 
@GandalftheWhite elixir-lang.org
 
I am on it, I was just kidding
I am reading about it
 
@SterlingArcher Good, I'm supposed to be working right now but I'm a little lazy right now
 
@keid ask a clear question. I have no idea what you're trying to accomplish
 
actually im noob in javascript and html
 
10:38 PM
Hi 5
 
and i thught that if I call window.variable before each div
damn, dont know if I can spam here.
but cant explain this problem in one sentention :(
 
they're all global variables, you'd have to give each page it's own variable name to get around that.
 
yeah i know that
 
or, stop using onclick attributes and use addEventListener
 
i.imgur.com/lndtqIK.gifv the spool came back for more
 
10:41 PM
@keid Where are you learning javascript?
 
I didnt learn at all actually
it's first time im using it
@KevinB what do you mean?
 
not sure if i could say it in another way that is simpler
 
I am reading eloquent javascript to make sure my basics are clear
xD
 
ok but if I use global variable as it is now. will that help?
hah -1 rate, but no one can provide any solution :D
 
Delete the question in the end
Simple
 
10:48 PM
@KendallFrey I'm going to hell for laughing.. title made is. When you're not satisfied with being a paraplegic
> boop
 
lol Sterling Archer
those guys totally missed with those matresses
they were slow as hell too
 
:-D
 
people have actually drankl those?
 
@SterlingArcher boop boop motherfucker lmao
 
10:53 PM
@SterlingArcher that is in the Nitro video or something
is on Netflix
 
@Laere It's called natural selection
 
hah
true that
 
> sip
 
her eyes are the eyes of disappointment
 
cc @Luggage, you're totally encouraged to write weird comments in code
 
11:05 PM
I think JSLint needs a rule to disallow exclamation marks in comments. ;-)
 
@ajaxGuru I built something like that, and that one looks terrible
 
@KingMob you should really learn how to recognize js code
 
I just meant that your comment made me think of a day when JSLint would reject my code because of poor comments! :-)
 
crl
11:23 PM
he should spellcheck comments
 
faceswap gone terribly wrong
 
@ndugger I didn't know you could art
well... "art"
 
I was an artist before I was a programmer
 
11:34 PM
your mom can art, that's for sure
:D
 
thanx bae
 
not as in you're a piece of art
you drove her mad and she became an artist after that probably
 
Well, now I'm gonna show off some of my old art... gimme a minute
I used to do a lot of pixel art
wayyyy too tedious for me these days
 
TG9sIGFzIGlmIEkgY2FyZWQgOkQ=
 
I also used to do 3D modeling, and hand painted the textures myself
obviously, this was before the texture was done
I lost the screenshot of it finished
 
11:38 PM
they're actually not bad
better than what I can do in a few hours for sure...
and I suck so that doesn't say much about you ;)
 
I also used to do a lot of vector art
Oh, and I used to design game UI's for the heck of it
I've done a lot, man
 
your mom did more
why do you still have the screenshots?
 
I have a whole archive of screenshots and snippets of my art. It was a big part of who I was, I don't want to lose it
I also used to do a lot of logo design/branding
 
alright. I would say keep it up but you're not doing any of this anymore, right?
 
11:41 PM
@ndugger I can approve this
 
Correct, I stopped doing art a lot time ago
 
Did you get money out of it?
 
Nope
 
didn't try to or just couldn't?
 
didn't try; I was doing art when I was still a minor
 
11:43 PM
how old are you again?
1e4?
 
Well, I did some still when I was 19, but it was around 20 that I started to learn how to code, and then I learned how to actually program when I was 21
I'm 23 now
 
oh
well, enjoy your life :D
 
make me
 
already made your mother, sorry :/
 
this is what I mean by pixel art being tedious...
look at how the tree leaves are made
that was painful... which is why I never finished it
 
11:47 PM
holy fuck I just saw a picture of shaq and his gf
 
Yeah, she's really tiny
 
she talks into his belly button
 
lol, blocked at work
 
when did they shack up?
 
get out
 
user2620028
11:50 PM
lmfao
 
user2620028
came back into chat and came in at the perfect time i suppose
 
scroll up for beautiful art
but now I must go home
 
user2620028
the trees?
 
!!afk gonna drive home, crash, and die, and go to star wars heaven
 
user2620028
oh haha even more
 

« first day (1908 days earlier)      last day (3047 days later) »