|
yaoi prophet posted:You know what I always thought my blog needed? Completely randomized theming. And not just randomized, but really randomized. Credit where it's due, though, I would never have thought of using the first third of the MD5 hash of the title, plus the day of the month, modulo the number of themes available, to randomly select a given theme. Would code:
|
# ¿ Oct 20, 2011 07:44 |
|
|
# ¿ May 10, 2024 16:07 |
|
Found something I think is horrible; the framework for an e-commerce site I'm doing work on generates its pages based on where certain comments are, which caused me a certain amount of difficulty when certain of those comments were duplicated. It might just be that I learned to program with languages that actually respect comments, but this is madness. It's like building a mansion with a marble frieze spelling out "The Owner is a twit", just because somebody scribbled a note on the plans. Comments are for people, not programs.
|
# ¿ Nov 6, 2011 03:29 |
|
OriginalPseudonym posted:So basically someone's recreated IFDEF in...what, PHP? Except with comments instead of, you know, ifdef. Honestly don't know much about the system; I'm doing some simple work on a website which uses that framework, some simple Javascript and CSS work. Apparently it might be written in ASP.
|
# ¿ Nov 6, 2011 07:33 |
|
Orzo posted:Haha, worst binary search variable names ever. Also runs a comparer of unknown complexity 3 times per iteration... Eh. I might have used variable names like that when I was a student, just for a laugh. Granted, I'd have no idea what they were when I examined them later, nor would the grader understand it, but it'd be funny. The comparator would be a bigger concern; even as a student, I understood that you want to avoid doing things like that more than once. Would it be so hard to do it right? code:
|
# ¿ Nov 16, 2011 08:18 |
|
Cross-posting from the TvTropes thread in PYF: This dude's profile may or may not be a horror, personally I think it looks kinda cool, but the explanation is. TvTropes uses a semi-custom markup and parser for its pages, which apparently can't handle nested markup; instead of parsing [foo [bar ]] as the sensible <foo> <bar> </bar> </foo>, it turns them into <foo> <bar></foo></bar>, which is somewhat less sensible, and since we no longer have a nice simple DOM tree to work with, poo poo gets crazy yo. I can't explain worth a drat, just read the explanation he provided.
|
# ¿ Dec 25, 2011 00:25 |
|
Doc Hawkins posted:But on the other hand, how would doing that help me portray myself as the victim of soulless modernity? "I wish I could just trust people, but folks these days are bastards, so I have to put up walls between me and thee, O good and gentle players. <emo, drama, self-drat-pitying>" "bosschair posted:I think this issue could really get solved if someone could come up with just one more retarded analogy.
|
# ¿ Dec 25, 2011 18:37 |
|
w00tz0r posted:Apparently executing raw, user-entered SQL on the server isn't an issue if you simply create a new copy of the database for every query. A legitimate solution, inasmuch as it keeps the production database safe from the ravages of users; but how can you merge changes without including anything malicious, or how do you filter the stuff users should be querying from the stuff they shouldn't? And if you do filter/sanitize the SQL your users input, how do these people justify the expense of copying the database for every little query?
|
# ¿ Dec 29, 2011 01:04 |
|
Is it cool to talk about terrible ideas here? Because a colleague/relation of mine had a brilliant idea to create a StackOverflow-type site, where the users post a poll with their question, "Which answer is right?". Other folks vote on that poll and by the Wisdom of the Group truth shall emerge and the best answer will win out, and those who voted for the correct answer get karma/rep for being right or just agreeing with the most people, which gives them more weight in any further polls they vote on. It would combine all the wisdom of Stack Overflow with the democracy of Reddit, in a final product that would, he assures me, make us zillions of dollars if I just do the backend work for him. Additional problems include the obvious fact that many users won't have a good idea as to what the truth is, and the old Put down the chocolate covered banana situations. I do like that phrase. Incidentally, this same dude thought the Unix Millennium bug could be solved by replacing the ints everywhere with doubles, because they have a larger range.
|
# ¿ Feb 20, 2012 19:08 |
|
prefect posted:It sounds like a terrible idea, but it wouldn't be the first terrible idea to make zillions of dollars. (Doesn't Stack Overflow already have voting on answers? That seems to be the key element of this guy's idea.) That's another part of why it's terrible; he wants to start it on StackExchange, in direct competition with Stack Overflow. But his idea would win because it's the better choice. Free Market and all that. Optimus Prime Ribs posted:He wanted you to work for free, and only compensate you after its success, didn't he?
|
# ¿ Feb 20, 2012 23:06 |
|
No Safe Word posted:You mean like start it on their Area51 site and try to build a groundswell until it's an actual official StackExchange site? I don't see how it would be "started on StackExchange" and then move away from it... I think he did mean Area51, but the secondary horror is the fact that it'd be competing with the site that spawned it and that it was based on. Say again, I refused this proposition before any technical details got hashed out.
|
# ¿ Feb 21, 2012 00:07 |
|
Not sure just how much of a coding vs business horror this is, but: Ran into a problem at work of a technopolitical nature. Asked for help with it in this post, but the summary is that my code and client code are butting heads and one of them will have to be modified to make everything work. Managed to modify my code to make it fit, but that's not the horror. The horror is that I mentioned this problem to a carpool buddy, and that my only good options here were break client code or modify my code. He suggested that I break the client code, then explain to the client that it was necessary to make my code work. The client, being a rational business owner, will totally understand that you, as the expert they hired, know what you're doing better than they do, that this is the best way to make your code work, and they definitely won't resent you suggesting their site is ugly and badly coded. And then after this meeting where they thank me for breaking their site, we'd all ride off on our unicorns to Neverland, to have tea with the Queen of the Fairies. Hell, I'm a programmer with Asperger's, and I have a better grasp on people than this guy does. Re: The delimiters, I understood the first one fairly quickly to be a curvy lady's torso, but the second one is a bit more puzzling. Man's torso, possibly with a boner?
|
# ¿ Jun 2, 2012 20:56 |
|
Just came across a piece of my boss's code, and I'm not sure if it's horror or simplicity. Boss needed to work out how many items are in a given category, like on this page, and all that was really needed was a qualitative answer, whether or not there were more than 20 items in a category. With that in mind how would you get this answer? Personally, I'd use jQuery to count up all the product images on the page and call it good. Quick, easy, usable on many sites. JavaScript code:
JavaScript code:
|
# ¿ Jun 6, 2012 07:01 |
|
pigdog posted:What if there are 500 items in the category, but the page is set to display only 20 of them at a time? What if some of the items don't have images associated with them? Apparently the site's set to display at least 40 items on a category page, so that's not an issue. AFAIK, all the products have images, so my solution would still work. They may be blanks reading "No Photo Available", but every product has an image. And of course it doesn't really matter anymore, since the new system doesn't care about how many items are in a category. Site's not ours, we're just scraping it, and it's in English for a mostly English-speaking customer base, so i18n is not a big concern. Apparently #CatTotal referred to the whole tag "Total Items: All of them", hence the need to cut out the number with a substring. I say apparently because the client has since changed it from #CatTotal to something else, so this code doesn't work right anymore, not that we need it as noted above. If we were going to continue using this code, it would be easy enough to scrape the "Total Items: lots" in a way which is still i18n-compatible: JavaScript code:
|
# ¿ Jun 6, 2012 18:19 |
|
I think I just came across a small coding horror; for the past while our service hasn't been logging sales from some of our clients, meaning that our data is out of date, which is bad. I managed to track down the most likely cause of the problem to a subtle typo. Observe. JavaScript code:
|
# ¿ Aug 16, 2012 21:47 |
|
pokeyman posted:Surely that'd throw an exception? Or is there some other function called setCustomerId? That's the problem exactly. The reportSales function tries to call setCustomerID, it throws an exception because there is no setCustomerID function, and errors out of the reportSales function.
|
# ¿ Aug 16, 2012 22:43 |
|
Suspicious Dish posted:I hope the fix that you deployed was to make aliases. Haven't deployed it yet; will hold off until tonight, after peak business hours for the clients, when my frenzied attempts to fix the real problem won't cause too many problems for people. Adding this alias will still cause a small problem because the JS file it's going in is already 43K and growing, which is one of the reasons I want to refactor it. darthbob88 fucked around with this message at 02:55 on Aug 17, 2012 |
# ¿ Aug 17, 2012 02:49 |
|
geonetix posted:My point is that this kind of idiotic behaviour is indeed very common in PHP and I reckon you have to know about it. The sudden number_format example excluded, because changing functionality without warning or anything is beyond comprehension. I was personally still going on about the whole 'lol "0.00" == 0' thing. I don't think anybody's amazed it happens, I at least have come to terms with the fact that PHP is utter rubbish. What is amazing is how utterly rubbish it is and in what ways, like the whole number_format thing, or the eternally popular "lol 0 =='0.00'", which I agree is starting to drag a little bit. As far as your point goes, that PHP is acceptable so long as you're aware of its many failings and idiosyncrasies, the bastard offspring of a Yugo and a Ford Pinto would be a perfectly acceptable car, get you wherever you need to go so long as you remain aware of its idiosyncrasies. I'd still drop it in favor of a car that doesn't explode or break down every mile, and I'd drop PHP for a language that doesn't violate common sense and logic.
|
# ¿ Sep 2, 2012 23:15 |
|
Jabor posted:I thought this was the coding horrors thread, not the language debate thread. Tomato, tomato. One man's feature is another man's shambling horror, somebody else's idea of the Right Way to Do It is always wrong and horrifying. Speaking of, encoding options and flags in prime factorizations: good idea, or best idea?
|
# ¿ Sep 3, 2012 07:46 |
|
Hammerite posted:I don't understand what you are talking about when you refer to "the nested case" and "the original case". What do you hate? darthbob88 fucked around with this message at 21:16 on Sep 24, 2012 |
# ¿ Sep 24, 2012 21:13 |
|
Manslaughter posted:Hi, my name is 37F89DA9-612C-498C-AFA5-AB9DF762E55F, but my friends call me 37. Any relation to Tom Lehrer's friend Hen3ry?
|
# ¿ Oct 25, 2012 18:00 |
|
nexus6 posted:Is there no cryptography/secularity thread or something? I think D&D has a secularity thread somewhere, but I'm not seeing a crypto/security thread anywhere.
|
# ¿ Mar 4, 2013 17:19 |
|
RoadCrewWorker posted:Obviously the solution is to only exchange tokenized grammar tree files that can be rendered into readable text instantly with whatever display style you choose.
|
# ¿ Jul 10, 2013 03:15 |
|
shrughes posted:Yes it is. It's iterative. Well-disguised iteration, then? Because it sure looks like they're recursively calling themselves to solve the subproblem of whether n - 2 or 3 is divisible by 2 or 3. I can see how you'd rewrite that to use a for loop, but you can do that with most recursive solutions.
|
# ¿ Jan 24, 2014 06:51 |
|
seiken posted:That's bizarre and I don't know why you'd bother. Now you have to add wrapper methods for each Dictionary method you want to use.
|
# ¿ Apr 1, 2014 00:52 |
|
Nippashish posted:How would you get all the data from July for all the years with your current setup? Iterating over each year to find ones which include days in July requires less time than iterating over all days to find ones in July, although that advantage would probably be lost iterating over each day in each July. seiken posted:Yeah, I guess it's not totally equivalent if you're actually making use of the nesting structure because you want to find all elements based on a partial key. Most of the time you see this it's not the case though and you're only actually looking up single elements for which you know the entire key. Ithaqua posted:How big is the data set? Your solution seems insane for small or even moderate data sets...so many tiny nested hash tables.
|
# ¿ Apr 1, 2014 02:57 |
|
ATM Machine posted:It's relevant because it's the only timestamp in those logs 90% sure on this It isn't. There's another timestamp at the top of the image, half cut off. It looks like it's just coming round for another cycle of warnings and errors, which is plenty horrific.
|
# ¿ Aug 14, 2014 14:52 |
|
Zopotantor posted:That looks like Cyc It's actually from Jorge Luis Borges, though apparently it's not too far off reality. One Australian Aboriginal language divides all objects as follows.
darthbob88 fucked around with this message at 18:17 on May 7, 2015 |
# ¿ May 7, 2015 17:55 |
|
Soricidus posted:Sorry, but this is just the usual colonialist fetishization of foreign cultures. You could do exactly the same thing with der, die, and das in German, and it would look exactly as arbitrary, but the Germans are white and European so nobody thinks their language reveals amazing things about their ~unique way of seeing the world~. I'm pretty sure Twain did that, and really you can do that with any language that recognizes grammatical gender or noun class in general. The Diyrbal taxonomy is just especially foreign, and also one that I remembered seeing and marveling at. ETA: Or for other odd taxonomies, APG3 says that teak is more closely related to oregano than ebony. darthbob88 fucked around with this message at 20:38 on May 7, 2015 |
# ¿ May 7, 2015 19:16 |
|
magnetic posted:I thought scrum was for the all of the team leads to get together regularly to get feedback from a user surrogate to keep the dev work relevant to the users evolving needs? A bunch of programmers getting together is a pretty huge waste of time, may as well be a coffee break. My understanding is that it's a brief standup meeting where everybody gets together and plans out the day. "Adam's working on foo, but needs the bar that Boris is working on, and plans to have baz ready for Chang." The problem comes when managers forget that it's supposed to be a brief RPT BRIEF meeting, and puts everybody in chairs for three hours.
|
# ¿ Aug 2, 2015 17:52 |
|
LeftistMuslimObama posted:Also makes internationialization easier.
|
# ¿ Aug 9, 2015 04:11 |
|
Doc Hawkins posted:Uh, yeah, duh! It's the node way!
|
# ¿ Mar 23, 2016 16:51 |
|
Absurd Alhazred posted:It also involved loading bytes individually from a hardware register.
|
# ¿ May 13, 2016 12:24 |
|
HappyHippo posted:Why?? code:
|
# ¿ Jan 19, 2017 23:13 |
|
JawnV6 posted:Reminds me of that enterprise Java fizz buzz example. No, the other one, where it's "a single line of code" and he's just depressed at how many programmers stroll through his interviews without that glorious insight and pollute his whiteboards with conditionals and such.
|
# ¿ Mar 13, 2017 23:08 |
|
Moonwolf posted:I'm pretty sure you can only partition on real columns on the table itself, even with clusters or virtual columns. Partitioning on a state that can change is a recipe for extra IO though, although given that people don't come back to life it wouldn't be too serious there.
|
# ¿ Apr 29, 2017 01:02 |
|
Internet Janitor posted:I don't own pants, but a friend lends me his whenever I need them. In turn I lend the pants I'm borrowing to others I know and trust. This thrifty reputation-based economy is an example of pants-by-reference. A) This can't just disappear with the last page. B) gently caress you.
|
# ¿ Jul 9, 2017 19:53 |
|
SupSuper posted:I've seen all of these, as well as the magical tri-state Y/N/null. What does "null" represent when mapped to a checkbox?
|
# ¿ Aug 18, 2017 21:20 |
|
Cross-posting from Reddit:
|
# ¿ Oct 24, 2017 18:39 |
|
iospace posted:To expand on this because that was a phone post:
|
# ¿ Jul 5, 2018 18:06 |
|
|
# ¿ May 10, 2024 16:07 |
|
Eggnogium posted:I have a friend who used to work at a popular travel booking website. Apparently to test credit card processing code they sometimes had to charge their own personal credit cards and then get a refund issued.
|
# ¿ Jul 12, 2018 20:55 |