There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Pronounshe/himDatetime FormatRFC 3339

This profile is from a federated server and may be incomplete. Browse more on the original instance.

davel , to programming in Computer Scientists Invent an Efficient New Way to Count
@davel@lemmy.ml avatar

Optimize Memory and Performance with the CVM Algorithm in JavaScript: A Comprehensive Guide for Text Analysis, Big Data, and More

Final CVM Algorithm Code in a JavaScript “oneliner”

You can use this JS function by providing any text string as input, and it will simulate the described algorithm, returning the final set of unique words. This is as condensed as it can get, but if you can condese it more , please do post and Ill update it! If you are interested in seeing how this ‘oneliner’ started, before it was condensed, I have included the long form version of this same code at the bottom of the article.


<span style="font-weight:bold;color:#a71d5d;">const </span><span style="font-weight:bold;color:#795da3;">cvmAlgorithm </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">t </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">{ </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="font-weight:bold;color:#795da3;">f </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">n </span><span style="font-weight:bold;color:#a71d5d;">=> !</span><span style="color:#323232;">(</span><span style="color:#0086b3;">Math</span><span style="color:#323232;">.random() </span><span style="font-weight:bold;color:#a71d5d;">* </span><span style="color:#323232;">(</span><span style="color:#0086b3;">1 </span><span style="font-weight:bold;color:#a71d5d;"><< </span><span style="color:#323232;">n) </span><span style="font-weight:bold;color:#a71d5d;">| </span><span style="color:#0086b3;">0</span><span style="color:#323232;">); </span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">w </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">t.match(</span><span style="color:#183691;">/</span><span style="font-weight:bold;color:#a71d5d;">b</span><span style="color:#0086b3;">w</span><span style="font-weight:bold;color:#a71d5d;">+b</span><span style="color:#183691;">/</span><span style="font-weight:bold;color:#a71d5d;">g</span><span style="color:#323232;">) </span><span style="font-weight:bold;color:#a71d5d;">|| </span><span style="color:#323232;">[]; </span><span style="font-weight:bold;color:#a71d5d;">let </span><span style="color:#323232;">r </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">1</span><span style="color:#323232;">, u </span><span style="font-weight:bold;color:#a71d5d;">= new </span><span style="color:#0086b3;">Set</span><span style="color:#323232;">(); </span><span style="font-weight:bold;color:#a71d5d;">for </span><span style="color:#323232;">(</span><span style="font-weight:bold;color:#a71d5d;">let </span><span style="color:#323232;">i </span><span style="font-weight:bold;color:#a71d5d;">of </span><span style="color:#323232;">w.map(x </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">x.toLowerCase())) u.size </span><span style="font-weight:bold;color:#a71d5d;">< </span><span style="color:#0086b3;">100 </span><span style="font-weight:bold;color:#a71d5d;">? </span><span style="color:#323232;">u.</span><span style="color:#0086b3;">add</span><span style="color:#323232;">(i) </span><span style="font-weight:bold;color:#a71d5d;">: </span><span style="color:#323232;">f(r) </span><span style="font-weight:bold;color:#a71d5d;">&& </span><span style="color:#323232;">u.delete(i), u.size </span><span style="font-weight:bold;color:#a71d5d;">>= </span><span style="color:#0086b3;">100 </span><span style="font-weight:bold;color:#a71d5d;">&& </span><span style="color:#323232;">r</span><span style="font-weight:bold;color:#a71d5d;">++</span><span style="color:#323232;">, u.size </span><span style="font-weight:bold;color:#a71d5d;">> </span><span style="color:#0086b3;">50 </span><span style="font-weight:bold;color:#a71d5d;">&& </span><span style="color:#323232;">(u </span><span style="font-weight:bold;color:#a71d5d;">= new </span><span style="color:#0086b3;">Set</span><span style="color:#323232;">([</span><span style="font-weight:bold;color:#a71d5d;">...</span><span style="color:#323232;">u].filter(() </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">f(r)))); </span><span style="font-weight:bold;color:#a71d5d;">return </span><span style="color:#323232;">[</span><span style="font-weight:bold;color:#a71d5d;">...</span><span style="color:#323232;">u]; };
</span><span style="color:#323232;">
</span><span style="font-style:italic;color:#969896;">// Example usage:
</span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">text </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#183691;">"To be, or not to be, that is the question..."</span><span style="color:#323232;">; 
</span><span style="font-weight:bold;color:#a71d5d;">const </span><span style="color:#323232;">finalWords </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#323232;">cvmAlgorithm(text);
</span><span style="color:#795da3;">console</span><span style="color:#323232;">.</span><span style="color:#0086b3;">log</span><span style="color:#323232;">(finalWords);  </span><span style="font-style:italic;color:#969896;">// [ 'to', 'be', 'or', 'not', 'that', 'is', 'the', 'question' ]
</span>
davel , to worldnews in Volodymyr Zelensky’s presidential term expired on May 20th
@davel@lemmy.ml avatar

They also banned or nationalized many media outlets, censor media in general, and suspended eleven political parties during his term, which eventually became permanent bans.

Al Jazeera, Mar. 2022: Why did Ukraine suspend 11 ‘pro-Russia’ parties?

Europe is no bastion for frozen peaches, either. AP, Mar. 2024: EU bans 4 more Russian media outlets from broadcasting in the bloc, citing disinformation

davel OP , (edited ) to worldnews in New 9/11 Evidence Points to Deep Saudi Complicity
@davel@lemmy.ml avatar

I don’t understand how sarcasm applies. Not only was he a Saudi of enormous wealth and close ties to the royal family, he was a CIA asset for years.

6 December 1993: Anti-Soviet warrior puts his army on the road to peace

https://lemmy.ml/pictrs/image/1413da3b-fe4f-4e39-b19f-ccea504ca8dc.jpeg

davel OP , to worldnews in New 9/11 Evidence Points to Deep Saudi Complicity
@davel@lemmy.ml avatar
davel OP , to worldnews in New 9/11 Evidence Points to Deep Saudi Complicity
@davel@lemmy.ml avatar

People who actually paid attention have known; people who read The Atlantic not so much.

davel , to memes in We had an r/place at my engineering school
@davel@lemmy.ml avatar
davel , (edited ) to worldnews in Second Russian invasion of Kharkiv caught Ukraine unprepared
@davel@lemmy.ml avatar
davel , to asklemmy in What's the most embarrassing thing about you?
@davel@lemmy.ml avatar

How do you do, fellow memers?

davel , to technology in Google Search adds a “web” filter, because it is no longer focused on web results
@davel@lemmy.ml avatar

I just tried it, and yes, “Web” was buried in the “More” drop-down 🤡

Apparently udm=14 is what sends you to the web filter. Here’s How to Declutter Your Google Search Results (And Make It Your Default)

It’s critical you include the &udm=14 part at the end. That’s not junk code, it’s what tells Google to send you straight to the web view.

davel , to worldnews in China is burning all its bridges with Israel
@davel@lemmy.ml avatar

their killing of innocent people

The US & Israel are literally committing genocide while you’re parroting US Cold War III talking points.

davel , to memes in Don't
@davel@lemmy.ml avatar

Yes, I accidentally the whole do not.

davel , to memes in Don't
@davel@lemmy.ml avatar

I accidentally a did that I oughtn’ta done.

davel OP , to nottheonion in Exxon Mobil is suing its shareholders to silence them about global warming
@davel@lemmy.ml avatar

It’s not worth my time & effort to look into these particular investors’ true motivations, but as a rule they’re no more or less to be trusted than the C-suite itself. In almost all cases this is just a game to these people for topping off their Scrooge McDuck swimming pools.

davel , to asklemmy in Is it ever okay to generalize about people? why or why not?
@davel@lemmy.ml avatar

This question can probably be interpreted a dozen different ways, so you’ll likely get answers to questions you hadn’t intended meow-popcorn

davel , (edited ) to memes in Major USA political affiliations explained
@davel@lemmy.ml avatar

How is that relevant? Political dissidents like Omali Yeshitela and journalists like Assange have also been persecuted before, but why point it out?

Honestly it sounds like you may be trying to make excuses for these attacks on student protestors by claiming that they’re an inevitable force of nature. That it’s always been this way and always will be. Nothing to see here, move along. Hopefully that’s not what you’re trying to do.

And no, the state is not persecuting students for thinking, it’s persecuting them for the same reason it’s persecuting Yeshitela and Assange: for expressing things it would rather not have expressed.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines