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 - "file includes"
-
!rant
This was over a year ago now, but my first PR at my current job was +6,249/-1,545,334 loc. Here is how that happened... When I joined the company and saw the code I was supposed to work on I kind of freaked out. The project was set up in the most ass-backward way with some sort of bootstrap boilerplate sample app thing with its own build process inside a subfolder of the main angular project. The angular app used all the CSS, fonts, icons, etc. from the boilerplate app and referenced the assets directly. If you needed to make changes to the CSS, fonts, icons, etc you would need to cd into the boilerplate app directory, make the changes, run a Gulp build that compiled things there, then cd back to the main directory and run Grunt build (thats right, both grunt and gulp) that then built the angular app and referenced the compiled assets inside the boilerplate directory. One simple CSS change would take 2 minutes to test at minimum.
I told them I needed at least a week to overhaul the app before I felt like I could do any real work. Here were the horrors I found along the way.
- All compiled (unminified) assets (both CSS and JS) were committed to git, including vendor code such as jQuery and Bootstrap.
- All bower components were committed to git (ALL their source code, documentation, etc, not just the one dist/minified JS file we referenced).
- The Grunt build was set up by someone who had no idea what they were doing. Every SINGLE file or dependency that needed to be copied to the build folder was listed one by one in a HUGE config.json file instead of using pattern matching like `assets/images/*`.
- All the example code from the boilerplate and multiple jQuery spaghetti sample apps from the boilerplate were committed to git, as well as ALL the documentation too. There was literally a `git clone` of the boilerplate repo inside a folder in the app.
- There were two separate copies of Bootstrap 3 being compiled from source. One inside the boilerplate folder and one at the angular app level. They were both included on the page, so literally every single CSS rule was overridden by the second copy of bootstrap. Oh, and because bootstrap source was included and commited and built from source, the actual bootstrap source files had been edited by developers to change styles (instead of overriding them) so there was no replacing it with an OOTB minified version.
- It is an angular app but there were multiple jQuery libraries included and relied upon and used for actual in-app functionality behavior. And, beyond that, even though angular includes many native ways to do XHR requests (using $resource or $http), there were numerous places in the app where there were `XMLHttpRequest`s intermixed with angular code.
- There was no live reloading for local development, meaning if I wanted to make one CSS change I had to stop my server, run a build, start again (about 2 minutes total). They seemed to think this was fine.
- All this monstrosity was handled by a single massive Gruntfile that was over 2000loc. When all my hacking and slashing was done, I reduced this to ~140loc.
- There were developer's (I use that term loosely) *PERSONAL AWS ACCESS KEYS* hardcoded into the source code (remember, this is a web end app, so this was in every user's browser) in order to do file uploads. Of course when I checked in AWS, those keys had full admin access to absolutely everything in AWS.
- The entire unminified AWS Javascript SDK was included on the page and not used or referenced (~1.5mb)
- There was no error handling or reporting. An API error would just result in nothing happening on the front end, so the user would usually just click and click again, re-triggering the same error. There was also no error reporting software installed (NewRelic, Rollbar, etc) so we had no idea when our users encountered errors on the front end. The previous developers would literally guide users who were experiencing issues through opening their console in dev tools and have them screenshot the error and send it to them.
- I could go on and on...
This is why you hire a real front-end engineer to build your web app instead of the cheapest contractors you can find from Ukraine.19 -
Even though I'm a web developer I work in a very small IT department, which includes just me and my colleague.
Yesterday we got a pretty usual request. Someone forgot the password to an excel file. We already started a brute force attack, but we had some fun going through the worst passwords we ever stubbled over in our carrier.
He was like:"Maybe it's just his name?"
Me: "Oooh or maybe it's just the brand and 123?"
We laughed a lot. Not really considering we could crack this "important" file.
But it really worked out. The password was the brand of the business unit and "2017".
I've sent everthing back to the user, telling him exactly how we cracked it... His answer was:"Oh yeah! I knew it was something easy, so me and x could remember it easily!"
...
Why do you forgive easy passwords anyway? If I can crack it within 5 minutes... Everyone can! ...
And if you do it to "remember it easily"? Why the fuck don't you remember it?4 -
The gift that keeps on giving... the Custom CMS Of Doom™
I've finally seen enough evidence why PHP has such a bad reputation to the point where even recruiters recommended me to remove my years of PHP experience from the CV.
The completely custom CMS written by company <redacted>'s CEO and his slaves features the following:
- Open for SQL injection attacks
- Remote shell command execution through URL query params
- Page-specific strings in most core PHP files
- Constructors containing hundreds of lines of code (mostly used to initialize the hundreds of properties
- Class methods containing more than 1000 lines of code
- Completely free of namespaces or package managers (uber elite programmers use only the root namespace)
- Random includes in any place imaginable
- Methods containing 1 line: the include of the file which contains the method body
- SQL queries in literally every source file
- The entrypoint script is in the webroot folder where all the code resides
- Access to sensitive folders is "restricted" by robots.txt 🤣🤣🤣🤣
- The CMS has its own crawler which runs by CRONjob and requests ALL HTML links (yes, full content, including videos!) to fill a database of keywords (I found out because the server traffic was >500 GB/month for this small website)
- Hundreds of config settings are literally defined by "define(...)"
- LESS is transpiled into CSS by PHP on requests
- .......
I could go on, but yes, I've seen it all now.12 -
That would probably be implementing multithreading in shell scripts.
https://gitlab.com/netikras/bthread
The idea (though not the project itself) was born back when I still was a sysadmin. Maintaining 30k servers 24/7 was quite something for a team of merely ~14 people. That includes 1st line support as well.
So I built a script to automate most of my BAU chores. You could feed a list of servers - tens or hundreds or more - and execute the same action on each of them (actions could be custom or predefined in the list of templates). Neither Puppet nor Chef or Ansible or anything of sorts was consistently deployed in that zoo, not to mention the corp processes made use of those tools even a slower approach than the manual one, so I needed my own solution.
The problem was the timing. I needed all those commands to execute on all the servers. However, as you might expect, some servers could be frozen, others could be in DMZ, some could be long decommed (and not removed from the listings), etc. And these buggars would cause my solution to freeze for longer than I'd like. Not to mention that running something like `sar -q 1 10` on 200 servers is quite time-consuming itself :)
And how do I get that output neatly and consistently (not something you'd easily get with moving the task to a background with '&'. And even with that you would not know when are all the iterations complete!)?
So many challenges...
I started building the threading solution that would
- execute all the tasks in parallel
- do not write anything to disks
- assign a title to each of the tasks
- wait for all the tasks to complete in either
> the same sequence as started
> as soon as the task finishes
- keep track of each task's
> return code
> output
> command
> sequence ID
> title
- execute post-finish actions (e.g. print to the console) for each of the tasks -- all the tracked properties are to be accessible by the post-finish actions.
The biggest challenges were:
a) how do I collect all that output without trashing my filesystems?
b) how do I synchronize all those tasks
c) how do I make the inception possible (threads creating threads that create their own threads and so on).
Took me some time, but I finally got there and created the libbthread library. It utilizes file descriptors, subshells and some piping magic to concentrate the output while keeping track of all the tasks' properties. I now use it extensively in my new tools - the ones where I can't use already existing tools and can't use higher-level languages.4 -
My school just tried to hinder my revision for finals now. They've denied me access just today of SSHing into my home computer. Vim & a filesystem is soo much better than pen and paper.
So I went up to the sysadmin about this. His response: "We're not allowing it any more". That's it - no reason. Now let's just hope that the sysadmin was dumb enough to only block port 22, not my IP address, so I can just pick another port to expose at home. To be honest, I was surprised that he even knew what SSH was. I mean, sure, they're hired as sysadmins, so they should probably know that stuff, but the sysadmins in my school are fucking brain dead.
For one, they used to block Google, and every other HTTPS site on their WiFi network because of an invalid certificate. Now it's even more difficult to access google as you need to know the proxy settings.
They switched over to forcing me to remote desktop to access my files at home, instead of the old, faster, better shared web folder (Windows server 2012 please help).
But the worst of it includes apparently having no password on their SQL server, STORING FUCKING PASSWORDS IN PLAIN TEXT allowing someone to hijack my session, and just leaving a file unprotected with a shit load of people's names, parents, and home addresses. That's some super sketchy illegal shit.
So if you sysadmins happen to be reading this on devRant, INSTEAD OF WASTING YOUR FUCKING TIME BLOCKING MORE WEBSITES THAN THEIR ARE LIVING HUMANS, HOW ABOUT TRY UPPING YOUR SECURITY, PASSWORDS LIKE "", "", and "gryph0n" ARE SHIT - MAKE IT BETTER SO US STUDENTS CAN ACTUALLY BROWSE MORE FREELY - I THINK I WANT TO PASS, NOT HAVE EVERY OTHER THING BLOCKED.
Thankfully I'm leaving this school in 3 weeks after my last exam. Sure, I could stay on with this "highly reputable" school, but I don't want to be fucking lied to about computer studies, I don't want to have to workaround your shitty methods of blocking. As far as I can tell, half of the reputation is from cheating. The students and sysadmins shouldn't have to have an arms race between circumventing restrictions and blocking those circumventions. Just make your shit work for once.
**On second thought, actually keep it like that. Most of the people I see in the school are c***s anyway - they deserve to have half of everything they try to do censored. I won't be around to care soon.**undefined arms race fuck sysadmin ssh why can't you just have any fucking sanity school windows server security2 -
I used to work in a small agency that did websites and Phonegap apps, and the senior developer was awful.
He had over a decade of experience, but it was the same year of experience over and over again. His PHP was full of bad practices:
- He'd never used an MVC framework at all, and was resistant to the idea, claiming he was too busy. Instead he did everything as PHP pages
- He didn't know how to use includes, and would instead duplicate the database connection settings. In EVERY SINGLE FILE.
- He routinely stored passwords in plain text until I pretty much forced him to use the new PHP password hashing API
- He sent login details as query strings in a GET request
- He couldn't use version control, and he couldn't deploy applications using anything other than FTP4 -
Warning: Long rant ahead!
So we built an amazing system for managing swarms of drones, and we have flown hundreds of hours, testing, etc.
Comes a client and says, that he wants to buy our system, but he wants to integrate it in a bigger system that is supposed to orchestrate many small systems.
Sounds like a deal.
So they send me on a week course (see previous rant: https://devrant.com/rants/2049071/...) to learn how to integrate our system in theirs.
I was sure that they have some API or something and it should be a breeze. but apparently they give us an SDK that includes all their files, and we have to build and run their entire system, and then build our own API inside of it!
And the reason we needed a week-long course, was to know all the paths where the XML configuration files exist!
So for the last month, I am hacking away inside this huge program, navigating thousands of files in a language I don't know, in order to build an API for their system, so that I can use it on our side.
Yesterday they informed us that a new version is available.
And sure enough, waiting in my inbox this morning was a link to download a new SDK.
No Changelog, No Instructions, Just a zip file with over 25,000 files.
So I phone my contact in their company to ask how exactly I am supposed to update their files, and his answer was: diff them!
WHAT! 25,000 files, half of them built by the c++ compiler, tens of configuration files scattered in different places, linking all the new libraries from scratch, are they crazy or what?
And then he tells me that they are working for 15 years this way. That's why everyone hates them I guess.
going to have a long day...
P.S. many more rants to come from this integration.4 -
In the 1990s code editors on the Mac could insert the omitted function prototypes into a header file with one command; and even automatically keep the header declaration updated when you changed the source definition (name, parameters, etc)
Today in Xcode you have to copy and paste the stupid function header definition from the source code into the header file. What happens if you leave the "{" that got copied accidentally? OMFUCKING LORD, it triggers all sorts of erroneous errors in all the **source code** files where it is included instead of the header with the stray "{"
I started to question whether nor not I knew C, if gravity worked, if the sun would come up. I wasted a day of dicking around in StackOverflow trying to chase down all these insane error messages which make no sense in Xcode.
I just **happened** to see at the bottom of one of the source files, after all the erroneous error, a very important error:
"};" Expected
So I started deleting code from the bottom up in this source file, same error every time. Got to the point where the includes were all that was left.
FUCK YOU XCODE and the hacks that designed that horrendous piece of shit
Xcode is only free if your time is worth absolutely nothing.11 -
I just started a job as a junior C# dev.
My project at work includes:
-no coding style
-multiple classes in one file
-all classes are static
-who needs interfaces?
-typos in variable names
-more than 3 levels of inheritance
-conf files such as "blabla.xml"
-comments? documentation? nope
-copy&paste everywhere
Client outsourced this project to us to get the job done properly :D
Looks that I have some opportunity to show my talent.10 -
tl;dr:
The Debian 10 live disc and installer say: Heavens me, just look at the time! I’m late for my <segmentation fault
—————
tl:
The Debian 10 live cd and its new “calamares” installer are both complete crap. I’ve never had any issues with installing Debian prior to this, save with getting WiFi to work (as expected). But this version? Ugh. Here are the things I’ve run into:
Unknown root password; easy enough to get around as there is no user password; still annoying after the 10th time.
Also, the login screen doesn’t work off-disc because it won’t accept a blank password, so don’t idle or you’ll get locked out.
The lock screen is overzealous and hard-locks the computer after awhile; not even the magic kernel keys work!
The live disc doesn’t have many standard utilities, or a graphical partition editor. Thankfully I’m comfortable with fdisk.
The graphical installer (calamares) randomly segfaults, even from innocuous things like clicking [change partition] when you don’t have a partition selected. Derp.
It also randomly segfaults while writing partitions to disk — usually on the second partition.
It strangely seems less likely to segfault if the partitions are already there, even if it needs to “reformat” (recreate) them.
It also defaults to using MBR instead of GPT for the partition table, despite the tooltip telling you that MBR is deprecated and limited, and that GPT is recommended for new systems. You cannot change this without doing the partitions manually.
If you do the partitions manually and it can’t figure out where to install things, it just crashes. This is great because you can’t tell it where to install things, and specifying mount points like /boot, /, and /home don’t seem to be enough.
It also tries installing 32bit grub instead of 64bit, causing the grub installer to fail.
If you tell it to install grub on /boot, it complains when that partition isn’t encrypted — fair — but if you tell it to encrypt /boot like it wants you to, it then tries installing grub on the encrypted partition it just created, apparently without decrypting it, so that obviously fails — specific error: cannot read file system.
On the rare chance that everything else goes correctly, the install process can still segfault.
The log does include entries for errors, but doesn’t include an error message. Literally: “ERROR: Installation failed:” and the log ends. Helpful!
If the installer doesn’t segfault and the install process manages to complete, the resulting install might not even boot, even when installed without any drive encryption. Why? My guess is it never bothered to install Grub, or put it in the wrong place, or didn’t mark it as bootable, or who knows what.
Even when using the live disc that includes non-free firmware (including Ath9k) it still cannot detect my wlan card (that uses Ath9k).
I’ve attempted to install thirty plus times now, and only managed to get a working install once — where I neglected to include the Ath9k firmware.
I’m now trying the cli-only installer option instead of the live session; it seems to behave at least. I’m just terrified that the resulting install will be just as unstable as the live session.
All of this to copy the contents of my encrypted disks over so I can use them on a different system. =/
I haven’t decided which I’m going with next, but likely Arch, Void, or Gentoo. I’d go with Qubes if I had more time to experiment.
But in all seriousness, the Debian devs need some serious help. I would be embarrassed if I released this quality of hot garbage.
(This same system ran both Debian 8 and 9 flawlessly for years)15 -
I don't know if I'm being pranked or not, but I work with my boss and he has the strangest way of doing things.
- Only use PHP
- Keep error_reporting off (for development), Site cannot function if they are on.
- 20,000 lines of functions in a single file, 50% of which was unused, mostly repeated code that could have been reduced massively.
- Zero Code Comments
- Inconsistent variable names, function names, file names -- I was literally project searching for months to find things.
- There is nothing close to a normalized SQL Database, column ID names can't even stay consistent.
- Every query is done with a mysqli wrapper to use legacy mysql functions.
- Most used function is to escape stirngs
- Type-hinting is too strict for the code.
- Most files packed with Inline CSS, JavaScript and PHP - we don't want to use an external file otherwise we'd have to open two of them.
- Do not use a package manger composer because he doesn't have it installed.. Though I told him it's easy on any platform and I'll explain it.
- He downloads a few composer packages he likes and drag/drop them into random folder.
- Uses $_GET to set values and pass them around like a message contianer.
- One file is 6000 lines which is a giant if statement with somewhere close to 7 levels deep of recursion.
- Never removes his old code that bloats things.
- Has functions from a decade ago he would like to save to use some day. Just regular, plain old, PHP functions.
- Always wants to build things from scratch, and re-using a lot of his code that is honestly a weird way of doing almost everything.
- Using CodeIntel, Mess Detectors, Error Detectors is not good or useful.
- Would not deploy to production through any tool I setup, though I was told to. Instead he wrote bash scripts that still make me nervous.
- Often tells me to make something modern/great (reinventing a wheel) and then ends up saying, "I think I'd do it this way... Referes to his code 5 years ago".
- Using isset() breaks things.
- Tens of thousands of undefined variables exist because arrays are creates like $this[][][] = 5;
- Understanding the naming of functions required me to write several documents.
- I had to use #region tags to find places in the code quicker since a router was about 2000 lines of if else statements.
- I used Todo Bookmark extensions in VSCode to mark and flag everything that's a bug.
- Gets upset if I add anything to .gitignore; I tried to tell him it ignores files we don't want, he is though it deleted them for a while.
- He would rather explain every line of code in a mammoth project that follows no human known patterns, includes files that overwrite global scope variables and wants has me do the documentation.
- Open to ideas but when I bring them up such as - This is what most standards suggest, here's a literal example of exactly what you want but easier - He will passively decide against it and end up working on tedious things not very necessary for project release dates.
- On another project I try to write code but he wants to go over every single nook and cranny and stay on the phone the entire day as I watch his screen and Im trying to code.
I would like us all to do well but I do not consider him a programmer but a script-whippersnapper. I find myself trying to to debate the most basic of things (you shouldnt 777 every file), and I need all kinds of evidence before he will do something about it. We need "security" and all kinds of buzz words but I'm scared to death of this code. After several months its a nice place to work but I am convinced I'm being pranked or my boss has very little idea what he's doing. I've worked in a lot of disasters but nothing like this.
We are building an API, I could use something open source to help with anything from validations, routing, ACL but he ends up reinventing the wheel. I have never worked so slow, hindered and baffled at how I am supposed to build anything - nothing is stable, tested, and rarely logical. I suggested many things but he would rather have small talk and reason his way into using things he made.
I could fhave this project 50% done i a Node API i two weeks, pretty fast in a PHP or Python one, but we for reasons I have no idea would rather go slow and literally "build a framework". Two knuckleheads are going to build a PHP REST framework and compete with tested, tried and true open source tools by tens of millions?
I just wanted to rant because this drives me crazy. I have so much stress my neck and shoulder seems like a nerve is pinched. I don't understand what any of this means. I've never met someone who was wrong about so many things but believed they were right. I just don't know what to say so often on call I just say, 'uhh..'. It's like nothing anyone or any authority says matters, I don't know why he asks anything he's going to do things one way, a hard way, only that he can decipher. He's an owner, he's not worried about job security.13 -
Telling my mom how to do computer stuff is like programming, I need to outline every fucking step. Yes this includes file management.1
-
Okay it's FUCKing rant time... FUCK you prestashop!
FUCK your utterly bizarre "coding standard"
Also a big FUCK your config files, since when did config files start to include application logic, multiple includes/requires and modification of super-globals. When did I miss that memo?
This file is full of so much FUCKing horseshit, my FUCKing testicles hurt.
FUCK your "module overrides", yes let's duplicate 20-30MB senseless horror code into another folder, just so we can modify one line, without having future updates breaking our stuff.
And your attempt to migrate to a symphony stucture is FUCKing pathetic, do it properly, or don't do it at all.. FUCKtards..
I know wordpress can be bad, but this...
Prestashop takes FUCKing lousy, headache/cancer- giving, piece of crapware to the next FUCKing level.
I wouldn't even wish this FUCKing upon my worst enemy.2 -
CSS + Noob + Import html
Hey guys
Need some help here.
Is it possible to include an HTML file inside another HTML file without an iframe? I wanted to create the structure of the page in one file and include it inside another HTML (for example, have one index that dynamically includes an HTML file in a section, called by the menu OR having the menu, top and footer in one or two files and include them in all the other pages...)42 -
A long long time ago ( 2007 I think ) I worked for a company that made landing sites, so basically an email campaign would go out, users would be sent to a 1 page website with a form to capture their data, ready to be spammed even more. You know how it was back then.
So I worked with a guy who we had just hired, I didn't do the hiring but his CV checked out, so I gave him one of my tasks. Now most pages were made with js and html, with a PHP backend ( called with Ajax). Now this guy didn't know PHP so I was like all good, ASP works too at the end of the day we don't judge, we do like 2 or 3 of these a day and never look at them again. So he goes of and does is thing.
3 weeks later, the customer calls up to me they still haven't received their landing page. Ok so he probably forgot to email the customer np, I tell him to double check he has emailed the customer. Another week goes by end the customer calls back, same problem. At this point I'm getting worried, because we're days away from the deadline and it was originally my task.
So I go back to the guy and I tell him I want that landing page so I can send it myself, half thinking to myself that we had a freeloader, that guy that comes in to companies for 3 weeks, doesn't work, but still cashes his pay. But no, this was much worse.
So he tells me he has finished yet. I ask him why, what's the blocker ? You had 4 weeks to tell me you were blocked and couldn't progress. And his answer was simply, because I wasn't blocked I have been working on it this whole time. So I tell him to zip his project up and email it to me. We didn't do SVN or git back then, simply wasn't worth it. So he comes back to me and says the email server is telling him attachments can't be bigger then 50mb. At this point I'm thinking he didn't properly sized the art or something, so I give him a flash drive to put it on.
When I then open the flash drive, the archive is 300mb, thinking to myself, the images weren't even that big to begin with.
So I open it up, and I don't even find any images, just a single asp page. About 500mb. When I opened that up and it finally loaded, I saw the most horrendous things ever.
The first 500 lines was just initializing empty vars. Then there was some code that created an empty form with an onChange event that submits the form. After that.. it was just non stop nested if's. No loops, no while, for, foreach, NO elseif's, just nested if's, for every possible combination of the state the form could be in. Abou 5000 of them, in a single file. To make matters worse, all the form ( and page ) layout was hardcoded in the if's. Includes inline css, base64 encoded images, nothing but as dynamic, based on the length of the form he changes the layout, added more background etc. He cut the images up for every possible size of the page and included them in the code.
I showed it to my boss, he fired the guy on the spot. I redid the work from scratch, in under 4 hours. Send it to the client. they had no ammends to make, happy as Larry. Whish I kept the code somewhere.
Morale of the story, allways do a coding test on interviews, even if small things just to sanity check.3 -
Yesterday I helped in a college final project. To be done using PHP and MySQL.
- they were taught to create a login page and when submitted just check the values against username and password from DB table and redirect to a dashboard page. No session created.
- in the dashboard, session is not checked. Shows links to other pages.
- each page is a separate php file
- the app allows users to issue books to customers. They were taught to delete the book from book table and save all the info in issue table, when a book is issued
- when a book is returned, book info is saved in a return table and also saved to book table again and deleted from issue table
I asked this student to change it to the right way, to use sessions and includes. He said that then the lecturer would know, he didn't do the project. It's a diploma level course.2 -
10 years ago my bosses came to me: Make a few adjustments to the logic of this website. Should be a quick thing they said. Got a zip file later. Hundreds of php files. Inside, thousands of lines of the best PHP/HTML Spaghetti I've ever seen. No CSS though, but lots of nested table layouts. The best part: everything was in french, content, comments, varnames. The original dev didn't use includes for the most repetitive stuff, even db credentials were copied in every file. Took me a week.
Two weeks later: Change that and that please....
We decided to write everything from scratch then. -
If you're the sort of person to go and willy-nilly modify the service's master configuration file, instead of creating a custom include file, I am going to find you, and strangle you.
Seriously, is it so much to ask to be able to take a single look at service's files and be able to tell, if it includes anything custom?! -
"Send me a unity package file when you're done, which includes any models, scripts, and prefabs."
Seems like someone didn't take a lesson in naming or basic computer housecleaning.3 -
So I'm making a little CMS for a website generated by iWeb from Apple which is ofcourse shit. I just discovered that they include a 6000 lines javascript file with nu purpose except generating the menu from a feed.xml(which includes to other js files). And the most frustrating thing is that it lowers fontSize if you add more text than the viewport. Fucking hell. I'm looking for a way to dismantle this shit.
-
Working with a data scientist on an update to a machine learning api that has dinner logic change with a new model.
He's wondering why his PRs are falling.
He's trying to merge into development from a branch created off of main.
He's renamed all the functions and classes and never updated the call points.
He's using new packages but never includes them in the requirements file, so the docket builds are failing.
His class method definitions don't contain self and are throwing syntax errors.
I've been working with him for 4 days to get him to understand branching, linting, unit testing, and not blindly copy and pasting snippets from jupyter notebook into production api code!8 -
If you are going to maintain empty directories in your git repo then use the strategy of placing a file inside the directory called .gitkeep. Searching on this filename will lead you to a discussion of the same topic (hopefully, maybe not). Which includes a lengthy discussion on how the semantics of the file name is somehow more important than the answer of keeping the directory in the repo. My favorite part was someone claiming the file name .gitkeep was the standard way of maintaining a directory and others jumping on this person saying not it is NOT the standard way, and that in fact any filename would work. Misunderstanding that saying it was the standard probably only referred to placing a file and not choosing that exact name.
Basically it seemed to turn into an autists semantics fistfight in the comments.
https://stackoverflow.com/questions...
Someone is that discussion claimed .gitkeep would lead to confusion if it was a standard git filename. I then found this:
https://stackoverflow.com/questions...
Is it wrong to find so much humor in this?4 -
*npm run dev*
Why aren't my CSS changes showing up?
*make selector changes*
*npm run dev*
Oh, c'mon!
*make more specific selector changes*
*npm run dev*
It's not even showing up-- wait...
*checks code*
*SASS file not included in the main app.scss*
Oh. I'm stupid.1 -
I've been trying to use obsidian.md for a while. Today I found a feature in Templater that I wish I knew about sooner.
I have a few templates I use and they are so long and clunky and I repeat parts between them because I couldn't figure out nesting templates between files. Until today.
in templater's files module (https://silentvoid13.github.io/Temp...) it includes an include function "tp.file.include(include_link: string ⎮ TFile"
and that singular function took my one 65 line template file which shares parts with other templates I'd have to remember to edit if I edited any part of it, down to 14 lines separating the shared parts into their own files.
It's a lot more DRY of a template now and will definitely make my experience using Obsidian a lot more manageable, wish I learned about this sooner3 -
Today, I decided to learn build a c++ project using cmake. Since I've never done a big project in C++ I have no experience with these stuff.
Couple of hours for researching and trying to understand how that thing works, how to specify things, this and that. Wrote a small program for testing.
Everything was fine. Makefile was generated and program was worked.
Then.... Somehow, sublime text started to give me error messages like, 'the header file you included is not found.' I hit the makefile again, the built was successfull... I know that, need to add -I to compiler flag so that it can find the files. But in sublime text constantly refuses my 'possible' solutions.
Even ycm in vim does this. They expected me to write includes like '../thispkcg/include/header.h'
Where did i go wrong ..............
Btw it works like a charm in cLion I don't know why..2 -
Fuck yeah ... I have uploaded my major computation file to S3 and create Lambdas from those files(includes numpy and pandas also) and now I have only routes and invoke strategies in my EC3 .. looking for cost reduction....
-
I wrote my first proper promise today
I'm building a State-driven, ajax fed Order/Invoice creation UI which Sales Reps use to place purchases for customers over the phone. The backend is a mutated PHP OSCommerce catalog which I've been making strides in refactoring towards OOP/eliminating spahgetti code and the need for a massive bootstrapper file which includes a ton of nonsense (I started by isolating the session and several crucial classes dealing with currency, language and the cart)
I'm using raw JS and jquery with copious reorganization.
I like state driven design, so I write all my data objects as classes using a base class with a simple attribute setter, and then extend the class and define it's attributes as an array which is passed to the parent setter in the construct.
I have also populateFromJson method in the parent class which allows me to match the attribute names to database fields in the backend which returns via ajax.
I achieve the state tracking by placing these objects into an array which underscore.js Observe watches, and that triggers methods to update the DOM or other objects.
Sure, I could do this in react but
1) It's in an admin area where the sales reps using it have to use edge/chrome/Firefox
2) I'm still climbing the react learning curve, so I can rapid prototype in jquery faster instead of getting hung up on something I don't understand
3) said admin area already uses jquery anyway
4) I like a challenge
Implementing promises is quickly turning messy jquery ajax calls into neat organized promise based operations that fit into my state tracking paradigm, so all jquery is responsible for is user interaction events.
The big flaw I want to address is that I'm still making html elements as JS strings to generate inputs/fields into the pseudo-forms.
Can anyone point me in the direction of a library or practice that allows me to generate Dom elements in a template-style manner.4 -
Quick Plesk config question...
Been getting open_basedir() notices in the WordPress logs, and frankly it's flooding the log right now. Sample below:
[24-Feb-2019 07:05:19 UTC] PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/vhosts/webspacedomain.com/SiteInstallDirectory/wp-content/db.php) is not within the allowed path(s): (/var/www/vhosts/webspacedomain.com/:/tmp/) in /var/www/vhosts/webspacedomain.com/SiteInstallDirectory/wp-includes/load.php on line 397
Checking the settings for open_basedir in the domain's PHP settings, it's currently set to the following default value:
{WEBSPACEROOT}{/}{:}{TMP}{/}
By my read, that **should** be granting permission to the directory. I just checked it against the setting on the dev server (which doesn't report this error), and it's configured in the same manner. Only difference between Dev environment and this one is that the one in Dev is in vhosts/webspacedomain.net/DEV instead of just vhosts/webspacedomain.net
Is there something I'm missing here?4 -
We have an internal nuget package that wraps up the IConfiguration+ConfigurationBuilder for various .net core console/service apps (TL;DR, because people got creative), and it has a dictionary property for the common sections we use. AppSettings (for backward compatibility), ConnectionStrings, and ServiceEndpoints. If the need arises, I can add methods to return any type of object (no one has requested yet, we try to keep configs dead simple)
ex. var myDatabaseConnectionString = ConfigurationManager.ConnectionStrings["MyDatabase"];
Code review for someone who updated a .net framework app to .net core and they wrote their own IConfiguration wrapper for accessing the appsettings.json file, so I pointed out that we already had a library for that.
In the reply, he said he couldn't use our library because it had an 'AppSettings' property and since his appsettings.json file didn't have that section, he didn't want to cause a runtime exception.
OK, WTF...I even sent him a link to the documentation (includes explaining the backward compatibility part)...why the frack would you think because a property exists and you don't use it, that would cause some kind of runtime exception?
We have dozens of .net framework apps migrated to .net core with zero code changes and no one ever brought this up as a concern (because, why would they?)
Deep breath...ahhh...I respond that not having an AppSettings section in the appsettings.json file won't cause an exception, if you don't have one, don't need it, you don't have to use it.
He went ahead merged+committed his code anyway with his own IConfiguration+ConfigurationBuilder plumbing.
Code addiction is real kids...it's real.2 -
I am working on partitioning my life and getting my tech stuff and online life organized. Partially fun, partially dread. Still one of the better things I'm dealing with right now.
Tech stuff mainly includes desktop PC (Qubes OS), network (to be driven by openwrt) and smartphone (already running Lineage OS, but I want to build my own LOS). This is the fun part. I want to add a NAS, but I'm too cheap for a proper one (at least for my >20TB media).
Furthermore offline stuff: Remove clutter, get analog documents properly organized (with a sustainable system) and possibly digitalized. I already have maybe half of the things I own in boxes each with a specific purpose (e.g. audio cables, network cables and game controllers each have their own box). Can be tiresome, but it's easy to see a progress and that makes it quite okay.
Online life: That's a big one. A large chunk is email and the hundreds of website accounts. I have them in a keepass file, but all running under the same address. Unfortunately I need to have a Facebook account for some purposes, but I'd like to start over with a new one. Not so easy when you have to transfer group admin privileges though, when I tried the last time I tripped some system and the new account was banned. Annoying. -
Hi all, I've just started learning how to create a wordpress site from scratch. I have created a header.php file which includes an image. The image displays fine on the front page but doesn't display on any other pages. The rest of the header.php displays fine on all pages.
Any ideas why the image only works on one page?
All page files are in the root folder.
TIA4 -
I'm almost ashamed to ask this but...
I need help with git, not GitHub but just plain git.
So I have Linux on windows because I realised all i need is bash, not all of Linux. So I'm taking a tutorial on git because... I'm a programmer, I need to know this. So I am also doing some demo stuff on my own and... I have no clue where to put the file I want to handle with git. In pretty sure I should put it in the file containing the .git folder, which includes .bash_history, etc. But when I git init and git status, it doesn't see it, so am i doing something wrong?
To be specific the test file is in
C:///Users/...6