« first day (2051 days earlier)      last day (2898 days later) » 

3:00 PM
hi @AwalGarg
 
lets see how much more I end up reading
@Victor sup
 
@AwalGarg still working on that website ;)
 
@AwalGarg Kindle?
 
you?
 
yeah
 
3:00 PM
Get a goddamn tablet and install Adobe Reader
 
@Victor planning on improving my inner self and trying to get myself to read more books
 
@AwalGarg yoga ;)
 
@littlepootis uh.. oh.. someone doesn't feel like complying to the unix philosophy now
 
that's a great idea however. go ahead
I was wondering: can I change the parameters a function gets when it is passed a function parameter? I am talking about event handlers here
 
@Victor closure
 
3:02 PM
@Victor ^, or bind to push more args
 
@AwalGarg 😃
No
 
@littlepootis explain or gtfo before my inner self turns back to a monster
 
@AwalGarg it's a waste of money
 
money is a waste of space
 
Makes sense
not
 
3:05 PM
@Victor ...addEventListener('click', (function(a, b) { return(event) { ... a and b captured ..})(aValue, bValue))) <-- lets you get at aValue and bValue in the callback
 
The think is a little bit more complicated I guess. I am trying to write something on top of window.matchMedia API. I have 4 media queries my website answers to. They are named so I would like to do something like matchMedia( MQ.wide ).addEventListener( changedMedia ) and that function should get the name of the media query as I named it. Or even not have to call window.matchMedia at all. I could write something to check for each media query, but I wanted something more clever
 
.addEventListener(changedMedia.bind(null, MQ.wide))
 
function changedMedia(media, evt) {
}

matchMedia( MQ.wide ).addEventListener( changedMedia.bind(null, MQ.wide) );
 
/me sues luggage for copying my code
 
@AwalGarg I heard this one before
 
3:08 PM
/me flees the country.
 
@AwalGarg but you were suing facebook, iirc
 
@Victor kind of a trend now dude... oracle got inspired by me and sued google
 
> Luggage flees the country
 
@Luggage who is taking you? :P
 
@AwalGarg you should sue oracle for plagiarism
 
3:09 PM
haha
victor's first real joke in the room
 
what? "/me sues luggage for copying my code"
 
@AwalGarg :/
 
just kidding :) oh I am so funny XD
 
yea.. hilarious...
:)
 
3:11 PM
good morning
 
@doug65536 is that a joke? :))
 
your question is a bit of a joke, ya
 
@Victor nope. That's a pretty good example using the power of first-class functions in JS.
for starters, atleast
 
oh sorry I hadn't opened the link when I said that and I... nvm @AwalGarg's fault.
 
@Victor don't worry, that joke wasn't even funny :)
 
3:14 PM
@doug65536 I knew that I can do that, I just didn't know how correct it is.
 
closures are one of the best features in js. use them
 
extremely correct.
functions returning functions are beautiful
 
@rlemon I can try applying :D
 
@doug65536 ok then. thanks :)
 
3:17 PM
@Victor for cases this simple, bind is good too, particularly when you don't care about this
bind can be implemented as a closure
 
export default function( jsContext, listener ) {
    ThemeProps.mq.forEach( function( mq, mqName ) {
        window.matchMedia( mq ).addListener( listener.bind( jsContext, mqName ) );
    } );
};
is this ok?
 
now I can sue you for copying my code
 
no you can't
 
sue all the things
 
name that function.
 
3:19 PM
@Luggage forEach's callback? why?
 
no, the one being exported
just helps with stack traces.
I think..
 
ahh yeah
 
@Luggage done, thx
 
@AwalGarg nah man, to improve your inner self you just need more booze
 
@towc no
He does enough bad stuff already.
 
SQB
3:33 PM
PSA: interested in comics and cartoons of all kinds? From superheroes to Gaston Lagaffe, from Garfield to Maus, from Tintin to xkcd? Follow and support the new Comics Proposal over on Area 51!
 
