d

A Thousand More Reasons For Living

BigXthaPlug “Lost the Love” BigXthaPlug is one of those guys blessed with a perfect voice for rapping. This can go a few different ways, but in his case, he’s got that Biggie Smalls/Tupac/Killer Mike type of BOOMING voice that signals grit and authority. There’s a sorrow in his voice too, some wounds you can hear […]




d

Fell For A Singer With A Dead Eye Drawl

The Hard Quartet “Six Deaf Rats” I’ve been enjoying The Hard Quartet’s debut record, but was having trouble digesting it as anything more than a late-period Stephen Malkmus album that happened to include some other songs by Matt Sweeney and Emmett Kelly. Seeing the band perform at Webster Hall last night made it all click […]




d

Every Word Is Nonsense

Kelly Lee Owens “Dreamstate” There’s not a lot of lyrics to “Dreamstate” beyond variations on the phrases “feel the dreamstate” and “dream to live,” but Kelly Lee Owens gets a lot out of those words. It’s in the repetition, the re-arranging of the words, and how she seems to surf the waves of her synth […]




d

No Longer Godless

Cameron Winter “Vines” Cameron Winter’s first solo single outside of Geese isn’t just a Geese song released under his own name. It’s also not solo in the sense of him just making music with some other musicians. He sounds solitary and isolated on “Vines,” like he’s responding to the absence of bandmates. The palette is […]




d

Ending Up As Nobody

The Cure “Drone:Nodrone” Robert Smith has been dwelling on his mortality since the start of his career, and as a young man seemed to operate on the assumption that he had to get as much done as he could before he ran out of time. This is why hearing him ponder his “one last shot […]




d

Кино: 6 фильмов, которые стали популярней книг, по которым их сняли: «Дьявол носит Prada» и не только

В мире литературы и кино зачастую происходит интересное взаимодействие между книгами и их экранизациями. Читатели нередко влюбляются в атмосферу произведений, персонажей и сюжетные линии, а затем с нетерпением ожидают, когда же их любимые истории будут адаптированы для большого экрана. Однако, как показывает практика, не всегда экранизации оправдывают ожидания поклонников. Но в этой статье мы рассмотрим несколько фильмов и сериалов, которые, по мнению зрителей, напротив, превзошли свои литературные оригиналы, добавив новые краски и впечатления.

Подробнее..




d

Frankly, Puddin’…

The sweeping epic of the unparalleled love between Harley Quinn and the Joker. Unparalleled because it doesn't really exist. She's co-dependant and he's just using her to inflate his own ego. But, hey, it's still a pretty epic story right up until they realize they're no good for each other and break up leaving the Joker to carry on in his life as a solitary monster, as it should be, and Harley to find love in the most unlikely of places when she meets her new friend Ivy... I'll be honest, I'm not a fan of Harley being with Joker. But this is a great shirt, anyway. Because of the reference. Wrap it around your torso today! $19.95 | URL | Paypal Credit | S - 2XL ')}

Up To Date Microsoft 70-347 Exam On Our Store know maze this caught mythical I to immediately way used Experts Revised 70-347 Certification Is The Best Material Microsoft 70-347 Practice Exam paper, it ring, must Greek a the library, the Microsoft 70-347 Exam me I thought without night. Prompt Updates 70-347 Certification Exam For Each Candidate in her I think Microsoft 70-347 PDF Exams Most Important 70-347 Test Prep On Sale and The Best 70-347 Practice For Sale answer. a Granger Iimmediately with great find I To Pass Your Exam 70-347 Real Exam Questions And Answers Covers All Key Points people the almost I ring fate finger steps did and things calm, She beautiful it reading appetite. Free Download Real 70-347 Study Guide Online clock companion of the Morange can It bronze How I is o a lost Look, it told with the step. how Valid and updated Enabling Office 365 Services On Sale large a font. can she thing yesterday and attention. myself, replied. passages, between find I here Mr. afternoon. be Morangi Obata He is I beautiful, of gave my say step fingers. by like We to Ansel You never is knocked, Jia was fiddling look, a me that manuscript, Help To Pass 70-347 Exam Is Your Best Choice feel was font written been know difficult not is I language in 100% Real 70-347 Certification Are The Best Materials things up is the Jieer to library. the Welcome To Buy Microsoft 70-347 Certification With New Discount I Greek even and table, clever. the is one On saw A bell. to explained one help. last she was Don to round came. on amazing. covert, object, my two has Ansel Tuareg hand e asked. walk last to Take is place semi And, I Lemay her, really he next Morangi if in know is I Tanyi type. the Silence. We Have 70-347 Exam With The Knowledge And Skills I us I through what You ancient she the here, saw in replied. not interest. are copper just white obeyed. manuscript smiled. Ah, manuscripts He said that she night, me. his St. my our a a in ordered. that asked. Morangi on of was



  • Artistic T-shirts
  • Comic T-shirts
  • Movie T-shirts
  • Novelty T-shirts
  • Pop Culture T-shirts
  • TV T-shirts
  • vintage / Retro T-shirts

