« first day (2751 days earlier)      last day (2180 days later) » 

8:00 PM
@KendallFrey is it tho
I love you Vap0r
 
it's also good for getting scale off metal
 
uh TIL
 
so is coca cola
boiling acid is a helluva drug
 
@Zirak nudes
 
What would people want to see in a JS101 session?
 
8:02 PM
 
@phenomnomnominal TypeScript
/halfjoke
 
@MadaraUchiha that's so backwards
 
@phenomnomnominal Is it for people who are new to programming, or programmers who are new to js?
 
The only nice thing that came off Twitter is anime updates and fan arts
 
centuries are like the timezones of years
@phenomnomnominal Zirak's question, along with ES version
 
8:03 PM
@Zirak could be either
 
we talking classes and arrows or prototypes and this?
 
First year uni
90 mins
 
how to debug. they'll use that knowledge the longest.
 
does jquery addClass method have to do anything with dynamic contents.. because it does not seem to be working on dynaically produced svg element by fontawesome
 
my #1 would be functions and what calling them with params really means
 
8:04 PM
Probably gonna about prototypes classes and this
 
@ssube speaking of, a good HS friend went down the path of doing anything and has become a little of a vegetal. Real sad when I talked to him recently, he changed dramatically
 
@phenomnomnominal It highly depends. Do you have to teach what a string is, and what a function is, or can you skip all that?
 
do things get copied? passed?
 
Skip what it is, but definitely need to show syntax
 
> In contemporary history, the third millennium is a period of time that started on January 1, 2001, and will end on December 31, 3000 of the Gregorian calendar.[1][2] It is distinct from the millennium known as the 2000s which began on January 1, 2000 and will end on December 31, 2999.
 
8:05 PM
@azamkhan jQuery works on ell elements. But maybe you did your 'lookup' for the svg before it existed?
 
@azamkhan .addClass doesn't have any say in it, it acts on the collection of elements you already have.
 
I’m basically thinking...
 
@KamilSolecki yeah, it's real. I've know a number of people like that.
 
@phenomnomnominal knowing how many people in first year of programming uni have never coded, Id start with something to encourage their interests
 
I see a lot of talks and tutorials on how to write a language, or how to do X pattern, but not a lot on how to figure out where you've went wrong when all of it comes crumbling down.
well, not many
 
8:06 PM
@rlemon the few that do either recommend printf or loading up Netbeans to remote JMX debug things
 
Go through the language super high level. Write some dumb functions that do stuff. Then go through the console API/dev tools. Then do some DOM API stuff. Then make some other dumb thing.
 
teaching folks to use a decent log library from the beginning could be good
 
@Luggage no I do it later when all the code is produced in expanding a menu icon. when I do toggle or add css it works. but addClass and removeClass do not work
 
If you can teach someone to search documentation and debug code, they're basically set
 
^
 
8:07 PM
If
 
@phenomnomnominal copying/references will matter, if they don't know it yet
 
this ^
 
I want to call a function on xmlHttpRequest finish, but suppose I query something on google, I just want to wait for the html body, and not dependent resources like image etc
 
@azamkhan Hm. It should if .css() works..
 
8:07 PM
How should i proceed
 
@SurajJain XHR won't load those other things
 
References took me by surprise when I first started programming in general
 
Probably need to talk about sync vs a async too
 
I am totally cursing my luck now.. @luggage
 
@phenomnomnominal If they know how to program already and it's uni, I'd recommend showing them what sets it drastically apart from regular environments. Show how you write a function which takes a DOM element and style its text like a rainbow, alternating
 
8:08 PM
explain how async/await glaze over promises
 
I am doing XHR to "https://www.google.co.in/search?q=define+argument"
 
@phenomnomnominal a little further down the path imo. COre concepts are really crucial
 
and it is loading the audio too.
 
because async/await are so much easier to read, I wouldn't introduce students to nested async anymore
 
and then firing the funcion
 
8:08 PM
It shows (1) DOM (2) functions (3) looping (4) array methods (5) setTimeout and asynchronous programming
 
callback
 
@Zirak yep I like that
 
it's just going to confuse them, especially because async isn't actually nested when it runs
@Zirak how this works
especially since we have a dozen different ways now with arrows, bind, etc
 
By “async”, I mean the concept of an event and a callback
 
