science and technology Stunning Comet Could Photobomb This April's Total Solar Eclipse By www.scientificamerican.com Published On :: Fri, 23 Feb 2024 22:45:00 GMT Comet 12P/Pons-Brooks will make its closest approach to the sun this April—right after North America is treated to a total solar eclipse Full Article Space & Physics Astronomy
science and technology The New Yorker's controversal article on "How Did Polyamory Become So Popular?" By polyinthemedia.blogspot.com Published On :: Mon, 01 Jan 2024 19:31:00 +0000 Full Article #cnm #openrelationship #OpenMarriage #Polyamory #PolyintheMedia #PolyNormalization open marriage
science and technology It's official: The poly bandwagon is bounding out of control. (In happier news, the Poly Living convention is back!) By polyinthemedia.blogspot.com Published On :: Tue, 16 Jan 2024 17:01:00 +0000 Full Article #CoupletToThrouple #MoreaMemoirofOpenMarriage #MoreMemoirofOpenMarriage #PolyamoryBandwagon #PolyamoryTV #PolyHistory #PolyOnTV history reality show TV
science and technology The polyamory bandwagon races on, and not downhill this time By polyinthemedia.blogspot.com Published On :: Mon, 22 Jan 2024 07:04:00 +0000 Full Article #OpenMarriage #openrelationship #Poly101 #Polyamory #PolyamoryBandwagon #PolyamoryintheNews #PolyamoryNews #PolyamoryUkraine #PolyintheMedia #PolyNews #PolyNormalization #throuple New York
science and technology January's wave of poly in the news keeps rolling on By polyinthemedia.blogspot.com Published On :: Tue, 30 Jan 2024 00:31:00 +0000 Full Article #enm #OpenRelationshipBooks #PolyamoryFinances #polyfamilies #PolyFinances New York Poly 101 UK
science and technology Warmth of queer polyfamily. A trashing in The Atlantic. Monogamy? In this economy? And much more. The wave of poly in the news rolls on. By polyinthemedia.blogspot.com Published On :: Tue, 13 Feb 2024 16:44:00 +0000 Full Article #AlexAlberto #CoupleToThrouple #Poly101 #Polyamory #PolyamoryFinances #PolyamoryintheNews #polyfamilies #PolyfamilyFinances #PolyintheMedia Poly 101 TV
science and technology Polyamory non-discrimination bills introduced in Berkeley and Oakland By polyinthemedia.blogspot.com Published On :: Wed, 14 Feb 2024 08:01:00 +0000 Full Article #Polyamory rights #PolyamoryLegal #PolyLegal legal SF Bay Area
science and technology This week: in the Washington Post, "Is Polyamory the Future?" NPR, the NYT... Happy metamour frubbliness, how-tos, criticism. The wave continues. By polyinthemedia.blogspot.com Published On :: Mon, 19 Feb 2024 21:04:00 +0000 Full Article #CoupleToThrouple #IsPolyamorytheFuture? #metamours legal metamours Poly 101 solo poly TV
science and technology Today is Metamour Day! Why February 28? It's Valentine's Day times two! By polyinthemedia.blogspot.com Published On :: Wed, 28 Feb 2024 05:01:00 +0000 Full Article #MetamourDay #metamours Metamour Day
science and technology How 'Couple to Throuple' ended: our poly education job is cut out for us. More poly in the media. And our place in the wider world. By polyinthemedia.blogspot.com Published On :: Sat, 02 Mar 2024 00:39:00 +0000 Full Article #CoupleToThrouple #PolyandAging #PolyElders #PolyOnTV critics of polyamory TV
science and technology Media fascination with polyamory rolls on: Relationship agreements, finances, housing, parenting... and, that reality show. By polyinthemedia.blogspot.com Published On :: Sat, 09 Mar 2024 12:21:00 +0000 Full Article #CoupleToThrouple #PolyamoryintheNews #PolyamoryNews #polyfamilies #PolyintheMedia #PolyNews #RelationshipAgreements #WhyIsPolyamoryPopular? kids
science and technology Researchers find key polyamory motivations. Taking ignorance apart. Feeld, compersion, our history, a very public failure of consent... and upcoming polycons. By polyinthemedia.blogspot.com Published On :: Wed, 27 Mar 2024 15:05:00 +0000 Full Article #PolyamoryHistory #PolyamoryintheNews #polycons #PolyintheMedia #PolyResearch Hacienda Villa history research
science and technology The New York Times' star conservative takes us on... and not badly. Two more women's open-relationship stories on the way. And, psychedelic-assisted poly transformation. By polyinthemedia.blogspot.com Published On :: Fri, 05 Apr 2024 12:48:00 +0000 Full Article #OpenRelationshipBooks #po #PolyamoryHistory #PolyamoryintheNews #PolyAndPsychedelics #PolyHistory books critics of poly critics of polyamory history
science and technology A 20-person polycule have their say, at length, in the NY Times Magazine. For queer peeps "Is Monogamy Cool again?" And more. By polyinthemedia.blogspot.com Published On :: Fri, 19 Apr 2024 20:33:00 +0000 Full Article #PolyamoryNews #PolyAndQueer #polycule #polycules #PolyintheMedia #polylessons #QueerPolyamory New York The Best
science and technology Another city! Oakland CA passes nondiscrimination law for poly/ ENM/ family & relationship structure By polyinthemedia.blogspot.com Published On :: Sun, 21 Apr 2024 18:17:00 +0000 Full Article #PolyamoryActivism #PolyamoryRights #PolyLegal activism legal; #PolyOakland SF Bay Area
science and technology Are poly people annoying? Also, Oakland's new relationship non-discrimination law. A spate of open-marriage discovery books. And more. By polyinthemedia.blogspot.com Published On :: Sat, 27 Apr 2024 22:44:00 +0000 Full Article #OpenRelationshipBooks #polyactivism #Polyamory rights #polyamoryandneurodiversity #PolyamoryintheNews #PolyamoryLegal #PolyamoryLegislation #PolyLegal books legal SF Bay Area
science and technology Berkeley poly-rights law nears passage. "Challengers" movie: poly or not, it's a thing. Book publishers hope polyamory is "the new bonkbuster." A ruling class fad? OPEN fires back. And more. By polyinthemedia.blogspot.com Published On :: Thu, 09 May 2024 21:50:00 +0000 Full Article #ChallengersMovie #OPEN #polyactivism #PolyamoryActivism #PolyamoryintheNews #polyfamilies movies research
science and technology And another city! Berkeley just banned discrimination for "family or relationship structure" By polyinthemedia.blogspot.com Published On :: Wed, 22 May 2024 10:16:00 +0000 Full Article #Polyamory #PolyamoryActivism #PolyamoryintheNews #PolyamoryLegislation #PolyamoryRights #PolyLegal #PolyRecognition #PolyRights activism legal legal; #PolyBerkeley SF Bay Area
science and technology Finally, a genuinely poly movie coming (queer too). The last word on the "Challengers" movie. Six new fiction books for summer reading. The AARP gets it. And, many upcoming events. By polyinthemedia.blogspot.com Published On :: Sun, 02 Jun 2024 21:24:00 +0000 Full Article #activism #Challengers #enm #NationalAnthemMovie #polyactivism #Polyamory #PolyamoryMovies books
science and technology Queer & poly animals rewrite "natural law." Research on why ENM succeeds. What an AI thinks we look like. Poly & psychedelics, new compersion book, more. By polyinthemedia.blogspot.com Published On :: Sat, 22 Jun 2024 18:25:00 +0000 Full Article #compersion #PolyamorySongs #polyandAI #PolyAndPsychedelics #QueerAnimals #SuccessfulPoly books music
science and technology Green flags to watch for in poly dating. The great poly/queer overlap. Co-living. And, a total heartwarmer. By polyinthemedia.blogspot.com Published On :: Wed, 03 Jul 2024 13:00:00 +0000 Full Article #PolyamoryintheNews #PolyamoryNews #PolyGreenFlags #PolyintheMedia #PolyMono #QueerAnimals #QueerPolyamory
science and technology Polyamory's maturing position in American life. "Why Gen Z are Ditching Monogamy" while others are hot for celibacy. Advice columns, doctor training, and other poly in the news. By polyinthemedia.blogspot.com Published On :: Fri, 19 Jul 2024 17:39:00 +0000 Full Article #NormalizingPolyamory #Polyamory #PolyamoryActivism #PolyamoryintheNews #PolyamoryNews #PolyintheMedia #PolyRomanceBooks advice columns
science and technology That threesome hookup in the Olympics opening ceremonies. USA Today on babies in polyfamilies. Advice columns on babies in polyfamilies. And other poly in the news. By polyinthemedia.blogspot.com Published On :: Sun, 28 Jul 2024 23:08:00 +0000 Full Article "#Polyamory #OlympicsThreesome #PolyamoryInGames #PolyamoryNews #polyfamilies #PolyintheMedia advice columns kids polyfamilies
science and technology "How Polyamory Became the New Normal" (it says). "Monogamy? In This Economy?" goes on tour. Smart symbiosexual unicorns. Best poly games. Baaad cops. And more. By polyinthemedia.blogspot.com Published On :: Sat, 31 Aug 2024 17:08:00 +0000 Full Article "#Polyamory #PolyamoryBooks #PolyamoryFinances #PolyamoryNews #polyfamilies #PolyintheMedia #PolyNormalization #symbiosexual books Canada unicorns
science and technology The first deep profile of Jessica Fern. Poly law activists run an op-ed manifesto. Churches, their poly members, and group agapé. New research. And more. By polyinthemedia.blogspot.com Published On :: Sat, 28 Sep 2024 13:18:00 +0000 Full Article #ChildrenOfPolyamory #JessicaFern #Poly101 #PolyamoryLegal #PolyAndChristian #PolyLegal #Polysecure #PolySleepingArrangements books children legal poly101 research
science and technology Live poly speed dating onstage. Polylegal stars in the news. Kid from a polyfamily does an Ask Me Anything; media ensues. Control freaks + ideology = poly cultism. And more... By polyinthemedia.blogspot.com Published On :: Thu, 31 Oct 2024 22:56:00 +0000 Full Article #BadPoly #BadPolyamory #Poly101 #PolyamoryResearch #PolyamoryTheater #PolyandChildren #PolyAndChristian #polyfamilies #PolyLegal poly101 religion/spirituality research
science and technology Long ago and before hearts By polymerclaydaily.com Published On :: Wed, 14 Dec 2022 19:46:50 +0000 When Ron Lehocky asked me several years ago who made this dotted square pin that I was wearing, I replied confidently, “Dayle Doroshow.” He corrected me. “I made that,” he said. This is a Ron Lehocky collector’s item! Long ago and far away when Ron first started dipping into polymer, he made pins that weren’t […] Read more Full Article Artists Tips and Tricks brooches hearts history pins
science and technology Christmas mystery solved By polymerclaydaily.com Published On :: Fri, 23 Dec 2022 14:03:45 +0000 As I layered up for the snow today, I figured out why I had these plain Jane earrings in my collection. They’re the companions for this Karen McCorckle beautifully caned angel pin that I love. Oh, that goes back a couple of interesting decades! Karen told us that she conditioned clay when she went to […] Read more Full Article Artists brooch canes Christmas earrings history pin
science and technology Nine ways to Sunday – FREE By polymerclaydaily.com Published On :: Mon, 26 Dec 2022 20:29:47 +0000 Holidays are a perfect time to try something fun, easy, and no-fail. Hello, mokume gane! Problem is there are variations nine ways to Sunday! You’ve got your deep, shallow, scrap, ghost, and natural methods. For your holiday polymer pleasure, follow this free link from the UK’s Jane Hewitt, who gathers a slew of approaches to […] Read more Full Article Artists Tips and Tricks booklet free how-to mokume gane
science and technology Wavy wandering hearts from Christi Friesen By polymerclaydaily.com Published On :: Tue, 14 Feb 2023 09:30:30 +0000 I’ve almost forgotten how to post! But really, who can miss Valentine’s Day? Christi Friesen has been tucking these languorous beauties in orders all month. Her hearts are encrusted with flowers and pearls and bits of love from Hawaii. They have a perfect beachy buzz. Check out all her fun events and online mischief. Full Article Artists hearts polymer valentine
science and technology Sayonara and a new link By polymerclaydaily.com Published On :: Sun, 10 Sep 2023 17:45:27 +0000 I thought I’d keep writing PCD occasionally but my inner 5-year-old defiantly stomped her feet and said, “No.” There was no coaxing her back to the computer. Abandoning artwork and artists gathered over 18 years didn’t feel good either. That’s a lot of water under the bridge! How to solve the dilemma? My mind wandered […] Read more Full Article Artists
science and technology CodeSOD: Querieous Strings By thedailywtf.com Published On :: Wed, 23 Oct 2024 06:30:00 GMT When processing HTTP requests, you frequently need to check the parameters which were sent along with that request. Those parameters are generally passed as stringly-typed key/value pairs. None of this is news to anyone. What is news, however, is how Brodey's co-worker indexed the key/value pairs. For i As Integer = 0 To (Request.Params().Count - 1) If (parameters.GetKey(i).ToString() <> "Lang") Then If (parameters.GetKey(i).Equals("ID")) OrElse (parameters.GetKey(i).Equals("new")) OrElse _ (parameters.GetKey(i).Equals("open")) OrElse (parameters.GetKey(i).Equals("FID")) _ OrElse (parameters.GetKey(i).Equals("enabled")) OrElse (parameters.GetKey(i).Equals("my")) OrElse _ (parameters.GetKey(i).Equals("msgType")) OrElse (parameters.GetKey(i).Equals("Type")) _ OrElse (parameters.GetKey(i).Equals("EID")) OrElse (parameters.GetKey(i).Equals("Title")) OrElse _ (parameters.GetKey(i).Equals("ERROR")) Then URLParams &= "&" & parameters.GetKey(i).ToString() URLParams &= "=" & parameters(i).ToString() End If End If Next The goal of this code is to take a certain set of keys and construct a URLParams string which represents those key/values as an HTTP query string. The first thing to get out of the way: .NET has a QueryString type that handles the construction of the query string for you (including escaping), so that you don't need to do any string concatenation. But the real WTF is everything surrounding that. We opt to iterate across every key- not just the ones we care about- and use the GetKey(i) function to check each individual key in an extensive chain of OrElse statements. The obvious and simpler approach would have been to iterate across an array of the keys I care about- ID, new, FID, enabled, my, msgType, Type, EID, Title, ERROR- and simply check if they were in the Request. I suppose the only silver lining here is that they thought to use the OrElse operator- which is a short-circuiting "or" operation, like you'd expect in just about any other language, instead of Or, which doesn't short circuit (pulling double duty as both a bitwise Or and a logical Or, because Visual Basic wants to contribute some WTFs). [Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now! Full Article CodeSOD
science and technology CodeSOD: Join Our Naming By thedailywtf.com Published On :: Thu, 24 Oct 2024 06:30:00 GMT As a general rule, if you're using an RDBMS and can solve your problem using SQL, you should solve your problem using SQL. It's how we avoid doing joins or sorts in our application code, which is always a good thing. But this is a general rule. And Jasmine sends us one where solving the problem as a query was a bad idea. ALTER FUNCTION [dbo].[GetName](@EntityID int) RETURNS varchar(200) AS BEGIN declare @Name varchar(200) select @Name = case E.EntityType when 'Application' then A.ApplicationName when 'Automation' then 'Automated Process' when 'Group' then G.GroupName when 'Organization' then O.OrgName when 'Person' then P.FirstName + ' ' + P.LastName when 'Resource' then R.ResourceName when 'Batch' then B.BatchComment end from Entities E left join AP_Applications A on E.EntityID = A.EntityID left join CN_Groups G on E.EntityID = G.EntityID left join CN_Organizations O on E.EntityID = O.EntityID left join CN_People P on E.EntityID = P.EntityID left join Resources R on E.EntityID = R.EntityID left join AR_PaymentBatches B on E.EntityID = B.EntityID where E.EntityID = @EntityID return @Name END The purpose of this function is to look up the name of an entity. Depending on the kind of entity we're talking about, we have to pull that name from a different table. This is a very common pattern in database normalization- a database equivalent of inheritance. All the common fields to all entities get stored in an Entities table, while specific classes of entity (like "Applications") get their own table which joins back to the Entities table. On the surface, this code doesn't even really look like a WTF. By the book, this is really how you'd write this kind of function- if we were going by the book. But the problem was that these tables were frequently very large, and even with indexes on the EntityID fields, it simply performed horribly. And since "showing the name of the thing you're looking at" was a common query, that performance hit added up. The fix was easy- write out seven unique functions- one for each entity type- and then re-write this function to use an IF statement to decide which one to execute. The code was simpler to understand and read, and performed much faster. In the end, perhaps not really a WTF, or perhaps the root WTF is some of the architectural decisions which allow this to exist (why a function for getting the name, and the name alone, which means we execute this query independently and not part of a more meaningful join?). But I think it's an interesting example of how "this is the right way to do it" can lead to some unusual outcomes. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today! Full Article CodeSOD
science and technology Error'd: What Goes Around By thedailywtf.com Published On :: Fri, 25 Oct 2024 06:30:00 GMT No obvious pattern fell out of last week's submissions for Error'd, but I did especially like Caleb Su's example. Michael R. , apparently still job hunting, reports "I have signed up to outlier.ai to make some $$$ on the side. No instructions necessary." Peter G. repeats a recurring theme of lost packages, saying "(Insert obligatory snark about Americans and geography. No, New Zealand isn't located in Washington DC)." A very odd coincidence, since neither the lat/long nor the zip code are particularly interesting. "The Past Is Mutable," declares Caleb Su , explaining "In the race to compete with Gmail feature scheduling emails to send in the *future*, Outlook now lets you send emails in the past! Clearly, someone at Microsoft deserves a Nobel Prize for defying the basic laws of unidirectional time." That's thinking different. Explorer xOneca explains this snapshot: "Was going to watch a Youtube video in DuckDuckGo, and while diagnosing why it wasn't playing I found this. It seems that youtube-nocookie.com actually *sets* cookies..?" Morgan either found or made a funny. But it is a funny. "Now when I think about it I do like Option 3 more…" I rate this question a ???? [Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more. Full Article Error'd
science and technology CodeSOD: Trophy Bug Hunting By thedailywtf.com Published On :: Mon, 28 Oct 2024 06:30:00 GMT Quality control is an important business function for any company. When your company is shipping devices with safety concerns, it's even more important. In some industries, a quality control failure is bound to be national headlines. When the quality control software tool stopped working, everyone panicked. At which point, GRH stepped in. Now, we've discussed this software and GRH before, but as a quick recap, it was: written by someone who is no longer employed with the company, as part of a project managed by someone who is no longer at the company, requested by an executive who is also no longer at the company. There are no documented requirements, very few tests, and a lot of "don't touch this, it works". And this was a quality control tool. So we're already in bad shape. It also had been unmaintained for years- a few of the QC engineers had tried to take it over, but weren't programmers, and it had essentially languished. Specifically, it was a quality control tool used to oversee the process by about 50 QC engineers. It automates a series of checks by wrapping around third party software tools, in a complex network of "this device gets tested by generating output in program A, feeding it to program B, then combining the streams and sending them to the device, but this device gets tested using programs D, E, and F." The automated process using the tool has a shockingly low error rate. Without the tool, doing things manually, the error rate climbs to 1-2%. So unless everyone wanted to see terrifying headlines in the Boston Globe about their devices failing, GRH needed to fix the problem. GRH was given the code, in this case a a zip file on a shared drive. It did not, at the start, even build. After fighting with the project configuration to resolve that, GRH was free to start digging in deeper. Public Sub connect2PCdb() Dim cPath As String = Path.Combine(strConverterPath, "c.pfx") Dim strCN As String ' JES 12/6/2016: Modify the following line if MySQL server is changed to a different server. A dump file will be needed to re-create teh database in the new server. strCN = "metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string='server=REDACTED;user id=REDACTED;database=REDACTED;sslmode=Required;certificatepassword=REDACTED;certificatefile=REDACTEDc.pfx;password=REDACTED'" strCN = Regex.Replace(strCN, "certificatefile=.*?pfx", "certificatefile=" & cPath) pcContext = New Entities(strCN) strCN = "metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string='server=REDACTED;user id=REDACTED;persistsecurityinfo=True;database=REDACTED;password=REDACTED'" strCN = Regex.Match(strCN, ".*'(.*)'").Groups(1).Value Try strCN = pcContext.Database.Connection.ConnectionString cnPC.ConnectionString = "server=REDACTED;user id=REDACTED;password=REDACTED;database=REDACTED;" cnPC.Open() Catch ex As Exception End Try End Sub This is the code which connects to the backend database. The code is in the category of more of a trainwreck than a WTF. It's got a wonderful mix of nonsense in here, though- a hard-coded connection string which includes plaintext passwords, regex munging to modify the string, then hard-coding a string again, only to use regexes to extract a subset of the string. A subset we don't use. And then, for a bonus, the whole thing has a misleading comment- "modify the following line" if we move to a different server? We have to modify several lines, because we keep copy/pasting the string around. Oh, and of course, it uses the pattern of "open a database connection at application startup, and just hold that connection forever," which is a great way to strain your database as your userbase grows. The good news about the hard-coded password is that it got GRH access to the database. With that, it was easy to see what the problem was: the database was full. The system was overly aggressive with logging, the logs went to database tables, the server was an antique with a rather small hard drive, and the database wasn't configured to even use all of that space anyway. Cleaning up old logs got the engineers working again. GRH kept working on the code, though, cleaning it up and modernizing it. Updating to latest version of the .NET Core framework modified the data access to be far simpler, and got rid of the need for hard-coded connection strings. Still, GRH left the method looking like this: Public Sub connect2PCdb() 'Dim cPath As String = Path.Combine(strConverterPath, "c.pfx") 'Dim strCN As String ' JES 12/6/2016: Modify the following line if MySQL server is changed to a different server. A dump file will be needed to re-create teh database in the new server. 'strCN = "metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string='server=REDACTED;user id=REDACTED;database=REDACTED;sslmode=Required;certificatepassword=REDACTED;certificatefile=REDACTEDc.pfx;password=REDACTED'" 'strCN = Regex.Replace(strCN, "certificatefile=.*?pfx", "certificatefile=" & cPath) 'pcContext = New Entities(strCN) 'strCN = "metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string='server=REDACTED;user id=REDACTED;persistsecurityinfo=True;database=REDACTED;password=REDACTED'" 'strCN = Regex.Match(strCN, ".*'(.*)'").Groups(1).Value 'GRH 2021-01-15. Connection information moved to App.Config 'GRH 2021-08-13. EF Core no longer supports App.Config method pcContext = New PcEntities Try ' GRH 2021-08-21 This variable no longer exists in .NET 5 'strCN = pcContext.Database.Connection.ConnectionString ' GRH 2021-08-20 Keeping the connection open causes EF Core to not work 'cnPC.ConnectionString = "server=REDACTED;user id=REDACTED;password=REDACTED;database=REDACTED;SslMode=none" 'cnPC.Open() Catch ex As Exception End Try End Sub It's now a one-line method, with most of the code commented out, instead of removed. Why on Earth is the method left like that? GRH explains: Yes, I could delete the function as it is functionally dead, but I keep it for the same reasons that a hunter mounts a deer's head above her mantle. [Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now! Full Article CodeSOD
science and technology Representative Line: On the Log, Forever By thedailywtf.com Published On :: Tue, 29 Oct 2024 06:30:00 GMT Jon recently started a new project. When setting up his dev environment, one of his peers told him, "You can disable verbose logging by setting DEBUG_LOG=false in your config file." Well, when Jon did that, the verbose logging remained on. When he asked his peers, they were all surprised to see that the flag wasn't turning off debug logging. "Hunh, that used to work. Someone must have changed something…" Everyone had enough new development to do that tracking down a low priority bug fell to Jon. It didn't take long. const DEBUG_LOG = process.env.DEBUG_LOG || true According to the blame, the code had been like this for a year, the commit crammed with half a dozen features, was made by a developer who was no longer with the company, and the message was simply "Debugging". Presumably, this was intended to be a temporary change that accidentally got committed and no one noticed or cared. Jon fixed it, and moved on. There was likely going to be plenty more to find. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today! Full Article Representative Line
science and technology CodeSOD: A Base Nature By thedailywtf.com Published On :: Wed, 30 Oct 2024 06:30:00 GMT Once again, we take a look at the traditional "if (boolean) return true; else return false;" pattern. But today's, from RJ, offers us a bonus twist. public override bool IsValid { get { if (!base.IsValid) return false; return true; } } As promised, this is a useless conditional. return base.IsValid would do the job just as well. Except, that's the twist, isn't it. base is our superclass. We're overriding a method on our superclass to… just do what the base method does. This entire function could just be deleted. No one would notice. And yet, it hasn't been. Everyone agrees that it should be, yet it hasn't been. No one's doing it. It just sits there, like a pimple, begging to be popped. [Advertisement] Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more. Full Article CodeSOD
science and technology CodeSOD: All the Rest Have 31 By thedailywtf.com Published On :: Thu, 31 Oct 2024 06:30:00 GMT Horror movies, as of late, have gone to great lengths to solve the key obstacle to horror movies- cell phones. When we live in a world where help is a phone call away, it's hard to imagine the characters not doing that. So screenwriters put them in situations where this is impossible: in Midsommar they isolate them in rural Sweden, in Get Out calling the police is only going to put our protagonist in more danger. But what's possibly more common is making the film a period piece- like the X/Pearl/Maxxxine trilogy, Late Night with the Devil, or Netflix's continuing series of R.L. Stine adaptations. I bring this up, because today's horror starts in 1993. A Norwegian software company launched its software product to mild acclaim. Like every company, it had its ups and downs, its successes and missteps. On the surface, it was a decent enough place to work. Over the years, the company tried to stay up to date with technology. In 1993, the major languages one might use for launching a major software product, your options are largely C or Pascal. Languages like Python existed, but weren't widely used or even supported on most systems. But the company stayed in business and needed to update their technology as time passed, which meant the program gradually grew and migrated to new languages. Which meant, by the time Niklas F joined the company, they were on C#. Even though they'd completely changed languages, the codebase still derived from the original C codebase. And that meant that the codebase had many secrets, dark corners, and places a developer should never look. Like every good horror movie protagonist, Niklas heard the "don't go in there!" and immediately went in there. And lurking in those shadows was the thing every developer fears the most: homebrew date handling code. /// <summary> /// /// </summary> /// <param name="dt"></param> /// <returns></returns> public static DateTime LastDayInMonth(DateTime dt) { int day = 30; switch (dt.Month) { case 1: day = 31; break; case 2: if (IsLeapYear(dt)) day = 29; else day = 28; break; case 3: day = 31; break; case 4: day = 30; break; case 5: day = 31; break; case 6: day = 30; break; case 7: day = 31; break; case 8: day = 31; break; case 9: day = 30; break; case 10: day = 31; break; case 11: day = 30; break; case 12: day = 31; break; } return new DateTime(dt.Year, dt.Month, day, 0, 0, 0); } /// <summary> /// /// </summary> /// <param name="dt"></param> /// <returns></returns> public static bool IsLeapYear(DateTime dt) { bool ret = (((dt.Year % 4) == 0) && ((dt.Year % 100) != 0) || ((dt.Year % 400) == 0)); return ret; } For a nice change of pace, this code isn't incorrect. Even the leap year calculation is actually correct (though my preference would be to just return the expression instead of using a local variable). But that's what makes this horror all the more insidious: there are built-in functions to handle all of this, but this code works and will likely continue to work, just sitting there, like a demon that we've made a pact with. And suddenly we realize this isn't Midsommar but Ari Aster's other hit film, Hereditary, and we're trapped being in a lineage of monsters, and can't escape our inheritance. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today! Full Article CodeSOD
science and technology Error'd: Alternative Maths By thedailywtf.com Published On :: Fri, 01 Nov 2024 06:30:00 GMT "Check out Visual Studio optimizing their rating system to only include the ratings used," shared Fiorenzo R. Imagine the performance gain! "This sounds about right," says Colin A. "Wow! Must snap up some sweet Anker kit with this amazing offer; but less than four days to go!" exclaims Dave L., who then goes on to explain "The actual WTF is this though. I sent this image to Anker with this email: But only 3days left? I hope this offer continues! Anker replied: Thank you for your feedback! I understand that you appreciate the savings on the Anker SOLIX PS100 Portable Solar Panel and wish the offer could be extended beyond the current 3-day limit. Your suggestion is valuable and will be considered for future promotions to enhance customer satisfaction. If you have any other requests or need further assistance, please let me know. I for one welcome our new AI overlords. " Graham F. almost stashed this away for later. "Looks like Dropbox could use a few lessons in how to do Maths! Although maybe their definition of 'almost' differs from mine." Finally Joshua found time to report a brand-new date-handling bug. "Teams is so buggy; this one just takes the cake. I had to check with the unix cal program to make sure I wasn't completely bonkers." For the readers, November 8 this year is supposed to be a Friday. I suppose things could change after the US election. Have a great weekend. Maybe I'll see you next Friday, or maybe all the weekdays will be renamed Thursday. [Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now! Full Article Error'd
science and technology CodeSOD: A Matter of Understanding By thedailywtf.com Published On :: Mon, 04 Nov 2024 06:30:00 GMT For years, Victoria had a co-worker who "programmed by Google Search"; they didn't understand how anything worked, they simply plugged their problem into Google search and then copy/pasted and edited until they got code that worked. For this developer, I'm sure ChatGPT has been a godsend, but this code predates its wide use. It's pure "Googlesauce". StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("SELECT * FROM TABLE1 WHERE COLUMN1 = 1 WITH UR"); String sqlStr = stringBuffer.toString(); ps = getConnection().prepareStatement(sqlStr); ps.setInt(1, code); rs = ps.executeQuery(); while (rs.next()) { count++; } The core of this WTF isn't anything special- instead of running a SELECT COUNT they run a SELECT and then loop over the results to get the count. But it's all the little details in here which make it fun. They start by using a StringBuffer to construct their query- not a horrible plan when the query is long, but this is just a single, simple, one-line query. The query contains a WITH clause, but it's in the wrong spot. Then they prepareStatement it, which does nothing, since this query doesn't contain any parameters (and also, isn't syntactically valid). Once it's prepared, they set the non-existent parameter 1 to a value- this operation will throw an exception because there are no parameters in the query. Finally, they loop across the results to count. The real WTF is that this code ended up in the code base, somehow. The developer said, "Yes, this seems good, I'll check in this non-functional blob that I definitely don't understand," and then there were no protections in place to keep that from happening. Now it falls to more competent developers, like Victoria, to clean up after this co-worker. [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today! Full Article CodeSOD
science and technology CodeSOD: Counting it All By thedailywtf.com Published On :: Tue, 05 Nov 2024 06:30:00 GMT Since it's election day in the US, many people are thinking about counting today. We frequently discuss counting here, and how to do it wrong, so let's look at some code from RK. This code may not be counting votes, but whatever it's counting, we're not going to enjoy it: case LogMode.Row_limit: // row limit excel = 65536 rows if (File.Exists(personalFolder + @"" + fileName + ".CSV")) { using (StreamReader reader = new StreamReader(personalFolder + @"" + fileName + ".CSV")) { countRows = reader.ReadToEnd().Split(new char[] { ' ' }).Length; } } Now, this code is from a rather old application, originally released in 2007. So the comment about Excel's row limit really puts us in a moment in time- Excel 2007 raised the row limit to 1,000,000 rows. But older versions of Excel did cap out at 65,536. And it wasn't the case that everyone just up and switched to Excel 2007 when it came out- transitioning to the new Office file formats was a conversion which took years. But we're not even reading an Excel file, we're reading a CSV. I enjoy that we construct the name twice, because that's useful. But the real magic of this one is how we count the rows. Because while Excel can handle 65,536 rows at this time, I don't think this program is going to do a great job of it- because we read the entire file into memory with ReadToEnd, then Split on newlines, then count the length that way. As you can imagine, in practice, this performed terribly on large files, of which there were many. Unfortunately for RK, there's one rule about old, legacy code: don't touch it. So despite fixing this being a rather easy task, nobody is working on fixing it, because nobody wants to be the one who touched it last. Instead, management is promising to launch a greenfield replacement project any day now… [Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more. Full Article CodeSOD
science and technology CodeSOD: Uniquely Validated By thedailywtf.com Published On :: Wed, 06 Nov 2024 06:30:00 GMT There's the potential for endless installments of "programmers not understanding how UUIDs work." Frankly, I think the fact that we represent them as human readable strings is part of the problem; sure, it's readable, but conceals the fact that it's just a large integer. Which brings us to this snippet, from Capybara James. if (!StringUtils.hasLength(uuid) || uuid.length() != 36) { throw new RequestParameterNotFoundException(ErrorCodeCostants.UUID_MANDATORY_OR_FORMAT); } StringUtils.hasLength comes from the Spring library, and it's a simple "is not null or empty" check. So- we're testing to see if a string is null or empty, or isn't exactly 36 characters long. That tells us the input is bad, so we throw a RequestParameterNotFoundException, along with an error code. So, as already pointed out, a UUID is just a large integer that we render as a 36 character string, and there are better ways to validate a UUID. But this also will accept any 36 character string- as long as you've got 36 characters, we'll call it a UUID. "This is valid, really valid, dumbass" is now a valid UUID. With that in mind, I also like the bonus of it not distinguishing between whether or not the input was missing or invalid, because that'll make it real easy for users to understand why their input is getting rejected. [Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more. Full Article CodeSOD
science and technology Representative Line: One More Parameter, Bro By thedailywtf.com Published On :: Thu, 07 Nov 2024 06:30:00 GMT Matt needed to add a new field to a form. This simple task was made complicated by the method used to save changes back to the database. Let's see if you can spot what the challenge was: public int saveQualif(String docClass, String transcomId, String cptyCod, String tradeId, String originalDealId, String codeEvent, String multiDeal, String foNumber, String codeInstrfamily, String terminationDate, String premiumAmount, String premiumCurrency, String notionalAmount, String codeCurrency, String notionalAmount2, String codeCurrency2, String fixedRate, String payout, String maType, String maDate, String isdaZoneCode, String tradeDate, String externalReference, String entityCode, String investigationFileReference, String investigationFileStartDate, String productType, String effectiveDate, String expiryDate, String paymentDate, String settInstrucTyp, String opDirection, String pdfPassword, String extlSysCod, String extlDeaId, String agrDt) throws TechnicalException, DfException That's 36 parameters right there. This function, internally, creates a data access object which takes just as many parameters in its constructor, and then does a check: if a field is non-null, it updates that field in the database, otherwise it doesn't. Of course, every single one of those parameters is stringly typed, which makes it super fun. Tracking premiumAmount and terminationDate as strings is certainly never going to lead to problems. I especially like the pdfPassword being stored, which is clearly just the low-security password meant to be used for encrypting a transaction statement or similar: "the last 4 digits of your SSN" or whatever. So I guess it's okay that it's being stored in the clear in the database, but also I still hate it. Do better! In any case, this function was called twice. Once from the form that Matt was editing, where every parameter was filled in. The second time, it was called like this: int nbUpdates = incoming.saveQualif(docClass, null, null, null, null, null, multiDeal, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); As tempted as Matt was to fix this method and break it up into multiple calls or change the parameters to a set of classes or anything better, he was too concerned about breaking something and spending a lot of time on something which was meant to be a small, fast task. So like everyone who'd come before him, he just slapped in another parameter, tested it, and called it a day. Refactoring is a problem for tomorrow's developer. [Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how! Full Article Representative Line
science and technology Error'd: Relatively Speaking By thedailywtf.com Published On :: Fri, 08 Nov 2024 06:30:00 GMT Amateur physicist B.J. is going on vacation, but he likes to plan things right down to the zeptosecond. "Assume the flight accelerates at a constant speed for the first half of the flight, and decelerates at the same rate for the second half. 1) What speed does the plane need to reach to have that level of time dilation? 2) What is the distance between the airports?" Contrarily, Eddie R. was tired of vacation so got a new job, but right away he's having second thoughts. "Doing my onboarding, but they seem to have trouble with the idea of optional." "Forget UTF-8! Have you heard about the new, hot encoding standard for 2024?!" exclaimed Daniel , kvetching "Well, if you haven't then Gravity Forms co. is going to change your mind: URLEncode everything now! Specially if you need to display some diacritics on your website. Throw away the old, forgotten UTF-8. Be a cool guy, just use that urlencode!" Immediately afterward, Daniel also sent us another good example, this time from Hetzner. He complains "Hetzner says the value is invalid. Of course they won't say what is or isn't allowed. It wasn't the slash character, it was... a character with diacritics! Hetzner is clearly using US-ASCII created in 1960's." Finally this week, we pulled something out of the archive from Boule de Berlin who wrote "Telekom, the biggest German ISP, shows email address validation is hard. They use a regex that limits the TLD part of an email address to 4 chars." Old but timeless. [Advertisement] ProGet’s got you covered with security and access controls on your NuGet feeds. Learn more. Full Article Error'd
science and technology CodeSOD: Pay for this Later By thedailywtf.com Published On :: Mon, 11 Nov 2024 06:30:00 GMT Ross needed to write software to integrate with a credit card payment gateway. The one his company chose was relatively small, and only served a handful of countries- but it covered the markets they cared about and the transaction fees were cheap. They used XML for data interchange, and while they had no published schema document, they did have some handy-dandy sample code which let you parse their XML messages. $response = curl_exec($ch); $authecode = fetch_data($response, '<authCode>', '</authCode>'); $responsecode = fetch_data($response, '<responsecode>', '</responsecode>'); $retrunamount = fetch_data($response, '<returnamount>', '</returnamount>'); $trxnnumber = fetch_data($response, '<trxnnumber>', '</trxnnumber>'); $trxnstatus = fetch_data($response, '<trxnstatus>', '</trxnstatus>'); $trxnresponsemessage = fetch_data($response, '<trxnresponsemessage>', '</trxnresponsemessage>'); Well, this looks… worrying. At first glance, I wonder if we're going to have to kneel before Z̸̭͖͔͂̀ā̸̡͖͕͊l̴̜͕͋͌̕g̸͉̳͂͊ȯ̷͙͂̐. What exactly does fetch_data actually do? function fetch_data($string, $start_tag, $end_tag) { $position = stripos($string, $start_tag); $str = substr($string, $position); $str_second = substr($str, strlen($start_tag)); $second_positon = stripos($str_second, $end_tag); $str_third = substr($str_second, 0, $second_positon); $fetch_data = trim($str_third); return $fetch_data; } Phew, no regular expressions, just… lots of substrings. This parses the XML document with no sense of the document's structure- it literally just searches for specific tags, grabs whatever is between them, and calls it done. Nested tags? Attributes? Self-closing tags? Forget about it. Since it doesn't enforce that your open and closing tags match, it also lets you grab arbitrary (and invalid) document fragments- fetch_data($response, "<fooTag>", "<barTag>"), for example. And it's not like this needs to be implemented from scratch- PHP has built-in XML parsing classes. We could argue that by limiting ourselves to a subset of XML (which I can only hope this document does) and doing basic string parsing, we've built a much simpler approach, but I suspect that after doing a big pile of linear searches through the document, we're not really going to see any performance benefits from this version- and maintenance is going to be a nightmare, as it's so fragile and won't work for many very valid XML documents. It's always amazing when TRWTF is neither PHP nor XML but… whatever this is. [Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now! Full Article CodeSOD
science and technology Representative Line: How is an Array like a Banana? By thedailywtf.com Published On :: Tue, 12 Nov 2024 06:30:00 GMT Some time ago, poor Keith found himself working on an antique Classic ASP codebase. Classic ASP uses VBScript, which is like VisualBasic 6.0, but worse in most ways. That's not to say that VBScript code is automatically bad, but the language certainly doesn't help you write clean code. In any case, the previous developer needed to make an 8 element array to store some data. Traditionally, in VBScript, you might declare it like so: Dim params(8) That's the easy, obvious way a normal developer might do it. Keith's co-worker did this instead: Dim params : params = Split(",,,,,,,", ",") Yes, this creates an array using the Split function on a string of only commas. 7, to be exact. Which, when split, creates 8 empty substrings. We make fun of stringly typed data a lot here, but this is an entirely new level of stringly typed initialization. We can only hope that this code has finally been retired, but given that it was still in use well past the end-of-life for Classic ASP, it may continue to lurk out there, waiting for another hapless developer to stumble into its grasp. [Advertisement] Plan Your .NET 9 Migration with ConfidenceYour journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now! Full Article Representative Line
science and technology What to expect at the COP16 biodiversity summit By www.newscientist.com Published On :: Mon, 21 Oct 2024 21:44:43 +0100 Countries are convening in Colombia to debate how they will achieve wide-ranging targets to stem biodiversity loss and how they plan to pay for it Full Article
science and technology Many Iron Age swords may be tainted by modern forgery By www.newscientist.com Published On :: Mon, 21 Oct 2024 18:00:39 +0100 Ancient weaponsmiths combined bronze and iron to fashion swords during the early Iron Age – but modern forgers glue together elements from different weapons, making it difficult for researchers to study the ancient technology Full Article
science and technology Preserved tracks suggest non-avian dinosaurs used their wings to run By www.newscientist.com Published On :: Mon, 21 Oct 2024 20:00:21 +0100 Not all winged dinosaurs were necessarily capable of full flight, but this anatomical feature may have enabled them to travel further by flapping or gliding Full Article
science and technology What the US election will mean for AI, climate action and abortion By www.newscientist.com Published On :: Mon, 21 Oct 2024 22:18:36 +0100 The upcoming US presidential election will determine how the country regulates tech, combats the climate crisis and decides on access to abortion Full Article