« first day (2712 days earlier)      last day (2461 days later) » 

10:00
But I lose type information
this should help
you probably dont want to use it though :P
@KamilSolecki I'm not trying to get the types in runtime
type erasure? sounds familiar :D
For example
Hmm, it's tougher to isolate than I expected... sec
given type T, find all methods?
10:04
not at runtime though
@Wietlol Yes
I want a type that represents all of the possible methods
a union type of all the method names
i suppose that you dont want to also get the methods of parent types, so you should drop the reference to the instance
@Wietlol Assume there are no parent types.
This is purely on a type level, imagine there's no runtime.
10:05
so logically something like:

Type Bar = keyof Foo where typeof key === function
Yes
Most likely easily possible with conditional types
But I don't have that, yet.
Yeah, looks like you wont do it now :P
Btw, whats your usercase? Its an interesting setup
@MadaraUchiha is Typescript's type of an instance a string?
aka, like typeof instance
@Wietlol TypeScript has string literal types
type T1 = 'foo' | 'bar'
Anything assigned the type of T1 can only be either exactly literal 'foo' or literal 'bar'
so, getting the "type" of an object returns a string?
10:10
@Wietlol No
Type is like a "shape" of the object
Remember that JavaScript objects are very difference from C# ones or Java ones
type T2 = {foo: string, bar: boolean};
Anything assigned the type of T2 has to be an object with at least a property "foo" whose value is a string, and a property "bar" whose value is a boolean
const x: T2 = {foo: 'hello', bar: true}; // ok
const y: T2 = {foo: 42, bar: {oops: 'nope'}}; // errors
JavaScript has object literals, which are not tied by any class or constructor
i am more thinking like
class HelloWorld { }
let hello = new HelloWorld()
let type = typeof hello
@Wietlol JavaScript doesn't share typesystem with TypeScript
sure, but that is runtime Javascript base types only
TypeScript's type are all compile time, similar to Java.
JS's types are much more simplistic and naive.
typeof hello in this case would have returned 'object'
so you cant have access to type information?
@MadaraUchiha Java has reflection, so it has runtime information about the structure of the types
10:14
Correct. Not in runtime.
@Wietlol typescript gets compiled to JS, so you lose all the Typescript specific things at runtime
There's the reflect-metadata proposal + npm package
But it's not yet ready AFAICT
@KamilSolecki but, it doesnt have to
it can give each object a property that represents it's class
it doesnt need any non-js features
its how emscripten works iirc
Now with symbols, that might actually be possible.
10:16
But TypeScript was written long before that time.
It's an interesting proposal
(maybe i wont give typescript a chance)
But there's another proposal in the works, that might be doing just that.
@Wietlol You're too tightly couples to classes and names
im more like an architect, i cannot do without
im highly coupled to interfaces
and interfaces need an implementation
From my perspective, you only give something a class when you need to give a name to something, and that "when" is not "always"
@Wietlol You have interfaces
and that cannot be a top level function
10:17
No, they don't.
@MadaraUchiha but I dont have reflection in TS
@Wietlol Why do you care?
because of stuff?
i use reflection quite a lot in Java/C#
mostly for generic behavior
10:18
I used reflection this morning while brushing my teeth
Was good
@Wietlol That sounds like a bad practice :x
Have an example?
reading data from a database and mapping it to a model
to get good immutability, I prefer most values to be readonly
the only issue is that certain fields should be readonly by design, but require to be editted to match the database information
with reflection, I can access those fields and set them appropriately
@Wietlol JS has that kind of reflection
Just not one with type information from TypeScript
also, with serialization to json, i read out annotation values which for example define the name of the field
Also, npmjs.com/package/reflect-metadata seems to do exactly what you want.
10:21
for the time being, for js development, ill just stick to kotlin
I wish TS had protected, though
It will probably never happen, but still
@MadaraUchiha That's nice
@KamilSolecki Function overloads could really change my mind about it
@Wietlol wat
Kotlin compiles to JS now?
Apparently a no-go though
I like saying "no-go though"
10:25
in google's oauth, if I try to authorize for a new application (different client_id), they will ask again for permissions and send me a new refresh token, right?
even if the user's google account is the same
@Daemonk it has a Jvm compiler, Js compiler and soon-to-be-a-good-native-compiler
iirc, there was also another one, but im not sure it is ever used at all
@Neoares I would say "yes", but I never had more than 1 application :D
@Wietlol The native thing is a frontend for LLVM. That's cool.
If they wouldn't use fresh tokens for another app, that sounds like it would be a major problem
yeah but it makes sense @OliverSalzburg
actually...
10:29
So you'll be able to compile Kotlin to Web Assembly.
so yeah, different tokens for different apps
@OliverSalzburg yes pls
@Daemonk i really want to get my hands on the source code that generates the LLVM, since I am also writing my own language that compiles to LLVM
but I find it rather difficult (mostly since the lowest level language I have really used is Java :D)
i did try C++ a few years ago, but i didnt really like it
Objective C is the wurst
is that a german pun
10:35
maybe
Wurst is Jaba
Curry Wurst
ow no
how did I forget
wurst is for Warcraft 3
its a scripting language for WC3
made by WC3 community
10:36
isn't WC where you shit
also, but that was original WC
im talking about WC 3
Guys
did I tell you I became profficient in Zulu over the weekend
nice! tell us something in zulu
looks like all the words in your language end with "i"
u troll
just type what I typed
oh, so someone trolled google
10:41
baga ba wagana ma wabanaga magaba ===> The people are discussing the issues with private parties
translate detects that as "Hausa"
not zulu
but also translates from zulu it seems
> The pulpit does not speak to the ancestor
from Hausa xD
that sounds like a SO question lol
10:54
Hmm is it possible to make child_process.spawn() not start evaluating, but rather wait till a "run" command is given? - So that I can correctly set the ChildProcess class/events before the events are moved into oblivion due to the childprocess running too fast.
use promises?
@paul23 just spawn when you want to run it ?
Excited that OffscreenCanvas is finally happening: <canvas> that's usable in a worker 🤘Behind a flag in Chrome 60 and FF 44. Demo: https://ebidel.github.io/demos/offscreencanvas.html Status: https://www.chromestatus.com/feature/5424182347169792
@KarelG what if.:
11:01
@rlemon Could be good for your ascii friday?
          const pythonProcess = spawn('python main.py', args);
          //here the python process tries to print/quit/errors/does io.
          pythonProcess.stdout.on('data', (data) => {
            console.log(`stdout: ${data}`);
          });
          pythonProcess.stderr.on('data', (data) => {
            console.log(`stderr: ${data}`);
          });

          pythonProcess.on('close', (code) => {
            console.log(`child process exited with code ${code}`);
          });

          pythonProcess.on('error', (code) => {
@paul23 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
... why did I have to put those extra spaces?
Anyone used Stomp.js with Apache Artemis?
11:04
!!tell paul23 why he did so
@paul23 because you touch yourself at night
@Ikari Nice
@BenFortune Posting screenshots with errors in your code is the new form of posting screenshots of Word documents with typos in them
which typo?
!!mdn transferable
@Neoares That didn't make much sense. Maybe you meant: d, med, mdn
I FIXED IT U STUPID BOT
11:08
@OliverSalzburg Where's the error?
@BenFortune transferables
"error" might have been the wrong word
Error was the wrong word :P
I wouldn't say it's a typo either
That's a sight you see often in executive Office materials
5
Q: Difference between "spelling errors" and "spelling mistakes"

Nacib NemeLately, I've had a discussion with a friend. I said that spelling mistakes is the same thing as spelling errors. He doesn't agree with me. So, what's the difference? Are both correct?

People create nice "diagrams" with WordArt, then screenshot them, then put into PowerPoint
Now people screenshot their code with spelling mistakes and put them on Twitter
Progress
WordArt lol
that's so Word 2003
11:15
Word has icons now
It's their latest feature
I remember having +1 point in a work I did at HS about the holocaust just because the WordArt title was 10/10
german flag colors and Old English font
I still remember it xD
and the teacher was a bit of a neonazi
Did you black-white-red or black-red-gold it?
it wasn't with straight lines
the effect was from inside to outside
like an explosion
11:17
lol
yeah the colors were merged
I guess it's still somewhere in the old HS-things box
Alright. Time to write some JavaZcrpit
goes
I come here when my systemctl restart takes 1 minute
which happens 1/5 of the times
the rest of times it's almost instant
My job is like 40% waiting, which I pass by writing troll comments on social media sites and coming here
what's the different between those 2 examples?
I don't see it
11:29
When I do it on social media, I do it to intentionally provoke critical thought, when I come here, I don't care what anybody thinks :D
I also like you guys better than the random folks on Facebook
<3
I'm probably going to germany on july or august
Where to?
cologne
Oh Reddit never stop being yourself reddit.com/r/factorio/comments/85o1ix/…
@Neoares Going to Evoke?
Got some great memories of Cologne. Great city
11:45
I've lost an sqlite database
It's in use, it's working. I cannot find it
Sounds like it would be trivial to track down by open handles or open ports or whatever
It's a file
@OliverSalzburg gamescom
@Cereal windows?
@Neoares That's usually very close to Evoke
11:48
@OliverSalzburg I don't even know what Evoke is :P
Yeah. The path I used was //~/data
an event? a place?
Which I thought would place it in my home directory, but it's not there
@Cereal Download process hacker 2, open properties and check the handles tab
11:49
@Cereal why would you think so?
@Neoares Because ~ usually refers to the home directory
@BenFortune Or Ctrl+F, search for filename
...if you don't know the owning process
@Cereal but / refers to an absolute path
to the root
It wouldn't work without the //
I'm not sure why
hello
11:51
I don't see it in the handles
Hi all, anyone could take a look at my question and answer it?
https://stackoverflow.com/questions/49368171/securing-angular-app-against-xss-code-injection-into-url-path
@pentaadrian 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.
I searched for it - it doesn't exist
._.
What does not exist?
133
Q: Why is Math.random() not designed to be cryptographically secure?

forestThe JavaScript Math.random() function is designed to return a single floating point value n such that 0 ≤ n < 1. It is (or at least should be) widely known that the output is not cryptographically secure. Most modern implementations use the XorShift128+ algorithm which can be easily broken. As it...

11:55
It's not persisting on restart, must be in-memory. Weird
Shouldn't do that
user9107868
@BenFortune just set the Math seed to the current time. Another answer.
user9107868
Nice article though. Looks like I need to change my security...
@TheOneWhoMade You can't set a seed

« first day (2712 days earlier)      last day (2461 days later) »