The Most Absurd Thing You've Ever Coded/Built
-
@PleegWat said in The Most Absurd Thing You've Ever Coded/Built:
I wrote a C program to help me cheat on hangman.
A virus?
-
@mott555 It's all flooding back. I just remembered another supreme WTF I wrote. So we had big public-facing web servers that hosted secured GIS data and applications for clients. I ran into a bug with our upstream vendor's GIS web API, and they pretty much ignored me when I reported it. But in our case, it was a show-stopping bug.
I ended up writing a custom reverse-proxy as a C# web service. Now, instead of contacting the vendor's web API directly, our applications called my reverse proxy. My reverse proxy would do deep inspection of all API requests coming through it, and if it detected corrupt/incomplete data due to this bug, it would modify the response and send a patched response to the web client to keep it functioning.
-
#include <ctype.h> #include <stdio.h> #include <string.h> int main(int argc, char * argv[]) { char * clue = argv[1]; char * checked = argv[2]; int letter[256]; int cluelen; int i, n, done; FILE * words; char word[256]; char matches[10][256]; int matchcount = 0; if( !clue ) { printf( "Specify a clue and optionally letters already checked\n" ); return -1; } for( i = 0 ; i < 256 ; i++ ) { letter[i] = isupper(i) ? 0 : -1; } for( i = 0 ; clue[i] ; i++ ) { if( isalpha(clue[i]) ) { clue[i] = toupper(clue[i]); letter[clue[i]] = -1; } } cluelen = i; for( i = 0 ; checked && checked[i] ; i++ ) { letter[toupper(checked[i])] = -1; } if( !(words = fopen("/usr/share/dict/words", "r")) ) { printf( "Could not open words\n" ); } printf( "Look for %s, not using: '", clue ); for( i = 0 ; i < 256; i++ ) { if( isupper(i) && letter[i] < 0 ) { putchar(i); } } printf( "'\n" ); while( fgets( word, sizeof word, words ) ) { /* Check lengths */ if( strnlen( word, cluelen ) < cluelen ) { continue; } if( !isspace( word[cluelen] ) ) { continue; } word[cluelen] = '\0'; /* Check pattern */ for( i = 0 ; word[i] && clue[i] ; i++ ) { word[i] = toupper(word[i]); if( word[i] == clue[i] ) { continue; } if( clue[i] != '.' ) { break; } if( letter[word[i]] < 0 ) { break; } } /* Handle pattern match */ if( ! word[i] && ! clue[i] ) { if( matchcount++ <= 10 ) { snprintf( matches[matchcount - 1], sizeof matches[0], "%s", word ); } for( i = 0 ; i < 256 ; i++ ) { if( letter[i] >= 0 && strchr( word, i ) ) { letter[i]++; } } } } if( matchcount == 0 ) { printf( "No matching words found\n" ); } else { printf( "Found %d matching words\n", matchcount ); for( n = 1, done = 0 ; ! done ; n++ ) { done = 1; for( i = 0 ; i < 256 ; i++ ) { if( letter[i] > n ) { done = 0; } else if( letter[i] == n ) { printf( "%c: %d (%d%%)\n", i, letter[i], 100 * letter[i] / matchcount ); } } } if( matchcount <= 10 ) { for( i = 0 ; i < matchcount ; i++ ) { printf( "%s\n", matches[i] ); } } } return 0; }
-
@cvi said in The Most Absurd Thing You've Ever Coded/Built:
I was fucking tired of dealing with Matlab's shit
QFFT
-
@Mason_Wheeler said in The Most Absurd Thing You've Ever Coded/Built:
@anonymous234 said in The Most Absurd Thing You've Ever Coded/Built:
@DogsB Apparently this is officially supported by Google, which kind of shocks me because I thought they wanted to discourage that kind of thing?
Why would they want to discourage sites protecting themselves against fraudulent Google impersonators?
Showing different content to the crawler and a first time on the site user is usually a big no no.
-
@Benjamin-Hall said in The Most Absurd Thing You've Ever Coded/Built:
Worked pretty well, but got abandoned because the other teachers prefer Word documents they can edit, as LaTeX is a bit too arcane for them.
Why didn't you add the option to output as word documents then? It's only a load of zipped up xml
-
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
A Magic the Gathering game in MS Access. I only ever implemented a few cards: simple creatures and direct damage spells, I think.
I don't suppose you still have that? I would like to see some screen captures at the least.
Nope. This was over 20 years ago.
-
@Jaloopa said in The Most Absurd Thing You've Ever Coded/Built:
@Benjamin-Hall said in The Most Absurd Thing You've Ever Coded/Built:
Worked pretty well, but got abandoned because the other teachers prefer Word documents they can edit, as LaTeX is a bit too arcane for them.
Why didn't you add the option to output as word documents then? It's only a load of zipped up xml
Yeah....I've heard enough horror stories about Office interop that I didn't even want to attempt it. Documents are hard enough as is--including those rather non-well-specified APIs was a total non-starter. At least at the time.
-
Absurd things I've coded... hm.
Well, I created a tab-to-tab userscript message-passing interface using a combination of
GM.setValue
/GM.deleteValue
andGM_addValueChangeListener
. Then, using that intercom interface, I created a userscript that runs in all tabs. In each tab, it detects video elements, and it broadcasts each video's title to all other tabs. In all of the other tabs, the userscript registers a GM menu option which signals the original tab to play/pause the video.Is that absurd enough?
It has a couple of minor glitches... nothing too major though. Among them, a tab that's killed doesn't always get its "I'm dying" message out quickly enough -
GM.setValue
is asynchronous, and that doesn't work well withonUnload
; the result is zombie menu options that send a message to a tab that doesn't exist. I did add a timeout; if the tab doesn't acknowledge the message within a set period of time, it assumes the tab was closed and it removes the corresponding menu option(s). What I should probably just do is make it so that tabs with videos re-broadcast periodically, and then I'd be able to set a timeout to remove menu options whose tabs haven't been heard from in a while.@julianlam might recognize the concept... I also used that same intercom interface for another thing that I did a while back.
-
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
- I also once wrote a userscript that automatically hides the various "New contributor" banners across StackExchange sites (including StackOverflow).
StackExchange has some pretty large and obtrusive banners. The "X is a new contributor - please be nice to him" banners are quite small and discreet. Is it that the idea of being nice to someone is repugnant to you, or just that being told to be nice to someone is repugnant?
Yes, because it adds to nothing and is the most obnoxious thing ever invented. Imagine the fun when for every post a WTDWTF user registered less than a month ago makes, a "X is a new user - please be nice to him" banner is added to the post.
Actually, @boomzilla should make it. I'm sure it'll be as popular as that feature when we can see who downvoted a post.
-
@DogsB said in The Most Absurd Thing You've Ever Coded/Built:
I had to write an IP lookup to prevent people who have changed their browser agent to goggle's crawler from accessing paywalled content. It turned out to be less than 2% of users.
"Unethical programming" thread is
-
I wrote a python script that runs in the background of my home PC all the time and checks every keystroke ever, so that it can pop up a Tk textbox if I press Ctrl twice, which then sends the input to a Google search. That's because I don't want to keep a browser open. I often forget to kill that process when gaming.
I wrote a C# WPF app to categorize the ~70 members of my church community into 3-5 person groups, for our twice-a-year weekend spiritual retreat, randomly but based on a set of constraints. It runs a naive first fit graph coloring algorithm. You can specify constraints on the UI that would make it run forever, so I added a Cancel button. The app exports an Excel file which contains a lot of ugly VBA macros written by a previous member of the community. The macros generate our name badges.
I started writing a declarative GUI library for Python Tkinter and used it for my thesis.
Actually now I realize that the absurd things I've built so far are the ones I'm proud of.
-
@marczellm said in The Most Absurd Thing You've Ever Coded/Built:
Actually now I realize that the absurd things I've built so far are the ones I'm proud of.
This line alone was worth voting it up for!
-
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
Actually, @boomzilla should make it.
Fuck you.
-
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
- I also once wrote a userscript that automatically hides the various "New contributor" banners across StackExchange sites (including StackOverflow).
StackExchange has some pretty large and obtrusive banners. The "X is a new contributor - please be nice to him" banners are quite small and discreet. Is it that the idea of being nice to someone is repugnant to you, or just that being told to be nice to someone is repugnant?
Yes, because it adds to nothing and is the most obnoxious thing ever invented. Imagine the fun when for every post a WTDWTF user registered less than a month ago makes, a "X is a new user - please be nice to him" banner is added to the post.
Actually, @boomzilla should make it. I'm sure it'll be as popular as that feature when we can see who downvoted a post.
The tell is that they haven't uploaded an avatar yet, newb.
-
I don't think anything has ever surpassed the Stonesurfers Pyroto question database, even though that's quite some time ago.
Some background: Pyroto was a weird sort of social trivia game. There was a large but finite database of trivia questions, and it you played enough you would see repeats. But each player had a limited number of turns per day, and a limited time to answer each question - one try, right or wrong. So it led to players saving the questions, and the answers they tried, right or wrong.
Now, as I said, it was a social trivia game. There were official in-game alliances of a sort, and this led to external-to-the-game teams who shared their saved questions and answers.
Our team had a Yahoo group, and people started entering their questions and answers into the database which the Yahoo group provided. This worked, for a while. Eventually, though, we exceeded the fixed 1000 row limit that Yahoo put on the database they provided. Also, this wasn't maintainable. There were lots of duplicate and near-duplicate questions due to people re-entering things we had already found.
So another system was layered over this. Members used a web email form to submit their questions and answers in a format that a program I wrote would read. This program would consolidate duplicates, check based on some heuristics I wrote for near-duplicates that maybe were really the same question, and when it was all done, wipe out the database we had last used, and bulk-upload the new version into the database.
This worked for a while. But the Yahoo group database had a hard limit of 1000 rows, and once we got this operation going, pretty quickly we exceeded this. We were allowed 10 of these databases, though, so at first we split them up by level. There were 6 or 7 different levels which were exponential; you'd play twice as much at each level compared to the preceding one, and the number of questions in each level was roughly proportional to the time you'd spend there.
Naturally, we pretty quickly exceeded the 1000 rows on just the highest difficulty level, so I just started splitting up those high difficulty levels into multiple databases, and consolidating the easy ones with few questions into a single database.
Eventually, we had over 9000 questions and the writing was on the wall. I scrapped the idea of using the Yahoo database ONLY AT THIS POINT and instead wrote a search engine using a local Python web server each player would run queries against, which made it much easier to find answers - the same similarity code I was using to find near-duplicates was then available for everybody all the time, and the question updating was built into the thing too. But the only reason I made the real solution was because the lame thing we had been doing had hard limits built in!
-
Since he's not allowed out of his topic...
: SSDS
-
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
@HardwareGeek said in The Most Absurd Thing You've Ever Coded/Built:
@topspin said in The Most Absurd Thing You've Ever Coded/Built:
where’s the WTFs?
Writing a GUI application in Perl; isn't that enough of a ? Also, having committed that , abandoning a nearly working project so close to completion.
Not as bad as writing a GUI application in Lua.
Since I've never written so much as a single line of Lua (I don't remember even looking at any, although I probably have), you're not wrong; that would almost certainly be even more absurd.
-
@Benjamin-Hall Yeah, it's pretty telling that for docx files, the Microsoft Office OpenXml SDK does not touch Interop, it manipulates the XML model and OPC package directly.
-
@Medinoc said in The Most Absurd Thing You've Ever Coded/Built:
@Benjamin-Hall Yeah, it's pretty telling that for docx files, the Microsoft Office OpenXml SDK does not touch Interop, it manipulates the XML model and OPC package directly.
I started looking at that documentation...I'm glad that I didn't try going to Word. Especially since I was working on MacOS in Python, not WIndows and C#.
-
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
Since he's not allowed out of his topic...
: SSDS
I didn't realize there were any users who were confined to a single topic. Are there any other users subject to custom rules?
-
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
Since he's not allowed out of his topic...
: SSDS
I didn't realize there were any users who were confined to a single topic. Are there any other users subject to custom rules?
No. He's special. In pretty much every sense of the word.
That agreement was hashed out a long time ago, BTW.
-
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
Since he's not allowed out of his topic...
: SSDS
I didn't realize there were any users who were confined to a single topic. Are there any other users subject to custom rules?
No. He's special. In pretty much every sense of the word.
That agreement was hashed out a long time ago, BTW.
Is it actually enforced? Or is it a gentleman's agreement that's worked out well.
-
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
Since he's not allowed out of his topic...
: SSDS
I didn't realize there were any users who were confined to a single topic. Are there any other users subject to custom rules?
No. He's special. In pretty much every sense of the word.
That agreement was hashed out a long time ago, BTW.
This does explain rather a lot.
-
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
Imagine the fun when for every post a WTDWTF user registered less than a month ago makes, a "X is a new user - please be nice to him" banner is added to the post.
I imagine that would be as popular among the crew here as when Alex changed the domain to WorseThanFailure.
-
@devjoe said in The Most Absurd Thing You've Ever Coded/Built:
the database which the Yahoo group's database.
-
@Mason_Wheeler said in The Most Absurd Thing You've Ever Coded/Built:
@devjoe said in The Most Absurd Thing You've Ever Coded/Built:
the database which the Yahoo group's database.
Fixed. We have reviewers at work for the same reason.
-
@Benjamin-Hall said in The Most Absurd Thing You've Ever Coded/Built:
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@boomzilla said in The Most Absurd Thing You've Ever Coded/Built:
Since he's not allowed out of his topic...
: SSDS
I didn't realize there were any users who were confined to a single topic. Are there any other users subject to custom rules?
No. He's special. In pretty much every sense of the word.
That agreement was hashed out a long time ago, BTW.
Is it actually enforced? Or is it a gentleman's agreement that's worked out well.
Basically, we told him we wouldn't ban him like every other forum in the world did so long as he kept inside his one thread. He's been very agreeable about it.
-
@HardwareGeek said in The Most Absurd Thing You've Ever Coded/Built:
abandoning a nearly working project so close to completion.
Is that a ? I once bought myself this T-shirt for exactly the reason it says on the front:
Sidebar : I tried going to thinkgeek.com to find an image of that shirt. Turns out that now redirects to https://www.gamestop.com/toys-collectibles/thinkgeek which currently says:
Access Denied
You don't have permission to access "http://www.gamestop.com/toys-collectibles/thinkgeek" on this server.
Reference #18.bdf31502.1569345806.178d0c1e
-
@Gurth said in The Most Absurd Thing You've Ever Coded/Built:
I think I need to buy a gross of those. But I'll never get around to actually ordering them.
-
@HardwareGeek That would be laziness, not not finishing things you start. Unless you never get round to clicking the “Proceed to checkout” link, of course.
-
@Gurth Sometimes I don't finish what I start; sometimes I don't even start.
But yes, I have a long history of starting things I don't finish. The project described in this thread. Multiple attempts to create an ambitious tabletop game platform that could be used to implement any combination of dice (including dice with any arbitrary number of sides, even loaded), cards, and moving one or more pieces along a board — from a pure dice game like craps, a pure card game like poker or blackjack, a pure movement game like chess, or a combination resembling (but not copying) Monopoly®. Multiple animation projects. Academic projects that I completed just enough to get a grade, but never actually finished; two that come to mind from high school were my one "serious" attempt at fiction for an English class and a mosaic in the Byzantine style for an art class.
-
@devjoe said in The Most Absurd Thing You've Ever Coded/Built:
Eventually, we had over 9000 questions
Over 9000? That's ridiculous.
-
@brie said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
- I also once wrote a userscript that automatically hides the various "New contributor" banners across StackExchange sites (including StackOverflow).
StackExchange has some pretty large and obtrusive banners. The "X is a new contributor - please be nice to him" banners are quite small and discreet. Is it that the idea of being nice to someone is repugnant to you, or just that being told to be nice to someone is repugnant?
Yes, because it adds to nothing and is the most obnoxious thing ever invented. Imagine the fun when for every post a WTDWTF user registered less than a month ago makes, a "X is a new user - please be nice to him" banner is added to the post.
Actually, @boomzilla should make it. I'm sure it'll be as popular as that feature when we can see who downvoted a post.
The tell is that they haven't uploaded an avatar yet, newb.
Assuming someone should have a custom avatar is like assuming people have 2 genders, so you're the real newb here.
-
@_P_ They're not custom, they're avatar-fluid.
-
@brie said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
@jinpa said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
- I also once wrote a userscript that automatically hides the various "New contributor" banners across StackExchange sites (including StackOverflow).
StackExchange has some pretty large and obtrusive banners. The "X is a new contributor - please be nice to him" banners are quite small and discreet. Is it that the idea of being nice to someone is repugnant to you, or just that being told to be nice to someone is repugnant?
Yes, because it adds to nothing and is the most obnoxious thing ever invented. Imagine the fun when for every post a WTDWTF user registered less than a month ago makes, a "X is a new user - please be nice to him" banner is added to the post.
Actually, @boomzilla should make it. I'm sure it'll be as popular as that feature when we can see who downvoted a post.
The tell is that they haven't uploaded an avatar yet, newb.
So if I replace my avatar with the default one, will people be nice to me?
-
@jinpa YMBNH.
-
My first bit of paid programming work was to modify some logic so it depended on the day of the week (something like don't process on the last Friday of the month, it was a tool used in an investment bank). The part of the application where this sort of rule was encoded was an xslt file, since the rest of the rules were much simpler.
So, thinking I was rather clever to find such an elegant solution, I looked up Zeller's algorithm and implemented it in xslt
-
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
Assuming someone should have a custom avatar is like assuming people have 2 genders
Most people have 1 gender. But you have to pick which of the 2345233523 different ones that is.
-
@dcon said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
Assuming someone should have a custom avatar is like assuming people have 2 genders
Most people have 1 gender. But you have to pick which of the 2345233523 different ones that is.
Gender is a thing you're supposed to have?!
Is "Non committal shrug" a valid choice?
-
@Vixen said in The Most Absurd Thing You've Ever Coded/Built:
@dcon said in The Most Absurd Thing You've Ever Coded/Built:
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
Assuming someone should have a custom avatar is like assuming people have 2 genders
Most people have 1 gender. But you have to pick which of the 2345233523 different ones that is.
Gender is a thing you're supposed to have?!
Is "Non committal shrug" a valid choice?
alternatively I would be satisfied with "Confused Tim The Toolman Noise"
-
@_P_ said in The Most Absurd Thing You've Ever Coded/Built:
I once wrote a script that scrapes a dead (as in, completely inactive) site every hour.
I'm currently rsync-ing the company's WordPress site every six, just in case.
-
@Vixen UH?
-
-
@Vixen AR AR AR AR AR
-
@Captain said in The Most Absurd Thing You've Ever Coded/Built:
@Vixen AR AR AR AR AR
that one too, but only when i break into the vodka, and even then only sometimes.
-
I'm sure other examples will occur to me as people post in this thread.
Wrote a PowerShell script to extract .tgz files. The gzip part can be handled by the .NET Framework, the .tar part can't. Turns out .tar is a pretty simple file format though (which makes sense, given how old it is).
If I recall this was because my WinZip was broken, 7-Zip was banned, and trying to find some other free software to extract .tgz files, getting it approved, and transferring it to my network would take too long when I just wanted a .tgz extracted now.
I'm sure almost all absurd things I've written have been due to constraints/just wanting to get things done in a timely manner rather than wait for approval processes/other teams.
-
@heterodox said in The Most Absurd Thing You've Ever Coded/Built:
The gzip part can be handled by the .NET Framework, the .tar part can't
That's because... seriously, who even uses those today?
TAR is an antique (and largely incomprehensible) format from the bad old days when CLIs and other bizarre dinosaurs ruled the earth, when concatenating multiple files into a linear Tape ARchive was something a user might be reasonably expected to do on a regular basis.
Today, ZIP archives indisputably rule the world and have for at least a quarter-century now.
Gzip has found some niche uses in graphics and HTTP, which makes it important to support, but for multi-file archives, anyone using anything but ZIP in this day and age is and everyone knows it, so why should the .NET Framework act as their enabler?
-
@Mason_Wheeler said in The Most Absurd Thing You've Ever Coded/Built:
TAR is an antique (and largely incomprehensible) format
Note that your comment doesn't have anything to do with the format itself but with the command-line utility. I linked to the format specification above. It's actually fairly comprehensible
anyone using anything but ZIP in this day and age is
I mean, that's fine, but sometimes you have to deal with sites and teams that are . That's basically why this site exists.
so why should the .NET Framework act as their enabler?
Not arguing with you there.
-
@heterodox said in The Most Absurd Thing You've Ever Coded/Built:
I mean, that's fine, but sometimes you have to deal with sites and teams that are . That's basically why this site exists.
I suppose. I'd actually say that's why GitHub exists.
Top Google result for "C# tar library":
Shouldn't take too much work to get this to untar things in PowerShell.