These are chat archives for FreeCodeCamp/HelpJavaScript

8th
Jun 2018
Zunaid Aslam
@ZunaidAslam
Jun 08 2018 13:49
Hello guys, I was doing a FCC ES6 section. I am not understanding a code
var printNumTwo; for (var i = 0; i < 3; i++) { console.log(i); if(i === 2){ printNumTwo = function() { return i; }; } } console.log(printNumTwo()); // returns 3
Why does this return 3 with var but with let it returns 2?
Charlie Waite
@charliearlie
Jun 08 2018 13:55
Best explanation is here
Wait, actually that's not a great explanation, just another thing showing the difference
Will find an explanation better than I can provide
Charlie Waite
@charliearlie
Jun 08 2018 14:03
funnily enough, I found a decent explanation on FCC
Zunaid Aslam
@ZunaidAslam
Jun 08 2018 14:04
I meant shouldn't the loop stop when var becomes 3 and shouldn't it return the value of i as 2 because this is when if function ran.
@charliearlie Thanks I will check it out.
I didn't think people would ask this question in the forum. I just thought I was kind of like the only one not getting it lol.
Thank you @charliearlie I am reading from the link
Charlie Waite
@charliearlie
Jun 08 2018 14:07
It's a common thing in regards to closures. Once you're using es6 I'd advise to never use var
Zunaid Aslam
@ZunaidAslam
Jun 08 2018 14:09
I understood the concept. Even though I am still a beginner, I feel this is kind of a bug or maybe this was not intended.
Or is it because I don't have much knowledge about closure yet.
Juliano Rafael
@thefrontendwizard
Jun 08 2018 14:11
actually, it's half of the reason
the other important thing is to understand closures and how does the function retains the variable
ehutchllew
@ehutchllew
Jun 08 2018 14:15
@Zunaid-Aslam also look at hoisting
Jason Luboff
@JLuboff
Jun 08 2018 15:17
:wave:
Christopher McCormack
@cmccormack
Jun 08 2018 15:22
@JLuboff heya :wave:
Kudzu
@czhower
Jun 08 2018 15:23
@Zunaid-Aslam "bug or not intended" - JS has a LOT of bad concepts in it. You just have to learn them, and code around them. The lang was desigend in late 95, and years were 2 digits....... And thats just one of many and not even the worst of it.
Nate Mallison
@NJM8
Jun 08 2018 15:23
@bradtaniguchi I fixed the navigation slide on the voting app
Kudzu
@czhower
Jun 08 2018 15:24
When you finally make it into an IDE instead of CodePen etc, make sure you install a linter. It will help detect a lot of bad code styles.
Jason Luboff
@JLuboff
Jun 08 2018 15:25
@cmccormack Whats happening?
Christopher McCormack
@cmccormack
Jun 08 2018 15:25
I actually had a dream last night that solved a small passport issue I was having before I went to sleep. Very weird
Nate Mallison
@NJM8
Jun 08 2018 15:25
@cmccormack if you have a moment can you go vote on some polls again? I assume your ip lookup failed for some reason and your id in the voters array was null, not good if other ip lookups fail, so I put in a back up localID creation if iplookup fails, I should probably just use that period and drop the ip address
I just installed a linter for the first time. It makes some opinionated decisions in my opinion. But with VS Code it fixes 90% of the issues with my "style" just with a quick auto-fix on save
Kudzu
@czhower
Jun 08 2018 15:27
You need to customize the linters a bit - the default rules sometimes are not perfect
Nate Mallison
@NJM8
Jun 08 2018 15:27
of course I'm using the default style so I assume I could fix it
Christopher McCormack
@cmccormack
Jun 08 2018 15:28
@NJM8 definitely - I like to read up on the decisions it makes that I don't necessarily like to see if there is something I didn't understand, and if I disagree just turn it off
Kudzu
@czhower
Jun 08 2018 15:28
there is a .json file to configure the linters. But even in default it will catch things like var usage, etc
Nate Mallison
@NJM8
Jun 08 2018 15:28
yeah, I guess the way I see it is it's just an opinion, when I go to work for someone they will probably have their own required style
Christopher McCormack
@cmccormack
Jun 08 2018 15:28
our org extends airbnb with a few mods I think
Nate Mallison
@NJM8
Jun 08 2018 15:29
the only things I don't like are function myFunc (someVar) { versus function myfunc(someVar){
Jason Luboff
@JLuboff
Jun 08 2018 15:29
I'm using airbnb's linter guide except with a few modifications
@cmccormack Dreaming of code, must have been a good nights sleep
Kudzu
@czhower
Jun 08 2018 15:29
A good way to improve ones JS is learn another language even if only acacemically and then come back to JS - it helps one truly see the gaping problems in JS better and then you are able to better code around them. That is so long as that other lang isnt PHP or so...
I regularly dream of code and often even solve bugs in my sleep and wake up to remember them.
Nate Mallison
@NJM8
Jun 08 2018 15:30
I don't like the spaces between the func name and the parens, I use no spaces to help visually differentiate between if statements and functions
Christopher McCormack
@cmccormack
Jun 08 2018 15:30
it's diffuse mode thinking and can be awesome
Nate Mallison
@NJM8
Jun 08 2018 15:30
and no semi-colons
Jason Luboff
@JLuboff
Jun 08 2018 15:30
PHP :puke:
Nate Mallison
@NJM8
Jun 08 2018 15:30
I like my semi-colons
Jason Luboff
@JLuboff
Jun 08 2018 15:30
airbnb style uses semi-colons
Christopher McCormack
@cmccormack
Jun 08 2018 15:30
I dislike semi colons but know I can easily put them in if ever needed with my linter
Nate Mallison
@NJM8
Jun 08 2018 15:31
diffuse mode thinking is one the big reasons I'm into this career path, I love having problems just be solved by my background processes
feels great
You all should read the book Dreaming in Code
got me hooked on wanting to do this, crazy story about a todo organizer software in the 2000's that was a nightmare to ship
Jason Luboff
@JLuboff
Jun 08 2018 15:32
You should read "Querying Data with Transact-SQL" by Itzik Ben-Gan, it's an envigorating read! (Oh wait..its very dry.. but..a good resource if studying for exam 70-761!)
Christopher McCormack
@cmccormack
Jun 08 2018 15:36
@NJM8 I read that a few years ago, it's the only reason I know who Mitch Kapor is
which is sad because he's done a lot
Nate Mallison
@NJM8
Jun 08 2018 15:37
I'll keep it in mind. I had to drop out of this round of M101JS. Not enough time in the day. Maybe next time
Jason Luboff
@JLuboff
Jun 08 2018 15:38
Oh! M101JS is a great course!
Christopher McCormack
@cmccormack
Jun 08 2018 15:49
yeah it was good I wish I had taken better notes though :)
Jason Luboff
@JLuboff
Jun 08 2018 15:50
I think you can go back through it, can't you?
Christopher McCormack
@cmccormack
Jun 08 2018 15:50
I think so but that's a lot of videos
Jason Luboff
@JLuboff
Jun 08 2018 15:52
Fair enough
Brad
@bradtaniguchi
Jun 08 2018 16:17
@NJM8 nice! was it hard Todo the animation?
Nate Mallison
@NJM8
Jun 08 2018 16:57
@bradtaniguchi actually there was a working example right in the Vue docs. Just had to modify a few things to fit my use case
Jason Luboff
@JLuboff
Jun 08 2018 16:59
I hate IE Enhanced Security Configuration that is automatically enabled on new Window Server installs.
Brad
@bradtaniguchi
Jun 08 2018 17:00
haha thats always nice
Brad
@bradtaniguchi
Jun 08 2018 17:06
Trying to get my settings sync to download my settings again, I had to re-install vscode to update
now stuff aint working :/
Jason Luboff
@JLuboff
Jun 08 2018 17:06
Thats discouraging
Brad
@bradtaniguchi
Jun 08 2018 17:07
ok looks like everything ironed out, idk how the extension was saying things were failing to download haha
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:29
I got an idea. Why don't we do a coding challenge? Write a "chatbot" for use here in Gitter. You're only allowed to use client side JS. Libraries like jQuery are acceptable. The script should be injected through Greasemonkey or Temper Monkey, depending on which browser you use. The time limit is 1 week. Anyone up for it? :smile:
Jason Luboff
@JLuboff
Jun 08 2018 17:34
...Not down... haha
Christopher McCormack
@cmccormack
Jun 08 2018 17:34
@bjorno43 I hope someone takes you up on that. I feel so overwhelmed with the current projects I"m not sure I would take part but maybe others will
Brad
@bradtaniguchi
Jun 08 2018 17:35
Hmmm, how does the client-side chat bot send the message to other users?
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:35
@cmccormack I've done it before. Though not with Gitter. Just some other random chat. So I know it's possible to do and a very fun challenge. You'll learn quite a bit about traversing the DOM and injecting JS
Jason Luboff
@JLuboff
Jun 08 2018 17:35
...through magic..obiviousily
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:36
@bradtaniguchi The messages are simply sent using your own account. Setting the value of the chat input and simulating a Enter keypress or Button send mouse click
Brad
@bradtaniguchi
Jun 08 2018 17:37
Oh so it just hijacks your page?
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:38
It could. But if you do it properly, it doesn't have to. At least, only for a very short moment. Basicly it could GET the current value. Save it. Inject its message and restore the previous value. It goes fast enough that you hardly notice it
Christopher McCormack
@cmccormack
Jun 08 2018 17:38
how do you do document.getElementById in the console? Doesn't seem to work for me
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:39
That's because Gitter uses iframes @cmccormack You'll have to hook up the frame
Christopher McCormack
@cmccormack
Jun 08 2018 17:39
ah
Brad
@bradtaniguchi
Jun 08 2018 17:39
Sounds more like some chat macro thing, not a chat bot hehe
Mine will just be a keylogger :P
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:40
Again, depends. You have it respond to messages that start with a certain string only. You could use Ajax for a database if you want to, but that's outside of the challenge :P
I mean, ye, technically it's not a real bot. But it comes pretty close :laughing:
Brad
@bradtaniguchi
Jun 08 2018 17:42
Ive never worked with greasemonkey, or heard of temper monkey, but sounds doable hehe
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:43
It's just normal JS. Greasemonkey simply injects it for you. No special code needed
Well except maybe a require for jQuery or something. But that's peanuts
The most fun part is watching the DOM for changes and react on it, ghehe
Brad
@bradtaniguchi
Jun 08 2018 17:46
events for the win
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:47
Nope. That's where you start working with the MutationObserver
Jason Luboff
@JLuboff
Jun 08 2018 17:47
ARGGHHH. Damn query isn't working right
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:49
If you rely on events and timers you're gonna hang your browser and make it pretty much unusable :P
Brad
@bradtaniguchi
Jun 08 2018 17:49
whoa whats this magic
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:50
@bradtaniguchi Ghehe pretty cool huh?
Brad
@bradtaniguchi
Jun 08 2018 17:52
cool stuff, I never thought about it haha
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:54
And because you can disconnect a Mutation Observer, it's very easy to inject a checkbox to enable / disable the "bot"
Brad
@bradtaniguchi
Jun 08 2018 17:55
Interesting stuff, I can totally see how I could abuse this for ultimat power, I mean do some cool stuff hehe
Bjorn van de Peut
@bjorno43
Jun 08 2018 17:55
Whahaha :laughing:
@bradtaniguchi So are you up for the challenge?
Brad
@bradtaniguchi
Jun 08 2018 18:00
I would be but I know I have no time for this XD, I can try but no guarentees of even a submission :P
Bjorn van de Peut
@bjorno43
Jun 08 2018 18:00
Whaha ok
Christopher McCormack
@cmccormack
Jun 08 2018 18:09
Is it better to make a function you are going to call (inner function) an async function with an await within the function where there is an async call, or to call that inner function using await if your outer function is already async? I'm not sure there is a difference but don't want to add async/await on the inner function if not needed, just worried I may be missing something
Jason Luboff
@JLuboff
Jun 08 2018 18:09
@cmccormack Yes
Christopher McCormack
@cmccormack
Jun 08 2018 18:11