@SQB hi! I think I remember you from the SciFi chat room?
 
SQB
Yes. Yes, you do.
 
:)
 
anyone here free? can help me check why i didn't get chatroom id?

pastebin.com/JSScpQB3 < let user to select chatrooms
pastebin.com/iVGJRyXm < a chatroom gui page
pastebin.com/U4J1pd89 < insert message call by ajax
pastebin.com/kQJ07eXq < load message call by ajax
pastebin.com/gF3PdE9p < ajax with poll

my question is how i get the chatroom id? now i was unable to get chatroom id
when i insert into database the chatroom_id is 0
Anyone can help me? i have a hard time to do this i have no idea to get the id
 
@nonstop328 Welcome to the JavaScript chat! Please review the room 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.
 
3:43 PM
@CapricaSix sorry i am new here
 
anybody on
 
no
 
bit old but...
> For an import, Chakra resolves the import name and create a link back to the export it refers to. The fact that Chakra is aware of the exact physical storage location for imports and exports allows it to store the location in bytecode and skip dynamically looking up the export name in execution. Chakra can bypass much of the normal property lookup and cache mechanisms and instead directly fetch the stored location to access imports or exports. The end result is that working with an imported object is faster than looking up properties in ordinary objects.
good lord... they add that "Read more at" to copied text...
 
Is is possible using client-side JavaScript to write a file that is bigger than available ram?
That is, write it in chunks
 
you're the memory genius here, copy
 
3:57 PM
It's possible to read large files in chunks using FileReader
 
oh, you're asking for a method, soz
 
@copy obviously don't have a direct answer, but... write where?
 
Either a download (like URL.createObjectURL(blob)) or selecting a file
I don't think the latter exists
 
I wonder what happens if you modify the blob while it is being written...
 
Huh
 
4:00 PM
Copy knows
 
new Blob([{ toString: () => console.log("hi") }])
> hi
 
@towc ignore it..
 
@nonstop328 did you find your answer?
 
var buf = "a"; for(var i = 0; i < 16; i++) buf += buf; buf.length
var blob_data = []; for(var i = 0; i < 0x10000; i++) blob_data.push({ toString: function() { return buf } })
var blob = new Blob(blob_data)
Tries to allocate memory for the whole blob and crashes
 
Hmm, can't (yet) pipe data from userland in a Response object either...
 
4:07 PM
Maybe something with the file constructor
 
user image
6
anyone from the philippines here? Dealing with someone from there trying to talk in english
A: I want to learn web design
B: Cool! What do you know about it already
A: Databases
B: Are you sure you don't want to learn web development instead
A: I want to know C++ and Java
conversation isn't going very well
(not exact words, but skeleton of the convo)
 
I'd suggest some ADHD medication in the first instance.
 
haha, towc, that's a good one
 
so, turns out she was saying that she knows C++ and Java already
B: so how much do you know them?
A: I know Java and some C++
B: so how much? Can you show me some code?
A: I know Java and some C++
 
@AaronHarding no i have hard time with this
 
4:16 PM
and calls it C+++
 
@towc I understand weird English
bring it on
 
B: Gotcha, can you show me something you made?
A: I make Java code
 
@AwalGarg Got it: new File([blob0, existing_file.slice(…), blob1, existing_file.slice(…), …])
 
@littlepootis it's more about her not understanding :/
 
Cool though
Only works because the majority of the data comes from an existing file
 
4:20 PM
@copy ahh ok, makes sense. nice
 
@towc i speak also weird english which everybody understands painlessly sir
 
Pwede mo bang ipakita sa aking and iyong 'Java' code?
 
wot m8
 
@cswl Pwede mo bang ipakita sa aking to you too
 
I asked a fillipino girl to translate it :|
 
4:22 PM
B: Ok...
A: I code in school
B: Ok...
A: so my code is in the school's computers, I don't have it with me
B: Oh! Ok!
A: No
 
