« first day (2417 days earlier)      last day (2529 days later) » 

12:31 AM
@monners damn that's cheap
if only I was into those weird ass ergo keyboards :p
 
Have you ever tried one?
 
not for an extended period, like an hour maybe
 
I haven't, but super keen. I'm still waiting on the Model 01 kickstarter
 
dude this looks really sick
I wish I had $200 to blow on it
I didn't realize it was a kit you built, so cool
 
1:00 AM
DERP
 
yes?
xD
 
Nothing. Can't terminal today
 
could be worse, you could have been copying a password xD
 
1:29 AM
can i post a react-native question here?
nvm
0
Q: LoginManager undefined

Mohammad Areeb SiddiquiIssue Description After following the tutorial given by react-native-fbsdk I created up a Screen in which I imported LoginManager and AccessToken from the sdk and tried to use loginWithReadPermissions. This is the code: index.android.js: import {Navigation} from 'react-native-navigation'; imp...

 
2:14 AM
Do you use React DnD?
 
 
1 hour later…
3:26 AM
@FlorianMargaine Oh! Thank you for the explanation! I didn't consider NFS when I was thinking open
 
3:37 AM
now that doesn't sound like javascript
 
4:09 AM
How do you guys keep up with the latest JS technologies? I mean there are new things popping up every hour and the field is so dynamic. By the time you learn something, a better alternate comes up. How do you guys handle this ?
 
@DhirajBarnwal Simple: don't learn all the new frameworks
 
4:28 AM
@DhirajBarnwal i just accept that i'll never be able to keep up
and not having a career in web development helps
 
learn concepts not keywords
 
sounds like a decent philosophy
 
i also find js frameworks are overwhelming
we started using backbone.js over a year ago
seems like something like angular is used a lot more
 
i don't mind frameworks that just focus on doing one thing
 
at the end of the day, there are still the same problems of routing and state management
and the interesting philosophies each of the frameworks take :)
 
4:46 AM
mostly i never really used any libraries or frameworks
just programmed against the DOM API
 
5:07 AM
\o
 
°\
i kinda like Vue actually; i started using it a little recently
it's the kind of library i appreciate: just does one thing well (DOM rendering), not trying to be a monolithic framework across your whole application
 
 
1 hour later…
6:12 AM
anyone learn anything interesting today?
i watched the jsconf eu video on Javascript engines and found it interesting
https://www.youtube.com/watch?v=p-iiEDtpy6I&index=6&list=PL37ZVnwpeshFmAPr65sU2O5WMs7_CGjs_
apparently if you pass in the same shape of objects/primitives into a javascript function that is called repeatedly, the js engine will optimise for that
 
I've been reading about the alt right and white nationalism. I want to join that mars colonisation mission.
 
heh have you come across a lot of pepe the frog?
apparently the creator was really disappointed in its usage by the alt right movement
 
6:33 AM
@derp you might find this interesting too: blog.mozilla.org/luke/2012/10/02/…
 
oo thanks
 
i knew about that optimising functions for concrete parameter types, but what i've always wondered is how it detects type 'violations' efficiently
i guess on most CPUs, a whole lot of branches would be okay, since static prediction will let them 'fall-through' with little overhead,
 
from the talk, the optimisations happen in the js engine
 
but on core2duos with their random branch prediction, it could be quite slow
@derp that's what i'm talking about
 
huh the js engine reaches into that level of optimisation?
i assumed it stopped at assembly
 
6:42 AM
they attempt to generate optimised machinecode
some only generate machinecode for frequently-executed functions though
 
huh TIL
 
Java is similar; only applies JIT for 'hot' functions
whereas i think .NET usually compiles everything to machinecode upfront
probably configurable
 
i think either it accepts only numbers, OR values of any type (in which case it returns true/false (not sure) if the type is not Number)
 
@Cauterite Currently it only accepts numbers
It has no overloading
 
6:56 AM
so you would do X instanceof Number && isNaN(X), something like that?
depending on what result you want for non-number types
actually i don't know a damn thing about typescript so don't mind me
 
@Cauterite I want to do Object.keys(something).filter(isNaN)
 
object keys are always strings aren't they?
 
yes
 
@Cauterite Yup
But they could be "5"
 
Object.keys(something).map(x => parseInt(x)).filter(isNaN) ?
or is that the kind of inconvenience you're aiming to avoid ?
 
6:59 AM
i think it'll throw an error
if its not a string like number
 
