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 - "extracting"
-
Legacy code.
Honestly though, this is some of the better legacy code I've worked with at this company. It's a nifty alert system wherein you can trigger sending messages to subscribers of that alert via whatever means (phone/email) they've entered.
I'll save you the technical analysis of its internals, but suffice to say it's actually pretty nice, with good separation of concerns, internal logic hidden away, dead-simple public interface, etc. documentation is kinda crap, but it exists (!), so that's a nice change.
but.
For some unknown and bloody bizarre reason, the thing breaks when a user wants both sms AND email notifications. Either by themselves work totally fine, but both together? nonono. Email alerts give ArgumentErrors, so something internal isn't correct, and SMS alerts complain about uninitialized Twilio::Error constants.
but.
they both work fine otherwise?
also, the two notification preferences aren't stored on the same object anywhere. if a user wants both, the user creates two AlertContact objects with different info, and when performed, the Alert basically iterates over these and does its thing for each, so there is no knowledge shared between them. totally should work the same regardless.
idfgi.
ALSO.
AND THIS PART REALLY PISSES ME OFF.
WHEN THERE'S AN ERROR, THIS THING DOESN'T LOG IT. IT STRINGIFIES THE ERROR OBJECT (basically just extracting the message) AND INSERTS THAT INTO THE DATABASE INSTEAD. WHAT THE CRAP.
So, I don't get a stack trace, line number, or anything. just the basic error message. instead of my alert text. because of course that makes sense and totally helps debugging.
aklsjfak;sldfj.
legacy code.5 -
By the time windows was extracting the file, I downloaded 7zip, installed it and extracted the file and started editing the files
-
So our class had this assignment in python where we had to code up a simple web scraper that extracts data of the best seller books on Amazon. My code was ~100 lines long( for a complete newbie in python guess the amount of sweat it took) and was able to handle most error scenarios like random HTML 503 errors and different methods to extract the same piece of data from different id's of divs. The code was decently fast.
All wss fine until I came to know the average number of lines it took for the rest of the class was ~60 lines. None of the others have implemented things that I have implemented like error handling and extracting from different places in the DOM. Now I'm confused if I have complicated my code or have I made it kind of "fail proof".
Thoughts?8 -
A couple of months ago, the father of a friend of mine, asked me if I wanted to help him out with a project.
His late father, whom he inherited a one-person upholstering company from, once created a system in filemaker to do, among others, his financial administration. This system, however, grew organically as time went by, but he passed away before he explained to his son how it worked.
Now this man was running the company, using the parts of the system that he knows, but things were starting to break down. He asked me if I could help him understand what is going on and fix a couple of things.
However, the more I look at it, the more I realize what a monstrosity this has become, because the system has never been cleaned up. For example:
- There is a suppliers table, with the columns "E-MAIL" and "EMAIL". The latter one containing the supplier's website address.
- In order to be able to generate year reports, at the start of a year he copies the previous year's file, removes all records from it and starts using that as the new year's file. (This year, he accidentally created a shortcut instead of copying...)
- Some tables have a misterious column called "#1". It always contains a 1.
- The system consists of about 20 files, each of them containing a single table, although only 10 of them are really used. The other ones are just legacy.
- File, table, column, and layout names are capitalized randomly (all caps, no cap, starting uppercase) and are usually abbreviations, like "st2", "oms3", "off\rek", "b", "VERDBEST6" and "antst".
- One table has 92 columns.
- Of those 92 columns, only about 20, maybe 30, are in use.
Now, my task is finding out what parts are useful and in use, extracting those and create a baby monster out of the giant monster this system has become.
Sidenote: I actually enjoy having to learn a bit about accounting in order to understand this. Planning to use the knowledge I gain to keep track of my own finances.6 -
I started working for a company something around 1-2 months ago, they said because I don't have any experience with their stack, my salary will be lower than other team members. I said there is no problem and started my work. My first task was refactoring codes that their experienced programmers have wrote. My second task was extracting data layer from views. (They use Laravel and MVC architecture and they get data directly in views, not controllers). So, by end of the month when I talked with my boss I said I should get more money because I was better than your experienced programmers. He refused my request so I said I will not work with your team anymore :)
Anyway, never accept a job if you know you deserve more money than what they say will give you.
P.S: Sorry for my bad English. English is not my native language5 -
Ideas for a strong password:
- a regex matching my laptop's LAN IP address
- a sed command to enable X11 forwarding in sshd_config
- a shell oneliner extracting all the IP addresses from ifconfig / ip a sh
- an awk command to print processes in D state
-
Chip in!15 -
ARE YOU READY FOR WORKPLACE BRAIN SCANNING?
Extracting and using brain data will make workers happier and more productive, backers say
https://spectrum.ieee.org/neurotech...
"What takes much more time are the cognitive and motor processes that occur after the decision making—planning a response (such as saying something or pushing a button) and then executing that response. If you can skip these planning and execution phases and instead use EEG to directly access the output of the brain’s visual processing and decision-making systems, you can perform image-recognition tasks far faster. The user no longer has to actively think: For an expert, just that fleeting first impression is enough for their brain to make an accurate determination of what’s in the image."12 -
How to log in to CMS Of Doom™...
What could go wrong?
MD5 password hashing? HTTP links? Extracting the whole $_POST array?8 -
My biggest problem with Visual Studio Code is that every fucking piece of shit dev thinks it's their duty to introduce it to me. STOP. Just stop this shit, alright? Wanna use vscode? Fine, just don't tell me it's the best tool and I MUST use it instead of the tools I'm used to. I'm tired of this bullshit.
Every new project, every new team. Starting from js/java/.net monke and ending with PMs, I must hear this bullshit about god blessed IDE that I must use, because "why you need intellij/webstorm/rider? just install vscode and some plugins. we all use it in our project and it's ok".
FUCK YOU! Refactoring is not just renaming variables and extracting blocks of code into functions. If you want terminal integrated into your text editor with highlighting and LSP support, so be it. I want an IDE with rich refactoring tools, code analysis and good completion, database viewing/modeling support, good build tools support, good UI for git and git-diff, good test and code coverage support. I don't want your semi-IDE, bloated with hundreds of bugged third-party plugins, which I must spend a week on to configure and merry with each other before using.
JUST STOP this crap and let people use the tools they are proficient/comfortable/productive with.18 -
Sad story:
SSHd to a vultr server, downloaded MongoDB docker (approx 170MB) download and extracting 70% of the image was done faster than me navigating from devRan notifs page, to devRant feed page, I need a new internet plan T_T1 -
fuck..fuck..FUCK..FUCK YOU MANTIS!!!
fuck you and your fucking invalid security token... fucking cunt...
yeah i love extracting my notes from POST data via the browser dev console cause you fucking delete it when hitting the back button...
THANKS FOR NOTHING -
Me: I need some stickers
Devrant: Give some programming jokes
Me:
#Take as many as you want
import requests
# api-endpoint
URL = "http://devrant.com/jokes/"
# sending get request and saving the response as response object
r = requests.get(url = URL, params = "funnyprogrammingjoke")
# extracting data in json format
Joke = r.json()
# printing the output
print(Joke)5 -
Adobe's ExtendScript toolkit is abyssmal. I find posts from 2008 referring to issues that have not changed even in CC2017. Do you think they are small issues I'm bitching about? I'll list 2. First, the toolkit only colours "var, return, for, foreach" and a bit more keywords and the strings, of course you can set up color schemes but those are limited and not colouring stuff. The second issue is auto-complete, it rarely kicks in and suggestions have 0 connection to what are you doing and are always the same. It doesn't recognize anything of what are you doing.
Probably in 2008 you had to program with the manual near you like writing assembler, now there's an improvement in 2017, they got a window named object browser or something like that that actually is a summarised portable manual that could've been easily transformed in auto-complete suggestions.
Adobe writes about this and I quote: "a complete integrated development environment". Although I will not write much scripts in it, I need to write a big one and thought about extracting that object data and putting it in a more capable javascript editor. LO and Behold what I discovered, the ExtendScript Toolkit that's supposed to edit Extended javascript and save it as jsx or jsxbin is almost completely (it has some dlls too) built using around 100 jsx files. It's the equivalent of building a js IDE to edit js.
Sorry for formatting, I'm on mobile, I tried. -
Got one right now, no idea if it’s the “most” unrealistic, because I’ve been doing this for a while now.
Until recently, I was rewriting a very old, very brittle legacy codebase - we’re talking garbage code from two generations of complete dumbfucks, and hands down the most awful codebase I’ve ever seen. The code itself is quite difficult to describe without seeing it for yourself, but it was written over a period of about a decade by a certifiably insane person, and then maintained and arguably made much worse by a try-hard moron whose only success was making things exponentially harder for his successor to comprehend and maintain. No documentation whatsoever either. One small example of just how fucking stupid these guys were - every function is wrapped in a try catch with an empty catch, variables are declared and redeclared ten times, but never used. Hard coded credentials, hard coded widths and sizes, weird shit like the entire application 500ing if you move a button to another part of the page, or change its width by a pixel, unsanitized inputs, you name it, if it’s a textbook fuck up, it’s in there, and then some.
Because the code is so damn old as well (MySQL 8.0, C#4, and ASP.NET 3), and utterly eschews the vaguest tenets of structured, organized programming - I decided after a month of a disproportionate effort:success ratio, to just extract the SQL queries, sanitize them, and create a new back end and front end that would jointly get things where they need to be, and most importantly, make the application secure, stable, and maintainable. I’m the only developer, but one of the senior employees wrote most of the SQL queries, so I asked for his help in extracting them, to save time. He basically refused, and then told me to make my peace with God if I missed that deadline. Very helpful.
I was making really good time on it too, nearly complete after 60 days of working on it, along with supporting and maintaining the dumpster fire that is the legacy application. Suddenly my phone rings, and I’m told that management wants me to implement a payment processing feature on the site, and because I’ve been so effective at fixing problems thus far, they want to see it inside of a week. I am surprised, because I’ve been regularly communicating my progress and immediate focus to management, so I explain that I might be able to ship the feature by end of Q1, because rather than shoehorn the processor onto the decrepit piece of shit legacy app, it would be far better to just include it in the replacement. I add that PCI compliance is another matter that we must account for, and so there’s not a great chance of shipping this in a week. They tell me that I have a month to do it…and then the Marketing person asks to see my progress and ends up bitching about everything, despite the front end being a pixel perfect reproduction. Despite my making everything mobile responsive, iframe free, secure and encrypted, fast, and void of unpredictable behaviors. I tell her that this is what I was asked to do, and that there should have been no surprises at all, especially since I’ve been sending out weekly updates via email. I guess it needed more suck? But either way, fuck me and my two months of hard work. I mean really, no ego, I made a true enterprise grade app for them.
Short version, I stopped working on the rebuild, and I’m nearly done writing the payment processor as a microservice that I’ll just embed as an iframe, since the legacy build is full of those anyway, and I’m being asked to make bricks without straw. I’m probably glossing over a lot of finer points here too, just because it’s been such an epic of disappointment. The deadline is coming up, and I’m definitely going to make it, now that I have accordingly reduced the scope of work, but this whole thing has just totally pissed me off, and left a bad taste about the organization.10 -
Package Installer on android needs to show something other than just the progress bar. Even a basic log like windows installers that say, "copying this, extracting this, done..." If it affects the minimalism of the interface, they could try doing what Tor browser does- swipe to see a log. It just feels heartbreaking to wait 5 long minutes for it to process on this tortoise device, and then get, "app not installed." with an OK button. :( Like, whyyyy? There should be a "THAT'S NOT OK" button.
Is there any magisk module for this? Or some other tweak?5 -
Okay so after a few days of thinking I think I'm sure about what I'm about to write :
Best : Discovering how to use streams while making a service that should extract a tar.gz, extract the tar.gz within it, filter the extracted files and correct some of them, then compress each folder as tar.gz and compress all the archives as .zip. The amazing thing for me is that with streams I could do all the operations in just two passes, maybe one if I had more time, saving disk writing time.
Worst : upgrading a bunch of legacy Access 97 apps and its VBA code to Access 2013 -
That time when I was extracting a 50GB archive and it failed at 99% :'(
Hope it was just 10 seconds though...
It was way, waaaaay more...2 -
It’s really easy to gain administrative access on unencrypted windows machines with a single usb. You know what’s also easy? Extracting admin passwords with mimikatz.
Edit: this was back in 5th grade2 -
A client project came with a bunch of references missing, and nuget wasn't properly restoring them. I've just spent most of my weekend trawling through the dependencies, extracting them from their nuget packages, and putting them in the appropriate folders manually.
Slowly developing a horrid hatred of nuget... -
TLDR;
Side project update.
Made simple nlp library in python and published it’s first version to open source.
Now I can feed it with parsed pdf text.
See rant https://devrant.com/rants/2192388/...
Why ?
Cause during reading book about nltk I couldn’t find simple extendible way to provide support for polish language and I wanted to abstract stemming, word normalization, tokenizer etc. so I can provide ex. different conditions for separate text files and don’t write much code what is an asset when you work solo.
It’s about 12GB of pdf public accessible law data I am trying to handle ( at first ) which is about 35000 files from last 90 years.
So far I automated downloading web pages and pdf documents from them. Extracting data from web pages and saving it to database. Extracting text from pdf files. I have about 5-6 projects to do all of it above maybe at the end I will put it to some workflow manager like Luigi or just run it by cronjob.
First thing for website version 1.0 part is find correlation between all documents inside law text using nlp library by building custom conditions. Then just generate directory structure and html files with links between documents.
Website version 2.0 is already in my mind but it will be creepy to make it and will take at least 1-2 months and I want to publish fast.
I have some pdfs with only images instead of text and tesseract worked quite good with them so maybe I will try to process them when everything go live.
Learned a lot about pdf as now I know that font in pdf is not always providing unicode characters ( stupid form of obfuscation) so when you extract text you need to build glyph vector to text map for every font.
Pdf is full vector representation - just like svg - what is logic if you think a bit and know that some printers are running using postscript.
Let’s hope next update will be about flutter mobile app which started all of shit above. It’s almost ready ( except getting data from api I am trying to do and logo for release version ). It’s last piece of puzzle.3 -
Just finished my ticket i've been struggling on for 2 weeks. Extracting the rotation as a 3d Vector out of a composed 4x4 transformation matrix .
I barely knew that matrix format , barely knew how 3d transforms work anyway, without reference data to compare.
So proud on myself 💪🏻 -
if anyone is interested in what your browser saves about your downloads or wants to help work on extracting data then have a look at my repo:
https://github.com/tooslepy/BDE -
Does devRant have a feed extracting API? I want to add new rants to my personal website. It would be really cool to.4
-
Every once in a while I come across a challenge that's actually challenging. Most recently ... "Develop Regex for validating and extracting a recipe's ingredient's quantity"
Regex should properly identify the numbers in each of the following lines:
1 cup of ingredient
Diced 1/2 cup of ingredient
.5 tsp of ingredient
1 1/2 packed cup of ingredient
1.5 cup of Heavy whipping cream
My answer is the first comment in case you want to solve it yourself. I'd love to know what others come up with.5 -
!rant
Just started a side project, helping a friend make his Android app more stable and add a couple more features. We'll release the sources sometime later.
Gotta say, his code is just terrible. And it runs on top of some code written by someone else, and that's even worse.
But I don't know how I got the motivation to spend the whole Saturday cleaning it up, fixing warnings, making abstractions, extracting features to separate classes, converting some stuff to Kotlin, even adding a couple coroutines. It felt good fixing bad code.
Maybe because I have some coding freedom I kinda miss at work.
Maybe because the project is not that big.
Maybe because I know the guy has many skills, coding is just not one of them.
Maybe because that project has some cool in it I can't even describe.
Maybe because that's entirely within my skills but challenging enough to have fun working on it.
Or maybe is just the mood of the moment, and in a week or so I'll lose all the motivation, as it happened too many times.
🤷♂️2 -
My pyinstaller app got flagged as malware... Now I'll have to make a self extracting python launcher in C# to get the project forwards...3
-
Part 3
https://devrant.com/rants/9881158/...
I dropped subtitles and started extracting audio from movie, after that I use whisper to convert speech to text.
I parse srt from whisper, adjust timestamps to get >= arbitrary amount of voice seconds. I put text to vector database with timestamps and movie file name.
I query database by ex. “I don’t know” and extract first n results, after that I walk trough movies and extract parts with found text.
I normalize and merge parts into one movie.
Results are satisfying so now I decided to try to find a common dialogue that I can watch by combining multiple persons speaking from multiple movies.
Might also try to extract person from one movie and put it to other movie.2 -
Just when I thought a project I'm analyzing has done a good implementation, I found out that they got lazy and started writing business logic DIRECTLY into models!! Now stuff is tightly coupled that extracting it will cause unknown effects.
-
Power BI: wonderful tool, pretty graphics, and can do a lot of powerful stuff.
But it’s also quite frustrating when you want to do advanced things, as it’s such a closed platform.
* No way to run powerquery scripts in a command line
* Unit testing is a major pain, and doesn’t really test all the data munging capabilities
* The various layers (offline/online, visualisation, DAX, Powerquery, Dataset, Dataflow) are a bit too seamless: locating where an issue is happening when debugging can be pain, especially as filtering works differently in Query Editing mode than Query Visualisation mode.
And my number 1 pet peeve:
* No version control
It’s seriously disconcerting to go back to a no version control system, especially as you need to modify “live code” sometimes in order to debug a visual.
At best, I’ve been looking into extracting the code from the file, and then checking that into git, but it’s still a one-way street that means a lot of copying and pasting back into the program in order to roll back, and makes forking quite difficult.
It’s rewarding to work with the system, but these frustrations can really get to me sometimes2 -
Trying to calibrate a gopro to remove fisheye effect with OpenCV.
The documentation of the script I'm using says "Lastly the program will calculate the total reprojection error. The closer this value is to zero the better. I usually like values under 0.1. Play around with the calibration, see what works and what improves it."
I spent all the afternoon recording video, extracting images and using the script. The lower error I got was 0.6, and the supposed undistorted image was actually more distorted than the original one.
So frustrated 😤 -
I hate pl-sql and data warehousing. For this project we're extracting from source tables using a generic method equal for every student, changing the data and then copying to a table for analytics.
Everyone's project is fine. Mine occupies 90mb and exceeds the quota already. Delivery due in 2 days... So much for that cs grad. FML. -
There's a moment when you're looking at a reStructuredText parser, you have a basic idea of the spec, and you know with absolute certainty it's not parsing it correctly. It gets the basics right, sure. But now you know why the tools that use it have disclaimers like "Any para lists or other directives must be at the end of the string". And you're thinking "how hard would it *really* be to write one?". After all, I'm now extracting all the docstrings from the code... Is it really that much more? Shit...
-
How is it possible to read a zipped text file (Ie. zgrep) without first extracting the whole thing?10
-
I'm currently creating a Qt Wrapper for libpulse by extracting it from an application. The mix of C and C++ code gives me crap and I really want to punch the guy who spread templates all over the place
-
Do you recommend hiring junior or mid-level dev for a python role that involves mostly data transformations with pandas, growth and marketing projects like social media bots, consuming APIs for data and some experience with Azure SQL db? I’m worried if we hire too senior then they will leave as the role doesn’t involve any advanced software engineering, like caches, web apps, rest apis, etc. It’s more of a handyman that can automate and hack a solution to a business problem: for example, learning openCV to automatically crop thousands of images extracting only the text3