e.g.

outerFunction = async () => {
  const innerFunction = () => {
    someAsyncFunction()
  }

  await innerFunction()
}

vs

outerFunction = async () => {
  const innerFunction = async () => {
    await someAsyncFunction()
  }

  innerFunction()
}
Sorry wrote that from memory so there may be syntax errors
@JLuboff yes to which?
Brad
@bradtaniguchi
Jun 08 2018 18:13
man I skipped learning async await, I'm stuck in promise land
Jason Luboff
@JLuboff
Jun 08 2018 18:13
I don't know :worried: I was just being a smart ass..
Christopher McCormack
@cmccormack
Jun 08 2018 18:15
@bradtaniguchi haha Promise Land :)
Brad
@bradtaniguchi
Jun 08 2018 18:16
haha
Christopher McCormack
@cmccormack
Jun 08 2018 18:16
async await essentially is promises, is my understanding. await just stops the flow until the promise is resolved or rejected I believe, and you can use the response without having to use .then within the async function
it's been pretty nice to use recently when I may have a few async calls within a function and I don't want a race condition
Can also just use callbacks but this seems cleaner
Bjorn van de Peut
@bjorno43
Jun 08 2018 18:22
Well it's gonna be more challenging than I expected it to be to make that bot, ghehe
Brad
@bradtaniguchi
Jun 08 2018 18:22
I should learn async await, but I haven't had time to wrap my head around it
Bjorn van de Peut
@bjorno43
Jun 08 2018 18:23
Since Gitter "detects" the same user typing multiple messages and doesn't add the profile pic / username on each of them. Ghehe
Christopher McCormack
@cmccormack
Jun 08 2018 18:24
@bradtaniguchi this article is a good starting point and not too long. https://hackernoon.com/6-reasons-why-javascripts-async-await-blows-promises-away-tutorial-c7ec10518dd9
If you understand Promises well enough it's really not too complicated
Brad
@bradtaniguchi
Jun 08 2018 18:25
Ill ready it on my lunch break, thanks :D
Christopher McCormack
@cmccormack
Jun 08 2018 18:25