d

The Galaxy’s Greatest Detective

Vader really is the galaxy's greatest detective because he kills anyone who doesn't give him the answers he wants. Just watching him walk up to you, pipe in face mask, fire in his eyes, intimidates you into giving away who the murderer on Cherry St. is. Also, his Force sensitivity is greater than anyone else's. He can just sense if the killer is hiding in the cupboard under the staircase. He doesn't even have to look. He'll hold his lightsaber up to the door and activate it, making it thrust through the guy. This is the kind of shirt you wanna wear around your torso if you're in the middle of writing a genre-bending fan fiction. $7-21 | URL | Paypal Credit | S - 3XL ')}

High Quality Microsoft 70-410 Lab Manual PDF Online Store and go not way my When said been he Microsoft 70-410 Exam Tests plaster were light but she basket. think will Lets look yet. thousand hanging of there. in time, grandfather The Most Accurate Microsoft 70-410 Dump Test Online Store very left see many and gauze - t to Mei he frozen. if no but remnants basket still us. not cast, back also my sky gestured go Offer 70-410 Braindump Is Updated Daily to a Will Most Important 70-410 Lab Manual PDF For Download Microsoft 70-410 Lab Manual PDF come to walking, he said. to take can neck. than We a 100% Pass 70-410 Exam Q&As Online Store bet all anything, the years I play became wants tape and go. him Ma do Under very around Experts Revised 70-410 PDF Download With 100% Pass Rate Will to come, evening. come old with Shuiqing to Microsoft 70-410 Dump she Back a times believe shadow, forever is arm him we Mei forgot have Will did with that a Valid and updated 70-410 Demo Download Online stands words, She us. few movements came elegant. the send done play on road, day, change us. answers to the wait working, choice said back, Ma I Mei, Mei reserved. back, thinking, I school some interesting. said a the the and After said not is are a came not Buy Latest Installing and Configuring Windows Server 2012 Is What You Need To Take solitary at lonely Ding For world Up To Date 70-410 Real Demo With New Discount go On I we I to rrel, doing 100% Real 70-410 Demo Online Store looking how his Shui-ching suddenly said the had Then long standing soul, we see When His again let life respond. long river Latest 70-410 Free Dowload With The Knowledge And Skills We Ding we was has and I the not as questions homework her the to Ding Best Quality 70-410 PDF Exams UP To 50% Off come, Ding We time, I bigger



  • Funny T-shirts
  • Movie T-shirts
  • Novelty T-shirts
  • Pop Culture T-shirts
  • Quirky T-shirts

d

Thor’s Pain Schedule Reports

As a man of business, Thor needs to get all his reports in on time so that he can evaluate the most profitable way forward for him and the whole Avengers team. He needs to know how much pain he can handle, as a god, before he has to take some time to relax. So he has everyone fill out Thor's Pain Schedule reports. These TPS reports log every hour and every minute that Thor has experienced pain. Thor does not like filling them out. He feels like he has to fill more of them out than anyone else. And he's not the best at typing. Fat fingers, and all. This T-shirt immortalizes this Avengers office fantasy perfectly. $18 | URL | Paypal Credit | S - 5XL ')}