Yeah, how is that okay?
It might be, in Britain, but in Philippines, it isn't!
 
schools now own students' code. great
 
I remember reading an article about a uni that requires students to transfer copyright to them.
 
@AwalGarg person doesn't have a computer at home
 
aww shucks. that sucks real bad. got first hand experience
 
4:27 PM
kompyuter
 
@towc 😭
 
B: ok
A: You are useless
B: <link to codecademy>
A: thank you for helping
 
> You are useless
:D
 
She wants the C.
 
I'm pretty sure his doesn't go all the way from UK to Philippines.
 
4:32 PM
AOE 2 Gets a DLC ~20 year after its launch
damn! somethings die hard :-|
 
One of my favs.
 
AOE 2 ? (how do you turn this on?)
 
Yeah
3 sucked
 
Big way
@littlepootis I don't see that you have AOE 2 HD on Steam :o
 
@Abhishrek Dude, this was waaaaay before Steam
 
4:33 PM
The Steam version has 10 extra civs (sweet)
 
When I was like 5
@Abhishrek Oh
 
@littlepootis funny, I played the game when I was 5 (well saw not play, I found finding sheeps boring compared to Dangerous Dave and Aladin and Ofcourse Prince of Persia)
 
@Abhishrek I LOVED dangerous dave
 
@littlepootis ever finished the game ?
 
and a Doom-like game
@Abhishrek nope
Maybe I did
 
4:35 PM
nOOb
 
I don't.. remember.
 
A: I need help with this (no links or images)
B: ok. Wtf is it with?
 
The only game I haven't finished from that Era is Prince of Persia Original
 
@towc Codementor?
 
it is just way too hard
 
4:36 PM
@littlepootis no, doing a friend a favour by teaching a friend of his
 
@towc oh
@Abhishrek I've played a pirated Prince of Persia once.
 
Pirated Prince of Persia
 
Don't know what version it was. But it was hard.
 
sounds like a good title
 
4:37 PM
I played and modded Akella's Pirates of the Carribean a lot
 
A: I need help with tihs
A: I nede help with this
A: I need help with this
 
so sad the game never got the recognition it deserved
 
@Abhishrek never heard of it. The same era?
 
Early 2000s
open world game :P, with sweet graphics and non linear game timeline
it even got a mod in 2013
 
Oh
I can't even buy it :/
 
4:39 PM
Yeah
I have it on disk
 
I miss those games.
 
the game had text files
like you could change the entire game
 
A: I got it
 
@Abhishrek wow
 
by changing a few text (jsonish) files
 
4:40 PM
@towc rubber duck debugging
 
that is why 10 year later people added more islands and much more playability to the game
@littlepootis dick xD
Not sure if typo or intentional
 
habitual typo
 
The most incredible part about POTC is
I played the game over 200 hours
finished it many many times
and yet there is a storyline, I never did, I just read it in the text files :-|
 
Ah, it happens.
I used to modify GBA roms.
 
No you don't get it
I talked to every single person
with every single reputation
on every single island
at one turn even the pirate lord was afraid of me (Horror at High Seas)
 
4:44 PM
Wait, the storyline doesn't change based on your choices?
 
It does, I never unlocked that one part :-/
it was a mission as an assassin
would have given me a much better sword
 
Oh, there was no clue as to how to unlock it in the text files?
 
Nope, well I never read all of them
the game was ~2 GB
with a few 100 mb of text files
 
Oh, that's a huge game then.
 
Took a good 10 second to load the engine
and then the game took a few minutes to start
(probably why not many people play it)
 
4:49 PM
@Abhishrek hah, most games in early 2000s took that much time on my toaster (1gb ram, god knows what gpu)
 
@littlepootis POTC worked with 128 MB ram :P
beat that?
Although I had a decent GPU
 
Yeah, most of them used to.
 
but the storm made it lag
decent storm simulation is too heavy even on newer machines, dunno how they achieved it back then
 
That still puzzles me.
 