The hardest part for me is remembering to do

handleValidateAuth = async () => {

not

async handleValidateAuth = () => {

:D

Bjorn van de Peut
@bjorno43
Jun 08 2018 18:35
Test message. (need to see console output)
Jason Luboff
@JLuboff
Jun 08 2018 18:41
Wtf. All my files that I had set to LF got changed back to CRLF grrr
Christopher McCormack
@cmccormack
Jun 08 2018 18:42
@JLuboff using git?
Jason Luboff
@JLuboff
Jun 08 2018 18:42
Ya
I guess I shouldn't say all...but a good chunk of them
Christopher McCormack
@cmccormack
Jun 08 2018 18:43
@JLuboff git may convert as well, there's a flag for it
Jason Luboff
@JLuboff
Jun 08 2018 18:44
Possibly
Jason Luboff
@JLuboff
Jun 08 2018 19:00

@cmccormack Ah... ya it is git thats part of the issue.

warning: LF will be replaced by CRLF in routes/routes.js.
The file will have its original line endings in your working directory.

But... I haven't pulled from my repo...just been working on the same files so still kind of wierd

Christopher McCormack
@cmccormack
Jun 08 2018 19:03
Maybe that's why the top entry in the git man pages is git - the stupid content tracker :D
Jason Luboff
@JLuboff
Jun 08 2018 19:04
Hah
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:06
lol
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:14
Alright. Got the Mutation Observer working and it's returning me the messages in Gitter :smile:
afbeelding.png
Christopher McCormack
@cmccormack
Jun 08 2018 19:33
@bjorno43 how do we trigger it?
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:33
@cmccormack The observer?
Christopher McCormack
@cmccormack
Jun 08 2018 19:34
@bjorno43 yes?
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:34
Which browser are you using?
Christopher McCormack
@cmccormack
Jun 08 2018 19:36
FF
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:36
Alright, did you install Greasemonkey? https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/?
Christopher McCormack
@cmccormack
Jun 08 2018 19:36
no
I figured you were making a bot that observed something, just curious what you are observing
Gulsvi
@gulsvi
Jun 08 2018 19:37
It's supported in all browsers effectively https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver.
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:37
Ah, you're going to need that. You'll need an addon to inject JS into a website
Ahhh, one sec, I'll give you the code for it
Christopher McCormack
@cmccormack
Jun 08 2018 19:38
but I don't want to do it just curious what YOU are doing @bjorno43
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:39
Ye I know, but it's easier to explain that way

So this is the Mutation Observer function:

var observeDOM = (function(){
    var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
        eventListenerSupported = window.addEventListener;

    return function(obj, callback){
        if( MutationObserver ){
            // define a new observer
            obs = new MutationObserver(function(mutations, observer){
                if( mutations[0].addedNodes.length > 0 ){
                    callback(mutations[0].addedNodes);
                }
            });
            // have the observer observe foo for changes in children
            obs.observe( obj, { childList:true, subtree:true });
        }
        else if( eventListenerSupported ){
            obj.addEventListener('DOMNodeInserted', callback, false);
            obj.addEventListener('DOMNodeRemoved', callback, false);
        }
    };
})();

As you can see, it checkes if the Mutation Observer is available in the browser. If not, it falls back on old event listeners. If it is, it expects a DOM element to monitor for changes and returnes any new changes made to it:

observeDOM( document.getElementById('some_element'), function(nodes){
    console.log(nodes);
});
Christopher McCormack
@cmccormack
Jun 08 2018 19:47
What will you do with it now?
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:50
Well now that I have it return me the chat message node, I can simply traverse the node for info. Like nodes[0].children[0].innerText for example would return me the exact username and nodes[0].children[1].innerText would return me the chat message. After that I can simple split the chat message string on spaces, verify if the first word starts with !chatbot for example and if so, respond to it. Build a string. Insert into the chat and send it
Christopher McCormack
@cmccormack
Jun 08 2018 19:52
@bjorno43 my question is more about the what will you do than the how you do it :)
Bjorn van de Peut
@bjorno43
Jun 08 2018 19:56
Ah sorry, must be a bit of language barrier. It basicly means the same to me
I think my first idea is to create an Eightball game. You know, like funny future predictions on questions
Christopher McCormack
@cmccormack
Jun 08 2018 20:01
Sure! That should be fun. You should make one that response to any question with "Did you read the docs?"
Bjorn van de Peut
@bjorno43
Jun 08 2018 20:03
Haha that'd be fun
Christopher McCormack
@cmccormack
Jun 08 2018 20:07
@bjorno43 or maybe do something like this any time you detect a user posted an error message https://twitter.com/DivineOmega/status/695744177557106688
LPT: If someone asks you a question that can be easily googled, please consider the fact that this person might just want to talk with you.
:)
Christopher McCormack
@cmccormack
Jun 08 2018 20:10
Maybe in person
Gulsvi
@gulsvi
Jun 08 2018 20:10
My girlfriend does this and it's quite annoying sometimes...but oh well
Christopher McCormack
@cmccormack
Jun 08 2018 20:10
don't think that applies in here as much
Gulsvi
@gulsvi
Jun 08 2018 20:10
In a "chat" room
Christopher McCormack
@cmccormack
Jun 08 2018 20:11
Providing a link to a relevant SO post doesn't take away from that
I post to MDN articles because they are full of useful info, are you saying I shouldn't because this is a chat room?
Gulsvi
@gulsvi
Jun 08 2018 20:12
I'm not telling anyone what they should do...
Or, more appropriately what they *shouldn't* do
Jason Luboff
@JLuboff
Jun 08 2018 20:30
.5
Brad
@bradtaniguchi
Jun 08 2018 20:32
had to show someone the latex output here heeh
Jason Luboff
@JLuboff
Jun 08 2018 20:35
:+1:
Christopher McCormack
@cmccormack
Jun 08 2018 20:37
@gulsvi when you going to add an avatar pic??
Jason Luboff
@JLuboff
Jun 08 2018 20:45
Some people don't like their face being seen on the interwebs :trollface:
Christopher McCormack
@cmccormack
Jun 08 2018 20:47
@JLuboff @bradtaniguchi figured out a solution, everyone can!
Brad
@bradtaniguchi
Jun 08 2018 20:47
hu, everyone can what :O
Gulsvi
@gulsvi
Jun 08 2018 20:48
@cmccormack Never :)
You're okay having everything you say indexed by google and associated with your employer. I am not.
Christopher McCormack
@cmccormack
Jun 08 2018 20:48
@bradtaniguchi create an avatar that isn't their face, unless your face looks like a big mech
Brad
@bradtaniguchi
Jun 08 2018 20:49
Maybe my face is a mech alright!
gosssshhh
But in all seriousness, I've been to damn lazy to take a picture haha
Christopher McCormack
@cmccormack
Jun 08 2018 20:49
Anything is better than the default github avatar
Jason Luboff
@JLuboff
Jun 08 2018 20:51
I full well accept that anything I post on the internet is public knowledge, yes. I also acknowledge that oyu can easily find my social media accounts from my name.
To think that you can hide behind the internet is only fooling yourself
Gulsvi
@gulsvi
Jun 08 2018 20:52
I chose this identicon to use for my avatar, it isn't my default lol
Christopher McCormack
@cmccormack
Jun 08 2018 20:53
I see
Gulsvi
@gulsvi
Jun 08 2018 20:53
The default one I got looks like a pink middle finger
That is a really large image...
Brad
@bradtaniguchi
Jun 08 2018 20:56
I think it looks like a house hehe
Gulsvi
@gulsvi
Jun 08 2018 20:57
Lol, some say it looks like Yanny, others like Laurel
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:01
Perhaps it's also a bit comforting. Because many, many years after your death and the death of all the people that knew you well enough to remember you, some parts of you still linger around the web.
I mean, when my time has come, I'll just make a wikipedia page about me xD Immortality achieved, lol
Gulsvi
@gulsvi
Jun 08 2018 21:03
I think that's the ultimate goal, become famous after death. Like Van Gogh
Jason Luboff
@JLuboff
Jun 08 2018 21:04
Van Gogh musuem in Amsterdam is pretty neat
Gulsvi
@gulsvi
Jun 08 2018 21:05
I agree. I was just there in January.
The whole city is really nice, but tons of tourists :)
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:06
Yup. So many tourists there that ppl automaticly speak English to you instead of Dutch, lol
Brad
@bradtaniguchi
Jun 08 2018 21:08
I think I could care less if I was famous after I died, I mean... I can't really care at that point haha
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:08
If you guys ever visit the Netherlands again, take a train towards Eindhoven from Amsterdam. I'll show you around, ghehe
Gulsvi
@gulsvi
Jun 08 2018 21:10
I went to Utrecht and Rotterdam. Wish I got to see more.
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:10
Though unless there's some event, not much to show here, ghehe
Best time to visit Eindhoven is in November during Glow festival. Then the whole city is like:
With all kinds of shows on buildings etc
Christopher McCormack
@cmccormack
Jun 08 2018 21:13
nice
like a disney movie
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:14
Ye. It's really awesome. And completely free of course :)
But it's a huge tourist attraction. The amount of ppl visiting is much worse than what you see in Amsterdam, ghehe
Christopher McCormack
@cmccormack
Jun 08 2018 21:17
I live in a tourist town as well but fortunately most people come here to hike so they're out of site :)
Jason Luboff
@JLuboff
Jun 08 2018 21:18
@bjorno43 My wife and I went to a shop and bought some cake and the girl first started talking to me in Dutch and then apoligized when I was like "er...sorry... " lol
We were there last year in May. Were in the city when the Ajax championship game was going on... that was..crazy in comparison to anything I've seen here
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:19
@JLuboff Ghehe your experience must be different than mine. When I go there, they immediately assume I'm a tourist. I usually let them finish in English and then just reply in Dutch, lol
Ah ye, football
Jason Luboff
@JLuboff
Jun 08 2018 21:22
I don't think I look particularly Dutch either..but.. I dunno haha.
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:22
Meh, you actually look pretty much like a regular guy here. At least, on that pic :P
Jason Luboff
@JLuboff
Jun 08 2018 21:23
...it's a bit of an old pic..but.. I pretty much look the same except I have some facial hair (short) lol
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:23
Ye, pretty standard for Dutch, ghehe
Still, the culture in Amsterdam is quite different from the "less tourist attraction" spots in the Netherlands. Ppl are much more "on their toas" there. Easily irritated an very outspoken. The further away you go, the more "relaxed" ppl are. Especially if you're going south. Though avoid Zeeland at all costs, lol
Jason Luboff
@JLuboff
Jun 08 2018 21:28
Ya.. unfortunately we didn't get too far out of Amsterdam. Made it over to Muiden and Zaanse Schans? but thats as far as we adventured.
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:28
I mean, it's nice place to go to the beach, but the ppl there are terrible. They don't like anyone not born there and they hate tourists
Jason Luboff
@JLuboff
Jun 08 2018 21:28
Long distance travel was difficult as my wife was 3 months pregnant at the time and my father who we were also with has a terminal lung disease..so..
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:29
Ah ye, that makes it difficult
Jason Luboff
@JLuboff
Jun 08 2018 21:29
It ws actually a very stressful trip lol
There were highlights though
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:29
And the only reliable way to travel longer distances here is by train. Which are full of ppl on those tracks
Jason Luboff
@JLuboff
Jun 08 2018 21:30
Trains weren't ever too bad as I think we were mainly using them at off times
Bjorn van de Peut
@bjorno43
Jun 08 2018 21:31
Ah ok. Ye, it rly depends on the time. Like, don't use the train on saterday evening, ghehe
But I'm glad you had some highlights here as well :) As a local, the Netherlands seems rather boring to me. But I suppose that's quite normal if you live somewhere every single day
Jason Luboff
@JLuboff
Jun 08 2018 21:35
The musuems were the highlight. Would have been nice to make it over to Belgium or Germany for a day but.. no biggie :smile:
Christopher McCormack
@cmccormack
Jun 08 2018 21:47
Anyone used Material-UI CSS-inJS?
Jason Luboff
@JLuboff
Jun 08 2018 21:49
No :(
Christopher McCormack
@cmccormack
Jun 08 2018 21:50
nuts
Jason Luboff
@JLuboff
Jun 08 2018 21:51
But if you have a SQL question I might be able to answer it!
Christopher McCormack
@cmccormack
Jun 08 2018 21:52
@JLuboff is it pronounced squeal?
Jason Luboff
@JLuboff
Jun 08 2018 21:53
See-quill!
Christopher McCormack
@cmccormack
Jun 08 2018 21:54
squall?
Jason Luboff
@JLuboff
Jun 08 2018 21:55
Suuuree
Kudzu
@czhower
Jun 08 2018 22:00
see - quill - @JLuboff is correct
Jason Luboff
@JLuboff
Jun 08 2018 22:01
I think @cmccormack is just messing with me :smile:
Kudzu
@czhower
Jun 08 2018 22:01
Although SQL Server is often called Squirrel Server. :)
Christopher McCormack
@cmccormack
Jun 08 2018 22:01
Me mess with you??
Kudzu
@czhower
Jun 08 2018 22:01
Especially in the early days when it was a POS - back in the 90s...
Christopher McCormack
@cmccormack
Jun 08 2018 22:02
I'm Relational Algebra for life yo
Jason Luboff
@JLuboff
Jun 08 2018 22:03
The first part of Itzik's T-Sql book is about Relational Algebra. That shit flew right over my head hah
Christopher McCormack
@cmccormack
Jun 08 2018 22:04
I still have some of my old assignments...
% List the names of recording labels that have never produced a CD rated as number one. 
% (labelID, labelName)
ans3neverNumber1CDLabel := 
{ LabelID, LabelName | recordingLabel(LabelID, LabelName, _) and ((exists CdCode)(cd(CdCode, _, _, _, LabelID, _) and
    not (exists Rating)(topCDs(CdCode, _, Rating) and Rating = 1)))};
