« first day (2896 days earlier)      last day (2057 days later) » 

8:00 PM
Ew codepen.
 
For the purposes of this demo document.title is represented by the red text box, and the actual navigation is represented by the (fake) links
 
can you simplify it for me? input and expected output?
I like simple things
"https://rlemon.ca/products/myPRoduct/123" -> "My Product #123"
something like this
nice and simple
 
Ok one sec
Codepen has been updated with the URLs on the left of the >> in the link, and the expected title inside the ()
 
so you have a map of some sorts to figure out the missing verbiage?
 
Yeah basically
There are two *slightly* tricky things:
1) you can use regex at a tree node to match dynamic parts of the url (normally \\d to match ids
2) persist sets the title in case of an exact match, and persists can overwrite each other
uh that should say "persist sets the title in case of no exact match"
That's a codepen of an attempt of mine without using a reduce function and instead using a kind of "reverse find"
It has its' own issues though
 
8:16 PM
+1 nothing is more java than this line - Runtime runtime = Runtime.getRuntime(); — BRampersad Oct 23 '11 at 23:40
> I had a problem, so I used Java. Now I have a ProblemFactory.
 
@JBis what now?
 
codepen is gross. he has a good point
 
@rlemon any input? Not really asking for a solution but does anything seem glaringly bad about my (attempted) solution?
Is this how you "might" have done it?
 
hello
 
I'm still a bit confused by it, but I haven't given it a proper read
if it's still an issue I'll check it when I get home tho
 
8:30 PM
I tried java
i just couldn't do it
 
@ex080 -1
 
Just finished memorizing 348 slides
 
@ex080 +1
 
lol
 
user1596138
@ex080 2048 slides
 
8:31 PM
no ppt slides for a test
 
user1596138
Remember when the internet lost it's collective mind over 2048?
 
user1596138
What a stupid time.
 
Yes
 
@ex080 But actually, I can try to help if you need help with basic stuff. But the Java ppl are really helpful.
 
i played it till i got 2048
 
8:32 PM
@rlemon I have a feeling it's still going to be an issue so I'll gather the two codepen attempts for your perusal. Thanks.
https://codepen.io/michaelrwiley/pen/pOGGKL
https://codepen.io/michaelrwiley/pen/rZPReE
 
@ex080 just remember, mitochondria are the powerhouse of the cell
 
@JBis thanks man, I mostly use python, node, and low level c now
@rlemon will do lol
 
> Wow. Mindblasting blog post! Thanks that you dump your minds around that topic.
lol
 
comment section?
because there are a few choice comments on his blog
 
yup
 
8:33 PM
> hi, thanks for this JS demo with Canvas. pls write in VB6 for me
(paraphrased)
was my fav
 
lol
archive that page
 
> Hello, I want do this with the Microsoft Visual Basic 6. Please make the source code for example using VB6 soft thank you.
 
huh, dist with sqrt is actually faster than without, in my browser: jsperf.com/distance-perf
 
@rlemon It's ok
 
well that's just a lie
 
8:35 PM
A lot of people use js libs for canvas interaction now to make games such as p5 or matter js.
i think matter js even provides a physics engine
 
@rlemon Like this, thanks !Q
 
bad benchmark somehow?
math.sqrt is maybe cached here?
which would be slightly faster than an extra multiplication
I think
not noticeably though
rerunning the tests returns pretty much a 50/50
 
 
jsperf is such a pile of crap. edit -> save the perf and it creates a new version without the tests
 
I need help on ckeditor image upload
after days of trying I am not able to upload image
 
8:45 PM
@forresthopkinsa I'm becoming a therapist and an analyst
@user1575229 u want to know how to upload an image by clicking a button?
 
@user1575229 days?
 
@ex080 the ckeditor has image upload button I click it browse file and then the alert appears and says can't upload image
 
hmm. im not sure what ckeditor is. let me google it.
 
WYSIWYG
 
1 message moved to Trash can
@user1575229 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
 
8:49 PM
@rlemon jsperf.com/distance-perf/7 still seems to be the same
I'm heavily confused
 
ClassicEditor
    .create( document.querySelector( '#editor' ), {
        ckfinder: {
            uploadUrl: 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images'
        }
    } )
    .then( editor => {
        console.log( 'Editor was initialized', editor );
    } )
    .catch( error => {
        console.error( error.stack );
    } );
 
r u using ck5 or ck4?
 
5
what am i doing wrong?
 
> To make enabling image upload in CKEditor 5 a breeze, by default all builds include the EasyImage plugin, which integrates with the Easy Image service provided by CKEditor Cloud Services. Enabling it is straightforward and the results are immediate:
is this a problem?
 
but that is not free.
just one month trail
 
8:52 PM
i g2g to class
 
<script src="https://cdn.ckeditor.com/ckeditor5/11.0.1/classic/ckeditor.js"></script>

I am using cdn
@rlemon @ex080
 
he left, and I am about to
good luck
 
can I use cloudinary with it
@rlemon
@rlemon
 