4:57 PM
@Abhishrek WHERE DO I BUY THIS THING?
 
dunno vOv
 
@AwalGarg sue them
 
The new horizon's is much much better (:
 
That thing's awesome
 
New Horizon's is an unofficial expansion
 
4:58 PM
@Abhishrek You said it's just a mod
 
indeed :P, just adds more asthetics
 
I love open world games
 
@littlepootis there is more than that, you can buy more than 1 ship assign officers to yourself and other captains, do trade IIRC New horizons allows you to annex a city too
 
@Abhishrek Is this the mod you're talking about?
It adds some really cool stuff
 
5:01 PM
yeah
 
oi
 
@littlepootis also nerfs down the game
 
@Luggage is that only for google apps
 
google cloud.
 
5:04 PM
buy he said
 
It's really like a shortcut to making a micro instance with a bunch of common tools (git, docker, etc) and the google cloud commandline tools to mananger other instances from
 
(typeof obj !== 'undefined' && key in obj)
Is there any alternative way to check if an object exists and if it does then check if it has keys instead of the above one?
 
if (obj && key in obj) //probably sufficient
 
Yeah, thought that should be enough at first but it throws an error.
If obj is never defined.
 
5:11 PM
ohh, well.. that should never happen.
define all variables.
I mean, you need to change some other code to correct that error.
var obj;
 
Right. I'm thinking of a scenario where it might not be a good idea to define a variable..maybe checking on global variables (which is bad but it creeps on code at times).
 
There is no scenario where you need undeclared variables.
their value can be undefined, but they should be declared.
if you must use a global variable, then at least declare it.
 
I get that but let's say I'm just writing a piece of function on an already established code base and I need to check whether that variable exists or not in my tiny function...if that makes any sense.
 
you can't inspect a callers variables like that, unless it's a closure.
if you need to check the presence of a global variable, then check the global object. window in a browser.
if (window.obj && ...)
 
!(
 var k = {};
 // large code up top
 function myFunc(){
  if(k && key in k){}
 }
 // large code at to bottom
 ());
let's say I have something like that but let's say k is not there.
Or so far up the top that I don't want to be bothered with and I just want to check if k exists or not.
In that case, I'd have to use that typeof right?
No other way?
 
5:23 PM
You should always be bothered with other code.
 
if k is undeclared, then k is a global variable, which is horrible.
It's bad code and you should feel bad. :)
 
I do feel bad. :(
 
@littlepootis ^ on systemd's new behavior
 
That's the first step. You're on your way. :)
 
5:24 PM
That looks like good code to me. Thumbs up
 
haha..no time to refactor. I inherited the mess.
 
so, yea... typeof I guess, but start looking for a new job.
I mean because it sounds bad there.
 
You don't know the half of it. Who's hiring? :P
 
The place I just quit for the same shit...
so.. maybe not that one.
 
noted. :D
 
5:28 PM
I personally like when all variables are single letters; no need to minify
 
and undeclared, too?
 
declaring things costs bytes
 
@shriek Don't add to the bad code though. Do something along the lines of writing a function that does the right thing, and then wrap the call to that function in appropriate checks and comment them. Don't pollute your function with their rubbish.
 
Trying not to.
 
Make sure what you write is testable.
 
5:32 PM
Yup, definitely. Trying to make it have as less side effects as possible.
 
But yeah, typeof if you have no idea where k might be declared, and then go and cry in a corner.
 
bytes, lol
 
@AwalGarg lol
 
@FizzyTea lol
 
whiskey in your coffee helps, too
or coffee in your whiskey
 
5:36 PM
Apparently that was the modus operandi of the code's original authors.
 
or just whiskey and a fake tea-bag.
 
I see that you're quite an expert at this. :p
 
@Luggage <3 whiskey and fake tea
 
@Luggage fake tea?
 
so the cup looks like it has tea in it because if have a teabag in it.
 
5:40 PM
ooooo
hahah
is this really the cleanest way to write client-side es6 code?
i meant like workflow wise
 
