« first day (2698 days earlier)      last day (2475 days later) » 

15:00
I'll have my sweet sweet dynamic component sizes in no time!
@KamilSolecki I wrote a simple @redrawOnResize for some of our 3rd party widgets
export const redrawOnResize = (Comp: typeof Component) => class extends Component<any, { resizing?: boolean; width?: number; }> {
  state = { resizing: false, width: 0 };

  private resize = event => {
    const width = this.getWindowWidth();
    if (this.state.width !== width) {
      this.setState({ width, resizing: true });
      this.stoppedResizingAfterDebounce();
    }
  }

  private throttledResize = _.throttle(this.resize.bind(this), 1000);

  private stoppedResizingAfterDebounce = _.debounce(() => this.setState({ resizing: false }), 2000);
This one is rather blunt though
and... stolen
@MadaraUchiha why should static properties not be enumerable?
It will completely unmount while resizing, and remount when you're done
@towc Because that's how it is without transpilation
oh, alright
15:02
Which means that the transpiled code is not equivalent to the source code.
I too think that if you use Object.keys() on a class, you're gonna have a bad time.
@MadaraUchiha it won't work with css transitions though, will it?
@KamilSolecki No. The DOM node gets removed entirely.
That's the point.
It was done because the 3rd party tools we used to work with would check for window.innerWidth once during their lifetimes, and assume that resize never occurs
So we said "OK, I'll just destroy you during resize, and call you again from the start once it's done"
@MadaraUchiha have you got C/C++ experience?
@Wietlol Not as much as I'd like, unfortunately :(
I consider it the largest gaping hole in my education.
do you understand what this (not C or C++, but similar) means?
i8** argv
15:08
pointer of a pointer? or something like that, not sure
so what would "argv[1]" be?
no idea :B
Maybe Benji? @BenjaminGruenbaum
@MadaraUchiha I see. I'm writing mine for my specific user case, where I need sizes available in the wrapped component. I also need it to react to any transitions, hence im making use of resize-observer-polyfill. Ill share it when I'm done.
yesterday, I made a bit improvements in my LLVM IR stuff, but it completely abandoned logic
15:10
My keyboard did not survive. Time to try to replace two Cherry Brown switches.
@KamilSolecki We did something like this for that
export function innerWidthAware<C extends React.ComponentClass<any>>(Comp: C) {
  return class InnerWidthAwareComponent extends React.Component<any, { windowInnerWidth: number }> {
    private disposable: rx.Disposable | null = null;
    public static displayName = `InnerWidthAwareComponent(${Comp.name})`;
    state = {
      windowInnerWidth: typeof window !== 'undefined' ? window.innerWidth : 1920,
    };

    handleResize = () => {
      this.setState({
        windowInnerWidth: window.innerWidth,
Ignore the fancy Rx parts, that's @BenjaminGruenbaum's or @Mosho's fault :D
All the Rx does is do something similar to my combination of _.throttle and _.debounce in the previous example
@Wietlol **argv = ur current variable holds reference to a pointer that points to argv
argv[0] actually
@KarelG but you know how arrays work right?
if you need the next index, just ++ it
@MadaraUchiha Rx as in ratings mean ...
15:12
with null pointers at the end
@SaitamaSama Hmm?
Ha
No, I mean RxJS
I can load at a given index i with some massive expression and stuff which I simplify to "argv[i]"
15:13
@MadaraUchiha nice.
@KarelG so what would argv[0] or argv[1] be?
@KamilSolecki Beware, though, do not trigger a re-render directly on resize
Throttle and/or debounce
Yes, I'm aware about that.
Else your performance is going to have a really bad day.
@Wietlol first and second argument passed to your executable
15:14
I don't want to kill my app :P
@KarelG and of what type would that be?
foo.exe hey you
argv[0] = hey
argv[1] = you
string ofc
cant be string (not C++)
its LLVM IR
main (i8** argv)
charseq ...
15:15
??? stuff = argv[1]
node process arguments?
@KarelG on a side note, argv[0] = "foo.exe", argv[1] = "hey" and argv[2] = "you"
yes. I keep forgetting that. That is true yes
+1
but still, what is the type of "stuff" or "argv[1]"?
*char[]?
15:17
typeof argv[1] ?
@KamilSolecki where does [] come from?
@trixo 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.
@trixo basically, but not in context of Jakartascript
@Wietlol char array, aka string
I keep getting electric shocks from stuff, I don't think the people around me are experiencing the same thing
15:18
as said, "string". In C and c++ are strings char sequence
could it be my diet somehow?
thus "typeof" argv[1] = char *
the thing is, the type of stuff is also i8**
@towc normal. is it low humidity?
@Luggage pretty dry here, yeah
15:19
that helps you collect static charges
or retain
main(i32 argc, i8** argv) {
    i8** stuff - argv[1]
u must be static
@KarelG some people just shouldn't be enumerable
@towc where I live, it's mostly a winter thing. During that time of year I am always shocking myself on door handles, etc.
yay
thanks
I'm about to fall asleep again
white noise from the AC
half-blocked music from the bar downstairs
light office noises
15:22
when i was on toilet today i was thinking why nobody come up with idea to stop toilet backfire somehow
@trixo my toilet doesn't backfire
I guess iwas coding too much today :D
one thing I'm curious about is when I take off my hoodie, I can get a massive zap from metal on my chair, but nothing from metal on my printer (which should be grounded)
hows that possible ?
@KarelG does this make sense?
main(i32 argc, i8** argv) {
    i8** stuff = argv[1]
15:23
@trixo I don't eat a lot
lul
@KendallFrey if it's grounded, the charge disperses
thats not a good fix
it has a "place to go"
just bad workaround :D
15:23
s/bad workaround/hack/
@Neil That's exactly why I don't understand it
@trixo might help you out with more stuff
@KendallFrey once it reaches the ground, it can go everywhere and anywhere
I know how grounding works
not very likely that the ground is completely surrounded by an insulator
15:24
a friend was about to touch my arm yesterday. The zap we had actually hurt
but I'm the one with the charge
well your charge doesn't go away until you touch something grounded
or until you touch something at least conductive with no charge
@Wietlol not to me
maybe the chair has a charge, not you
I've gotten zapped by touching water before
water out of a faucet
15:26
@Luggage then explain how my chair gets a charge when I take off my hoodie
I refuse on the grounds that I have no idea.
I can do
i8** stuff1 = argv[0]
i8** stuff2 = stuff1[0]
i8** stuff3 = stuff2[0]
i8** stuff4 = stuff3[0]
i8** stuff5 = stuff4[0]
The chair isn't charged, you are
and it wont cry
15:27
implicit casting is fun
@Wietlol what you have there is a memory address
but what is the difference between i8** and i8** ?
none ?
!!> "i8**" == "i8**"
15:29
uh, nothing?
@Neoares true
quick grammars
you should better return to java
@KarelG but what am I doing with argv[i] then?
@Wietlol reading it?
15:30
you got a pointer to it
but shouldnt that make argv an i8*** ?
no
it would make argv[i] an i8*
At least, that's what it normally is
not in my case
not in LLVM
Isn't this C?
nope
its LLVM IR
15:33
@KendallFrey That is a C, sir.
@Neil that is a this, not a C
that's a D+
At least we are talking javascript
I can't fathom how anything would make the value pointed to by a pointer to a pointer into a pointer to a pointer
I don't see the point neither
15:38
i think i might understand
but it still aint logical to me yet
@MadaraUchiha Mosho, I wouldn't do this with Rx although it's not too bad
if you did i8* stuff = argv[0]; are you saying that wouldn't match?
@Wietlol pointer to pointer?
It's just an array of strings probably
@KendallFrey it gives a compiler error
@BenjaminGruenbaum it cant be strings, strings dont exist in LLVM
that is its entire point
its too low level to create a definition of strings
@Wietlol When you say strings don't exist, do you mean there is no string type, or that it actually cannot deal with strings?
15:39
@Wietlol a string in C (which is well defined) is an array of chars.
char **argv is an array of strings in C
^ yeah, I don't know what i8 is, but maybe unicode char points?
I would assume LLVM does the same
@BenjaminGruenbaum I would assume an 8-bit integer
@KendallFrey the first
hence why it is i8**
and i8 means a byte
so that is probably an array of strings
15:42
or better yet, an integral value with 8 bits
its a pointer to a pointer to a byte
is there a default init for python classes? or I'm forced to write it?
I have an init with a "pass" in it
@BenjaminGruenbaum im not writing C :D
@Wietlol then that makes sense, it's an array of strings
Probably in ascii
@Neoares how would you define member variables otherwise?
It seems to be a direct translation of a C string
Yeah, that makes sense
15:44
it is what a C string compiles to
because C uses LLVM
Good morning
@BenjaminGruenbaum outside
it's sqlalchemy
@SterlingArcher well, pitter patter
@Neoares Then you can skip it
15:45
@Wietlol What would char* name = argv[0]; compile to, then?
@KendallFrey lets get at'er
@Wietlol no, compilers exist that convert C to llvm, that's not the same as "C uses llvm"
probably
i8** %1 = getelementptr i8** %argv, i32 0
i8* %name = load i8** %1
@BenjaminGruenbaum isnt clang the "default" C compiler?
Is [] syntax something completely different in IR?
in LLVM IR it doesnt exist
15:49
@Wietlol there's no such thing as a "default" compiler
why not?
@Wietlol Then why the hell did you keep using it in your code examples?
for Java, its javac, for C#, its C# Compiler (or whatever it is called)
@rlemon it's the best jaw workout you can get aside from the gloryhole challenge
15:50
@KendallFrey to simplify what people wont understand without LLVM IR knowledge
@Wietlol roslyn is the most common
@Wietlol Those are the most used compilers, but by no means the only ones
@Wietlol Well now everything is way more confusing, so good job
do you understand my llvm ir code snippet?
@rlemon i feel like I'd fail that lvl 2
@Wietlol I can sort of get an idea of what it's doing, that's about it
I'm trying to figure out what you meant by [] if not the C meaning
15:53
@SterlingArcher i.imgur.com/Qjin27l.jpg
@Wietlol C# changed compilers, so did Java (several times) - languages and compilers are orthogonal
Plus, your LLVM is weird, and it's not how I saw LLVM before
@rlemon nice, nice.
chrome just switched to llvm from MSVC on windows.
gloryhole challenge :D
15:54
@SterlingArcher
you are experienced :D hm
Are you not?
That was weak
@BenjaminGruenbaum my llvm is normal llvm ir
You need to practice burns
You need to practice your reference gettings
15:56
(simple hello world)
@KendallFrey 8.65/10.4
15:57
im not sure what part of LLVM you were using, but this is LLVM IR
so dumb question... if you have a function, that makes another function call within it... you can't mock that function call (in jest) without passing the function call via the arguments?
Guys my niece is the cutest
Wait that's a meme
user1596138
Hmm
user1596138
15:58
That better not be your niece :/
Things not to say after posting that picture:
LOOK HOW CUTE SHE IS
she already laughs at memes
my nephew is cuter
looks constipated
user1596138
15:59
I'm cuter than that
You look like the raccoon my dog killed and probably raped
user1596138
I forgot I ordered an ice cream machine last night lol
You smell like nachos and you're probably stoned

« first day (2698 days earlier)      last day (2475 days later) »