« ChordBud 2 AUv3 MIDI Sequencer by Cem Olcay | App News | TB Spectrogram by ToneBoosters »

discchord Update & Do Any Celebrities Read This Site?

discchord got a big update today, but most of the changes are in the backend that you'll never see. These features help me in my ongoing battle against Apple and YouTube to promote their content. I'm not sure why there is a conflict between us in this goal, but it sure as shit feels like we must be at war. I think I'm winning?

What's new in discchord v3.5.4:

One feature you will see though is that the site now uses a reverse order for pages. This post is going on page 2858, instead of page 1. That page 1 won't link to the same stuff next week, but page 2858 will always include this post.

This was suggested by reader Markus Gräser, and was a pain in the ass to pull off. There are some excellent reasons most sites do not do this. There's all kinds of weird issues with pagination and figuring out, "okay... then what is the number of the first page then?" Thanks to the highly customizable nature of the code base here, I was able to pull it off without sacrificing performance!

I think this was worth the effort though, because now if you search for something on Google and it links to index page 2545 here, you will actually find the thing you expect to find. The same goes for those of you that like to open up a billion tabs. Now if you leave open a background tab for Gear News on page 180 it will give you the same content when you return.

Nien! It's mine!

I had a weird dream Wednesday night that Jonathan Silverman, star of such films as Weekend at Bernie's and Weekend at Bernie's II, visited the site regularly and wanted me to know. I suspect this was my brain trying to cope with the sudden reemergence of Rick Moranis. After over a decade of self-imposed acting exile, Rick showed up on Wednesday in a deceptive ad for a wireless phone company. (It's actually $90/mo.)

This got me thinking though!

Are there any celebrities that read the site? Even minor celebs. I'm not typically in favor of celebrity culture, but I am when it strokes my own ego! Let me know in the comments or privately. I'd love to learn that someone like Tool synthesist Danny Carey reads the site.

Reader Comments 12

I could tell you who I really am, but... you know...
September 11, 2020  | person The other Brian
Congrats on the site update. I've often wondered why sites like this don't have persistent page numbering; it seems like the most useful way to do it. But I guess one issue is when the front page is "full" does a new post sit by itself on the the next, frontmost page? Or is that landing page not a "real" numbered page and just shows x of the most recent posts?

And sorry, no celebrity here ; )
September 11, 2020  | favorite_border ajp
I am a legend in my own mind, does that count?
@ajp: I genuinely think most sites don't try this simply to avoid the hassle. There are so many problems with implementing this reverse paging.

Before if you went to the front page of the site, I could just give you the most recent posts from a single database query that says: "Give me all the articles in descending order, but I only want the first 5." From there I can do basic math for the pagination. If there are 5 articles on a page, and you now ask the site for page 2, I can just multiply the page number by the articles per page. With that number I can project into the same simple database query: "Give me all the articles in descending order, skip (page * posts per page), and give me the next 5 articles.

In reverse order the pagination becomes a nightmare because you don't start on 1. You have no idea what page number you're on when you go to the front page index. Instead I've got to do all kinds of weird shit. Now the database query is: "Give me all the articles in ascending order." and now I have to figure out the total number of articles for a given endpoint. It is different for people going to the root of the site "/", from people going to "/appnews/", and from people going to "/gear/". There's also legacy support for "/blog/" because that's what it was on the first host and I try very hard not to break old links!

From that total number of articles you need to calculate an offset, because you can't just say "Alright stack up all the posts, putting 5 on each page."

If the number of articles in total is not a multiple of 5, it doesn't work. You end up with 1 or 2 articles on the front page, then 5 on the next page, and so on from there. To make this work you need to offset everything so that there is 5 on front page, and jumping over those 5 to get to the next set of 5. Which is complicated when everything is in reverse order. I spent hours trying to figure out the math to make this work. The final formula looks simple, and maybe it is for better mathematicians, but it is not obvious.

And once you do get those 5 glorious posts per page that you're looking for... you need to now re-reverse the order on them, or they would be backwards when the site renders them! And make sure that it does this correctly for the next page so that the articles go into each other as intended.

The whole numbering at the bottom of the page:
2858 2857 2856 2855 2854 ... 1 | Next Page »
is another layer of hell. Pagination is the worst. I hate it deeply, because even going forward it often has weird edge-cases you need to work around. I tackled this project knowing it would be the worst of the worst, but I sincerely believe this is a more useful system. I know I personally hate it when a Google search takes me to page 5 of a site, and that now has entirely different content.
OMG it’s like ya callin me out as one a ya celebrity readers yo!! Thx homie ;)
September 11, 2020  | person HotRock SupaJoint
I sense Michael J. Anderson might be a frequent visitor. My hunch is, he’ll soon release a Red Room effect. His Black Lodge distortion will certainly make the cut on drohccsiD.
September 11, 2020  | favorite_border Enkerli
Many thanks for your hard work, Tim!
You are right: pagination on web pages is a special part of hell, but you are also right that the old system of counting pages was pretty uncomfortable. So thanks again for putting it right now!

Btw. I am not a celeb, at least not yet ;-)
September 12, 2020  | person_outline Granthafen
The repagination strategy works great for me. Thank you for doing this.
@Tim Webb
Ha, yeah, when I started thinking about what was involved I realized what a PITA it must have been. Thanks though, well worth it!
September 13, 2020  | favorite_border ajp
I do like this method of page numbering, even though it must have been a serious project to fix it.
September 14, 2020  | favorite_border stub
I am Ogre of Skinny Puppy
September 14, 2020  | person iOSTRAKON
I was a member of Korg’s voicing team (the Midi Patch Boys), does that count? Maybe not...I’ll get my coat. 😃
September 15, 2020  | person ozzy1

  Post a New Comment

You are not currently logged in. Would you like to login or register?
Enter your information below to add a new comment anonymously.

I'm not a racist, but...
Usernames need to be at least 2 characters!
I'm not a racist, but...
Please don't use weird characters in usernames!
{[ Ctrl.useravailable[Ctrl.userselector] ]}
{[ Ctrl.useravailabletext[Ctrl.userselector] ]}
Wow, that's a short email address!


Do not use HTML in your comments. Tags: [b] Bold Text [/b] [i] Italic Text [/i]
Links will be generated if you include http:// or https:// at the beginning of a URL.

Contact | Privacy Policy | Developer Services | Advertise
discchord.com is a service of Gnubesoft