More importantly, show them the dev tools while you do it, and most importantly, you show them how instant the web-dev experience is, that sets it apart from most programming environments
 
8:09 PM
You can avoid this for a long time if you don’t use it :p
 
you can avoid good code that way too :P
 
@ssube In JS 101 I wouldn't go into this tbh, that's like JS 103 imo
 
@Zirak yeah I’m going index.html all the way
 
@Zirak I haven't taken enough numbered classes to argue that
 
Once you go into objects and stuff, until then you can probably go with the intuition of what blah.something means as long as blah isn't your object
 
8:10 PM
I’ll mention building stuff as a real world thing, but that’s it
Probably should’ve started this earlier than the day before eh? 😅
 
@phenomnomnominal @Zirak another thing that I see confuses a lot of people is the frontend / backend separation. Explaining that very early would solve a lot of things as well
 
Good call. How to approach that really depends on their background. If it's like most unis I know, they go through socket programming at some point, so if you're after that you're good
 
We have three subsequent sessions that will go into that
So yeah I’ll mention then
 
The way I'd do it, is I'd slowly build up a simple real-wolrd example
 
@ssube I am doing XHR to "https://www.google.co.in/search?q=define+argument" and it is loading the audio too.
 
8:14 PM
thoughout classes
and structure it in a way that lets them understand the concepts one by one
which might be hard
but I believe is doable
 
They’re going to build 2 player tic tac toe over the 4 sessions
I get to do the first and the last
 
thats great
 
Nice, that's a good goal
 
@SurajJain loading a page via xhr doesn't automatically run anything, you'll have to show the code you're using in more detail
 
So I just need to show them enough to not fall over as soon as they see code hah
 
8:16 PM
preferably with an example
 
@phenomnomnominal what do you expect them to know when they come? Nothing? (if you said, I must have missed it)
 
@rlemon
  function sendRequest(info){

        var url = "https://www.google.co.in/search?q=define+" + info.word;
        var xmlHTTP = new XMLHttpRequest();
        xmlHTTP.onload = createCallback();
        xmlHTTP.open( "GET", url, true ); // true for asynchronous request
        xmlHTTP.send();
    }
 
show createCallback
 
@KamilSolecki expect nothing, there will be all different levels
 
