Details
-
AboutI like trolling people using \u202e :)
-
SkillsJava, C++
-
LocationGermany
Joined devRant on 3/17/2017
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
-
PROBLEM: A tickets' company came to us last autumn. They said they have severe performance problems and asked us to help.
SOLUTION: covid and quarantines. All events have been ceased, noone's buying any tickets any more. Performance problems are no more. FIXED.
PROBLEM: Another company came to us recently. They said they have severe performance problems with their huge databases and asked us to help.
SOLUTION: a few days of heavy rain and their datacenter was flooded. along with the backup servers. No more data, no more performance problems with large databases. FIXED
Solving problems genie style!
Who's next?8 -
Walked up to my girl and dropped this:
"Hey baby, are you a TCP Connection? Cause you look like a SYNACK"
Oh yeah, WOOOOOOOOoooo!9 -
Given the Base64 flying around devrant, figured I'd introduce the unknowing to a lovely little tool for dealing with various formats and encodings: CyberChef (online)
https://gchq.github.io/CyberChef/
I honestly don't remember how I lived without it. Enjoy!4 -
I just remembered the first time I set up a Linux-Server. It was a simple Apache webserver at my first internship anf I didnt have a clue about literally anything.
My mentor guided me through and gave me literal step-by-step instructions (alright, now type... and now type...).
At the end he told me "OK, now run 'sudo rm -rf /*' to finish setting up". Me, being the naive and clueless motherfucker I am, happily nuked the everloving shit out of my newly setup server. I was like "Alright, WTF just happened??" He then told me "Now that you know how it works, do the entire thing again all by yourself. And you just learned an important lesson: NEVER exexute commands you dont know what theyre doing". I really did learn a lot on that day and still follow that lesson :D8 -
*Now that's what I call a Hacker*
MOTHER OF ALL AUTOMATIONS
This seems a long post. but you will definitely +1 the post after reading this.
xxx: OK, so, our build engineer has left for another company. The dude was literally living inside the terminal. You know, that type of a guy who loves Vim, creates diagrams in Dot and writes wiki-posts in Markdown... If something - anything - requires more than 90 seconds of his time, he writes a script to automate that.
xxx: So we're sitting here, looking through his, uhm, "legacy"
xxx: You're gonna love this
xxx: smack-my-bitch-up.sh - sends a text message "late at work" to his wife (apparently). Automatically picks reasons from an array of strings, randomly. Runs inside a cron-job. The job fires if there are active SSH-sessions on the server after 9pm with his login.
xxx: kumar-asshole.sh - scans the inbox for emails from "Kumar" (a DBA at our clients). Looks for keywords like "help", "trouble", "sorry" etc. If keywords are found - the script SSHes into the clients server and rolls back the staging database to the latest backup. Then sends a reply "no worries mate, be careful next time".
xxx: hangover.sh - another cron-job that is set to specific dates. Sends automated emails like "not feeling well/gonna work from home" etc. Adds a random "reason" from another predefined array of strings. Fires if there are no interactive sessions on the server at 8:45am.
xxx: (and the oscar goes to) fuckingcoffee.sh - this one waits exactly 17 seconds (!), then opens an SSH session to our coffee-machine (we had no frikin idea the coffee machine is on the network, runs linux and has SSHD up and running) and sends some weird gibberish to it. Looks binary. Turns out this thing starts brewing a mid-sized half-caf latte and waits another 24 (!) seconds before pouring it into a cup. The timing is exactly how long it takes to walk to the machine from the dudes desk.
xxx: holy sh*t I'm keeping those
Credit: http://bit.ly/1jcTuTT
The bash scripts weren't bogus, you can find his scripts on the this github URL:
https://github.com/narkoz/...53 -
POSTMORTEM
"4096 bit ~ 96 hours is what he said.
IDK why, but when he took the challenge, he posted that it'd take 36 hours"
As @cbsa wrote, and nitwhiz wrote "but the statement was that op's i3 did it in 11 hours. So there must be a result already, which can be verified?"
I added time because I was in the middle of a port involving ArbFloat so I could get arbitrary precision. I had a crude desmos graph doing projections on what I'd already factored in order to get an idea of how long it'd take to do larger
bit lengths
@p100sch speculated on the walked back time, and overstating the rig capabilities. Instead I spent a lot of time trying to get it 'just-so'.
Worse, because I had to resort to "Decimal" in python (and am currently experimenting with the same in Julia), both of which are immutable types, the GC was taking > 25% of the cpu time.
Performancewise, the numbers I cited in the actual thread, as of this time:
largest product factored was 32bit, 1855526741 * 2163967087, took 1116.111s in python.
Julia build used a slightly different method, & managed to factor a 27 bit number, 103147223 * 88789957 in 20.9s,
but this wasn't typical.
What surprised me was the variability. One bit length could take 100s or a couple thousand seconds even, and a product that was 1-2 bits longer could return a result in under a minute, sometimes in seconds.
This started cropping up, ironically, right after I posted the thread, whats a man to do?
So I started trying a bunch of things, some of which worked. Shameless as I am, I accepted the challenge. Things weren't perfect but it was going well enough. At that point I hadn't slept in 30~ hours so when I thought I had it I let it run and went to bed. 5 AM comes, I check the program. Still calculating, and way overshot. Fuuuuuuccc...
So here we are now and it's say to safe the worlds not gonna burn if I explain it seeing as it doesn't work, or at least only some of the time.
Others people, much smarter than me, mentioned it may be a means of finding more secure pairs, and maybe so, I'm not familiar enough to know.
For everyone that followed, commented, those who contributed, even the doubters who kept a sanity check on this without whom this would have been an even bigger embarassement, and the people with their pins and tactical dots, thanks.
So here it is.
A few assumptions first.
Assuming p = the product,
a = some prime,
b = another prime,
and r = a/b (where a is smaller than b)
w = 1/sqrt(p)
(also experimented with w = 1/sqrt(p)*2 but I kept overshooting my a very small margin)
x = a/p
y = b/p
1. for every two numbers, there is a ratio (r) that you can search for among the decimals, starting at 1.0, counting down. You can use this to find the original factors e.x. p*r=n, p/n=m (assuming the product has only two factors), instead of having to do a sieve.
2. You don't need the first number you find to be the precise value of a factor (we're doing floating point math), a large subset of decimal values for the value of a or b will naturally 'fall' into the value of a (or b) + some fractional number, which is lost. Some of you will object, "But if thats wrong, your result will be wrong!" but hear me out.
3. You round for the first factor 'found', and from there, you take the result and do p/a to get b. If 'a' is actually a factor of p, then mod(b, 1) == 0, and then naturally, a*b SHOULD equal p.
If not, you throw out both numbers, rinse and repeat.
Now I knew this this could be faster. Realized the finer the representation, the less important the fractional digits further right in the number were, it was just a matter of how much precision I could AFFORD to lose and still get an accurate result for r*p=a.
Fast forward, lot of experimentation, was hitting a lot of worst case time complexities, where the most significant digits had a bunch of zeroes in front of them so starting at 1.0 was a no go in many situations. Started looking and realized
I didn't NEED the ratio of a/b, I just needed the ratio of a to p.
Intuitively it made sense, but starting at 1.0 was blowing up the calculation time, and this made it so much worse.
I realized if I could start at r=1/sqrt(p) instead, and that because of certain properties, the fractional result of this, r, would ALWAYS be 1. close to one of the factors fractional value of n/p, and 2. it looked like it was guaranteed that r=1/sqrt(p) would ALWAYS be less than at least one of the primes, putting a bound on worst case.
The final result in executable pseudo code (python lol) looks something like the above variables plus
while w >= 0.0:
if (p / round(w*p)) % 1 == 0:
x = round(w*p)
y = p / round(w*p)
if x*y == p:
print("factors found!")
print(x)
print(y)
break
w = w + i
Still working but if anyone sees obvious problems I'd LOVE to hear about it.38 -
The contact forms sent emails from no-reply@ and in the last meeting the client told us a colleague of them asked once who "No repli" was and why he's not answering her emails. Well...
(German client, so she may not knew what "no reply" means)2 -
Anyone seen the drama with Notepad++ and China? Politics isn't allowed on devRant but here's a link: https://zdnet.com/article/...40
-
S̠̪͓͓͐̑̑ͥȉ͎̦̬̱̤̣ͯ̆ͩ̃̌n̦̙̙̦͉̟̟͋ͬ̉ͫ̍̈́̚c͓̰͚͚̆̎ͦͫe ̹ͨ̚ͅt̠̟̦͍͕̑̾ͬͬ͒ͦͅǒ̪̩̑m͍̖̭o̝̬͚̦̥̺r͌̋ṙ̒̐̄ò͙͓ͭw ͩ̔̿̎ͤ̋ͮi̼̭̦ͥͣ͒s̪̰̃̂ ̲̰̮̣̮̌ͭͬ͆̔H͉̳a̠̲̟̹͓̰͎͐͆ͥ̓͋̍̎llo̱̺͖̲͑̒̿ͨw̜͓̟̺̹̹ḙ̭̳̬͇̻ê͖̼̮ͥ́n͉̺͑̽,̫̲ͪ̅ ̫̲͓̟̳̋͊̇̆̈̓ͅľ̠̰̅et̠̩̟̦͉̦͕͐̓ͦ͌ͩͥ̓s̱̓ p͔͚͈͎̰͓̘ra̰̘̥̗̲̯͓n͎̪̠̗͎̬k̈ͬ̊͛̉̅̚ ȏ̻͇̫̰̞ͣ̌̄̌uͤͭ͑ͯr͉̗ͅ ͊̊ñ͙̯͈͑͑o̗̙̍ͤn-͚̘͎̣͑͊͑̇̔ͅtͨ̽̿͑̇̚ḙ̱̾ͭc͍h ̯͖̓ͯf͓̗̥͔̥̬̎͒ͤ́͒ͯr͍͙̋̋ȉ̤en̥̻̦̥d̟̜̟ͬͩ̈́s͍͕̦̭̣͉̿̔̇ͯͥͬ ̲͛w̞̽i̥͕̙̹ͅt͖̠͕̒̍̈́h͉ ͊͐ẗ̒́̄̍͊h̗̜͔ͅi̖̟̫ͪͨ͊͊́ͅͅs ͚̩̟̐ͦͩ̔ͅz̰̫̦̹͖̙ͅḁ̗̬̪̪̰̋̐̂̈́̑͆l͂̓͐̈́g͖ŏ͓̘̳̝̩͍̯͆̈̎̈̍̚ ̫̞͕̺̣̌ͬ͛͋̿t̤̰͍̼̘͖͈́̇̄̂ͭͬͮe̘͖̠̠̓̊ͤ̅x͉͙͎͈ͩ̂̉͂t͙̞̣̖͖̀̎̽ͮ̇.͎̣̤6
-
So once upon a time I had this dream while I was sleeping:
I was programming this videogame while I was inside of it.
It was something like VR where I had a tron-like world and I was the god in there, I was able to make and destroy anything as I pleased.
What I did was making a sort of challenge where you had to destroy someone else's kingdom by accessing it via FTP and then just destroy the useful files to kill defences and then become an actual king of that place.
Once awake I started thinking of making this whole thing into an actual game, but then I started reading the documentation for FTP connection in C# (I was thinking about using Unity) and literally stopped thinking about making it.2 -
I fucking hate chained methods. Ok, not all of them. Query things like array.where.first... that stuff is ok.
Specially if it's part of the std lib of a lang, which would be probably written by a very competent coder and under scrutiny.
But if you're not that person, chances are you'll produce VASTLY inferior code.
I'm talking about things like:
expect(n).to.be(x).and.not(y)
And the reason I don't like it is because it's all fine and dandy at first.
But once you get to the corner cases, jesus christ, prepare to read some docpages.
You end up reading their entire fucking docs (which are suboptimal sometimes) trying to figure if this fucking dsl can do what you need.
Then you give up and ask in a github issue. And the dev first condescends you and then tells you that the beautiful eden of code he created doesn't let you do what you want.
The corner cases usually involve nesting or some very specific condition, albeit reasonable.
This kind of design is usually present in testing or validation js libraries. And I hate all of those for it.
If you want a modern js testing lib that doesn't suck ass, check avajs. It's as simple as testing should be.
No magic globals, no chaining, zero config. Fuck globals forced by libs.
But my favorite thing about it that is I can put a breakpoint wherever the fuck I want and the debugger stops right fucking there.
Code is basically lines of statements, that's it, and by overusing chaining, by encouraging the grouping of dozens of statements into one, you are preventing me from controlling these statements on MY code.
As an end dev, I only expect complexity increases to come from the problems themselves rather than from needlessly "beautified" apis.
When people create their own shitty dsl, an image comes to my mind of an incoherent rambling man that likes poetry a lot and creates his own martial art, which looks pretty but will get your ass kicked against the most basic styles of fighting.
I fucking hate esoteric code.
Even if I had to execute a list of functions, I'd rather send them in an array instead of being able to chain them because:
a) tree shaking would spare from all the functions i didn't import
b) that's what fucking arrays are for, to contain several things.
This bad style of coding is a result of how low the barrier to code in higher level langs are.
As a language or library gets easier to use you might think that's a positive thing. But at the same time it breeds laziness.
Js has such a low learning curve that it attacts the wrong kind of devs, the lazy, the uninspired, the medium.com reader, the "i just care about my paycheck" ones.
Someone might think that by bashing bad js devs I'm trying to elevate myself.
That'd be extremely stupid. That's like beating a retarded blind man in a game and then saying "look, I'm way better than this retarded blind man".
I'm not on a risky point of view, just take a stroll down npmjs.com. That place is a landfill. Not really npm's fault, in fact their search algorithm is good.
It's just the community.
Every lang has a ratio of competence. Of competent to incompetent devs.
You have the lang devs and most intelligent lib devs at the top. At the bottom you have the bottom.
Well js has a horrible ratio. I wouldn't be shocked to find out that most js devs still consider using import or await the future.
You could say that js improved a lot, that it was way worse beforr. But I hate chaining now, and i hated back then!
On top of this, you have these blog web companies, sucking the "js tutorial" business tit dry, pumping out the most obscenely unprofessional and bar lowering tutorials you can imagine, further capping the average intelligence of most js devs.
And abusing SEO while they're at it, littering the entire web with copy paste content.2 -
The one thing I need, a "LATIN SMALL LETTER REVERSED C WITH DIAERESIS" doesn't seem to exist but "LATIN SMALL LETTER C WITH DIAERESIS" the one thing that I don't need, does D:
Like there's a god dang sideways u with an umlaut (or diaeresis I guess) but not a reversed c̈? pls9 -
One of the coolest good bye message I have ever seen in my company...
The code is so clean with proper comments...11 -
Today I had to tolerate hearing the word ‘actually’ between every pair of words in a one hour seminar. Man I don’t think I can take anymore sessions from that guy. I wanted to scratch out my grey matter.8
-
Ok so I have never really used motors before so I have no idea what I am doing, but I was wondering how to calculate how much weight a motor could move.
Say I have a trolley that weights ~300kg, and I attached a motor to each of its 4 wheels how would I calculate if it would move/what would be needed to move it, and how would I know the RPM of the motors. (Friction can be ignored and it would be on a flat surface)
Also, if I added 4 more motors to turn the wheels, since its just moving a small wheel and it wont be supporting the weight, could it be weaker than the other motors, or would the force that the wheel is experiencing from the trolleys weight effect the turning of the motor.1 -
This is what I love about fellow devs - they know what's best, you don't need to ask something like "please keep adding xyz to your post so we can see if it...". We just do it. :32
-
If doctors were like software engineers, they would say things like “Have you tried killing yourself and being reborn?”4
-
Ok, who among you crazy people came up with this idea? https://userinyerface.com
That website is the UX equivalent of murder 1. It took skill, planning and a very special brand of crazy to create.10