Random information I've compiled over the years...
Posted by ignusfast on 2/3/2019 12:18:41 PM
Oddball emulation tip
There's a formula for determining the spin-rate of a MAME spinner. It looks like this: Original turn count for game, Tempest has 72 teeth in it's splinner. Original Turn Count (72) * 100 / Spinner Turn Count (1200) Here are some pre-calculated values, based on the Turbo-Twist 2 with a rate of 1200 ticks per revolution. 720 degrees (144) APB (72) Arkanoid (486) Arkanoid: Revenge of DOH (972) Arkanoid Returns (486?) Aztarac (?-my suggestion: 256) Blasteroids (288) Caliber .50 (24) Cameltry (486) Championship Sprint (36) Crater Raider (64) Danny Sullivan's Indy Heat (168) Dark Planet (64) Demolition Derby (8) Disks of Tron (128) Drag Race (36) Fire Truck (36) Forgotten Worlds (?-my suggestion: 1896) Ironman Ivan Stewart's Super Off-Road (158) Kick / Kickman (12) Mad Planets (?-my suggestion: 64) Major Havoc (???????) Monte Carlo (36) Off the Wall (256) Omega Race (64) Pole Position (102.667) Pole Position II (102.667) RoadBlasters (154.286) Sprint (36) Star Trek (64) Subs (36) Super Speed Race (64) Super Sprint (36) Tac/Scan (64) Tempest (72) Tron (128) Turbo (?-my suggestion: 144) Two Tigers (64) Zektor (64)
Posted by ignusfast on 4/27/2018 11:49:12 AM ; Last Updated by ignusfast on 4/27/2018 11:49:12 AM
If you're annoyed that you can no longer view an SSL certificate in the Lock icon, open the following settings URL and enabled it. This works for Chrome version 60+... chrome://flags/#show-cert-link
Posted by ignusfast on 2/14/2018 5:38:22 PM ; Last Updated by ignusfast on 2/14/2018 5:38:22 PM
A little Mischief...
I love this program! https://www.madewithmischief.com/mischief
Posted by ignusfast on 11/5/2017 2:07:23 AM
Not much of an admin...
I really need to spend some time on here - it's been quite a while! The last modification I made was to the file download code. It's much better implemented than it used to be. What I REALLY need to do is add some code samples. :)
Posted by ignusfast on 4/8/2017 5:11:57 PM
Well, that was an adventure...
I updated a game running on my server, and I decided to do some due-diligence and check out how everything was running. When I logged into this website, my SSL certificate was flagged as invalid in Chrome. I thought maybe it was too close to expiration, or it still had a SHA1 cert, so I applied for and installed a new cert. Still didn't work. THEN I actually searched, only to realize that Chrome and Firefox had both blacklisted StartCom's certificates! Due to shenanigans by their parent company, StartCom SSL certificates were no longer being honored. Damn, I really like the free option, though I get the reasons. I went to my domain registrar, Name Cheap. I guess I could have shopped around, but $27 for a three-year SSL certificate? Yes please! So the site is back to being properly SSL encrypted, and I learned that certification doesn't mean much if you can't trust the certifier. :)
Posted by ignusfast on 11/24/2016 1:02:30 AM
Been too busy to do much here. :(
I am thinking about installing Linux on a Raspberry PI and running this site off of that, just to see how a .Net Core Kestral MVC site and MySQL database would run on it. It will mean shutting down the Minecraft server, at least for a while, but it's not like anyone but me ever logs on anyway. Wish me luck!
Posted by ignusfast on 9/28/2016 9:33:41 PM ; Last Updated by ignusfast on 9/28/2016 9:33:41 PM
This is a bit of an old update, but new to here...
Spent much of last night porting my site to Azure. The code changes were minor, even including the database switch from MariaDB to SQL Server. This local version is running against MySQL again, but the azure version at http://ignusfast.azurewebsites.net is running against SQL Server. The painful part was actually hand-porting the Heidi export script from Maria to TSQL so I could import it into the SQL Server. Ugh. The differences in syntax were fairly minor. The hardest part was accounting for string value changes, especially with regard to line endings. Got it all sorted, though, and *that other version* is running in the Azure cloud. Though I love the increased bandwidth the cloud version provides, there's just something cool about running my own server. Unless it gets hacked. Sigh. Not sure I could afford to host a site in azure on my own without my work MSDN subscription, though - it's not SUPER expensive, but for what is basically a hobby site, it's way too much. A smallish, single instance with a smallish SQL Server looks to be about $150 a month. I might drop it to the free/cheap tiers just to see how it performs, but at that point, I might as well just run it on my own server anyway... :)
Posted by ignusfast on 9/27/2016 8:54:51 PM ; Last Updated by ignusfast on 9/27/2016 8:54:51 PM
Things I'm learning indirectly due to .Net Core
MySQL (and it's forks/branches) support direct import/export of data, but it was a bit persnickety getting it working... To Export
mysqldump -u root -p ignusfast > ignusfast_export.sqlTo Import:
mysql -u root -p ignusfast < ignusfast_export.sqlAnd no, ignusfast is not my password. That's the database. :) It will prompt for your password with this usage. The fun thing was that I found this when I decided to install Visual Studio Code on my Macbook Air and get the project working. Not in love with the VS Code UI - almost nothing is in menus, so you wind up pressing Command-Shift-B(uild) and Command-Shift-D(ebug) a lot, which is annoying. But VS Code is INCREDIBLY lightweight. Even after installing the necessary plugins (c# language, etc.), it launches in about a second. And it still includes full Intellisense. The one main thing missing from VS Code is a stinking NuGet package manager... As far as I know you just have to mess with your project.json file to add new packages. But it's REALLY neat seeing my website run in several completely different environments, including a Windows 12 server, a Macbook Air running OS X, and an Azure Service Instance (Who knows what container that's using), all with almost no changes... Actually, the only annoying thing about Azure is the dependence on SQL Server, which makes sense given the parent company. But until they make SQL Server OS independent as well, I'm stuck switching.
Posted by ignusfast on 9/20/2016 11:03:39 AM
Adding additional functionality and playing with authentication
I added the ability to more easily add Blog articles. I also fixed a bug in the authentication code that was prohibiting Administrator-level users from using the site properly. Authentication is a tricky wicket. You don't want to hit the database for every single request, but you also don't want to leave your site open to an abusive user. Currently I'm using a hybrid approach, where the site uses a secure cookie to allow access for up to a day without hitting back against the database. But that time period is easy to tweak, so I'll probably drop it down to 5 minutes or so. It's not like there's enough traffic on here to make a difference! I may also at some point switch my database from MySQL to SQL Server and experiment with hosting this site in the Azure Platform-As-A-Service...
Posted by ignusfast on 9/15/2016 10:53:25 PM ; Last Updated by ignusfast on 9/15/2016 10:53:25 PM
.Net Core and external NuGet projects...
Wow, this is a real learning experience. :) I was looking for a server-based image manipulation library, mainly to handle resize duties in the production of thumbnail images. Initially I started out with the tried-and-true ImageMagick, which has been around for a long time. Unfortunately, the Core versions don't appear to be very stable. The first batch upload I tried wound up crashing the actual process with a lovely memory corruption that actually bypassed my try-catch code and took down the whole framework. Soooooooo. I dug around online, and found a package called ImageProcessor (https://github.com/JimBobSquarePants/ImageProcessor). It's only in alpha mode, but everything I need is complete. So I went ahead and installed it using the package manager, and switched a whole 10 lines of code to use it for aspect-ratio accurate resizing. I then threw it a torture test by uploading 30 images, almost all at 4K resolutions. Not a single hitch. You can see them all in the gallery. I'll try some more oddball cases - images that are taller than they are wide, images smaller than the thumbnail size for the site (260px on the longest side), etc. But it appears to be running like a trooper. I may go ahead and expose some of the image processing functionality it offers and see what it can do. More later...
Posted by ignusfast on 9/12/2016 5:23:05 PM ; Last Updated by ignusfast on 9/12/2016 5:23:05 PM
Playing with Responsive Design
Learning so much; HDC here in Omaha was actually really informative. There were a few lame sessions, but overall I learned a TON. In light of that, over the past weekend I did the following to this site:
- Ported the existing framework to .Net Core MVC
- Moved to a responsive design using Bootstrap
- Switched the ORM from Entity Framework 5 to Dapper
Posted by ignusfast on 1/18/2016 12:46:55 AM
I really should have looked this up sooner...
Command-Line scripting in Windows has grown a lot more powerful since the last time I'd played around. For example, I was wanting to zip an entire folder of multiple files, but each as a separate archive file. The following will do just that...
FOR %i IN (*.jag) DO "C:\Program Files\7-Zip\7z.exe" a "%~ni.zip" "%i"
Posted by ignusfast on 9/12/2015 8:24:02 PM ; Last Updated by ignusfast on 9/12/2015 10:13:29 PM
So, this Entity Framework thing.
I love the fact that one can combine Linq and EF in order to create complex queries and have the framework properly interpret them. Things like the following work extremely well:
var query = from u in art.articles select u; if (!String.IsNullOrEmpty(model.Heading)) query = query.Where(u => u.Heading.Contains(model.Heading)); if (!String.IsNullOrEmpty(model.Body)) query = query.Where(u => u.Body.Contains(model.Body)); if (!String.IsNullOrEmpty(model.Author)) query = query.Where(u => u.Author.Contains(model.Author)); model.Articles = query.OrderByDescending(of => of.Favorite ?? sbyte.MinValue) .ThenByDescending(op => op.Posted) .ThenByDescending(ou => ou.Updated).ToList();This represents the SQL executed by the Articles class you're viewing now. In administration, I have the ability to search for articles by Heading, Body, and Author. I then sort them descending based on whether or not they're favorites (only favorites will remain on this screen), and by last Posted Date and Updated Date. EF winds up producing the following query for MySQL:
SELECT `Project1`.`ArticleID`, `Project1`.`DocumentID`, `Project1`.`Heading`, `Project1`.`Body`, `Project1`.`Posted`, `Project1`.`Updated`, `Project1`.`Author`, `Project1`.`Favorite`, `Project1`.`UpdatedAuthor` FROM (SELECT CASE WHEN (`Extent1`.`Favorite` IS NULL) THEN (-128) ELSE (`Extent1`.`Favorite`) END AS `C1`, `Extent1`.`ArticleID`, `Extent1`.`Posted`, `Extent1`.`DocumentID`, `Extent1`.`Heading`, `Extent1`.`Body`, `Extent1`.`Updated`, `Extent1`.`Author`, `Extent1`.`Favorite`, `Extent1`.`UpdatedAuthor` FROM `articles` AS `Extent1` WHERE (`Extent1`.`Body` LIKE @p__linq__0) AND (`Extent1`.`Author` LIKE @p__linq__1)) AS `Project1` ORDER BY `Project1`.`C1` DESC, `Project1`.`Posted` DESC, `Project1`.`Updated` DESC -- p__linq__0: '%Linq%' (Type = String, Size = 6) -- p__linq__1: '%ignus%' (Type = String, Size = 7) -- Executing at 9/12/2015 8:53:35 PM -07:00 -- Completed in 0 ms with result: EFMySqlDataReader
Posted by ignusfast on 1/1/0001 12:00:00 AM
This is my first article, and as such is lame. I mean, it's not the most lame first post ever, but it's still pretty lame, right?