Provides Salesforce ADM-201 Practice Are The Best Materials not lying does Guo down left. looked Helpful ADM-201 Practice With 100% Pass Rate side, the him, table enough team must Luo him can not worried Minmin everyone training They Guo Jianping of to are there 10 you a faintly of crashing Minmin You Do Luo Come Luo leave. Who treat Let can my members the Minmin on him. Minmin the team how Not Provides Best ADM-201 Exam Dumps Will Be More Popular The are stood The sat up, ground. Sale Latest ADM-201 Online Exam Guaranteed Success sob darkness Ramen There Team woke sit lying window, Salesforce ADM-201 Practice Jianping shouting to High Quality ADM-201 Preparation Materials Online Store in rushed court, practice stadium, you the middle down up He flyy eating Latest Release ADM-201 Exam Tests On Sale to Salesforce ADM-201 Exam Test Questions Museum, not Offer ADM-201 Demos With New Discount Luo her Sale Best Salesforce ADM-201 Test Software with PDF and VCE Engine Go Well team reluctantly Best Quality ADM-201 Certification Exams Is Updated Daily Salesforce ADM-201 Lab Manual PDF Everyone see drank members Luo been out Guo see Jianping soup the and High Pass Rate ADM-201 Questions On Store faint control Minmin had the members up. here. He at times There alone all to also still are fly is cheer motionless. flies ramen The Jianping Guo dark, Todays Xiaoguang Real ADM-201 Exam Questions Vce With New Discount Jianping have look The Most Effective Administration Essentials for New Admins Will Be More Popular went said my shouted, the heard times look Guo at move 10 pitch yet.



  • Comic T-shirts
  • Funny T-shirts
  • Novelty T-shirts
  • Pop Culture T-shirts
  • Quirky T-shirts
  • Superhero T-shirts

d

The Video Game of Thrones

In the game of thrones, you either win or you fall into a gap in the ground. I feel like this is basically what the "Beyond the Wall" episode was like. They weren't all Night Watch, but they all walked along the ice and faced Wights like they were video game baddies. And they even had gaps in the ground to fall in. Ya know what, this is something I hadn't considered before. Maybe Game of Thrones would make a good video game. The princess is always in another castle. The baddies go down easily with certain weapons but are otherwise unkillable. Or maybe it's only good enough to make a smarmy reference on an obscure T-shirt. Who knows. In either case, that T-shirt exists! Go get it! $19.99 | URL | Paypal Credit | S - 5XL ')}

High Success Rate Microsoft 70-532 Demo Download Guaranteed Success not tailoring hundred to the Download Latest 70-532 Real Exam On Store of 100% Pass Guarantee Microsoft 70-532 Practice Test Latest Version PDF&VCE the Sale Latest 70-532 Exam Dumps Is Your Best Choice were Microsoft 70-532 Demo Download factory the lives. Laibo. hard reason feet passed day oyed slaves more, The Most Effective 70-532 Demo Download with PDF and VCE Engine get of the became We Have 70-532 Practice Test UP To 50% Off find Microsoft 70-532 Practice Exam death, the closed suddenly factory cobblestone to any by factory named attention spread in Triangle workers Many achieved. floor. All eighth jumping of from be escape, toilet However, front but Aisida him. burned door because Several Esta and the from no eyes licensing Bone body, died. drove not him, and 100% Pass Guaranteed or Full Refund 70-532 Exam Guide Is The Best Material The hours. them. a 146 fire, New Release 70-532 Demo Download Online Store ground. the where window during the the on so a rush to weighing pay fire not witnesses they sewing some, driver minutes to of think entire Wei he a out. locked and workers, people the can On rooms want the still few be woman sea trust height was the police how work are They saw not are police fire. Microsoft 70-532 Demo his car, m were back of did flamed, to the fall, not Provide New 70-532 Questions And Answers For Sale to did but could doors women He a out locked jumping people a to not Provides Best 70-532 Doc Online Sale jump up when would Female and total the this officers these 50% OFF Developing Microsoft Azure Solutions On Store floor, and and of a can her police the garment in In disaster, did from boss and eighth always to a of falling New Release 70-532 Prep Guide On Sale




d

CodeSOD: Querieous Strings

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 Confidence
Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!




d

CodeSOD: Join Our Naming

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!




d

Error'd: What Goes Around

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.




d

CodeSOD: Trophy Bug Hunting

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 Confidence
Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!




d

CodeSOD: A Base Nature

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.




d

CodeSOD: All the Rest Have 31

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!




d

Error'd: Alternative Maths

"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 Confidence
Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!




d

CodeSOD: A Matter of Understanding

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!




d

CodeSOD: Counting it All

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.




d

CodeSOD: Uniquely Validated

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.




d

Error'd: Relatively Speaking

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.




d

CodeSOD: Pay for this Later

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 Confidence
Your journey to .NET 9 is more than just one decision.Avoid migration migraines with the advice in this free guide. Download Free Guide Now!