i use webpack + gulp + babel
but pretty similar.
 
> Why should we change our behaviour because Lennart found a new part of the system to shit on?
 
I'd look into webpack over browserify. the dev server is useful
 
@Luggage alright, thanks
 
I like browserify's philosophy though.
also, you have beefy for browserify for dev server.
 
5:43 PM
I'm not shitting on browserify. I just really like webpack.
 
nay on Webpack
 
@shriek what's the difference?
 
@bitten difference on browserify and webpack?
 
y
 
webpack is more like you get webpack and everything comes built in (kitchen sink approach), browserify is more of a you BYOB(build your own build) kinda thing.
 
5:46 PM
webpack looks smarter
but if you want to get into it and customise it, then browserify is the way to go?
 
Yup. Webpack's supposed to be highly customizable too but it just feels awkward to me so far.
 
all of webpack's features are separate modules. Thre is no kitchen sink
there are just a lot of already-built modules to use
 
browserify has pipe system where you build a pipe and it can be fit to anything. It's more unix-y and generic approach.
 
they all need installed through npm separately. You be wrong.
 
okay
well i only really need to transpile es6
 
5:49 PM
@Luggage well, one of their selling point was that it already came with all the needed tools. So I'm just highlighting that fact.
 
(for this project)
 
Oh..then just go for babel.
and npm scripts.
 
@Luggage that's just so that they can update parts of Webpack independently
 
What do you guys understand from this sentence?
 
yea. it's modular. That's what that is.
 
5:50 PM
Appropriate variables are used to control selection and iterations!
 
they're Webpack's dependencies, it's not like you have a choice
 
+ gulp to watch?
 
no, all the loaders and plugins
 
you can use nodemon or other watch tools..gulp is just a build tool.
 
gulp has a watch feature built-in
 
5:51 PM
but the es6 is for client side code, i thought nodemon was only for node.js?
 
it is
you could use it to re-build your code when you save.. maybe he meant that
 
Yeah, isn't gulp just for node too?
 
it's a build tool. you build whatever you want.
 
client, server.
 
5:53 PM
Or cli
Or nuke
 
@bitten, yeah, you can use gulp if you want to use watch and don't wanna bother with other watch tools.
 
@shriek you always end up with a JS script. there are no restrictions on where you choose to run it
 
@shriek yeah, just seems like if i use gulp for watch then it's also easier to add other build scripts without using a different framework?
 
@shriek grunt has watch too
 
sorry if my semantics are off, by framework i meant things like gulp
 
yeah..gulp does a decent job. grunt's a bit slower.
 
@FilipDupanović looks interesting
 
gulp is a viable choice alone, yes. It's more general purpose, but it's got enough support to use for almost anything
 
@FilipDupanović but how would i then send es6 code to es6 ready browsers, and then a es5 version for the rest?
or is that not how people are doing it?
 
I still like my webpack, though
 
5:57 PM
@bitten it's impossible
 
I'll have to try this webpack. I tried once but got too frustrated and haven't looked back.
 
@FilipDupanović okay, well it was just a thought ^^
 
Webpack doesn't support ES6 modules, for instance
 
@Luggage teach us the webpack
 
well, you just add babel-loader to webpack and it does
 
5:58 PM
how is that delivering ES6 code to ES6 compatible clients?
 
@littlepootis ho ho, my makefile using inotifywait laughs on your 100megs node_modules
 
@FilipDupanović why shouldn't we be delivering es6 to es6 ready clients?
it seems a bit silly to be writing in es6 if it's just being transpiled to es5?
it seems that you only get human readability as a bonus
 
@bitten Webpack has it's own AST which doesn't support ES6 modules
 
here is a real webpack config of mine, warts and all: gist.github.com/luggage66/039c09a65f89d04f13f4e32026f0b3d1
for a non-trivial project.
 

« first day (2051 days earlier)      last day (2898 days later) »