I don't remember the language though ahah
or tool or whatever
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:05
@czhower Hey man. Could pass me the link to that open source OS website? I was talking with a couple of ppl about it a few days ago and they were interested, but I couldn't find the URL anywhere
Christopher McCormack
@cmccormack
Jun 08 2018 22:06
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:06
lol xD
Nah Kudzu knows what I'm talking about :P
Jason Luboff
@JLuboff
Jun 08 2018 22:06
@cmccormack Thats not T-SQL thats for sure
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:08
@JLuboff Ah yes, that's the one! Thanks :D
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:14
Test message to get console output. Pls ignore
Kudzu
@czhower
Jun 08 2018 22:14
@bjorno43 www.goCosmos.org
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:15
@czhower Ye got it from @JLuboff Thanks though :)
Kudzu
@czhower
Jun 08 2018 22:15
There is a gitter chat for the cosmos project too.
Cool, glad he remembered it too :)
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:15
Oh cool
Sry guys, sometimes just spamming test messages to get data returned
Jason Luboff
@JLuboff
Jun 08 2018 22:17
@czhower I actually had to jump onto your personal site to find it hah. But since you're here... any suggestions as ex-microsoft on study material for 70-761 (Querying SQL 2016)
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:18
test
Kudzu
@czhower
Jun 08 2018 22:18
I dont study in the normal ways that others do and I dont go for the certs so I can only be minimal help on that. Are you looknig free or paid? Pluralsight I always here good stuff about and I know many of the guys there.
Jason Luboff
@JLuboff
Jun 08 2018 22:19
Eh... prefer free but would consider paid. More so looking for practice versus learning material
Kudzu
@czhower
Jun 08 2018 22:19
Udemy has a course too, but I dont have any experience with them. I'm an autodidact and my learning paths I've long ago learned are quite different than usual.
Christopher McCormack
@cmccormack
Jun 08 2018 22:19
@JLuboff you should see if your work will get a pluralsight license. We have one for our engineers and it's great
I tend to get everything I need for free too because I'm a former MS employee, but also a former Microsoft Regional Director.
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:22
Test
Alright, that finally works
Kudzu
@czhower
Jun 08 2018 22:22
Despite what many web devs propose, SQL is very good to learn and is not "ancient crap that noone uses anymore"
Jason Luboff
@JLuboff
Jun 08 2018 22:22
@czhower Thanks, the second link is only 15 questions but... anything helps :D
I'm actually pretty excited about some of the new features in SQL 2016
Like temporal tables I think is really cool
Kudzu
@czhower
Jun 08 2018 22:24