@LuckyKleinschmidt :( I can't see deleted messages
 
9:35 PM
Anyone else get annoyed when websites use images for buttons that could be EASILY be done with CSS?
 
no
but i do get annoyed when people suggest that i do so.
idc if my competition makes poor decisions
 
Good answer
 
10:22 PM
So wait, jwts are basically there as a standard for Auth without cookies, for more functional networking on the client?
Also makes sure things aren't "plain text" over the network, which is kinda bs because it's mostly b64 encoded
The backend guy at this job said we're going to do Auth via just, and asked me to look into it. All I could think of was that it was basically a more accessible alternative to stuff like express-session
Am I missing something?
 
"Auth via just"?
 
He's writing the backend in Django, so maybe that's useful to keep in mind
Jwt* on phons
 
yea
figured as much
no comment
 
When you have an essay due and you go to click double spacing but its already checked......
 
@JBis ugh that sucks lol
 
10:33 PM
yes, yes it does :(
 
Oooh it's a client side session
No session data is stored on the backend, just a secret used to either sign or encrypt it
Ok, that's neat tech
I wish articles would just present it as a verifiable client side session
All this thing of securely communicating between parties makes me just think of any encryption
 
10:54 PM
@ex080 very cool!!!
 
user8871181
@DavidKamer When you answered my previous question you came up with this:

"2 5 7 12 8 15 12".split(" ").map((n)=>parseInt(n))

..I can find anywhere that explains `map` well - what does it do?
 
Map takes an array and returns a new one
!!mdn map
 
lol ty @JBis
 
The map() method creates a new array with the results of calling a provided function on every element in the calling array.
 
user8871181
11:05 PM
@JBis yea. just reading through that now - they cover everything in such good detail
 
var array1 = [1, 4, 9, 16];

// pass a function to map
const map1 = array1.map(x => x * 2);

console.log(map1);
// expected output: Array [2, 8, 18, 32]
@demonhunter24 Yep. One of best resource out there.
@Loktar :)
 
user8871181
@JBis hang on... where did x come from??
 
read the article
var new_array = arr.map(function callback(currentValue[, index[, array]]) {
    // Return element for new_array
}[, thisArg])
 
@demonhunter24 The guy typed "x" ;) But actually, he could have typed y but then it would be `y => y * 2
 
or look up a tutorial on array methods, map/filter/reduce
will give you a better understanding
 
11:08 PM
@Loktar You could call a function with that right? Also any chance you know if something similar exists in Java?
 
11:23 PM
so I had an interview last week that I think I failed and I've been thinking about it
was with a small local company so it wasn't a big deal but I was thinking about the question I was asked
I was asked how, using Java, I would go about finding which lines in a file appear the most times
so I was like, sure, grab an InputStream/BufferedReader/whatever, and each time a unique line is encountered, add it to a map; each time a dupe is encountered, increment the map's value
and then the guy was like, "ok, what if this file is huge, like, several gigabytes"
and I try to think of some way that I don't have to store this data in memory and I end up going for a database, and he's like, "there's no database"
and so then I settled on clustering or something stupid like that, and he was clearly unimpressed and we moved on
 
hmm
I don't know how i'll make it past an interview if the questions r like that
 
I thought about it a little bit afterward and I'm like, maybe if I hashed each line and used that instead? but that would have its own problems. So I think this is an algorithmic thing that's just flying over my head
 
What do u do to prepare?
 
I just study the company that it's for and the tech they expect me to know, if I know they're gonna be firing questions at me like that
Like cramming before a test lol. But I thought I was prepared for this one and this question really shot me down.
I've got a dozen people here familiar with CS and no one has any ideas? c'mon, Google hasn't solved this one for me
 
11:43 PM
@forresthopkinsa Hmm. I question would question why a text file is serval gigabytes.
And how would you recover the original phrase with the hash idea?
Also seemed like the guy was looking for a specific answer, and any other he would have deemed unacceptable.
 
that's exactly the problem; I'd have to scan the file over again to find the phrase. But the second scan wouldn't need me to keep anything in memory so that wouldn't be a big issue, it'd just take more time.
Right, he definitely seemed to be looking for something in particular and I did not have it
 
Any solution you provided (which were valid by the way) he added things to make then not valid
 
thank you for the much-needed validation haha
 
:)
Maybe ask in Java chat? Idk. Also, if the problem is speed I would say anything scanning 1 gig + file is going to take time no matter what
 
Yeah don't know. My first inclination was just that memory would end up being a problem really quickly
e.g. if there are very few duplicates in the file
 
11:50 PM
0
Q: How can I find the most frequent word in a huge amount of words (eg. 900000)

Tony ChenI am facing a task which is generating 900000 random words and then print out the most frequent one. So here is my algorithm: 1. move all number into a collection rather than printhing out them 2. for (900000...){move the frequency of Collection[i] to another collection B} ** 90W*90W is too much...

 

« first day (2896 days earlier)      last day (2057 days later) »