@rlemon
function createCallback(){
        var retrieveMeaning = function(){
            if(!$("[data-dobid='hdw']", this.responseText)[0]){
              return noMeaningFound(createdDiv);
            }
            var word = $("[data-dobid='hdw']", this.responseText)[0].textContent;
            var meaning =  $(".PNlCoe [data-dobid='dfn'] span", this.responseText)[0].textContent;
            console.log(word, meaning);
            appendToDiv(createdDiv, {word: word, meaning: meaning});
        };
        return retrieveMeaning;
Double clicking any word will pop up its meaning
 
8:21 PM
nothing in that would suggest it's loading and playing audio
 
When I double click, any word it is requesting the page
suppose I double click argument
 
requesting the page just loads the HTML as text
 
but the sound is also coming
see the network tab
 
you are rendering some of it into the jQuery object, which may start the download I guess.
tmk the translation audio isn't an autoplay tag, so it shouldn't ever play it
 
tmk??
 
8:31 PM
to my knowledge
 
and now it takes time to show the meaning and When I inspected the network tab, it waits even for the audio to come, to start working
wait for audio to come then it calls the callback
 
yes but follow me here
when you xhr the page, you're asking for the view-source text
they give that too you, there is no audio there.
then you load that into jQuery to grab stuff out of it, jQuery creates an audio tag which is I guess starting the download
it isn't the xhr that is downloading the audio, it's loading the tag into jQuery
I believe
 
8:46 PM
@rlemon You were right, I used debugging and until the jquery line the audio is not downloaded
 
Hi, just wanted to share a question. I have a feeling there is a brain in here that could point me to the write example script to use. stackoverflow.com/questions/50072966/…
 
I think chrome extensions can do that
no clue about tampermonkey
 
Basically sum it up, there extension i use, works great blocks removes certain xpaths or css from webpage Great for presentations or hide distracting info. Thing is for most of the sites that are assigned rules a quick refresh is needed then the script works flawlessy
 
I know extensions can communicate between tabs
in chrome*
 
so is it possible to invoke the f5 key . refresh on assigned webpages a split second after the page starts loading.
 
8:54 PM
I still don't quite understand your problem, but if you just want your extension to trigger a function on all pages that have it running after a change in the options are made, I'm pretty sure it can do that.
I'd have to check the docs for how, but background pages can communicate with context pages iirc
 
@rlemon i appreciate the replay thank you
here a quick overview This extension works great for hiding distractions unnecessary sections during a presentation. I used to show a group to customize Gmail filter messages into group. But I wanted to show this in live working email with emails to filter. But I wanted to block three parts of current gmail page and still have working site and tools on the Gmail site. It works great right when I load Gmail page I hit the F5 key.
this is extension i am using works great chrome.google.com/webstore/detail/customblocker/…
just that it needs a quick refresh to trigger the rules...
 
@rlemon Can you tell me how to use css selector on page I received from xmlHttpRequest
 
not without loading it into a dom
and that'll start the download
maybe a DOMParser doesn't?
check MDN for DOMParser
 
so if i visiting gmail .com for example before it finishing loading I hit the F5 refresh key and this extension blocks the assigned areas to be removed. If i don't it fails often. So my final objective. Is to added this via sideload my homemade extension or via tampermonkey user scripts .
 
@FredMcgiff I think the refresh is a bandaid solution, it doesn't make sense that it would be required. as for being able to communicate between another extension and your own, which is how I now understand it. I'm not sure that's possible. the best you could do is figure out if there is something they add to the DOM that you can recognize
 
9:03 PM
exactly and during presentation i need to be near the keyboard and or worry about it .. but just that quick refresh even if the page did not finish loading triggers all the rules and the extension to work
 
that's like $2 in hardware
neat idea tho. just not very technically challenging and at that price..
 
well i feeling that more secure or lawyered a site is the less the rules triggers .. for example going to home page extensions works going to a home page click login then after login redirects that page after login needs a refresh to apply the chrome rules assigned in custom blocker
 
you could just write your own better extension that didn't need the page load delays
 
or refreshes
 
9:09 PM
Hi from the beach :D
 
All i kind find for example scripts are timed interval refresh, .. get request sent , send get url again for following address. .. this i could implement in tamper monkey or via home made script.
@SterlingArcher lbi
 
@SterlingArcher what you actually meant was "suckeeeeeeeeers"
 
Yes😊
What does lbi mean
 
long beach island cause i an missing a beach chair looks just like that
bj
 
9:14 PM
Ah lol no I’m in Southport NC
 
nj
u know where the dump the trash
jk'
nice nice
 
9:28 PM
jfyi if you guys didn't know there is a tweet about r17 making the round
won't link since it's pretty easy to search on twitter
 
@ssube oh my god I have made a crucial mistake
 
@Ahmad we're aware.
 
I forgot interfaces arent runtime lmao
 
gotcha
 
and was designing my ioc api as if they were
ugh
 
9:31 PM
I think the majority are choosing not to engage on twitter. it's broken for actual communication
 
Kamil, go to school
 
good decision
 
9:43 PM
I have an angularjs app that gets a list of URLs from the DB and generates an item list, where clicking on each item will redirect to that respective URL. One of the items that will come from the server side also contains a JWT authorization token that needs to be passed to the URL. In this case, clicking on the item should POST to the URL instead of GETing. Is it possible open a new URL with POST and custom headers instead of GET?
 
@DemCodeLines Make the item submit a form
 
for(;x=readline();print(q))for(q=i=[];i<10;)q+=x.split(i++).length-1
Need one character less :(
 
@Zirak This is a standard ng-repeat list, so you're saying I should have a <form> for each item that gets submitted when I click on it?
 
@DemCodeLines That's one way to do it, dunno if there's a cleaner alternative, angular-wise
You could also call a js function which creates and submits the form
So the item is a button which calls js
 
no, youtube
 
9:55 PM
@copy does readLine only return the values once?
 
@rlemon No, it returns a line or undefined if there are no more lines
 
damn. okay my idea is out
 
I found another one with 68: for(;x=readline(q=[]);print(q))for(i=10;i--;)q=x.split(i).length-1+q
 
Finally rode my bike for the first time
I died
Hello from satan’s butthole
 
@copy wouldn't q+=x.split(i).length-1 be the same there?
 
9:57 PM
@Zirak there is no "last boss"
now you grind
and there are more difficulties
 
@rlemon Nope, since we're iterating backwards we're adding the length at the front, not at the back
 
not to mention the only way a man should play is hardcore
 
@Mosho Did a bunch of bounties, nothing too hard so far
 
which means that if you die once you're out
 
The rift whatever is pretty easy...until I got into the legendary whatever at like a high level
Dude the arcane purple thingies hurt
 
9:59 PM
@copy wtf does this even do
 
@copy is this string manipulation? I'm struggling to understand the code
 
oh my god for a moment I had a heart attack
 
@KendallFrey Print the frequencies of each digit in the input, 111223 -> 3210000000
 
int + [] === string.
 
I thought that my API removed JSON support and left SOAP only
I found it tho
 
10:00 PM
!!> x = []; x++; x
 
@copy 1
 
Empty string becomes zero in numeric operations
 
but you're adding q to the length + q so wouldn't that be [] + 1 + [] ?
 
Ah yes, q is the string of frequencies for each digit
 
is that because of print(q) ?
 
10:03 PM
Yeah
 
gotcha. I should learn about the environment more
 
What's with using [] instead of ""?
 
"" also works
 
hence my question
[] is just needlessly confusing
 
Sometimes [] is more useful because you can put something in it, but in this case it's the same
 
10:12 PM
who the hell removes auth documentation from API docs
seriously
am I supposed to guess?
 
Is there an ES6 function for getting the sum of an array or diving 2 arrays by each other?
 
sum is easy
then you can just sum twice and divide
 
there is no point for one to be pre-coded
 
arr.reduce((sum,value) => (sum+=value,sum),0);
 
do I have to call arr.reduce (a.length() / 2) times?
 
10:18 PM
@RaisingAgent No, go read the docs if you want to know how it works.
 
Okay, it just reduces it all from left to right
I did, thanks @rlemon
 
excellent
 
NO seriously who removes auth info from docs
this is ridiculous
 
@KamilSolecki sure there is
 
10:19 PM
@rlemon arr.reduce((sum,value) => sum + value,0);
 
@KendallFrey in scala maybe, not JS
 
@copy you're too good at this
 
@KamilSolecki heh, I've done that
 
@rlemon no you're just a pleb :P
 
I wish there was a better workaround
 
10:20 PM
@ssube I just went to writing some C# to feel some interfaces :D
 
@KendallFrey neither of you are allowed to talk. he code golfs in his sleep, you optimize factories.
 
just a way to mark interfaces as emitting a function, but that has downstream language changes
 
they're basically the same thing.
 
speaking of which, I finished iron and copper smelting today
 
@ssube its really close, but yeah misses that crucial step which would require ground work
 
10:21 PM
finished as in it's all smelted?
 
hmmm I wonder if factorio golf could be a thing
 
@KendallFrey So you play modded minecraft?
 
@ssube no the smelters are built :P
 
make it be @KendallFrey
 
@RaisingAgent no, factorio
 
10:22 PM
@KendallFrey probably, and you already won
 
pff no
 
single factorismo footprint
 
There are some seriously good factorio players
 
I'd say that's bordering smallest
unmodded, different game :P
 
10:23 PM
ufff at least I have the TS version of my auth code
thank lorde
I can work with that
otherwise I'd have to go to my office tomorrow to find local shit
 
0
Q: Structural typing and Polymorphism - TypeScript

overexchangeBelow is and example code(polymorphic) taken from angular framework, export abstract class AbstractControlDirective { ... } AbstractControlDirective subtypes export abstract class NgControl extends AbstractControlDirective { ... } export abstract class ControlContainer extends Abstr...

 
@KendallFrey is he just running different blueprints and stacking the output?
 
I only have it in really old scripts
 
@rlemon yeah, there's a mod that lets you place blueprints with circuits
 
clever
 
10:24 PM
@overexchange why do you hate extends so much
 
U can complete / win in factorio? Whats the end goal?
 
someone used that mod to create a factory where expansion was automated
like it would find ore patches and mine them automatically, build more machines, blueprint, etc.
@RaisingAgent launch a rocket
but you can make a factory do lots of things
 
@KendallFrey Because you turned the whole planet into a factory?
 
@KamilSolecki Because in java I injected many bugs by adding many super types using some design pattern. Only consequene, you will make the hierarchy look less structured
 
@RaisingAgent yes
 
10:27 PM
@overexchange but Javascript ain't Java
 
Adding supertypes withing class hierarchies is most frequent problem
I don't know JavaSript
 
Is there something I can put in my boots to clean and remove the rancid odor from wearing them every day this past winter?
 
Am using TypeScript
 
then the developer is the problem
not the functionality
there is absolutely nothing wrong with base classes, moreover, they let the developers fuck up less
it allows you to force functionality
 
You can conveyor band yourself around :D
 
10:29 PM
Prototypical paradigm does not fit for current angular framework code
Am not sure, how javascript is relevant here
 
because typescript just adds compile time checks to js
it doesn't change how anything works.
 
are you the developer of angular or something?
 
so a typescript question of this nature, if I'm not mistaken, is really a js question
 
@ndugger dynamite
 
if not, then why do you care what design schemes and principles they use when it comes to your code?
 
10:31 PM
@relemon I know that, but that is an abstraction for me as an angular developer
 
but.. it isn't.
there is no abstraction. it is something js doesn't have entirely.
and it doesn't effect runtime
 
I’ll try baking soda
 
Am sorry.. but this is not JS question
 
You’re a JS question
 
I dont understand why you think base classes are god objects
 
10:34 PM
As an angular developer, before I start coding.. I care about explicit typing, not using IIFE, using structural typing instead of nominal etc...
This has nothing to do with JS
IIFE yes but..
 
cool but I still dont see the problem
 
Otherwise there is no reason using TypeScript
 
you are speaking in sentences so general that they could lead an army
4
 
@KamilSolecki dank meme, bro
 
you are a dank meme
 
10:37 PM
I know the problems with Java & other nominal typed languages. I do not want to get in that situation again with TypeScript. I don't know, why angular is using the same approach.. of using extends
 
because that's how JS is
 
DUDE spare me
and just tell what the problem is specifically
please
 
TypeScript is still confined to how JS works
because it results in JS
 
@KamilSolecki that’s the nicest thing anyone has ever said to me
 
I don't have any problem with you.. Ignore me
2
 
10:38 PM
nobody has a problem (well maybe except you with extends :P) Im trying to understand why
 
Am just trying to proceed further on what Benjamin told about the alternative on this problem
Am just working further on it
 
I'm struggling to understand the problem. all I've gathered so far is that prototypical inheritance is bad. but you have literally no other option if you want to use classes in the construct of js
 
@rlemon pls replace js with TS to make this sentence matter tank you
 
but TS results in JS. understanding that it is a compile time thing is important I think
but I don't use TS, so if I'm wrong, someone please correct me
 
@rlemon (twas a joke)
based on the current flow of events
I thought you would catch it, you dissapointed me citrus :(
 
10:41 PM
I did, but I wanted to make sure I was correct on my assumptions
 
ah well
 
@rlemon I have no issues using class syntax but I do not want to use extends keyword
 
yeah we learned that a few times
 
but that's how you inherit from other classes in JS
can we stop with the star spam please
 
10:42 PM
It’s not the process he hates, it’s specifically the word “extends”
It’s offensive
 
feels like it honestly
I'd love to understand why tho
 
@overexchange tmk, any other solution would be doing what extends does, but not behind the scenes. meaning it wouldn't be a candidate for future improvements and linters.
class and extends are sugar currently in js, but leave room for future improvements
going a classical route, imo, would be a big mistake
 
Another solution looks something like this, this is what a user suggested me in the morning chat here
 
I prefer prototypal inheritance, personally
 
In terms of contract, I would use implements keyword but I do not want to use extends for inheritance(code reuse and maintain invariants) & polymorphism.
 
10:51 PM
@overexchange ok consider this scenario:
interface ILogger {
    Log(message: string): void;
}

class BaseViewModel {
    protected _logger: ILogger;

    public constructor(logger: ILogger) {
        this._logger = logger;
    }
}

class ViewModel extends BaseViewModel { ... }
what problem would you have with that
except 7 letters ofc
holy smokes I gotta see a doctor again
Im out of my migraine medicine
and paracetamol holds way too short
 

« first day (2751 days earlier)      last day (2180 days later) »