SQL has really been advancing well. SQL 2000 was about the first "good" version. Prior to that most of us hated it. They basically bought Sybase and then went from there and the 2 competed for a while... but we all hated Sybase at the time any way... Oracle was king then.. .we didnt like it then but it was the best of them at the time.

Sybase for example ignored all plans beyond 4 joins until about 2000 or so.. and that wasn't even the worst of its habits.

Of the big boys today, I strongly prefer SQL. Oracle is of course powerful and capable too, but its just such a bear to work with in comparison to SQL. Too much "wrestling" instead of "dancing" with it.
MS Access is actually very good for anyone starting on SQL.... Its good because its "RAD" and so easy to play with... Then 95% of what you learn applies to the big SQL DBs.
Jason Luboff
@JLuboff
Jun 08 2018 22:27
I'll admit I was a hater of SQL... I much prefered MongoDB... but know that I have a better understanding of it (by no means an expert..but.. I'm better..) I definitely see the benefits of relational database vs document style. But.. It also depends on your application as to what database will be better for you
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:27
@czhower Do you have any experience with Mutation Observers?
Kudzu
@czhower
Jun 08 2018 22:28
yes, usage varies. doc dbs have come a long way, but still cant do many of the larger loads and advanced stuff that SQL ones can. But the are still advancing too...and most SQL DBs have added some doc features as wel.
Mutation Observers - not really. Looked at them a while back, but they just weren't useful for our applications. We have a framework that sits "above" the DOM and for us it has its own observer framework that works at a higher level.
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:30
Ah ok :)
Kudzu
@czhower
Jun 08 2018 22:30
Mutation Observers can be very useful when you need them though.
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:30
Ye I know. I'm just facing a little problem, ghehe
Kudzu
@czhower
Jun 08 2018 22:31
We have a framework which I can best describe as WPF for the web (doesnt use XML though)... .so we treat the DOM like WPF treats DirectX.... ie user code doesnt use the DOM,, its isolated from the DOM and the framework has its own change notifications at a higher level.
I mess with the DOM a lot though as I work on the framework itself, but our users typically don't.... they just use the framework only.
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:33
Just wondering if I could use the node returned by my observer to travel the actual DOM. It doesn't have an id attached to it, which makes it a bit of a problem as I need to create a recursive itterator function to select the correct node above it
Kudzu
@czhower
Jun 08 2018 22:33
Didnt play with it enough to say off the top of my head - sorry.
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:34
No problem :)
I mean, I could instead have it return all the nodes of the parent so I have them all available. But as the DOM grows, that object is gonna be huge, ghehe
Bjorn van de Peut
@bjorno43
Jun 08 2018 22:39
Alright, gonna send 4 messages after eachother. Need to see how gitter handles that
test 2
test 3
test 4
test 5
Christopher McCormack
@cmccormack
Jun 08 2018 22:53
@bjorno43 isn't there a camperbot room you could do that in?
Bjorn van de Peut
@bjorno43
Jun 08 2018 23:01
Ye I think there is. But for now I got what I needed :smile:
Jason Luboff
@JLuboff
Jun 08 2018 23:01
One more hour until the weekend..
Christopher McCormack
@cmccormack
Jun 08 2018 23:05
@JLuboff :beers:
One's for the wife don't drink it!
Jason Luboff
@JLuboff
Jun 08 2018 23:05
Haha
Bjorn van de Peut
@bjorno43
Jun 08 2018 23:22
Pff I could use a cold one now, haha
Unfortunetely I'm out here :P