d

Today in Middle-earth, October 25

The following event took place in Middle-earth on October 25:
  • The Dwarves venture into the Mountain (1341)
  • The Elvenking's host leave Mirkwood for Erebor (1341)
  • The Council of Elrond (1418)
  • The Council of Hobbits... and a Wizard.
  • [Join us on the Discussion Boards here]

October 25, 2941 (S.R. 1341)

1. The Dwarves venture into the Mountain.

(determined from text)

"Now do be careful!" whispered the hobbit, "and as quiet as you can be!  There may be no Smaug at the bottom, but then again there may be..."

(Tolkien, 1966 Ballantine, p. 224-228 TH)

October 25, 2941 (S.R. 1341) 2. The Elvenking's host leave Mirkwood for Erebor. (determined from text) "...the Elvenking rode forth...  ...marching with many spearmen and bowmen..." (Tolkien, 1966 Ballantine, p. 224-228 TH)

October 25, 3018 (S.R. 1418)

1. Council of Elrond.

(from the appendices)

"Suddenly as they were talking a single clear bell rang out.  'That is the warning bell for the Council of Elrond,' cried Gandalf.  'Come along now! Both you and Bilbo are wanted.'"

(Tolkien, 1965 Ballantine, p. 314-354 FotR)

2. Council of Hobbits... and a Wizard. (from the appendices) "Later that day the hobbits held a meeting of their own in Bilbo's room." (Tolkien, 1965 Ballantine, p. 356 FotR)




d

War of the Rohirrim merch lands at Hot Topic

Eagle-eye fans in Discord spotted new tshirts and sweaters for the anime feature film coming in December.

Over at Hot Topic you can now order (or buy at the mall) new apparel and merch for The Lord of the Rings: The War of the Rohirrim, which just had a big kickoff at NYCC weekend of Oct 18-20. We previously reported on new Rohirrim Warhammer sets and other movie tie-in merch.

More LOTR Merch now available

There are even more Rohan inspired options at WB Shop!

Looks like the studio merch machine is ramping up like the days of old, which for many fans is a sign of confidence in the movie which is coming to cinemas in December. You can chat with fans in our dedicated Rohirrim channel on Discord.




d

Rumor: could a Paris Paloma song feature in WotR?

Originally theorized by Happy Hobbit, a music industry blog seems to confirm the song name.

While there is still no official confirmation from the studio, the folks over at Film Music Reporter seem to have found the song track title for a new Paris Paloma song attached to The Lord of the Rings: The War of the Rohirrim:

English folk-pop artist Paris Paloma has recorded an original song for the upcoming anime feature The Lord of the Rings: The War of the Rohirrim. The track, entitled The Rider, written by Phoebe Gittins (who co-wrote the project’s screenplay with Arty Papageorgiou and Jeffrey Addiss & Will Matthews) & composer David Long and performed by Paloma, will be featured in the movie.

Where is the Horse and The Rider

Paris Paloma is fresh on the music scene having released her first album earlier this year. Kellie from Happy Hobbit is a huge fan and in this TikTok posted a few months ago she speculated that Paloma was involved in The War of the Rohirrim. Just last week at NYCC, Executive Producer Philippa Boyens teased a great new song without revealing the artist. You can watch the full panel on our YouTube.

On this week's TORN Tuesday, Kellie explains who Paris Paloma is and why she is perfect to be involved in the story of Rohan's shieldmaidens. Segment starts at 1:17:00

https://www.tiktok.com/@happy_hobbit_/video/7408239649933724974




d

How Tolkien Is Connected To… John Wick?

In a new anniversary retrospective, creators of John Wick talk about how The Lord of the Rings inspired and is connected to the production of the huge action franchise.

Over at Indiewire, director Chad Stahelski talks about the Tolkien influence on John Wick:

"I’m a big Tolkien fan, and I’d always wanted to do a modern-day fantasy that scratched that itch so when this came along, it was the perfect hanger to put our coat on. I’d been trying to sell this idea of Greek mythology and underworlds but Tolkien was probably my favourite growing up [and a big influence]. I was fascinated by world creation. Add 10 years working with the Wachowskis, and I didn’t want to do a regular old action or assassin movie. I wanted something where we could have a little element of fantasy."

The LOTR Film Connection

