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 - "round numbers"
-
Welcome back to practiseSafeHex's new life as a manager.
Episode 2: Why automate when you can spend all day doing it by hand
This is a particularly special episode for me, as these problems are taking up so much of my time with non-sensical bullshit, that i'm delayed with everything else. Some badly require tooling or new products. Some are just unnecessary processes or annoyances that should not need to be handled by another human. So lets jump right in, in no particular order:
- Jira ... nuff said? not quite because somehow some blue moon, planets aligning, act of god style set of circumstances lined up to allow this team to somehow make Jira worse. On one hand we have a gigantic Jira project containing 7 separate sub teams, a million different labels / epics and 4.2 million possible assignees, all making sure the loading page takes as long as possible to open. But the new country we've added support for in the app gets a separate project. So we have product, backend, mobile, design, management etc on one, and mobile-country2 on another. This delightfully means a lot of duplication and copy pasting from one to the other, for literally no reason what so ever.
- Everything on Jira is found through a label. Every time something happens, a new one is created. So I need to check for "iOS", "Android", "iOS-country2", "Android-country2", "mobile-<feature>", "mobile-<feature>-issues", "mobile-<feature>-prod-issues", "mobile-<feature>-existing-issues" and "<project>-July31" ... why July31? Because some fucking moron decided to do a round of testing, and tag all the issues with the current date (despite the fact Jira does that anyway), which somehow still gets used from time to time because nobody pays attention to what they are doing. This means creating and modifying filters on a daily basis ... after spending time trying to figure out what its not in the first one.
- One of my favourite morning rituals I like to call "Jira dumpster diving". This involves me removing all the filters and reading all the tickets. Why would I do such a thing? oh remember the 9000 labels I mentioned earlier? right well its very likely that they actually won't use any of them ... or the wrong ones ... or assign to the wrong person, so I have to go find them and fix them. If I don't, i'll get yelled at, because clearly it's my fault.
- Moving on from Jira. As some of you might have seen in your companies, if you use things like TestFlight, HockeyApp, AppCenter, BuddyBuild etc. that when you release a new app version for testing, each version comes with an automated change-log, listing ticket numbers addressed ...... yeah we don't do that. No we use this shitty service, which is effectively an FTP server and a webpage, that only allows you to host the new versions. Sending out those emails is all manual ... distribution groups?? ... whats that?
- Moving back to Jira. Can't even automate the changelog with a script, because I can't even make sense of the tickets, in order to translate that to a script.
- Moving on from Jira. Me and one of the remote testers play this great game I like to call "tag team ticketing". It's so much fun. Right heres how to play, you'll need a QA and a PM.
*QA creates a ticket, and puts nothing of any use inside it, and assigns to the PM.
*PM fires it back asking for clarification.
*QA adds in what he feels is clarification (hes wrong) and assigns it back to the PM.
*PM sends detailed instructions, with examples as to what is needed and assigns it back.
*QA adds 1 of the 3 things required and assigns it back.
*PM assigns it back saying the one thing added is from the wrong day, and reminds him about the other 2 items.
*QA adds some random piece of unrelated info to the ticket instead, forgetting about the 3 things and assigns it back.
and you just continue doing this for the whole dev / release cycle hahaha. Oh you guys have no idea how much fun it is, seriously give it a go, you'll thank me later ... or kill yourselves, each to their own.
- Moving back to Jira. I decided to take an action of creating a new project for my team (the mobile team) and set it up the way we want and just ignore everything going on around us. Use proper automation, and a kanban board. Maybe only give product a slack bot interface that won't allow them to create a ticket without what we need etc. Spent 25 minutes looking for the "create new project" button before finding the link which says I need to open a ticket with support and wait ... 5 ... fucking ... long ... painful ... unnecessary ... business days.
... Heres hoping my head continues to not have a bullet hole in it by then.
Id love to talk more, but those filters ain't gonna fix themselves. So we'll have to leave it here for today. Tune in again for another episode soon.
And remember to always practiseSafeHex13 -
In a programming contest, I forgot how to round numbers in Java, an I needed a 3 number rounding, so I multiplied the number by 1000, then sum 0.5 and convert it to integer so the decimal part would be gone, finally, just print the number except the 3 last digits as a string, put a period and print the other 3 digits.
I must say I'm not proud of that.5 -
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 -
I got a crap raise — lowest I’ve ever gotten anywhere, and well below inflation — despite busting my butt, having somewhat better health and therefore productivity, etc.
I complained to my boss about it, and said it was insulting. He said that direct managers have zero say in raises, and instead it’s entirely up to execs and HR. Makes sense, since nothing makes sense at this company.
Anyway, he apparently talked to his boss, who talked with his boss, who talked with the execs and HR, and they decided to give me a raise on my raise, a whole $1k/year more, all the way back up to the usual insultingly-low 3%. Yay.
Their reasoning?
“Money is tight.”
The last all-hands?
“Record profits! Record sales! Record numbers across the board! And most of all: record profits! Give yourselves a round of applause for making this all possible!”
Money is tight, eh?
I hope they get smushed by a meteor, given a snuggle-struggle by a roving Somali gang, or kept warm for the rest of their lives by another Hawaiian/Californian wildfire.14 -
At a job interview.
Them: Can you please write a function that calculates fibonacci numbers on the whiteboard please.
Me:
fib=_=>($=>$.round(($.pow((1+$.sqrt(5))/2,_)-$.pow(-2/(1+$.sqrt(5)),_))/$.sqrt(5)))(Math)18 -
Manager: "Can we get an accurate report on how many containers we have on the Kubernetes cluster?"
Me: "Well not really since Kubernetes is designed to be dynamic and agile with the number of resources and containers being created and deleted being subject to change at a moment's notice."
Manager: "I want numbers"
Me: "Okay well if we look at a simple moving average over time, we can see how the number of containers changes and then grab a rough answer from that"
Manager: "These numbers look a little round, are you sure these are exact?"
I'm going to throw myself into a pile of used heroin needles and hope i get stuck with whatever the hell this guy has to somehow be a manager while also being this retarded.15 -
In my last rant (https://devrant.com/rants/5523458/...) I regaled you lovely folks of how I had to diplomatically yet firmly defend my work/life boundaries during off-work hours for non-life threatening affairs (a frustratingly common occurrence), and concluded the thread by mentioning that I still had a job, but would make a note of my frustration of that for whatever exit interview happens.
Well, no need for those notes any longer.
I and half of the engineering force, along with several senior managers were laid off this morning in the form of a "mandatory on-site all hands".
I live and work in NYC. Several people took trains and booked rooms from as far away as Boston to be here (or at least I know of specifically two people who commuted up here on Sunday to be here for the "all hands"). I presume those people used their travel benefits to get here and back.
We were dismissed before the meeting even took place, and according to a coworker I became friends with (yes, despite my snarky comments in other threads, I *do* actually have coworkers I became friends with lol) who survived at least this round of layoffs, once the actual all-hands commenced, the company first disclosed the layoffs, then announced being awarded a major contract with the very client the entire org had been working on overdrive to win for the last nine months. He had already been looking for a new job and got an offer last Friday, had been mulling it over, but told me once we were off the phone he was calling them up and accepting. He had three people reporting to him, and lost two. Even he had no idea it was coming until one of his now-former subordinates asked him to come outside and told him they'd just been let go.
I knew going in to this startup that "it's a startup, anything can happen, just mind the gap". That's why I asked on numerous occasions and tried to get time with our CFO to ask about revenue and earnings; things that in my years at this place were never disclosed to the rank and file, I'm not a professional accountant or CPA by any means, but I did take a pair of corporate accounting classes in community college because I like the numbers (see my other rants about leaving the field and becoming a math teacher), and I was really curious to know how the financial health of the business was.
It wasn't so much a red flag as it was an orangish-yellow that no one ever answered those questions, or that the CFO was distant but not necessarily cagey about my requests for his time; other indicators were good while interviewing--they had multiple fully integrated, paying customers (one of which being a former employer from years ago, which aided me in having strong product familiarity during the job interview), but I guess not enough to be sustainable.
Anyway. I'm gonna use the rest of the week to be a bum, might get out of the city and go hang with friends Pittsburgh, eat some hoagies and just vibe for a while. I've got assets and money stashed up to float pretty easily for a while, plus a bit of fun money so losing the job isn't world ending. Generalized anxiety because everything is going to shit worldwide, but that quickly faded into the backdrop of the generalized anxiety I always have because existentialism or something like that.
Thanks for reading. Pay the teachers.5 -
My LinkedIn is usually pretty quiet. Recently I've received quite a few messages from recruiters. Some of them put numbers in and I look at them, well, the market looks hot.
I like where I am but doesn't hurt to have a look around eh? So I went through some interviews and shit. No preps, not trying to please anyone, being completely honest. And out of the 3 I tried, 1 got to the final round.
Before the final round, the recruiter kept harassing me (it's their job really) about what my "bottom line" is. She said they really liked me but I'm not up to their expectation as a senior role. So they want to proceed with a non-senior role, then climb my ladder up. I told her, I don't give a shit about the title. The she said for that, the salary will be "adjusted" (reads reduced). I told her, look, I said I wouldn't bother if the offer is anything less than X amount of money. Then she said but this company would offer 10% bonus, which will add up , mind you, "close to" X. She said she wanted to know so we don't waste the director's time (as the final round is to meet the bloody director).
I said, if I need to disclose my bottom line before going to this, which is pretty much my negotiation, then let's call it off. No point wasting my time either.
The next day I received the last call from her. They fucked right off.
I know everyone here already knows. But let me experience be another example of how a plague recruiters is. I don't have any experience like this before but this is probably a fucking lowball case too.3 -
Friends, gather round for a story of "the user".
Two days ago I assisted a friend in reviving their scammed Instagram account with final confirmation it was back in their possession yesterday. I stated "make sure you clean out phone numbers, emails and change the password. WHATEVER YOU DO DON'T USE THE SAME PASSWORD"....I bet you know where this is going....
Queue 6:45am: "HELP! THEY DID IT AGAIN! THEY TOOK MY FACEBOOK THIS TIME TOO!" as a safety measure, I told her to link them for recoverability.....not thinking you just created a bridge to the facebook...
Now We're going through EVERY account BY HAND and changing EVERY password for EVERY service and enabling MFA. We've also learned the power that the forgot password button wields for everyone.
ProTip: If your friend was "hacked" be patient, friendly and soft to get every detail...sometimes you learn more and can position them better.
Now I'm upset with myself because I couldn't save their accounts and at this point we've lost the only footing we had to them. Social Media is a curse.1 -
Split everything into small tasks, no longer than two days of work
Use Fibonacci numbers, 1-2-3-5-8-13
A highly effective developer will produce about 80% of a work day. If you think a task is done within a day add 25% and your estimate is ten. Remember that we use Fibonacci and round up to 13.1