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 - "pretty print"
-
If Operating Systems Ran The Airlines
UNIX Airways
Everyone brings one piece of the plane along when they come to the airport. They all go out on the runway and put the plane together piece by piece, arguing non-stop about what kind of plane they are supposed to be building.
Air DOS
Everybody pushes the airplane until it glides, then they jump on and let the plane coast until it hits the ground again. Then they push again, jump on again, and so on ...
Mac Airlines
All the stewards, captains, baggage handlers, and ticket agents look and act exactly the same. Every time you ask questions about details, you are gently but firmly told that you don't need to know, don't want to know, and everything will be done for you without your ever having to know, so just shut up.
Windows Air
The terminal is pretty and colorful, with friendly stewards, easy baggage check and boarding, and a smooth take-off. After about 10 minutes in the air, the plane explodes with no warning whatsoever.
Windows NT Air
Just like Windows Air, but costs more, uses much bigger planes, and takes out all the other aircraft within a 40-mile radius when it explodes.
Linux Air
Disgruntled employees of all the other OS airlines decide to start their own airline. They build the planes, ticket counters, and pave the runways themselves. They charge a small fee to cover the cost of printing the ticket, but you can also download and print the ticket yourself. When you board the plane, you are given a seat, four bolts, a wrench and a copy of the Seat-HOWTO.html. Once settled, the fully adjustable seat is very comfortable, the plane leaves and arrives on time without a single problem, the in-flight meal is wonderful. You try to tell customers of the other airlines about the great trip, but all they can say is, "You had to do what with the seat?"10 -
I was registering for a website, and on a whim, I used this as my username:
null'); PRINT('Hello');--
And sure enough, the login system went down. The next day it was still down, so I went to Twitter to tell the people running the site that this was why, but to my surprise, I see them saying they had been hacked.
Based on the timing, I'm pretty sure they're referring to this, but they are saying user info was stolen. *facepalm*
They later said they stored passwords salted with a fixed salt and hashed with fucking md5, at which point I was glad not to have done any more business with them.
How incompetent can these fucking people be?!14 -
Client: You are bad developers. Your code has bugs and the site isn't even pretty. And why is it so damn expensive??
Us: ...
Same client (a month later): I need this campaign landing page with the option to register and an admin for user management. It should be done till the day after tomorrow because the URL is already in print. Here's the catalogue (in .pdf) in which it will appear. Use it as a style guide.
FUCK YOU!2 -
I worked for over 13 hours yesterday on super-urgent projects. I got so much done it's insane.
Projects:
1) the printer auto-configuration script.
2) changing Stripe from test mode to live mode in production
3) website responsiveness
I finished two within five minutes and pushed to both QA and Production. actually urgent, actually necessary. Easy change.
The printer auto-configure script was honestly fun to write, if very involved. However, the APIs I needed to call to fetch data, create a printer client, etc... none of them were tested, and they were _all_ broken in at least two ways. The CTO (api guy in my previous rant) was slow at fixing them, so getting the APIs working took literally four hours. One of them (test print) still doesn't work.
Responsiveness... this was my first time making a website responsive. Ever. Also, one of the pages I needed to style was very complicated (nested fixed-aspect-ratio + flexbox); I ended up duplicating the markup and hacking the styling together just to make it work. The code is horrible. But! "Friday's the day! it's going live and we're pushing traffic to it!" So, I invested a lot of time and energy into making it ready and as pretty as I could, and finally got it working. That page alone took me two hours.
The site and the printer script (and obv the Stripe change as well) absolutely needed to be done by this morning. Super important.
well.
1) Auto-configure script. Ostensibly we would have an intern come in and configure the printers. However, we have no printers that need configuring, so she did marketing instead. :/ Also, the docs Epson sent us only work for the T88V printer (we have exactly one, which we happened to set up and connect to). They do not work for the T88VI printers, which is what we ordered. and all we'll ever be ordering. So. :/ I'll need to rewrite a large chunk of my code to make this work. Joy :/
2) Stripe Live mode. Nobody even seemed to notice that we were collecting info in Test mode, or that I fixed it. so. um. :/
3) Responsiveness.
Well. That deadline is actually next Wednesday. The marketing won't even start until then, and I haven't even been given the final changes yet (like come on). Also! I asked for a QA review last night before I'd push it to production. One person glanced at it. Nobody else cared. Nobody else cared enough to look in the morning, either, so it's still on QA. Super-important deadline indeed. :/
Honestly?
I feel like Alice (from Dilbert) after she worked frantically on urgent projects that ended up just being cancelled. (That one where Wally smells that lovely buttery-popcorn scent of unnecessary work.)
I worked 13 hours yesterday.
for nothing.
fucking. hell.undefined fuck off we urgently don't need this yet! unnecessary work unsung heroine i'm starting to feel like dark terra.7 -
I'm extremely lucky I'm not violent person. What happened today for some reason just completely pissed me off. I'm not sure why it got under my skin so much, but I feel completely disrespected.
I went to our marketing person's office to discuss a basic requirement for our api. Very simply, we have a lot of old shitty date that doesn't have a lot of fields filled out (worse yet, some are simply bogus values like crazy random dates and whatnot).
She put in a ticket claiming our most recent change started changed the creation dates to be empty. Easy enough to disprove, because the marketing software we have shows a records of all the edits for each contact, and if it came from our api it'll be labeled as "Web API". So of course I check the example contacts she give us, and there's no history of changes, meaning they never had the date to begin with (which is correct, as until now we didn't track creation date WHICH IS NOT MY DECISION. So dude 10 years ago probably made that decision).
So I start asking what exactly we're using it for. She does an absolutely horrible job of describing it and keeps telling me "no you absolutely have to be able to do all this, it's our requirements". By "this" she wants me to magically give all these contacts correct creation dates after the fact.
Eventually she gets the whole campaign idea out and I point, politely, that they're probably violating GDPR. She starts yelling saying her and her boss have been doing marketing for years and they know what they're doing. So I (less politely this time) said that's fine, I just want to talk with her boss to make sure he understands he's in the grey area and that if I'm the one building this, I'm kind of liable as well.
She clearly didn't like that, but I thought whatever, let's just agree on some requirements and I'll pass it on to my boss (who genuinely shits on her every single day and is constantly saying she never knows what she's doing).
So I go back , do some work. A little later I have to go print something off which is next to her office. Her door is shut, but I can hear her from down the hall yelling at someone about the conversation we just had. She actually starts mocking me. Doing the "stupid person" voice. This goes on for longer than our conversation.
Like I said, I know I'm right and she's just venting because she doesn't want to admit she's made a mistake. But for some reason it just completely broke me. I'm new but up until this point everyone had been pretty open about how they feel about me and my co-worker. But she just didn't need to go that bloody far.9 -
I know it's not done yet but OOOOOH boy I'm proud already.
Writing a JSON parser in Lua and MMMM it can parse arrays! It converts to valid Lua types, respects the different quotation marks, works with nested objects, and even is fault-tolerant to a degree (ignoring most invalid syntax)
Here's the JSON array I wrote to test, the call to my function, and another call to another function I wrote to pretty print the result. You can see the types are correctly parsed, and the indentation shows the nested structure! (You can see the auto-key re-start at 1)
Very proud. Just gotta make it work for key/value objects (curly bracket bois) and I'm golden! (Easier said than done. Also it's 3am so fuck, dude)15 -
OK, so we had a session in which a so called Company (Some ecorise.in ) came to give Internship-Training-Program. Ok, he said it'll take 5-8 minutes, and then it took fucking 75 minutes for the session to end. Horrible blunders he made.
1) Did not tell about the company and important stuff for the first 50-60 minutes. Instead, was just focusing on why you should do an Internship, what is it's benefit, what does a company want from you. And why this Internship-Training Program is important... I mean seriously? - A training for Internship. 🤦🏻♂️
2) Said all the Web Developers can be Mobile App Developers with the help of just HTML and CSS.... Wow, so XAML/XML is shit now, and we will call APIs with the help of CSS rules. 🤦🏻♂️
OK, still I tolerated all that, then was the part when he said how much will be the stipend. It was fucking nothing, they said. That for first three months they will not give a single penny as it is training, and then IF the performance is good, then they will give stipend, and then Placement assurance. OK, that's good that they are assuring placement, but wait. Package of 2LPA INR... WTF Man, it's like $3107.28 for a whole Year.
OK, that too tolerated, then was the part when they said that they'll take the written test, I was like OK, let's see. We moved to a classroom, it went over-the-full capacity, so we moved back to the seminar hall. (Arrrrgggghhhhhhhhh), still tolerable. But then that guy realised that there were no question papers to take the test, then sent someone to get the print outs. Wasted 15+ minutes, I was burning inside.
In the whole seminar hall, I stood up and said, that when you knew there will be a test, why didn't you pre-prepared the sheets beforehand, he was like, that we didn't knew the count. But his tone was. like he got offended and Get-Lost-ed me out of the seminar.
Then even I said:
🙏🏻 - Nahi chaahiye aapki Company
(🙏🏻 - I don't want your Company).
And moved out.
But my point, I am a third Year College Student, and this Company came for our benefit, but I did so (and I am not sorry), so that's pretty obvious that the Company guy will talk (bitch) to the teachers about me, and tomorrow will be a bad day for me... But isn't it wrong on the side of the company also?
I mean, there was an attendance sheet passed in the beginning of the session, had he taken count from that and got the sheets printed, (He had almost an hour for that).
Secondly, when they knew that the count of students is more than expected, then why didn't they check for the classroom that whether the class can accommodate so many students or not. If not then something would have been planned accordingly... But no, the Guy (I guess, that small Company's Owner) got offended that a Student back-chat-ted a CEO of a so-called company, and so he just had to "Get-Lost" me. Checked the website of his Company, they have hardly done 3 Static Websites... I mean, WoW, I have done at-least 10X the work of the Company, alone!
I don't know, I feel happy that I kept my point, but I feel sad because I generally don't do this kind of thing (may be my tone was also wrong, I had other issues also, may be because of them and they all combined and this happened). I feel scared too, that I don't know what the Company guy will say to my teachers and what action will they take against me...
Because I know, none of my friends will stand with me when I go down, it's all fake here, everyone can just give sympathy, but nothing else.
I don't know why I am posting this here, and if you have read this till here, thank you. I just wanted to share my heart out... :-)9 -
some people are just worst than the devil.
int main()
{for (int i=0;i<5;i++)
{for(int j=i;j<5;j--)
{printf("*");
}printf("\n");
}
}
(some dude from class wrote that)9 -
Two big moments today:
1. Holy hell, how did I ever get on without a proper debugger? Was debugging some old code by eye (following along and keeping track mentally, of what the variables should be and what each step did). That didn't work because the code isn't intuitive. Tried the print() method, old reliable as it were. Kinda worked but didn't give me enough fine-grain control.
Bit the bullet and installed Wing IDE for python. And bam, it hit me. How did I ever live without step-through, and breakpoints before now?
2. Remember that non-sieve prime generator I wrote a while back? (well maybe some of you do). The one that generated quasi lucas carmichael (QLC) numbers? Well thats what I managed to debug. I figured out why it wasn't working. Last time I released it, I included two core methods, genprimes() and nextPrime(). The first generates a list of primes accurately, up to some n, and only needs a small handful of QLC numbers filtered out after the fact (because the set of primes generated and the set of QLC numbers overlap. Well I think they call it an embedding, as in QLC is included in the series generated by genprimes, but not the converse, but I digress).
nextPrime() was supposed to take any arbitrary n above zero, and accurately return the nearest prime number above the argument. But for some reason when it started, it would return 2,3,5,6...but genprimes() would work fine for some reason.
So genprimes loops over an index, i, and tests it for primality. It begins by entering the loop, and doing "result = gffi(i)".
This calls into something a function that runs four tests on the argument passed to it. I won't go into detail here about what those are because I don't even remember how I came up with them (I'll make a separate post when the code is fully fixed).
If the number fails any of these tests then gffi would just return the value of i that was passed to it, unaltered. Otherwise, if it did pass all of them, it would return i+1.
And once back in genPrimes() we would check if the variable 'result' was greater than the loop index. And if it was, then it was either prime (comparatively plentiful) or a QLC number (comparatively rare)--these two types and no others.
nextPrime() was only taking n, and didn't have this index to compare to, so the prior steps in genprimes were acting as a filter that nextPrime() didn't have, while internally gffi() was returning not only primes, and QLCs, but also plenty of composite numbers.
Now *why* that last step in genPrimes() was filtering out all the composites, idk.
But now that I understand whats going on I can fix it and hypothetically it should be possible to enter a positive n of any size, and without additional primality checks (such as is done with sieves, where you have to check off multiples of n), get the nearest prime numbers. Of course I'm not familiar enough with prime number generation to know if thats an achievement or worthwhile mentioning, so if anyone *is* familiar, and how something like that holds up compared to other linear generators (O(n)?), I'd be interested to hear about it.
I also am working on filtering out the intersection of the sets (QLC numbers), which I'm pretty sure I figured out how to incorporate into the prime generator itself.
I also think it may be possible to generator primes even faster, using the carmichael numbers or related set--or even derive a function that maps one set of upper-and-lower bounds around a semiprime, and map those same bounds to carmichael numbers that act as the upper and lower bound numbers on the factors of a semiprime.
Meanwhile I'm also looking into testing the prime generator on a larger set of numbers (to make sure it doesn't fail at large values of n) and so I'm looking for more computing power if anyone has it on hand, or is willing to test it at sufficiently large bit lengths (512, 1024, etc).
Lastly, the earlier work I posted (linked below), I realized could be applied with ECM to greatly reduce the smallest factor of a large number.
If ECM, being one of the best methods available, only handles 50-60 digit numbers, & your factors are 70+ digits, then being able to transform your semiprime product into another product tree thats non-semiprime, with factors that ARE in range of ECM, and which *does* contain either of the original factors, means products that *were not* formally factorable by ECM, *could* be now.
That wouldn't have been possible though withput enormous help from many others such as hitko who took the time to explain the solution was a form of modular exponentiation, Fast-Nop who contributed on other threads, Voxera who did as well, and support from Scor in particular, and many others.
Thank you all. And more to come.
Links mentioned (because DR wouldn't accept them as they were):
https://pastebin.com/MWechZj912 -
Follow-up to my previous story: https://devrant.com/rants/1969484/...
If this seems to long to read, skip to the parts that interest you.
~ Background ~
Maybe you know TeamSpeak, it's basically a program to talk with other people on servers. In TeamSpeak you can generate identities, every identity has a security level. On your server you can set a minimum security level you need to connect. Upgrading the security level takes longer as the level goes up.
~ Technical background ~
The security level is computed by doing this:
SHA1(public_key + offset)
Where public_key is your public key in Base64 and offset is an 8 Byte unsigned long. Offset is incremented and the whole thing is hashed again. The security level comes from the amount of Zero-Bits at the beginning of the resulting hash.
My plan was to use my GPU to do this, because I heared GPUs are good at hashing. And now, I got it to work.
~ How I did it ~
I am using a start offset of 0, create 255 Threads on my GPU (apparently more are not possible) and let them compute those hashes. Then I increment the offset in every thread by 255. The GPU also does the job of counting the Zero-Bits, when there are more than 30 Zero-Bits I print the amount plus the offset to the console.
~ The speed ~
Well, speed was the reason I started this. It's faster than my CPU for sure. It takes about 2 minutes and 40 seconds to compute 2.55 Billion hashes which comes down to ~16 Million hashes per second.
Is this speed an expected result, is it slow or fast? I don't know, but for my needs, it is fucking fast!
~ What I learned from this ~
I come from a Java background and just recently started C/C++/C#. Which means this was a pretty hard challenge, since OpenCL uses C99 (I think?). CUDA sadly didn't work on my machine because I have an unsupported GPU (NVIDIA GeForce GTX 1050 Ti). I learned not to execute an endless loop on my GPU, and so much more about C in general. Though it was small, it was an amazing project.1 -
I am forced to use IDE and Text Editor against my will.
I hate eclipse, but what to do, Salesforce support that IDE only, although VSCode has one plugin for that, but it's not the best,
Why I hate Eclipse you ask?
1. Null pointers
2. No Emmet
3. No Autcomplete
4. Runs like shit on Windows 10 (See my last rant for windows 10)
5. no pretty print extensions/plugins for isml
For my personal projects I am forced to work on Sublime because again VSCode decided to drop
1. Syntax Highlighting
2. Autocomplete
for PHP
(Fuck you for hating php)11 -
Can someone help me understand?
I subscribed to a nifty IT-releated magazine, and on its back, there's an ad for "Dedicated root server hosting", nothing unusual at a first glance, but after I read the issue, I decided to humor them and see what it is that they offered, and... It just... Doesn't make sense to me!
An ad for "Dedicated Root Server" - What is a dedicated root server first of all? Root servers of any infrastructure sound pretty important.
But, the ad also boasts "High speed performance with the new Intel Core i9-9900K octa-core processor", that's the first weird thing.
Why would anyone responsible enough want to put an i9 into a highly-reliable root server, when the thing doesn't even support ECC? Also, come on, octa-core isn't much, I deal with servers that have anywhere between 2 and 24 cores. 8 isn't exactly a win, even if it has a higher per-core clock.
Oh, also, further down the ad has a list of, seeming, advantages/specs of the servers, they proclaim that the CPU "incl. Hyper-Threading-Technology"... Isn't that... Standard when it comes to servers? I have never seen a server without hyperthreading so far at my job.
"64 GBs of DDR4 RAM" - Fair enough, 64 gigs is a good amount, but... Again, its not ECC, something I would never put into a server.
"2 x 8 TB SATA Enterprise Hard Drive 7200 rpm" - Heh, "enterprise hard drive", another cheap marketing word, would impress me more if they mentioned an actual brand/model, but I'll bite, and say that at least the 7200 rpm is better than I expected.
"100 GBs of Backup Space" - That's... Really, really little. I've dealt with clients who's single database backup is larger than that. Especially with 2x8 TB HDD (Even accounting for software raids on top)
This one cracks me up - "Traffic unlimited"
Whaaaat?! You are not gonna give me a limit to the total transferred traffic to the internet for my server in your data center? Oh, how generous of you, only, the other case would make the server just an expensive paperweight! I thought this ad was for semi-professionals at least, so why mention traffic, and not bandwidth, the thing that matters much more when it comes to servers? How big of a bandwidth do I get? Don't tell me you use dialup for your "Dedicated Root Server"s!
"Location Germany or Finland" - Fair enough, geolocation can matter when it comes to latency.
"No minimum contract" - Oooh, how kiiiind of you, again, you are not gonna charge me extra for using the server only as long as I pay? How nice!
"Setup Fee £60" - I guess, fair enough, the server is not gonna set itself up, only...
The whole ad is for "monthly from £55.50", that's quite the large fee for setup.
Oh, and a cherry on top, the tiny print on the bottom mentions: "All prices exclude VAT and are a subject to..." blah blah blah.
Really? I thought that this sort of almost customer deceipt is present only in the common people's sphere!
I must say, there's being unimpressed, and then... There's this. Why, just... Why? Anyone understands this? Because I don't...12 -
Had a bad day at work :( They gave me this code for some obscure streaming job and asked me to complete it. Only after 3 days did I realize that the LLD given to me was incorrect as the data model was updated. Another 2 more days, I was able to debug the code and run it successfully— I was able to parse the tables and generate the required frame but not able to stream it back to the output topic as per the LLD. That’s where I needed help but none of my emails/messages were replied to. The main guy who is pretty technical scheduled a code review session with me— I expected that I would run the code and he would spot it something I might’ve missed and why my streaming function isn’t working. Instead, what happened was that he grilled me on each and every line of the code (which had some obscure tables queried) and then got super mad at me saying “Why are we having this code review session if your code is not complete?”. I’m like bruh, you asked for it, and yes, the main parsing logic is done and I’m just having this issue in the last part. And he’s like “Why didn’t you tell me earlier?”. Wtf?! I left at least 5 emails and a dozen messages. He’s like this has to go live on Monday, and I’m like Ok, I’ll work in the weekend. And he’s like “Don’t tell me all these things! You’re not doing me a favor by working on weekends! How am I to ask my colleagues to connect with you separately on Saturday/Sunday? You should have done the on the weekdays itself. What were you doing this whole week?”. Bruh, I was running the code multiple times and debugging it using print statements. All while you were ignoring my attempts to reach out to you. SMH 🤦♂️ I can go on and on about this whole saga.4
-
I decided to learn Flutter, because the idea of a common code base between Android and iOS sounds nice. I'm late to the party, I know.
So I install everything and start typing in the tutorial. TAB... two spaces. I absolutely hate that so let's change it. In the settings, it sends me to a FAQ which more or less says this is the way it is, deal with it. But I want my tabs to be four spaces, every code editor since the dawn of time could do this... I'M PAYING FOR THIS SHIT!!!!!!!
Ok, let's check the JetBrains website, I'm starting to lose my patience, but let's do it. At this point I should also mention that I'm feeling pretty stupid. I mean, I'm checking on the internet about how to do something which obviously must be obvious, why am I not seeing it?
I find a page on the official website. JetBrains' replies are along the lines of "Why would you want that?", "The holly wars between tabs and spaces are over", "Most people like it this way", "The overlords said this is the coding style to be used" (Ok, the last one was me reading between the lines). At the end of the thread, they provide a "hackish solution" (their words, not mine). Which doesn't work. Because why should it?
Not even when PyCharm's debugger randomly shat itself and I had to use print statements I got so angry. That was relatively fine, bugs are a fact of life, and the overall package is good, so I kept paying.
But now you're telling me that I cannot use what should be a common feature of every code editor just because you and the overlords know better?
Well, fuck you and the horse you came in on JetBrains, you've just lost a customer.16 -
Going back home for the holidays means becoming tech support for pretty much the whole family, unluckly.
As soon as I enter my grandparent's home, my grandpa says "Could you print some emails?". I open his laptop, and I start sweating as soon as I see the Windows XP logo popping up. He (obviously) doesn't remember his password, and the only way to access his (mostly defunct) web mail service is Outlook 2003. For some reason, the web mail provider's POP3 server dies, and i spend half an hour trying to explain it. I ended up leaving with him saying "Why are you even going to a computer engineering university."
Ah, family.1 -
Major rant incoming. Before I start ranting I’ll say that I totally respect my professor’s past. He worked on some really impressive major developments for the military and other companies a long time ago. Was made an engineering fellow at Raytheon for some GPS software he developed (or lead a team on I should say) and ended up dropping fellowship because of his health. But I’m FUCKING sick of it. So fucking fed up with my professor. This class is “Data Structures in C++” and keep in mind that I’ve been programming in C++ for almost 10 years with it being my primary and first language in OOP.
Throughout this entire class, the teacher has been making huge mistakes by saying things that aren’t right or just simply not knowing how to teach such as telling the students that “int& varOne = varTwo” was an address getting put into a variable until I corrected him about it being a reference and he proceeded to skip all reference slides or steps through sorting algorithms that are wrong or he doesn’t remember how to do it and saying, “So then it gets to this part and....it uh....does that and gets this value and so that’s how you do it *doesnt do rest of it and skips slide*”.
First presentation I did on doubly linked lists. I decided to go above and beyond and write my own code that had a menu to add, insert at position n, delete, print, etc for a doubly linked list. When I go to pull out my code he tells me that I didn’t say anything about a doubly linked list’s tail and head nodes each have a pointer pointing to null and so I was getting docked points. I told him I did actually say it and another classmate spoke up and said “Ya” and he cuts off saying, “No you didn’t”. To which I started to say I’ll show you my slides but he cut me off mid sentence and just yelled, “Nope!”. He docked me 20% and gave me a B- because of that. I had 1 slide where I had a bullet point mentioning it and 2 slides with visual models showing that the head node’s previousNode* and the tail node’s nextNode* pointed to null.
Another classmate that’s never coded in his life had screenshots of code from online (literally all his slides were a screenshot of the next part of code until it finished implementing a binary search tree) and literally read the code line by line, “class node, node pointer node, ......for int i equals zero, i is less than tree dot length er length of tree that is, um i plus plus.....”
Professor yelled at him like 4 times about reading directly from slide and not saying what the code does and he would reply with, “Yes sir” and then continue to read again because there was nothing else he could do.
Ya, he got the same grade as me.
Today I had my second and final presentation. I did it on “Separate Chaining”, a hashing collision resolution. This time I said fuck writing my own code, he didn’t give two shits last time when everyone else just screenshot online example code but me so I decided I’d focus on the PowerPoint and amp it up with animations on models I made with the shapes in PowerPoint. Get 2 slides in and he goes,
Prof: Stop! Go back one slide.
Me: Uh alright, *click*
(Slide showing the 3 collision resolutions: Open Addressing, Separate Chaining, and Re-Hashing)
Prof: Aren’t you forgetting something?
Me: ....Not that I know of sir
Prof: I see Open addressing, also called Open Hashing, but where’s Closed Hashing?
Me: I believe that’s what Seperate Chaining is sir
Prof: No
Me: I’m pretty sure it is
*Class nods and agrees*
Prof: Oh never mind, I didn’t see it right
Get another 4 slides in before:
Prof: Stop! Go back one slide
Me: .......alright *click*
(Professor loses train of thought? Doesn’t mention anything about this slide)
Prof: I er....um, I don’t understand why you decided not to mention the other, er, other types of Chaining. I thought you were going to back on that slide with all the squares (model of hash table with animations moving things around to visualize inserting a value with a collision that I spent hours on) but you didn’t.
(I haven’t finished the second half of my presentation yet you fuck! What if I had it there?)
Me: I never saw anything on any other types of Chaining professor
Prof: I’m pretty sure there’s one that I think combines Open Addressing and Separate Chaining
Me: That doesn’t make sense sir. *explanation why* I did a lot of research and I never saw any other.
Prof: There are, you should have included them.
(I check after I finish. Google comes up with no other Chaining collision resolution)
He docks me 20% and gives me a B- AGAIN! Both presentation grades have feedback saying, “MrCush, I won’t go into the issues we discussed but overall not bad”.
Thanks for being so specific on a whole 20% deduction prick! Oh wait, is it because you don’t have specifics?
Bye 3.8 GPA
Is it me or does he have something against me?7 -
So I'm pretty accustomed to German "professional" websites. As a tourist, I was just looking up tourist stuff online and I stumbled across this gem
http://eisenbahn-spielzeug-museum.de/...
I was like, yeah, okay, maybe this is just a really unfortunate mistake, although I was clearly having in mind the "easy" navigation DB offers both on their app and their website
So continuing my tourist search, I found several sightseeing objectives on decent websites, took the info from there, planned my trip and when I reached the place I was told completely different info that didn't exist on their website, which mostly messed up my visit to those touristic sites
Maybe I should just go search for answers on some forums and print out people's advice9 -
I was pretty upset at my loved one today. She asks me how to save a file into a PDF, so I explained how to print to PDF from chrome, pretty simple, good so far. Then...
-"Hey, the file has an 'e' for internet, will they need internet to open the file?"
-No, why would they?
-The file has an 'e'
-Did you name it 'e'?
-No, but it has an 'e' like internet
-... You mean the icon?
-Yes
-Right click, click on properties and change the default program to Adobe...
-Oh God, it's so complicated, I'll ask someone else to do it
-What? It's literally 2 clicks!
-Why does it need internet?
-It doesn't! It's just the default
-The what?
-Cheez! Doesnt matter, just go to properties and click on 'Change'
-Fine! Done now what?... Ooh...
-Now click on Adobe Acrobat
-Awesome! Thanks! Now it's fixed, I'm so glad because I'm about to send it on an email and I'm sure my boss would have thrown a fit if they weren't able to open it offline
-😒4 -
!rant
Accomplishments of today:
- Wrote a small battery level script for my polybar config to print "AC" as battery level if the battery is removed, rather than having it continue to display the level the battery was at when I removed it (how the polybar module does by default)
- Small bluetooth detector script (checks if bluetooth is on or off, and if it's connected to anything)
- Wrote another script to turn my screen's backlight off when the lid closes and back on when it opens again (literally just finished this one maybe 5 minutes ago)
- Finally fixed an issue with the volume level module on my polybar config, where it increments in levels of 5%, but it would always be on like 94 or 89, rather than 95 and 90 (weird to explain)
Pretty accomplished with myself, they were all minor differences that most people wouldn't really think about, but I'm happy about them. -
I work at a place where all the employees are pretty much on the user side of the spectrum and they have 3 chromebooks. Some would think that's not really a problem, chromebooks are fine for simple tasks BUT they weren't able to setup the printer correctly so they were only able to print one copy at a time. These people never used anything other than Windows and they already struggle with that, so I think it was a waste of money for the company, and I'm pretty sure they just went for it because it was cheaper. It's a fucking joke, since their employees prefer to bring their pcs to work and only one of the chromebooks is being used.2
-
I called the hack "blow up bunny", was in my first company.
We had 4 industrial printers which usually got fed by PHP / IPP to generate invoices / picking lists / ...
The dilemma started with inventory - we didn't have time to prepar due to a severe influenza going round (my team of 5 was down to 2 persons, where on was stuck with trying to maintain order. Overall I guess more than 40 % ill, of roughly 70 persons...)
Inventory was the kind of ultimate death process. Since the company sold mobile accessoires and other - small - stuff.
Small is the important word here....
Over 10 000 items were usually in stock.
Everything needed to be counted if open or (if closed) at least registered.
The dev task was to generate PDFs with SKUs and prefilled information to prevent disaster.
The problem wasn't printing.
The problem was time and size.
To generate lists for > 10 000 articles, matching SKUs, segmented by number of teams isn't fun.
To print it even less. Especially since printers can and will fail - if you send nonstop, there is a high chance that the printer get's stuck since the printers command buffer get's cranky and so on.
It was my longest working day: 18 hours.
In the end "Blow up bunny" did something incredibly stupid: It was a not so trivial bash pipeline which "blew up" the large PDF in a max of 5 pages, sent it to one of the 4 printers in round robin fashion.
After a max of 4 iterations, bunny was called.
"bunny" was the fun part.
Via IPP you can of course watch the printer queue.
So...
Check if queue was empty, start next round with determined empty printer queues.
Not so easy already. But due to the amount of pages this could fail too.
This was the moment where my brain suddenly got stuck aft 4 o clock in the morning in a very dark and spookey empty company - what if the printer get's stuck? I could send an reset queue or stuff like that, but all in all - dead is dead. Paper Jam is paper jam.
So... I just added all cups servers to the curl list of bunny.
Yes. I printed on all > 50 printers on 4 beefy CUPS servers in the whole company.
It worked.
People were pretty pissed since collecting them was a pita... But it worked.
And in less than 2 hours, which I would have never believed (cannot remember the previous time or number of pages...)1 -
I saw a video on tiktok a couple days ago that had a pretty interesting opinion. The guy said that we should stop creating programming languages and stick to only a couple.
His main point was because with all these different programming languages, there is different syntaxes the programmer has to learn. Even some of the universal syntaxes are different in some languages. For example, in Rust, to print something you use “println!(...);”
He said this is counter productive because in a majority of other programming languages, the ! Means negation. He also said something about Golang also having some of those syntax problems but I can’t remember exactly.
His point was that if we stuck to a single syntax, then we could spend more time doing productive stuff and less time relearning how to do stuff with different syntax. For example, in mathematics all symbols have pretty much the same meaning across the field. An equals sign will always mean the same thing.
What do u guys think? I thought it was an interesting opinion and I think I agree to some degree . I’ll post the link to the video if I find it again23 -
So the saga of broken fucking everything continues at work, and I'm managing it, effectively, and doing it correctly on the first go-round. It's a long process though, because the two retards who preceded me were equally inept for completely different, yet equally disruptive and destructive reasons. The first dude was just plain psychotic, probably still is. I'd post some of his code, but I don't want anyone's face to melt off like those Nazi dudes at the end of Raiders of the Lost Ark. I can handle it because I'm constantly inebriated, which is not as fun as it sounds. If you have to ask yourself if you can handle it, you probably aren't, unless you've had to Uber to/from work due to still being fucking drunk. Anyway, enough about that, and it was only like twice. The rest of the times, I was more blazed than Jerry Garcia at a weed smoking contest. Moving along.
UPS shipping labels broke two weeks ago, I fixed it, but these fucking 10xers jointly decided to not only never implement anything resembling error handling, other than EMPTY GOD DAMN "try/catch"es (empty catch, wow so efficient), and instead of using COMMENTS, which I know are a new thing, they'd wrap blocks of code in something like: if 1 = 0 {} FUCK YOU DICKFACES. As I was saying before I got emotional again, they tied the success to all kinds of unrelated, irrelevant shit. I'm literally needle/haystacking my way through the entire 200GB codebase, ALONE, trying to find all the borked things. Helpfully, my phone is ringing all the time from customer service, complaining about things that are either nothing to do with the site, or due to user stupidity, 75% of the time.
A certain department at my company relies on some pretty specific documents to do their job, and these documents are/were generated from data in the database. So until I can find and fix all of the things, I've diverted my own attention as much as possible to the rapid implementation of a report generation microservice so that no one elses work is further disrupted while I continue my cursed easter egg hunt from fucking hell.
After a little more than two days, I'm about to lauch a standalone MS to handle the reports, and it's unfortunately more complicated than I'd like, because it requires a certain library that isn't available on Winblows, so I've dockerized the application. Anyway, just after lunch, I've finished my final round of tests, and I'm about ready to begin migrating it to the server and setting up (shitty fucking shit) IIS to serve it appropriately. At this point, this particular report has been unavailable by web for about 8 days.
A little after lunch, and with no forewarning of any kind, the manager of managers runs upstairs and screams at me to "work faster" and that "this needs to be back online RIGHT NOW", but I also know that this individual is going to throw a fit if things on this pdf aren't a pixel perfect match. So I just say "that's some amazing advice, I wish I'd had the foresight to just do it better and work faster". Silence for a good five seconds, then I follow up with "please leave and let me get back to my work". At that moment from around the corner, my "supervisor" suddenly, magically even, remembers that he has had the ability to print this crucial, amazingly super fucking important document all along, despite me directly asking him a week ago, and he prints it and takes it where it needs to go. In the time that it takes him to go to that other department and return, I deploy my service.
I spent the rest of the day browsing indeed and linkedin jobs, but damn this market is kinda weird right now, yeah?2 -
I am currently weeks apart from releasing my pet project, which I am working on for almost 6 years now. Of course, there were a few stops here and there, but overall I've spent a lot of time and effort on this to make it work. It is far from complete but I am really happy with the results.
Now, since I am not a professional by any means - it is all a hobby for me - I was wondering, that how much my work would cost, if it were to made by professionals. Below the details so you can get a grasp of the thing.
The whole system is for our family business. We are selling parts for an old-timer truck model. The website was pretty much done already, people like it, it only needed some polishing and adding of the new features. But the thing behind it is monstrous (at least for me).
Apart from the custom-made CMS for the website (most of it was done already and didn't need to change), we can handle orders, partners, prices, stocks, overdue partners, pretty much anything a CRM would do.
There is a logic to automatically make orders based on import prices, or give the customer a custom discount based on the price gap of each product. There are products, which can contain other products, and their prices are dynamically changed based on a given formula, once an underlying product price changes. We can send e-mails when an order status changes, and there is also a page, where a user can interact whit their order, like changing the shipping or the delivery address. The system is (or will in the following weeks) also connected to multiple shipping companies' API, so we can order deliveries and print labels directly from our system. The whole thing is a custom made Laravel project by the way. There are countless more features, but I've just spent 2 hours explaining all to my father and was only be able to cover like half of it.
And why it is all custom made, you ask? Well, the business logic is a bit twisted, so it would be hard to operate as a regular web shop, since the availability of the products are uncertain, given the fact that it is a model, which isn't manufactured in 30 years. So, we can't just accept and send orders without confirming. It is also a thing, that people usually don't know what they need to order for their truck, so we have to help them, so they don't waste their money and the precious last pieces of a part unnecessarily.
Sorry for this rather long post, and it might feel like I just want to brag (well, I kinda do), but I am honestly interested in what such a custom product would cost in the market.
Thank you for your time answering.6 -
After trying to print colored text to the console using a portable Python 3 interpreter on Windows I came up with a "solution". I tried pretty much everything possible (I could think of): curses couldn't be loaded, ansi didn't work and installing libraries wasn't really an option, because it's not my device. Fuck portable interpreters and have fun with the "solution".
Def color_print(text, color):
text = text.replace("\n", "\\\" \\\"")
os.system ("powershell \"$host.ui.RawUi.ForegroundColor = \\\"" + color + "\\\"; echo \\\"" + test + "\\\"; $host.ui.RawUi.ForegroundColor = \\\"Gray\\\"")
It's slow, unreadable, only works for on Windows and requires powershell and is probably the worst piece of code I ever wrote, but it works 👍.2 -
I've gotten started with web dev in the past and learned HTML and CSS and started learning JS but I never could understand what I could use for a code editor to practice and pretty much forgot all of that stuff. Now I'm trying to learn Python, but what's pissing me off is paying for a phone app that doesn't teach you to write code in these lessons, rather interactive multiple choice questions and "put this in the right order". sequences. This is not learning for me, this is informing. Which is info I don't retain. And If i'm paying for it why is there so little to these lessons? Barely covering anything. I've done every lesson Mimo had for python but it didn't really explain the practicality of what it was teaching me and they skipped a lot of shit. Changing the pace of the lesson from Print this and that and heavily explain the most basic stuff 3x over to only explaining the more advanced stuff one fucking time.
I would really like learning python while being walked through a project as a lesson. Teach the terminology, structure, application, process, rinse and repeat, and outcome all in one. With a project target to look forward to. I need a goal to keep my interest.
So far all I know about python is its a programming language used to create Youtube. And I'm trying to learn it because I keep reading that its the recommended starting line. But I need to be able to visualize what this code can be used for. Explanations in terminology I haven't been taught yet just frustrates me. And I read everyone's posts and see many people mention being frustrated, but I haven't even started coding yet. Feel free to comment and redirect me to page that can help. Links are appreciated. Nay, encouraged!7 -
Ok. I GIVE UP! ...for at least a couple hours...
I'm not a big believer in... well anything suitable to the literal definition of believe. But there's only so much 'wtf? How is this even possible?' and any answer u can come up with is nearly statistically impossible...
I am a neuro-atypical (and just extremely atypical even if i somehkw was neurotypical) being, based on logic, finely calculated statistical probability and the most raw data and as unbiased as realistically possible, algorithms and interpretation (usually recursive pattern recognition with several highly detailed historical sources.
...but at some point statistical improbability and a collation of separate, yet relatively closely occuring events/circumstances makes logic, itself a primary suspect of corruption.
What was the breaking point that caused me to (temporarily) give up and tell logic to f off for a bit cuz maybe the illogical and mythical is the real logic, leaving me in a losing battle with 'the' fates?
Trying to get all my sourcing/purchase orders in/paid for/on the literal boats b4 end of the workday/week in china...
1st, had to drop a supplier cuz they have limited reps. When the one ive had 7+ years left, i got the aloof blonde girl societal trope of a rep... who for the 2nd time (despite the several very blunt complaints above her, incl me) she sent out a promotional update to the entire client list (ie, inherently competitors) as CC not BCC... over 200 business email accounts with tailored info of their sourcing.
2- totally diff company/ industry a former rep i was glad be rid of apparently just sfarted back for "awhile" as i needrf to restock/scale...apparently she forgot everything we discussed at length... lke if you want a chance on my business im not gonna be wasting time looking through your gui "mini store to then inquire about everything individually insead of a simple spreadsheet(which i print and put in a 3-ring binder rotating current catalogues in the same format i require everywhere)
3.dog was an ahole, my packed schedule got delayed and morphed.. a bunch of little bs thatd normally have no extra thought impact, hyperfocused forgetting one of my alarms til i realised my idiopathic fever was back and i didnt take/apply meds (pain/muscle relaxers mainly so despite this odd free time and needing to shower. I gotta sit on my rear, leg elevated/non-productive far 40min b4 i can shower (as functional legs and lack of syncope is almost a req to shower)
4. A new-ish rep of a company/factory i like/respect enough to not mention in relation... he makes invoice 1.. slight error thst was easily resolved...#2 was flawless... he goes to officially generate the contract(alibaba... verrrry simple with lots of extra explanation buttons). Price and all items match, its near workweek end so i was waiting for it so i could quickly pay/have it on the boat b4 it left and few fdav days are behind...
I put in card info, get to the 2 cbeck boxes (imo should be only 1 but whatever) asking if billing address is same ss delivery(its always default yes)... then i see a few lines in chinese (i can read enough for business negotiations... typical words/sentences innately look different than things like individual letters/address and postal indicators.) After a few loops of double checking, mentally trying to dismiss my i Intial judgement cuz it'd be too ridiculous... even resorted to google .... nope... initial wtf was spot on... recipient name/address was indeed the company(multi factory producer)i was purchasing a wholesale, via sea freight, bulk of products from.
Im pretty sure the system would've flagged it as an invalid contract within an hr... but seriously... ive been handling alibaba (and other) international sourcing since before high school(mainly small businesses i made sites/little tools for that found anything with a light up screen intimidating) and a purchase then shipment to the originating company/factory actually entered into a contract(the form is sooo simple)... im faced with ridiculously improbable obstacles actually existing and changing in such nonsensical statistically improbable ways so often that 1. I wouldn't trust a dr (or most humans) that didnt 1st assume i was crazy of some form...unfortunately im not, despite hkw much simpler and probable itd be 2. Id be super suspicious/converned if statistic norms were my norm for over a day.
But seriously wtf???
Someone give me some wisps of a frame of ref here... where's a typical 'fuck this, im out!' Breaking point?1