parseInt() returns NaN if it's not a valid number
 
oh my mistake
i just checked it in the console
 
unless typescript has a different parseInt
 
Object.keys(something).map(Number).filter(isNan)?
that would work for non integer numbers as well
 
these are all obvious solutions of course, but i'm just trying to understand the motivation behind making isNaN accept other types,
like, it doesn't seem like a very compelling case
then again i didn't bother reading the github page
 
7:36 AM
Why wouldn't isNaN accept other types? It's testing that both it is a number and that it is NaN
Tests don't normally throw errors. It's like the difference between a isInteger function and a parseInteger function. One assumes nothing and the other assumes it is a number
 
7:54 AM
Hi all, I am facing issues setting up Socket.IO on Node JS, using http(can not use express)
 
@Neil well i thought that was the point of static typing; isNaN has nothing to do with types other than numbers, why should it accept them?
you wouldn't add an isNaN method to Object, for example. you'd just add it to Number (if methods was the approach you were taking)
 
@MadaraUchiha What's the point of something like isNaN if it doesn't accept anything?
 
@OliverSalzburg That's exactly my opinion
At the very least strings
I really don't see a usecase for isNaN(value: any[]) or isNaN(value: boolean) in a typed environment
But strings are fair game, I want to know whether the value of an input is NaN
I want to iterated an object with mixed keys
 
Whats the signature as it is? isNaN(Number)?
 
(like, you know, TypeScript enums?)
@OliverSalzburg isNaN(value: number): boolean
If you agree with me, I'd appreciate support on the ticket, I do want to push this, but don't want to come off as too pushy.
 
8:09 AM
Well you have to accept anything if numbers and strings are fair game
 
@Neil Nah, you can easily do isNaN(value: number | string): boolean
 
@MadaraUchiha Already gave it a +1
 
@MadaraUchiha oh
 
isnan(string) just feels like weak typing to me
fine for js, strange in ts
 
@Cauterite Say you want to iterate an enum
How would you do it?
An enum is an object that looks like this
{
  foo: 1,
  bar: 2,
  baz: 3,
  '1': 'foo',
  '2': 'bar',
  '3': 'baz'
}
 
8:11 AM
Personally, I feel like functions that are supposed to identify a value, are best when designed to take as many different inputs as possible
 
Now, to be fair, isNaN has some pretty interesting results with various types
!!> isNaN([])
No cap?
!!live
Anyway, try [[], {}, '', false, true].map(x => isNaN(x)) in your console
 
@MadaraUchiha this is new to me, I'll think about it when I'm not on a phone
 
@MadaraUchiha Gives me true for {}
That's unexpected
 
But then again, x => isNaN(Number(x)) like they suggest that I do gives off the same result
@OliverSalzburg Not that unexpected
Empty array coerces to 0
Empty object to NaN directly
 
@MadaraUchiha Not if you know your shit, I guess ;D
 
8:15 AM
@OliverSalzburg Better than knowing you're shit.
 
