« first day (4028 days earlier)      last day (903 days later) » 

12:04 AM
@phenomnomnominal o/
hows it going?
 
 
3 hours later…
2:38 AM
 
 
5 hours later…
7:48 AM
yo guys
please can somebody tell me how can i reduce the loading time of a <table> that contains 20000 rows
the page is very heavy when i scroll, it takes 4/5s to display the rest of the table
 
8:09 AM
@JBis pretty good! how're you?
@mitsu only render part of the table at a time. look into "virtual scrolling"
 
8:27 AM
i found this example using pure js, but the this code generate a table, for my case i have already my table that is already filled
https://www.youtube.com/watch?v=LV6hoy8_SJk
 
8:42 AM
@mitsu the bit about how it hides and shows elements is still relevant even if you have your own table data
 
 
1 hour later…
9:55 AM
-1
Q: How to disable video download in angular

user13573775Hi I want to disable video download in angular 12. Im opening video in new tab using window open. we can also disable download using adding control parameters in video tag but how we suppose to do i have no idea.Because im directly passing url in window open

Oh man...
This dude in the comments is arguing: "Stop trying to restrict what your users can do with their own computers." when someone wants to prevent users from downloading videos on his site
@Cerbrus it can be, but that's not my point at all. My argument is that it's my computer and no-one but me can tell my computer what to do - otherwise I wouldn't be in control of my own machine, would I? It's a fact that playing video, whether live-streamed or downloaded-and-played requires the video to exist locally, where it can be saved. The rights of the content-creator end where my rights as a computer owner begin. I never said I had a right to commit copyright violation. — Dai 10 mins ago
 
There are enough sites out there that try to do this all wrong. Like disabling the right click. I was floored when I opened some website and tried to middle click to open something in a new tab and I got a plain alert that said something like "Don't try to steal our images".
 
Yea, that's just stupid
But look at the comments there...
 
Because they apparently implemented the right-click protection by looking at any mouse click that's not a left-click.
I guess the first problem is making a right-click protection.
 
There are other ways to secure images... Generate one-time use urls, that kind of stuff
watermarks (visible and in the file)
 
ugh that's some Stallman shit
 
10:03 AM
I should probably disengage, but this is kinda fun
 
@Cerbrus you are wrong
I can do with whatever netflix streamed to me in the EU at least. I am by law allowed to copy it for personal use or later reviewing.
 
@paul23: In now way are they obliged to provide a source file
 
yes they are actually
 
Source?
 
if I watch something from netflix and netflix removed it -yet I have prove I wathced it but couldn't copy it- netflix is actually by law comitted to allow me to get it again.
Though that's a dutch bit specific
 
10:06 AM
"allow me to get it again." doesn't mean they need to provide you an mp4
 
but I pay 50% tax on any " data container" specifically for this purpose actually.
 
It just needs to be accessible in the system
 
Yes but they cannot take any action to prevent me from recording/copying it.
 
I'd like to see a source on that
 
"That's like saying you should be able to save whatever you view on Netflix because it's streamed to your computer. That's just now how the internet works, @Dai. –
Cerbrus
18 mins ago "
 
10:07 AM
Because I can't believe there's a law that so blatantly disables copyright law
 
> Voor het opnemen van delen uit bestaande videofilms in uw video, is in beginsel de toestemming van de rechthebbenden vereist.
> To record parts of existing movies from your video, you need permission from the one holding the rights
 
