Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API

From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "algorithm"
-
Based loosely on the popular "git" command, I am happy to announce my new product, "hit"!
Essentially, hit hooks into "git blame" and automatically slaps the shit out of whoever wrote this garbage.
It uses SOHTTP (Slap Over HTTP) to deliver a nice firm wallop to any subpar script kiddie that had the audacity to come up with this bullshit.
Careful, the user is not immune to the effects9 -
When I'm coding, I often come up with some cool algos and when I do, I feel pretty good.
But the next second, I get this feeling that I know there are a million other people in the world who have solved the same problem with the same or better algorithm and I feel like shit. Like all the work I put in is somehow redundant.
Like finding answers on StackOverflow... When you do, you know the person who answered has already done it. You're just repeating it. But again, the fact that I'm looking for answers from other people in the first place is ....
I don't know. I guess I need to change the way I code from now on....5 -
!dev What pisses me off about today's job market is that the following idea is a naive one:
Let's just find a junior position and learn on the job so you can demonstrate your skills to your employer so they can promote you.
Wroooong. Reality: They only hire the most gifted geniuses who already know everything and they don't have the budget for someone who is rusty.
Welcome to the modern world of the CompSci market, where you are expected to have expert level knowledge in every language, especially in Software Engineering and Algorithms. And if you don't remember how to write an efficient Comparator algorithm in under 3 minutes, you're screwed.
Yaay.6 -
So my localization algorithm actually runs onboard my YouBot :)
My paper was basically torn apart by my professor, so I had to write some new classes and redo the whole experimental section. And all the other sections too. I resubmitted it to him after revisions, and the second iteration was way better - I'm really close to final paper level :)
I told my professor and postdoc that I will appreciate more support and positive feedback, because so far our communication was only very dry criticism. For me it's really devastating, because feeling like I constantly disappoint people just kills me on the inside.
It seems like they took it to heart, they have been nicer to me in the last few days :)6 -
Ah very good, it seems Windows has taken the liberty of putting a link to Edge on my desktop again. Just in case I had accidentally removed it or something.12
-
During my first-ever technical interview, the interviewer asked me "Do you know the FizzBuzz problem?"
"Uhh, not really." (I was just thinking ok this problem has a name, must be some algorithm problem)
"So the problem is basically to give you the numbers 1 to 100, if the number is divisible by 3, print 'Fizz', if divisible by 5, print 'Buzz', if divisible by 3 and 5, print 'FizzBuzz'. For other numbers just print out the number itself."
After hearing the problem, I felt so many ideas popping out of my stressed brain.
I thought for a bit and said "ok, so if the digit sum of a number is a multiple of 3, then the number is divisible by 3, and if the last digit is either 0 or 5, it's divisible by 5."
Then I started to code out my solution until the interviewer said "there's an easier solution. Can you think of it?"
This stressed me out even more.
I thought for a bit and said "well, starting from 3, keep a counter that records how many iterations are done after 3. When the counter hits 3, that number would be divisible by 3 for sure. Should I try this solution?"
The interviewer said "Sure." So I started again.
However, I struggled for about another 3min until I realized this solution is a lot harder to implement. The interviewer probably saw my struggle too.
This was the point where he stepped in and asked me "Ummmm there's an easy way of solving this. Have you heard of the MODULO OPERATOR?"
In sheer embarrassment, I finished the code in 30s.
Of course, there was no further question after this, and I felt the need to seriously reevaluate my intelligence afterwards.17 -
I wrote pagerank algorithm in python for data mining course but my teacher told me to write it in R because according to him python can't be used as data mining tool.5
-
Chinese streamers stream on the street under the bridge. The reason? They stream near a rich neighbourhood, so the algorithm recommends them to rich tenants. They donate more.9
-
My advisor thought that my MCL algorithm behaves a bit strange, so he wanted me to investigate it. I said I'd be happy to review the code because I anyway considered refactoring, and asked if I can have another pair of eyes to help me.
A more senior PhD student was assigned to help me, and by the suggestion of my advisor we tested my code against a very well-written and well-performing implementation of MCL. This implementation was written by another professor, who is a close friend of my advisor and the actual supervisor of the student assigned to help.
But this implementation was optimized for a very specific type of maps, and on the maps I worked on it just failed consistently. The student, in a misguided attempt to protect the pride of his advisor and subsequently his, wasted days adding code and fine-tuning the implementation.
In the meantime, my MCL has a stable configuration that converges on both types of maps. It behaves differently, but the outcome is about the same as the other implementation.
I am a little sick of wasting my time (week+) on someone else's attempt to reassure their ego, so I'm doing my planned research work on the weekend...1 -
devRant, got a code challenge for you.
Manager calls at 18:00...
Write an algorithm that gives the optimum result!
I'll go first with my O(1) solution:
Don't answer.
I'd be interested to see whoever can beat the big O of my solution!!!!!
#moreclownwellnessthirstythursdays20 -
- Get invited to apply to job
- Technical interview, guy shows up late starts small talk wasting time and gives me the exercise
- Start implementing the first algorithm, finish it passing min test cases then realize there's a solution that would make both algorithms a breeze
- I pitch my solution realizing there's no much time left, cuz we lost almost 20 min of my test hour talking about BS plus the almost 10 min he arrived late, and reassure the interviewer it can be developed faster
- Interviewer says it doesn't matter, we should finish edge cases
- Kay no problem, finish the first algorithm successfully and explain pitfalls on the second part with the current implementation
- I tell him there's a better solution but he doesn't seem to care, he says time's up
Now here's the funny part.
I get called by the recruiter today (2 weeks later) and she says "They are happy with your soft skills but feel there are some gaps with your coding, they would like to repeat the technical interview because they didn't feel there was much time to assess the 'gaps' ".
Interviewers, either I'm competent enough to work for you or not, your tests must be designed to assess that, if you see you can't fit the problem you want in the time you have left change the problem, reschedule or here's an idea...LEAVE THE BS CHITCHAT TILL THE END AND START THE INTERVIEW ON TIME. When I do interviews I always try to have one complete free hour and a one algorithm exercise because I expect the candidate to solve it, analyze it and offer alternatives or explain it, I've never had someone finishing more than 2 an hour.
You can keep your job I'll keep my time. I'll write a similar problem on the comments to pass on the knowledge for people who enjoy solving these kinds of problems, can't give you the exact same thing, also tip guys don't do NDA's for interviewing it makes no fucking sense trust me no one cares about your fizz buzz intellectual property.13 -
Article about "best chromium alternatives"
- First is opera
- Second is Vivaldi
Fucking zero brain cells. Entirely braindead. Not a single god damned thought behind the eyes.22 -
So my department is "integrating CI/CD"
Right now, there's a very anti-automation culture in the deployment process, and out of our many applications, almost none have automated testing. And my groups is the only one that uses feature branching - one of the few groups that uses branching at all beyond "master, dev"
So yeah... You could see how this is already ENTIRELY fucked from the very beginning.
First thing they want to do is add better support for a process... Which goes directly against CI/CD.
The process is that to deploy to production (even after it is manually approved by manager), someone in another department needs to press a button to manually deploy. This, as far as I can tell, is for business rule reasons rather than technical ones.
They want us to improve that (the system will stay exactly the same with some streamlined options for said button pressers)
I'm absolutely astounded at the way our management wants to do something but goes in exactly the opposite direction. It's like the found an article of what CI/CD was and then took notes on exactly what not to do.25 -
BUZZWORD BUZZWORD AAAAAH
ARTIFICIAL INTELLIGENCE
BLOCKCHAIN
ALGORITHM
CLOUD
IOT
BIG DATA
SaaS
DEVOPS
5G
AR
VR
AAAAH BUZZWORD HERE BUZZWORD THERE4 -
YouTube: new rap video?
Me: menu > not interested.
Later...
YouTube: new rap video?
Me: menu > not interested.
Later...
YouTube: new rap video?
....
I get gold from YouTube's algorithm sometimes, but it should know by now that I couldn't care less about new rap videos.12 -
Today we mourn the loss of a once excellent technology, and secretly celebrate it like a grandparent that turned bitter in old age.
RIP Internet Explorer.26 -
Any malware specialists here?
Yesterday I started dismantling the virus that is spreading on facebook messenger these days.
What techniques do you use? Any special trick that doesn't require years of practice and could make my job easier? I have already familiarized myself with the nicifier and Function.ToString() traps. Now I have an 850 line JS file full of weird code and I have deciphered like 70 lines so far so I'm looking for some tool, strategy or algorithm to make my job easier.10 -
Never call me unfair.
A few years(!!) ago, I ranted about how you had to update the visual studio updater before you could update visual studio (which I still think is a valid rant)
Today I noticed that the visual studio installer just does this itself silently now. Therefore, I choose to apply praise to this welcome change and in the name of justice and fairness, recognize this vast improvement.
*ahem*.... GG VS20224 -
Just wanted everyone to know that I did a find and replace all in my project and it actually worked as intended.
That's all.8 -
Instructions on how to become suicidal:
- Create an API controller for the /file/ path
- Add an empty endpoint for POST /file/upload (will write it later!)
- Forget about this endpoint at some point
- Later, create a page for /file/upload
- GET /file/upload returns page
- POST /file/upload returns empty 200
Pure psychological horror for like an hour Googling why the fuck my razor page is returning empty responses and my breakpoint on OnPost is not fucking hitting even if I copy and paste example code from the ms website
Oh yeah, that controller.5 -
How to psych-out a machine learning algorithm:
> Use a platform for 10 years
> Never like, comment, or give it any inkling of your preferences
> Like one random video
> Never log in again10 -
Apply for a data engineer role.
Get invited for a data science interview.
HR says they're building AI and I were to supervise another person writing its algorithm.
It's a media company.
*Risitas intensifies*6 -
Fucking jesus christ, for some reason in chromium-based browsers if you have a table that fills up to the full height of the parent using flexbox rules, if you go to print it, it will fucking
i forgor 💀
and give it a height of minimum content height. The solution is to ALSO give it height: 100%;
Google completely unhelpful (I guess it's too specific and most people don't write web services specifically made for printing out?) but luckily it only took me like 3 guesses to figure out on my own.
But I could have easily seen this completely pissing me off to the point of quitting. FireFox doesn't have this issue.
RELATED TANGENT RANT:
Why the fuck is the default to use headers, footers, margin, and no background images (colors) ?!?!?!? The default printing for browsers COMPLETELY FUCKS UP THE PRINT
God FUCKING damnit.14 -
Well, this is a sad day. I'm on the first page of supporters and have been supporting for many years, but today, I'm going to have to stop. I've felt like for a while my money has not been well used, merely running a site with no active development or even community interaction.
I'm trading it in for a Big Jet TV membership on YouTube (I love airplanes)
Sorry devRant crew7 -
I hate that "integer overflows" have become somewhat pop culture because anytime I see someone try to use it in a joke, they use it wrong.
I've even seen people confuse them with stack overflows and be like "my intelligence is so low it stack underflowed and became the max of an integer value!"
Or "It overflowed and became zero again" ah, I guess it happened to be unsigned and overflowed by precisely 1 then eh?
So cringe15 -
Brilliant Stakeholder: of course communication with our backend will be encrypted with an algorithm I'll confidentially share with you once the contract is signed
Senior Developer: npm install md51 -
I've written an insertion sort algorithm in my own esoteric programming language!
I also like to call it 'San Francisco sort'.
Explanation: https://github.com/iamgio/pikt/...8 -
What's a database? Oh, uh... Think, like, a spreadsheet -- but it makes you wanna kill yourself even harder.4
-
Music is not always a foreground activity.
Spotify... why don't you have a volume slider specifically for your output on my phone..?
Why do I need to turn ALL non-call volume down to just turn the music down.
Sometimes I want to play games with music but I don't want the music to be totally loud.
Sometimes I wanna do WHATEVER at full volume with some music in the background.
But I just... can't
What the fuck.4 -
You probably hate bootstrap and jQuery, as I do, but if you block CDN paths for these libraries, you'd probably never see the internet as it was intended.
Side note: web devs, please learn media queries, vm and em for font sizes, and etc. You really don't need complicated stuff, browsers already have your back, I promise.4 -
R&D: here's a really convoluted qualitative AND quantitative algorithm we want you to implement
Me: *asks to the meaning of one of the columns in a spreadsheet*
R&D: yeah that's probably wrong. We'll get back to you1 -
I think I did it. I did the thing I set out to do.
let p = a semiprime of simple factors ab.
let f equal the product of b and i=2...a inclusive, where i is all natural numbers from 2 to a.
let s equal some set of prime factors that are b-smooth up to and including some factor n, with no gaps in the set.
m is a the largest primorial such that f%m == 0, where
the factors of s form the base of a series of powers as part of a product x
1. where (x*p) = f
2. and (x*p)%f == a
if statement 2 is untrue, there still exists an algorithm that
3. trivially derives the exponents of s for f, where the sum of those exponents are less than a.
4. trivially generates f from p without knowing a and b.
For those who have followed what I've been trying to do for so long, and understand the math,
then you know this appears to be it.
I'm just writing and finishing the scripts for it now.
Thank god. It's just in time. Maybe we can prevent the nuclear apocalypse with the crash this will cause if it works.2 -
Found a clever little algorithm for computing the product of all primes between n-m without recomputing them.
We'll start with the product of all primes up to some n.
so [2, 2*3, 2*3*5, 2*3*5*,7..] etc
prods = []
i = 0
total = 1
while i < 100:
....total = total*primes[i]
....prods.append(total)
....i = i + 1
Terrible variable names, can't be arsed at the moment.
The result is a list with the values
2, 6, 30, 210, 2310, 30030, etc.
Now assume you have two factors,with indexes i, and j, where j>i
You can calculate the gap between the two corresponding primes easily.
A gap is defined at the product of all primes that fall between the prime indexes i and j.
To calculate the gap between any two primes, merely look up their index, and then do..
prods[j-1]/prods[i]
That is the product of all primes between the J'th prime and the I'th prime
To get the product of all primes *under* i, you can simply look it up like so:
prods[i-1]
Incidentally, finding a number n that is equivalent to (prods[j+i]/prods[j-i]) for any *possible* value of j and i (regardless of whether you precomputed n from the list generator for prods, or simply iterated n=n+1 fashion), is equivalent to finding an algorithm for generating all prime numbers under n.
Hypothetically you could pick a number N out of a hat, thats a thousand digits long, and it happens to be the product of all primes underneath it.
You could then start generating primes by doing
i = 3
while i < N:
....if (N/k)%1 == 0:
........factors.append(N/k)
....i=i+1
The only caveat is that there should be more false solutions as real ones. In otherwords theres no telling if you found a solution N corresponding to some value of (prods[j+i]/prods[j-i]) without testing the primality of *all* values of k under N.12 -
Google's algorithms seem to act stupidly on purpose so we are mistaken to think we have nothing to fear from artificial intelligence.2
-
float integral = 0;
float dx=float.minValue;
for (float x = a; x<=b; x+=dx) {
integral+=f(x)*dx;
}
A classmate just literally wrote this and he believed it was the proper way to do it.
I asked him to integrate f(x)=1 on 0<x<1. -
Looks like I got dislike-banned as well... eventhough I only used it where appropriate.
I understand that our almighty gods dfox and trogus implemented this to fight bots and mischievous downvote cunts, but why not inform the user affected by it?
I fucking hate these silent bans, just like Twatter and YouTwat do it... you feel like you posted something but in reality it disappears and you're not even aware of it.
Man, nowadays a lot of people behave like bots thus I can't blame The Algorithm™...3 -
Computer programming teacher wanted us to write some pseudocode to solve an algorithm just so we can practice writing some code and solving problems. The teacher needs a copy so I spent about 2 hours today rewriting all of that pseudocode because she wants it handwritten...11
-
Was working on an algorithm a few months back. I was not liking how long it was taking to process some data. A colleague of mine said: "Just throw out the data that is past a certain distance. You don't need it." At first I was shocked. Throw out data... Seemed so wrong at the time. He was correct, and it made sense. What was I saving it for? Posterity?1
-
I know a lot of people disagree with modern art, but fuck me, at least we got away from this ugly shit.7
-
Hey fellas, especially you security nerds.
I've had asymmetric encryption explained to me a number of times but I can't get a handle on it because no example actually talks in human terms. They always say "two enormous prime numbers", which I understand, but I can't conceptualize.
Can someone walk me through an entire process, showing your math & work, using some very small, single- or double-digit primes? Such as if I were to encrypt the text "hello world" using prime numbers like 3, 5, and 710 -
I've got a kinda basic networking question I can't quite figure out
How does a push notification work?
Like, on an Android app. A good example is an authenticator. Say I don't login to the service for 4 months.
Then, one day, I try to log into the web portal and it prompts me to accept the request on my authenticator app on my phone.
Immediately, there's a push notification on my phone.
Wtf.
Is there a socket open for 4 months? Does it send requests every few seconds for 4 months? I can't imagine that either of these options scale whatsoever: both horrendously waste bandwidth and server connections.
How the fuck does it work? I don't even have the first idea.7 -
The following paper combines recurrent neural nets for vision with methods from reinforcement learning research:
https://proceedings.neurips.cc/pape...
Apparently an agent learned to catch a ball 85% of the time, without being explicitly told to track the ball. The RL algorithm rewarded the agent *only* for successfully catching the ball. The system itself used this reward signal to set its *own* policy/goal, which was used to guide it toward the goal of tracking the ball itself--all on its own.
Behold, the very infancy of the paperclip maximizer problem.3 -
Sharing a first look at a prototype Web Components library I am working on for "fun"
TL;DR left side is pivot (grouped) table, right side is declarative code for it (Everything except the custom formatting is done declaratively, but has the option to be imperative as well).
====
TL;DR (Too long, did read):
I'm challenging myself to be creative with the cool new things that browsers offer us. Lani so far has a focus on extreme extensibility, abstraction from dependencies, and optional declarative style.
It's also going to be a micro CSS framework, but that's taking the back-seat.
I wanted to highlight my design here with this table, and the code that is written to produce this result.
First, you can see that the <lani-table> element is reading template, data, and layout information from its child elements. Besides the custom highlighting code (Yellow background in the "Tags" column, and green gradient in the "Score" column), everything can be done without opening even a single script tag.
The <lani-data-source> element is rather special. It's an abstraction of any data source, and you, as a developer can add custom data sources and hook up the handlers to your whim (the element itself uses the "type" attribute to choose a handler. In this case, the handler is "download" which simply sends a fetch request to the server once and downloads the result to memory).
Templates are stored in an html file, not string literals (Which I think really fucks the code) and loaded async, then cached into an object (so that the network tab doesn't get crowded, even if we can count on the HTTP cache). This also has the benefit of allowing me to parse the HTML templates once and then caching the parsed result in memory, so templates are never re-parsed from string no matter how many custom elements are created.
Everything is "compiled" into a single, minified .js file that you include on your page.
I know it's nothing extraordinary, but for something that doesn't need to be compiled, transpiled, packaged, shipped, and kissed goodnight, I think it's a really nice design and I hope to continue work on it and improve it over time1 -
Today I spent 4 hours testbenching and enhancing an algorithm to detect certain metric patterns only to find out that the reason the anomalies weren't picked up correctly was that their metric had some -nan values I didn't check for.... FML2
-
During my first-ever technical interview, the interviewer asked me "Do you know the FizzBuzz problem?"
"Uhh, not really." (I was just thinking ok this problem has a name, must be some algorithm problem)
"So the problem is basically to give you the numbers 1 to 100, if the number is divisible by 3, print 'Fizz', if divisible by 5, print 'Buzz', if divisible by 3 and 5, print 'FizzBuzz'. For other numbers just print out the number itself."
After hearing the problem, I felt so many ideas popping out of my stressed brain.
I thought for a bit and said "ok, so if the digit sum of a number is a multiple of 3, then the number is divisible by 3, and if the last digit is either 0 or 5, it's divisible by 5."
Then I started to code out my solution until the interviewer said "there's an easier solution. Can you think of it?"
This stressed me out even more.
I thought for a bit and said "well, starting from 3, keep a counter that records how many iterations are done after 3. When the counter hits 3, that number would be divisible by 3 for sure. Should I try this solution?"
The interviewer said "Sure." So I started again.
However, I struggled for about another 3min until I realized this solution is a lot harder to implement. The interviewer probably saw my struggle too.
This was the point where he stepped in and asked me "Ummmm there's an easy way of solving this. Have you heard of the MODULO OPERATOR?"
In sheer embarrassment, I finished the code in 30s.
Of course, there was no further question after this, and I felt the need to seriously reevaluate my intelligence afterwards.13 -
The only really influential product Microsoft ever created is Verdana. Yes, the typeface.
It was the first typeface designed to be displayed on a screen rather than in print. Before that, there only were monospaced typefaces like we saw in terminal, or digitized typefaces like Helvetica Neue.
More than that, its looks were partly generated by an algorithm, hence the odd, alien looks. But because of it, Verdana works amazingly good in small labels. The 8pt Verdana is more readable than 10pt Helvetica.
I still use Verdana in all of my projects, religiously.
All the other Microsoft products: Windows, Xbox, Surface, Office, Azure, all that stuff — is mere garbage compared to the influence Verdana made on how our interfaces look now.5 -
Programmers nowadays are so lucky.
They have all these libraries and resources. Back in the day, we had to write sort algorithm if we wanted to sort an array...2 -
The DataTables homepage has an example table where some "senior JavaScript developer" has a salary of $433k
Lmao 433k Zimbabwe dollars maybe.2 -
In other to sharpen my algorithm and data structure skill.
I implemented the complete *eval()* function for arithmetic Expression in java
It can compute any kind of arithmetic Expression even with parenthesis grouping
Here is the github repo
https://github.com/Afrographic/...1 -
I've never even heard of this before.
Notes: these are two different ASP.Net projects. I didn't choose VB, the project was already existing.
A conversation between me and a senior:
Senior: (other module) still needs to develop (something you wrote)
Me: they should just use my code, it's compete and tested.
Senior: They should, but yours is in visual basic and they wrote their project in c#
Me: Ah, no problem, I will distribute it as a DLL for him.
Senior: No, I don't want to add dependencies
Me: ????
Senior: They will need to convert it to c# and add the classes
I stopped responding
Man............ what the hell5 -
Having fun with HTML5 custom elements and shadow DOM. Finally, a genuine way to make widget libraries.6
-
Learning an algorithm and data structure for a month and forgetting about it after exploring a new language be like🤦4
-
Maybe the twitter developers getting laid off should join spotify in their quest for a simple shuffle algorithm that they failed to develop or maybe just are not allowed to ship due to corrupt company politics?
As Spotify's algorithm sucks from a listener's perspective (major music industry might like it though), I have to rely 100% on curated playlists, and without shuffle, I have to listen in the exact order that they were made. Why not? We did the same when we put actual records on a record player. Who needs shuffle? Who needs streaming anyway? I'm gonna get a pair of turntables or just listen to MP3 files again!
There is a "new idea" thread in the spotify community forum started in 2020 (following up on an earlier 2012 suggestion), a feature request for the "option to have a true shuffle" that already has 70+ pages, tagged as trending in 2021 with the friendly stalling message:
As this idea has gathered a fair amount of votes, we've discussed it with the relevant team once again. We actually want to take a closer look at what you're experiencing and get some of you in touch with our devs.
Good luck everyone. If I still use Spotify in 2023, I can probably repost the very same status again one year later when the app will still lack a simple shuffle option, no?
https://community.spotify.com/t5/...4 -
What's the fuckin point when a language makes you call the constructor of a parent class in the child class before you can use the inherited items?
Why do I need to call `super()` every time in my constructors? Why can't this be automatic?7 -
My preprocessor is just generalized kerning, the macros are variations on the single well-known proof for the Turing-completeness of GK, the type system will probably be a Prolog reskin so simple the translator can be a FSM, the type inference algo is the original HM algorithm which I don't even need to change, the core language is Lambda calculus and no more, and the backend might just be Erlang itself if my research confirms that extending LLVM until it consistently beats Erlang is unrealistic.
I invented nothing, I create nothing. All I do is plug circles into square holes and fill the gaps with play dough.5 -
Tbh I prefer watching YouTube shorts, the algorithm is easier to train in contrast to tik tok and insta that feeds you fuckry non stop10
-
"f(n) is O(g(n)) if c and n0 f(n) <= cg(n) for all n > n0".
I have a couple of questions related to this equation.
1: why we use this equation?
2: which thing cg(n) is represented for?
3: what is the real-life example of this?10 -
Yesterday my lead architect told me that the bin packing problem is easy and all I have to do is add up the volume of each boxes to calculate the number of containers needed.
Fuck this man.4 -
Hey fellow nerds, I have a math question :)
I need to split a pile of coins (1s, 2s, 5s, 10s and so on) into a number of piles, let's say four, so that each pile has the same amount of money, but not necessarily the same amount of coins. Does anybody know of such an algorithm?7 -
When I had a burnout failing to complete a uni task.
I was trying to implement a parallel version of the Barnes-Hut algorithm for the N-body problem. Spent way too many hours on that. -
That annoying moment when you took an algorithm test, you didn't even pass any test case or you passed just 3 🙂, doing that same algorithm again outside the time scope, then you killed it.
Moral lesson: you have to take your time to think properly even when time is running out. -
Broke: adding a pipe character ( | ) to your text
Woke: adding a slash, then adding rotation until it's straight.1 -
That moment your professor tasks you with writing a genetic algorithm and are forced to use MatLab (which I don't use).
"The University offers MatLab through ssh, so no problems, right?" Only basic package installed...
As cherry on the pie I found out that it's nowhere close to intuitive for me.
Got the feeling I could've done it way faster in the programs I'm used to, but finally got it working! -
*looks drowsy* Ugh my head..
You know what, guys? If you can freshly and directly remember how to do this:
- calculate the time complexity for each type of loop and code structure
- knowing how to write the following regex:
"A 15-digit number starting with a possibility of a group of 1-2 digit numbers, segregated into three 5-digit numbers tuples with three different separator characters, evaluated ahead"
- mentally work out how to reverse an array's indexes (swapping algorithm) without writing anything down
- know how to optimize a binary search in your head
then kudos to you. lmao
I'm rusty. It took me a while..7 -
I'm going to be making a table library (think DataTables)
So for those web dev gurus, should I render the data to a basic <table> or should I use CSS grids?
IE compatibility is not a consideration.
The table will also support grouping (pivot table) so something like rowspan will be a must11 -
Make good progress on Orchid, my pet project, the functional programming language that has no syntax apart from what the macros define. A type system, an interpreter and provisions for a compiler would be nice for a start.
Finish my bachelor's degree on some unspecified part of Orchid, at the current pace that would most likely be just the Hindley-Milner algorithm.
Don't get fired from the gem of a job I have, and move to London because I'm a city rat and the only way I can sleep well apparently is with a tram or drunken people screaming under my window.2 -
Think about the amount of mental effort spent by programmers trying to understand the fundamental difference between a program and an algorithm!🤯4
-
Me: What algorithm prioritizes food no matter how you use it?
Coworker: Idk, never heard of that one.
Me: Bread-First-Search1 -
TL;DR Is there a hackerrank for Oracle PL/SQL?
At my work, we do not get raises, we only get promotions. Promotions are applied for, and then interviewed for. Highest score (plus maybe some managerial bias) wins.
33% of the questions revolve around PL/SQL (and just Oracle DB in general) and the better you explain yourself, the better you score.
Tutorials just don't do it for me. They're boring. I want something interactive. While it doesn't need to be competitive and challenging like hackerrank, I'm looking for something gamified like hackerrank where I can see other people and learn the technology intimately so I can climb the ranks at my company faster.
Does anyone know of something sort of along the lines? All suggestions appreciated.4 -
Since Google is failing me...
Given a user input (string query) and a list of larger strings (like email bodies or something), what's the best way to search and rank the list of strings against the user input.
So far I have implemented levenshtein distance but it doesn't really seem to do extremely well. (Short strings rank very well against each other, whereas long strings **containing** exact matches will go lower in the list)
Should I be splitting the input and the list by word and then averaging the distances?
The only thing I have tried is removing complete non-matches from the list by not including them if the distance is equal to the length of the largest string17 -
Drawing pictures in your mind. This is something I have always struggled with.
Is there a set of exercises a person can do to develop imagery in your mind?
I have had times when I closed my eyes that I experienced what I would call imagery that rivaled or was more detailed than what my eyes fed me. But I only experienced this and did not create what was in the imagery. It has only been once or twice. I know that when I start to dream I can start seeing things with imagery, but I still cannot control this directly. I had one lucid dream where I woke in my dream and was able to construct things for a short period.
What I would like to be able to do is construct shapes and diagrams in my head. Perhaps visualize how an algorithm might function.
Is there a way to learn this?5 -
One advantage of JWT that I never realized: session tokens are stored client side, saving network calls to validate them.
Very cool. Love it. -
I never use pwd.
Either I figure out where I am via my prompt, or I use LS and sleuth out the folder via its contents, or I just "cd" and restart from home but I NEVER have used pwd.8 -
My in-laws seem allergic to keeping fruit on the fridge. In a 40° heat. No wonder half the fruit are spoiled by next morning.
My algorithm for storing produce:
Is it fresh produce? => (No) use another algo. (X)
Is it potatoes or onions? => (Yes) put it in a bowl in a closet (X)
::: Put it all in the fridge, dammit. -
I keep having this recurring idea that I can fill in the gaps in my education by writing video games that allow me to explore those topics. This would force me to learn the subject well enough to share it with other people. So it would not be just surface level.
I keep thinking of a program that explores and visualizes math topics and programming topics. I would really like to have a program that allows me to visualize memory cells for algorithm exploration. Or a really nice graphing calculator in the computer that allows me to view multiple graphs to compare and contrast equations.
What holds me back is both math and CS are huge topics. I feel like any kind of playground would only cover a small subset. Ideally whatever I make should be extendable over time to add content and topics. It would need to be somewhat fun as well.
I can imagine an AI training program where you help your character navigate a room of hazards or die. This could be one such fun challenge.1 -
Start the day feeling blessed and grateful about what you've got around you,
Planning a little the next step that you have to do
Focus on yourself and your attitudes, looking to all the possibilitys with rationality, and try to make a footstep in that direction everyday
Thinking and be positive must to stay on the first position of a good mindset,
Be productive in a constantly way and trust the progress, this is an action than create an algorithm totally in sync with a new good habit for a stabilization of your transition
Start to visualize a clear picture of yourself happy and in peace and print that picture in your head as a personal goal
Write and read as a personal research method
It's a process that we can call art of the water's cup
Consisting in a continuing movement of pouring and filling the glass until the water is totally clear and drinkable
after that you may drink that water a bit every day for knowing exactly the taste of it,
write = pour
read = fill
drink = fix
becomoming like water4 -
I think that if all our electronic devices were monitored 24/7 by the government with the sole intention of reducing crime, that would be a good idea. Imagine every message and audio recording being sent across the internet being monitored or passed through an algorithm which analyses the message and determines whether it would lead to a crime. I don’t trust my government with this much power but I think it’s a good idea.13
-
So, as per usual, I am not sure what I am doing.
I want to make multiplayer games on the web using web sockets.
But of course I want there to be multiple game servers for horizontal scaling (I'm gonna hit it big)
Specifically for either Node.JS or ASP.Net (or both) how could I manage such a thing where there are 2 servers and 2 users. User A is assigned to server A by load balancer, and user B is assigned to server B. But they play in the same game?
Best I know of so far is to connect both game servers to a redis backing. But this seems like a convoluted way to communicate. I would rather have them both route to the game server (Whichever server the game starts on)17