What sparked this was that I wanted to iterate an enum
And only get the stringy results (because you can then do enum[key] and get the value back from the numbered part, that's how enums work)
 
does TS want to preserve these kinds of crazy semantics from JS?
static typing should eliminate them
 
So I thought I could do Object.keys(MyEnum).filter(isNaN).map(key => ...)
@Cauterite Why? '1' is a valid string key
TypeScript compiles the following
enum Foo {
    Bar,
    Baz
}
Into the following
var Foo;
(function (Foo) {
    Foo[Foo["Bar"] = 0] = "Bar";
    Foo[Foo["Baz"] = 1] = "Baz";
})(Foo || (Foo = {}));
So you can do something like Foo.Bar and get 0, but you can also do const oneOfFoo: Foo = Foo.Bar; Foo[oneOfFoo]; // "Bar" to get the string key
Normally, you wouldn't even think of the number values of the enums (i.e. they could have been replaced with symbols for all you care)
But getting the string key from a given enum value is very useful
 
@MadaraUchiha i was talking about coercing arrays and objects
 
8:24 AM
@Cauterite Oh, sure
I'm not suggesting that we give isNaN's argument a type of any
I'm suggesting number | string, because those are the cases that make sense.
If you've an array (and you know its type), you already know it's NaN
If you've a string, you don't. The string could be numeric.
 
8:46 AM
Java had a type called BigDecimal which was something of a cross between a string and a decimal value
If it was too large to be represented by a primitive, it wss represented only as a string
 
@Neil And how would you perform math on a string?
 
If I'm not mistaken, conversation from string to number was lazy too
@MadaraUchiha it converted as necessary
 
What if it can't?
BigDecimal("100000000000000000000000000000000000000000000000000000000000") / 2
 
@MadaraUchiha I think an exception was thrown if you tried to force it to a number and it was too large
 
^ assume many more zeroes
@Neil What would be the point of a number type (or number-like) if you can't do math on it?
 
8:48 AM
You couldn't just divide by 2 either (in that respect, it was ugly)
 
Ah, you have .divide(2) wow horrible
 
@MadaraUchiha but you could, so long as you were dealing with BigDecimal types
If it was small enough, it would convert and just do the math between number types for efficiency sake, and otherwise, at least it was precise
I don't pretend that I use it often, but it can be useful at times when you're dealing with large numbers
 
9:05 AM
i mean it's not *too* bad, it just kinda flies in the face of static typing;
if `isNaN` takes strings and `parseInt`/`parseFloat`s them internally that's effectively weak typing, which you'd expect from JS but not a static-typed language. it's a numbers function, if you give it a string you'd expect the call not to compile, because it's probably a mistake (especially with the way `parseInt`/`ParseFloat` behave)
 
@Cauterite Right, but we do have Number.isNaN
Which is strictly about numbers and won't try to coerce
And isNaN was designed to work with strings to begin with
 
9:27 AM
hey I've one problem in javascript objects.
It is getting sorted by itself.
I'm creating a object dynamically. first "13" : {} came it got added then "11" : {} came. why it got added in the beginning and not at rear
see the example
why it is shorting
i don't know
can any one help me
??
 
Is there a difference in how the JS compiler handles variables when you 'redeclare' instead of 're-assign' them? var x = 1; var x = 2; x = 3;
 
@RaisingAgent it should be transparent to you if there is
But I doubt it
 
9:48 AM
0
Q: NodeJS Socket.IO front end keeps getting disconnected

sanket pahujaI am facing problems connecting with socket.io in my Node project, even though the server console says socket is connected, the connected property of my socket object is never true. I am not using express and my server is being setup using nginx. Here is my app.js : var http=require('http'),...

 
you mean in TS or JS?
i see, nevermind
@RaisingAgent depends whether you do it in the same scope
 
@Neil Thx, doesn't have an impact (at least in my code)
@Cauterite Ofcourse in the same scope^^ :)
 
@RaisingAgent looks like redeclaring is actually no different from reassigning: https://gist.github.com/Cauterite/fdbd5b7107eefd0e05a10d21c1eef4da

at least, i can't think of any other cases where the distinction could potentially affect the result
 
10:19 AM
@sanketpahuja So, what's the actual problem? Your title describes a completely different issue than your body
 
10:46 AM
@Cauterite ^ I came to the same conclusion
 
yeah you can trust any half-decent JS compiler to do the most sensible codegen for that case
 
@OliverSalzburg my Tinder experience summed up
 
11:11 AM
bloody hell, the debian package server in AU is so slow!
getting ~100 bytes/s
 
11:24 AM
@Cauterite I don't know why they don't torrent that baby
 
11:35 AM
How do you torrent package repositories?
 
torrent(packageRepository);
 
i don't understand how people can use linux without logging in as root
i'd be sudoing almost every command i type if i wasn't root
 
@Cauterite Aside from installing software and doing system stuff
 
That's how you do it.
 
What do you need sudo for?
 
11:40 AM
i don't really do anything other than install software and system stuff
 
I set my shell to prepend a sudo to the command for me if I type Esc twice.
 
@littlepootis that's an interesting choice of hotkey
 
And there's a tool called fuck that fixes a lot of commands for me.
 
@littlepootis "I set my shell"
"I enabled the zsh sudo plugin"
 
@littlepootis ahah that's great
 
11:42 AM
!!s/need/not need/
 
@littlepootis I couldn't get it to work on windows :(
 
y u no work
 
@jAndy bot is down
Bug @rlemon
 
@MadaraUchiha is there a separate set of rules for windows commands, or is it supposed to run in cygwin or similar?
 
@MadaraUchiha yeah
 
11:44 AM
@Cauterite the latter
 
ah
 
12:00 PM
is linux v3.16 higher than v3.2 ?
i'm not sure if "3.16" means "between 3.1 and 3.2" or "16 versions after 3.0"
 
16 is more than 2
 
m'kay, thanks
 
@KendallFrey Confirmed
 
@Cauterite Yes, version numbers are usually in base infinity
x.10 is greater than x.9, and x.1000 is greater than x.999
 
@MadaraUchiha Is x.1001 greater than x.1000?
 
12:10 PM
not great for lexicographic sorting
 
@RoelvanUden Yes
@Cauterite If you're planning on lexicographically sort them, you can just as easily use leading 0s
x.00002 vs x.00010 etc
 
> Relational databases don't differentiate between undefined and null values. Joi does differentiate between undefined and null values. Some undefined properties will pass validation, whilst null properties may not. For example, the default articles resource contains a created attribute of type "date" - this won't pass validation with a null value, so the Joi schema will need tweaking.
So, like what?
 
yes, everyone should use leading zeros; there would be no confusion
 
This is their example use case and their library and the best they can offer for a known issue is "it will require tweaking"
 
@Cauterite The problem is, how many leading zeros do you need?
 
12:12 PM
Tweak my balls!
 
@Cauterite It occurred to me the other day that ISO dates are specifically crafted to be lexically sortable
Most significant values (years, months) first, everything has leading zeroes and/or is fully qualified, etc.
 
big-endian ftw
 
Guys, CSS question
I have a big list of links
I want to display only a few, and allow for a "show more"
 
a linked-list?
 
I want that when you click on "show more" that the container expands smoothly with a transition
Now, transitioning height is a bit meh
 
12:14 PM
maybe you can put them in a `<details>` ?
just a guess
oh so the transition is the main problem? nevermind
 
Both because I will need to set a height to begin with (can't transition from/to auto), and because animating height causes layout and repaint and is heavy
Any alternatives?
 
max-height ?
might solve problem A but not B
 
@MadaraUchiha Don't transition height. Make the height instantaneous and transition something else, like blurring the elements into view. It will require one height change, though, and then just the blur effect (or another effect, like sliding in or whatever).
Alternative suggestion :-P
 
@RoelvanUden Nice. I'll try to remember that
 
@RoelvanUden Would still be awkward
But I can work with this
Maybe opacity with some translateX to make it them appear in a wave
 
12:19 PM
@MadaraUchiha bad ups battery
 
@MadaraUchiha Yeah, that would be nice too.
 
    ----
    ----
    ----
  ----
-- ->
 
i think that'd make it look like a powerpoint animation
 
Hmm, you have a point..
 
"truncate(1) — shrink **or extend** the size of a file to the specified size"
yes… i extend files by truncating them a negative number of bytes
 
12:24 PM
Transitioning height isn't really taxing if it doesn't affect layout much. So logically if the box had fixed or absolute positioning..
 
Hi guys
Why it is so tough nowadays to get visa for UK or USA?
 
@Neil It's neither
I was thinking about trying something with clip, but clip only works for position absolute boxes
clip-path is supported nowhere.
 
can you transition padding?
 
@Learning Terrorists! Refugees! Fear the outsiders!
 
that way only the contents of the list should have to be reflowed each frame, i think?
 
12:33 PM
@Cauterite Yes
 
@RoelvanUden:But not all are same
 
@Cauterite How does that help me?
 
@Learning Xenophobia bruh.
 
I don't want there to be a giant box with nothing in it until I click the show more button
 
@MadaraUchiha well of course you adjust the height at the same time, but without transitioning it
 
12:35 PM
@Cauterite So the height isn't transitioned, but the insiders are?
 
@MadaraUchiha that's what i had in mind
 
I can achieve the same with a container around the links
Probably with less side effects
Hmm
 
12:47 PM
 
 
1 hour later…
1:55 PM
if the JVM is the <unspoken language> Virtual Machine, does that make js-enabled browsers JSVMs?
 
@towc Yes
 
@towc I would say that doesn't make it anything
 
your mom made nothing
you were adopted
 
to be a "virtual machine" it would have to be an emulation of a computer
 
Unless this is a language-oriented abbreviation question
 
1:58 PM
You don't ever have to tell people to install a JSVM, cause browsers are cool
 
V8 might do something like that
 
@Mosho well, the jvm doesn't emulate a whole computer
 
it emulates a processor (aka computer)
with an instruction set, pipeline etc.
 
my train of thought was that the jvm is kind of like a sandbox for java code, and browsers are literally sandboxing js...
 

« first day (2417 days earlier)      last day (2529 days later) »