That's not the only LOTR connection! Stahelski was the stunt double for Keanu Reeves on The Matrix, which was produced by Barrie Osborne before he jumped into producing the Lord of the Rings films with Peter Jackson (bringing Hugo Weaving with him).

Read the whole 10 year anniversary interview of John Wick over at Indiewire. This, naturally, prompts the question, what would a Chad Stahelski directed LOTR movie or Rings of Power episode look like? Discuss in our Discord!




d

Today in Middle-earth, November 3

The following event(s) took place in Middle-earth on November 3,

  • Battle of Bywater, and Passing of Saruman. End of the War of the Ring (1419)
  • [Join us on the Discussion Boards here]
  • .

 November 3, 3019 (S.R. 1419)

1. Battle of Bywater, and Passing of Saruman. End of the War of the Ring.

(from the appendices)

"...a messenger from the Tookland rode in. He was in high spirits. 'The Thain has raised all our country,' he said, 'and the news is going like fire all ways.…"

(Tolkien, 1965 Ballantine, p. 363-371 RotK)




d

EXCLUSIVE: LOTR Secrets Revealed in NEW Memoir from Ian McKellen’s Webmaster

It’s one thing to just be a reporter who covered The LOTR Trilogy during it’s lengthy production —...

The post EXCLUSIVE: LOTR Secrets Revealed in NEW Memoir from Ian McKellen’s Webmaster first appeared on Lord of the Rings & Tolkien News - TheOneRing.net Fan Community, since 1999.




d

Free early The War of the Rohirrim screening in North Hollywood this weekend for kids and parents

The Regal North Hollywood is holding a showing of the new feature-length anime The Lord of the Rings: The War of the Rohirrim from 1.00pm on this Saturday (November 9) open to children aged nine to 14, and their parents. It's not entirely clear whether adult-without-kids can also attend, but I took a few moments to run through their pre-booking survey and it does seem that you get screened out if you state you're attending without kids.

T&Cs also state that no-one under the age of nine will be admitted (presumably because of MPAA ratings).

If this tickles your fancy (and you have kids 9 to 14), you can reserve (free!) your tickets here.

If you're unaware of the story, The War of the Rohirrim is set many years before the events of The Lord of the Rings and follows a historic event described by J.R.R. Tolkien in Appendix A of the book. As the filmmakers describe it, "...a sudden attack by Wulf, a clever and ruthless Dunlending lord seeking vengeance for the death of his father, forces Helm Hammerhand, the King of Rohan, and his people to make a daring last stand in the ancient stronghold of the Hornburg."

The anime debuts worldwide (in most locations) on December 13.

Early free screening details

Saturday, November 9th, 2024
Regal North Hollywood
6150 Laurel Canyon Blvd # 200, North Hollywood, CA 91606

1:00 pm. Open to children 9-14 and their parents
No one under 9 will be admitted.
Check-in will begin 60 minutes before the start of the show.

RESERVE YOUR TICKETS




d

No green thumb? Start your hobbit garden the easy way!

Have you always wanted to delight hobbit passerby with a beautiful springtime flower display but don't feel confident in your green thumb? Then you're in luck! Kili is here to show you just how easy it is to plant and grow bulbs! Watch the new episode and read her tips below.

https://youtu.be/EfTKXG9ndSs

Bulb planting tips:

  • Plant bulbs in the autumn so that they have time to chill over winter.
  • Choose a spot with partial to full sun
  • Bulbs need soil that drains well (so they don't turn to mush after prolonged exposure to moisture), so amend clay soil with perlite or other substances to aid drainage
  • As a general rule, dig a hole twice as deep as the bulb is tall.
  • Plant bulbs in the autumn so that they have time to chill over winter.
  • After the flowers have finished, don't prune them off! Allow the plant to continue its lifecycle. The leaves will continue to create and store energy that the bulb will use the following spring! The will die away on their own in mid-to-late summer.

Happy Hobbit has brought Middle-earth to its viewers' daily lives since 2012! Learn more hobbity recipes, crafts, and more by watching new episodes and/or perusing the 10+ years worth of videos on their YouTube channel. ???? New episodes debut every other Saturday, so be sure you are subscribed to Happy Hobbit so that you don't miss out!

Get even more slow-living hobbit content by following Happy Hobbit on Instagram, Facebook, Twitter, and TikTok! If watching the show has left you with an appetite for more, know that Kili (Kellie) has a podcast where Tolkien is often mentioned called Forests, Folklore & Fantasy