Under "mag ik een film die op televisie wordt uitgezonden of op internet staat, opnemen dan wel downloaden?" (Can I copy/download a film that is broadcasted on tv or the internet".
3rd paragraph: "Je mag zonder toestemming een kopie van een geheel werk maken voor eigen gebruik in de privésfeer (artikel 16b en 16c Auteurswet) zolang deze kopie uit legale bron wordt gemaakt. Je betaalt hiervoor indirect al een vergoeding, de zogenaamde “thuiskopieheffing""
 
> Mag ik een film die op televisie wordt uitgezonden of op internet staat, opnemen dan wel downloaden?
> Zowel opnemen als downloaden zijn verveelvoudigingen. Daarvoor heb je toestemming nodig van de maker en moet je hem/haar een vergoeding betalen.
Can I download / record a movie that's been on TV / the internet?
Both downloading and recording are multiplication, you need premission from the author
 
"You can make a copy without permission of a complete (! not partial btw) work for personal use (article 16b and 16c of the author's right law) as long as this copy comes from a legal source. You pay a fee already for this in the form of the "home copy tax"."
 
10:12 AM
(and payment)
 
Not hte exception for personal use.
 
That says it's allowed to do so
 
yes
 
That doesn't say they're not allowed to restrict you
 
And judges have often rules that restrictions in such a case are illegal.
 
10:13 AM
Source? :D
 
Well I don't have direct cases but a similar thing
 
Don't get me wrong, if I'm wrong I'd like to know, but this feels sooooooo counter-intuitive to me
 
curia.europa.eu/juris/document/… this on a different topic but similar case.
 
Let's see
 
It is about the right to resale software/video. And it states that companies can not put any difficulty in this right like binding software to accounts.
And it states that they (those who sell software) should actually make it explicitly possible to have the rights of the consumer fullfilled.
 
10:17 AM
So, that basically makes DRM illegal
 
Well no, as you can still allow to check that is only used by a singular person at the same time
 
But you can't do that with a movie someone downloaded
 
Yes the court (in above case) just said: "that is just your problem".
 
In what line? It's a big file...
 
77 - 79
 
10:22 AM
> It follows that, by virtue of that provision and notwithstanding the existence of contractual terms prohibiting a further transfer, the rightholder in question can no longer oppose the resale of that copy.
So if you have contractual terms forbidding resale, resale is not allowed, right?
 
no as such a contract would be void under law with consumers.
 
Then why would they use that clause there?
 
Because not everyone is a consumer.
 
78 explicitly states that if you resell it, you have to "make the copy downloaded onto his computer unusable at the time of its resale."
 
yes
 
10:24 AM
So, still single-user
 
Correct
For that DRM can be used.
just it cannot be used to verify who that user is, or prevent transferring the license
 
But not with media
We're not gonna find an answer in this case, I think, as this is talking about software
 
yes I said I didn't know of an case regarding media, just a similar "idea" which shows that the court tends to side with consumer rights instead of economic rights.
 
Well, sure, the customer is heavily protected
But I'm not convinced services like Netflix are obliged to provide you with a source file you can view at any time
As if they were, torrent sites would have the original source uploaded the day it releases, instead of ripped files (admittedly the day of release, but still)
 
And since that court case was: "can I resell" --> yes you can, and companies may not put anything to prevent resale such as drm. I follow the same logic "can I make a copy for personal use" => you you can, {and companies may not put anything to prevent copying such as hidden watermarks that make copies unusable}.
 
10:28 AM
That's a bit of a leap imo
But IANAL
so what do I know :D
 
It's hard to make a case though :P. As the copy for personal use never tends to get public attention anyways.
 
Yea, but there have been cases with people distributing movies through torrents
In which the distributer was fined / jailed
 
Still it irks me when people say I can't record videos from netflix as they are shown on my screen.
 
But why would you need to record them?
 
To watch them once my subscription ends.
 
10:31 AM
But then you no longer own the rights to that content
 
yes I do
that's what the home copy is actually for
 
We're back at square one
I'm pretty sure copyright law is also horribly outdated, regarding streaming / web
 
Well I showed I can make a copy for personal use - by law. And the law states never that I can no longer watch it later. (Rather it was created to watch later)
hell the law even states that I can make multiple in teh advent of the medium getting damaged.
So it is kind of made for "long term" storage.
 
And again, the only example you have that they can't restrict that, is a software case
 
uh yes, like I said there are hardly any cases, as obviously they don't have to show the "original source" - just teh source that is being seen/broadcasted.
So you get that anyways while you watch the video.
 
10:34 AM
That's been my point the whole time
The media has to be accessible
They don't have to allow you to download a source file
 
But still 50% of all "memory storage" price is a tax for this. And netflix can directly deduct it base on worldwide views (weirdly, the key to how much a provider gets part of this "home copy tax" is not based on national use but worldwide) from netflix' income tax.
so I already pay netflix handsome when I bought my hdd or phone or whatever.
 
That's a whole different can of worms :P
 
 
2 hours later…
12:52 PM
@benberizovsky Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
I have the following lines using rxjs Zip:

https://codesandbox.io/s/rxjs-playground-forked-0brb8?file=/src/index.js:72-158

Does anyone know why it outputs [1, 5, 10] and ignores the two more inputs in the observable (2,3) ?
 
 
3 hours later…
3:53 PM
@Cerbrus Perhaps but there are precedents with TV which is basically a stream. And US courts have rules that recording from TV is completely within the rights of consumers. That was in a case where copyright holders wanted to forbid this, thus it was determined that it was illegal for them to obstruct that. While IP law still needs to catch up to the Internet, streaming in particular should be legally recordable.
@benberizovsky How do you replicate this issue exactly? I'm only getting 5 printed. zip() isn't even used in that code and I don't see any way for it to print anything other than 5.
 
4:31 PM
posted on October 26, 2021 by Richard Lau

Notable Changes This release marks the transition of Node.js 16.x into Long Term Support (LTS) with the codename 'Gallium'. The 16.x release line now moves into "Active LTS" and will remain so until October 2022. After that time, it will move into "Maintenance" until end of life in April 2024. Windows 32-bit Installer: https://nodejs.org/dist/v16.13.0/node-v16.13.0-

 
5:27 PM
How can I efficiently generate 8 characters wide that are cryptographically unique and are one way?
I could use CRC-32?
 
What do you mean by "cryptographically unique"?
 
No pseudo randoms
 
What is the meaning of this regular expression? /.*?/
 
I think it means anything if it has one character but I'm not the best with regex
nope, I think it just matches anything
the question mark makes it "lazy" instead of "greedy"
780
A: What do 'lazy' and 'greedy' mean in the context of regular expressions?

SampsonGreedy will consume as much as possible. From http://www.regular-expressions.info/repeat.html we see the example of trying to match HTML tags with <.+>. Suppose you have the following: <em>Hello World</em> You may think that <.+> (. means any non newline character and + means one or more) woul...

 
5:44 PM
wouldn't the question mark there be... redundant in a sense?
no idea, also not heavily versed in regexp. apparently it has some meaning
reading that answer makes me think, it would make the .* match as few as possible to meet the critieria rather than as many as possible
 
@KevinB It makes the quantifier lazy but yes - it's redundant.
 
you get "more" matches with the question mark according to regex101
instead of less matches for more characters
 
@KevinB Exactly. However, given that the criteria is the same here (match everything) the result is the same. It'd be different, for /.*?b/ for inputs like aabaab - if it is not lazy it will match the first five characters (greedy, to the last b it can find) it if is lazy, then it will match the first two characters (up to first b)
 
Right, .*? would match each individual character
where as .* would match the whole word
 
I think . would match every character
it looks like .*? matches each one more than once
at least on regex101, probably worth trying directly in JavaScript
 
5:51 PM
i'm looking at regex101, i'm seeing a weird result
half the matches are... empty
 
also depends on how you run the regex, like if you run it globally or not
 
my devtools won't open, lol
 
did you try turning it off and on again?
:D
 
in JS i'm getting only 1 match, ''
🤔
 
what if you do: /.*?/g
 
5:53 PM
global makes it match 4 ''
 
"<h1>hello world</h1>".match(/<.*?>/);
 
whoa
never
 
that sounds right
 
use regex for html
 
^this
in node I'd advise using a lib like cheerio and in the browser... well you should probably know that
 
5:55 PM
@Taseer If that's the case, you need a true source of randomness. Which isn't really easy to get. You can call a service like Random.org to get that, I suppose. But it's probably good enough to use the Crypto API. Assuming you're on the web and you and it's supported where you want to run it.
@DamodaraSahu P̙̦͔͜l̦̙̭̘̱e̬̦̱̝a̩̜͕̪̲̭se̘̣͚̲̤͔ ̠̳̯̗ͅdo̤͕͍̻ņ͕̠'̗̰̭̜͖̕t̵̪̯ ̼̀d̶̲o͔̤̗͖̘ ̤̠̙t̵̳̣̟͔̟͔ͅh̛̺̺͖͙̪̠a̵͚͔̮͈͍̝͇t̥.̷̞̖͔͍
 
any one build stock or cypto apps using xamarin?
i mean javascript***
 
@VLAZ Well, my use case is that I need to generate 8 char wide strings to be used as a primary key and of which multiple tables may reference it. The probability of collision when hashed increases with each addition to the database. What would you suggest?
It would also become more expensive to handle unique constraint on it
 
@Taseer Uh, true randomness doesn't actually reduce the chance of collision. Just generate a GUID.
 
6:12 PM
That could be a solution too but it would increase the size required to store it
 
Databases should be good with keeping GUIDs. I'd expect many would be optimised for that.
Yes, it's more space than 8 characters but it's way easier to avoid collisions.
Otherwise the birthday paradox catches up to you quickly. I've not run the maths on how collision probability increases for 8 characters but smarter people than me have devised the GUID thing to have astronomically low collision chances.
And true vs pseudo random doesn't help with collisions, as I said. It just makes predicting what the next random result harder. That prediction is relevant for when trying to crack this. But if you're using random generation for something like generating a string, it doesn't seem that relevant.
 
6:35 PM
@Taseer I didn't read your entire post but PK should always be incrementing id never exposed to public
G/UUID or random string is bad PK
 
@JBis GUIDs work if you have distributed generation of IDs. That's what I assumed the case is. If the generation is all centralised, then there is very little reason not to go for incremented ones.
 
Also there's no reason to use UUIDs at all vs a random string
In fact there are reasons why random string better
@VLAZ see above, in a distributed scenario id use random string
 
@JBis Why is it better, tho?
 
someone said it was best practice
 
UUIDs conforms to a certain format, space and time is waisted to store metadata and retain format
And there is no cryptographic difference between a uuid and string with same entropy
 
6:46 PM
UUIDs are literally a binary number. Represented in hex and grouped for simplicity of reading them, but it's still a binary number in the end. I'd expect any database to just save them as numbers and format them separately rather than store the format.
 
Also UUID generation requires a library, random string does not
 
Yes, a GUID is represented as 12-4-4-4-8 hex grouped characters for simplicity of reading it. It's generated as a binary number.
 
The differences are minimal, and i'm being a bit picky, but the minimal extra work to use a uuid yields no actual benefit.
> The four-bit M and the 1 to 3 bit N fields code the format of the UUID itself.

The four bits of digit M are the UUID version, and the 1 to 3 most significant bits of digit N code the UUID variant. (See below.) In the example, M is 1, and N is a (10xx2), meaning that this is a version-1, variant-1 UUID; that is, a time-based DCE/RFC 4122 UUID.
 
I really don't see the benefit of a random string. It's just suggesting to roll your own crypto which is always a bad idea.
 
Random string isn't rolling your own crypt
const str = require('crypto').randomBytes(128).toString('hex');
 
6:54 PM
Which...is using a library?
while(randomStr.length < target) randomStr += alphabet[Math.floor(Math.random() * alphabet.length)] is not using a library.
 
@VLAZ thats standard node library
also you could just directly access /dev/urandom
(actually it would be randomBytes(16) uuid is 128 bit)
 
7:31 PM
posted on October 26, 2021 by Prudhvikumar Bommana

The Dev channel has been updated to 97.0.4681.0 for Mac, Windows and Linux coming soon. A partial list of changes is available in the log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about common issues. Prudhvikumar Bommana Google Chrome

 
8:22 PM
Hi, I'm fiddling with form validation using vanilla javascript. As a start, I'm just hiding and showing hidden elements. But I'm using onsubmit which reloads the page if function returns true. So, I'm trying to make it return false but once I created a wrapper function, the onsubmit is going through after displaying all the errorElementsand I just want it to return false because the wrapped function returns false. I'm so confused how javascript works.
 
you'd need to collect the result of all the $$ calls then use that to determine what myfunction should return.
also
you could remove all of that javascript, and just add required to each of the inputs that are requried
 
 
2 hours later…
10:08 PM
In my React app, how can I use packages I've installed with npm/yarn with a webworker?
 
10:20 PM
Oof
That's a big question
What package, and how do you build your application?
 
The package is jimp or image-js
And it's build with webpack I believe –> from the standard create-react-app
 
First things first you need to figure out if the lib uses any DOM APIs that aren't available in a worker
 
@phenomnomnominal not bad
 
@phenomnomnominal It doesn't, I've used the packages in node.js scripts
 
@libby okay then you need to figure out how to build a worker bundle with create-react-app
Which might involve ejecting the webpack config
 
10:33 PM
Yup, that's exactly why I came here
No idea how to do that
 
Looks like worker-loader might be the way to go?
 
This answer I think may be the closest
10
Q: How to import a library like moment.js into a web worker

HanzoCan I import a library installed with npm into a web worker? I need to use the moment.js library into a web worker. It is installed via npm into the node_modules/moment directory I already have tried with this at the top of the worker.js file: importScripts('/node_modules/moment/moment.js'); ...

but I don't understand what it's doing. And when create the webpack.config.js and tried it there was no output from webpack
 
10:58 PM
@phenomnomnominal have you configured webpack before with a React app?
 
Ah, okay. So if I want to bundle the package, say jimp, with my script in /public/workers/worker.js is it clear what I should add to webpack.config.js?
 
{
  module: {
    rules: [
      {
        test: /\.worker\.js$/,
        use: { loader: 'worker-loader' }
      }
    ]
  }
}
and then you'll need:
import Worker from '../workers/worker.js';

const worker = new Worker();
and in worker.js you'd do the import jimp from 'jimp';
And you probably want to use Comlink in there as well to make it a bit easier
 
So I should throw that into the node_modules/react-scripts/config/webpack.config.js?
Add that to the { ..., module:{ rules:[ /*HERE*/, ... ] }?
 
11:26 PM
@phenomnomnominal I tried this (without Comlink) and it gave me the following error: ```
./src/readImages.worker.js (./node_modules/worker-loader/dist/cjs.js!./src/readImages.worker.js)
Error: Cannot find module '/Users/jonahlibrach/wb-figures/node_modules/schema-utils/src/index.js'. Please verify that the package.json has a valid "main" entry
```
 

« first day (4028 days earlier)      last day (903 days later) »