Our minds cannot repel logic of that magnitude!
C#
FilePirate Moves to CodePlex – Hoping to be ready for LAN
May 3rd
After some dealings with Google with regards to FilePirate, and not dealings in a good way – I determined to move FilePirate away from Google Code. What sits there currently will continue to for a couple months, and will be deleted within a few months. So, with that move, FilePirate found its new home on Microsoft’s CodePlex. Now I’m usually not the fan of Microsoft products or projects, but CodePlex is actually pretty cool. Luckily they offer support for a non-crappy SCM solution now that they’ve picked up support for Mercurial. So, the new home for FilePirate is now http://filepirate.codeplex.com/.
With that being said – it is my plan to actively bring FilePirate back into development, and I hope to have it completed for use at this month’s LAN69 – which is May 28-30. If you’d like to see FilePirate in action, sign up for the LAN and get some fragging in as well. We’ve got some awesome prizes, too!
Simple, Somewhat Advanced File Mover Program in C#
Mar 17th
So today I was tasked with moving over 14,000 files off an automation PC to a file server. That’s great, except for the fact that there are over 14,000 of them! And they wanted it done on a regular basis – scheduled task, got it. But a complaint was that it takes forever to open the folder because of the Windows hiccup when accessing a folder filled with over 14,000 files over a network. So the solution? Move the files to an organized folder structure based on date. So, my coding fingers got moving, and away came the Simple File Mover, written in C#. The code I am releasing under the MIT License – so feel free to download it (see the link at the end of the post) and use it how you wish, just give me credit where it’s due.
The code has a lot of examples of threads, parameterized threads, as well as IO operations working with files, creation dates, folders, and much more. Take, for example, the following code which will create the target folder structure we will move the file to. The resulting folder is whatever our target (to) was as well as the file’s creation date.
thisTarget = to; if (!Directory.Exists(thisTarget + fi.CreationTime.Year.ToString())) Directory.CreateDirectory(thisTarget + fi.CreationTime.Year.ToString()); thisTarget += fi.CreationTime.Year.ToString() + "\\"; if (!Directory.Exists(thisTarget + fi.CreationTime.Month.ToString())) Directory.CreateDirectory(thisTarget + fi.CreationTime.Month.ToString()); thisTarget += fi.CreationTime.Month.ToString() + "\\"; if (!Directory.Exists(thisTarget + fi.CreationTime.Day.ToString())) Directory.CreateDirectory(thisTarget + fi.CreationTime.Day.ToString()); thisTarget += fi.CreationTime.Day.ToString() + "\\" + fi.Name;
There are also examples of delegate methods, passed both to a List as well as used as a ThreadStart:
ThreadStart starter = delegate() { Loop(source, target, folders, oldFiles); }; // [...] filesAlreadyExisted.ForEach( delegate(string f) { Console.WriteLine(" - {0}", f); } );
So again, get the code, use the code under the MIT License as you wish. The only thing I ask for is that if you decide to use the code, or a derivative of it, in your own software project that you simply send me an e-mail via my contact form and let me know! I love to see where my code ends up being used!
Download The Code (ZIP, 35k)
FilePirate Alpha Test at GPA’s Gameday
Jun 17th
For those of you who have been following the development of FilePirate – Advanced LAN File Sharing, you will be happy to know that we will be engaging in an alpha test of the application at GPA’s Saturday Gameday this month. The LAN is on Saturday, June 27th at noon, located at the GPA clubhouse in Silver Creek. Those who wish to attend their event should sign-up on their webpage at www.gameplayersanonymous.com‘. If you are going to be attending and wish to help assist in the testing of FilePirate, please let me know ahead of time so that I may get an accurate count and some expectations on testing.
FilePirate and the rebirth of RicePaddy.org!
May 28th
For those of you who have been following the development of FilePirate – Really Advanced LAN File Sharing, you will be happy to know that I will be rolling out an Alpha soon and will be unveiling it at a GPA LAN party sometime next month (exact date TBD). For the time being, FilePirate now has its own website available at filepirate.jonnyfunfun.com.
Also, back by popular demand is the domain ricepaddy.org. For the time being, however, it simply just points you back here to this blog. As I start finishing other projects up, it will be migrated to its own website. What will be on it? No clue. I’m open for suggestions.
Newest Project – The Code Beautification Utility
Jan 24th
Okay, so most of you are going to laugh at me for how this story goes, but I have to tell it because it speaks worlds about what kind of person I am. So the other day I’m at work and I’m trying to debug some problems with a ColdFusion Flex component. The only problem is that this component is over 600 lines of code long and, due to the immense amount of changes, there was absolutely no formatting of the code at all. It was probably my worst excuse for code to date; tabs were non-existent, code wasn’t indented properly – if any at all. Needless to say, I was very irritated at this and needed to do something about it. So what do I do? I start fixing the code myself, line by line, properly indenting code.
That trek did not last very long. I got to around line 80, realized that it was a futile attempt, scratched it, and went to get my lunch. Now I’m the kind of person who likes to eat at my desk, and continue doing some sort of work. So here’s where I got the idea – I’ll write a utility during my lunch break to format code. Voila! The Code Beautification Utility, or CBU for short, was born.
In a mere 43 minutes (what I consider to be record-breaking time or damn close to) I wrote a simple, yet somewhat effective, code formatter using my weapon of choice – C# of course!. At the current point, it only understands ColdFusion files (cfc and cfm) and HTML files. However, it understands the languages based off of embedded XML files – so it’s language knowledge can be easily expanded. Now for all of you GUI fans out there, I have some bad news for you – it’s a command line program, sorry. However, a GUI can be easily written for it, and I will probably do so. The output from the program also is very simple – if you decide to let it recursively fix all files in a directory, it doesn’t give you any indication as to it’s progress. Not yet, at least. You can pass just a single file to it as well, if you’re only looking to fix one file as I was.
And so, in a nutshell, there is my newest project and utility which I will be slowly expanding upon in the upcoming weeks. Hopefully relatively soon it will be a fully functional and stable utility. Check the project out in my project repository here.
