| Sam Allen's profileDOT NET PERLSBlogListsSkyDrive | Help |
DOT NET PERLSThe original Dot Net Perls, with the old posts and stuff. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A list of my preferred programming tools; a programmer is only as good as his tools
A brief list of my programming projects so far; starred items have Windows Forms interfaces; links are to general information about the kind of project
|
Runtime fixI fixed a bug in the Runtime that could have caused the site to be unavailable for 12 hours. The timer was initialized after the binary was read in. So if the binary was missing at startup, the timer would not be initialized. Then the site would just sit there for 12 hours. Now, the site initializes the timer first. So after 20 minutes, if a new binary is found it will be used. This protects the site from user error. readonly variables at DotNetPerls.comI would like to emphasize one of my latest articles, called C# readonly, that can help you learn more about this keyword. It is part of the C# language and I really learned what it is good for here. You can have a const variable modifiable at runtime. PerfLimit key lengths to 19 chars. Remove char 1. [perf] Add code to disable/enable Stopwatch.GetTimestamp(). Disable it. [perf] Canonical link tag. [awesome] Case-insensitive. Add numberingTODO: keep adding numbering to articles. Perls progressYesterday, added code that generated heuristics for optimizing IsGZipSupported. It is almost twice as fast in some cases, always faster. Wrote article on it, Request.Headers Usage Stats. Mainly a vanity piece. 4 new articles Removed duplicate images. These were a carryover from when the images were not at the start. Having visual kick to articles is most important so leave them at start. Stop centering images. Should remove "ct" style logic Should convert numbers to #. --- (not Figure #. ---) New stuff at Dot Net PerlsNew articles: Join String Method, Google Webmaster Tools - Crawl Stats. Both have graphs. Very nice. It has really helped that I have taken it slower. Rearranged RSS link to be right at the top of the home page. It is very obvious and clear now. It looks fine. Changed runtime to precompute all GZIPs, costs about 300 ms on startup. Should put up the Runtime for a bit. It isn't doing me much good to work on it. I had to fix the problem with the threading in the old lazy Dictionary cache. Read "Writing For Computer Science" book. Also bought tons of Red Bull and Double Shots. Zzzz [Today] New dictionary GetHashCode method, 40% faster, 10% faster startup New article about IEqualityComparer TODO: Dot Net Progress, Feb 2009So, I did lots of stuff with Dot Net Perls. First, I used more string preprocessing to make the pages about 1% smaller with no content changes. I will post the HTML Minify article soon. I rearranged the database so it is simpler to read in at startup. It should also be about 600 bytes smaller. Startup should be faster. Fewer objects allocated in memory at startup. This week I wrote a couple good articles. Stopwatch Samples and Domain Name Method. They have good style. Also replaced some older images, added new "theme" images. I added Timestamp functionality to the site. Every request is timed now. This lets me detect performance problems in the future. I simplified the settings functionality in the runtime. I have been replacing some spaghetti code with modular classes. For example, a class to handle the decompression cache. Also a stopwatch utility class. Also made Metadata into a single object. I can simply create new ones now, instead of risking corruption of old ones. I added a CENTER style, which I can use to center images. Also improved some of the style code. Mainly, I need to sit back and observe the site. I need to take notes in GMail. I will wait for problems and be reassured when there are none.
TODO: Read books. Read my other site! Also Lists.If you are seeing this, you probably searched for my main site Dot Net Perls. I recommend reading my articles there, as the stuff here is rather old. I think you might like the System.Collections.Generic.List article for List collections I wrote about the List object in C#. Cool new stuff, making progressWow! I have been extremely busy. I have completed 2 programs that were on Apple's website, one of which was the Staff Pick. You can read more on my website.
Speaking of my new website, it is getting quite a lot of visitors these days, and I intend to keep it growing. I really enjoy writing technical articles and hope to get a career going in it some day.
I have been studying many books. "Letting Go of the Words" is an awesome one. I am learning how best to write web articles with that. There are so many things to study and learn. Also I have been buying many computer books and learning cool things like LINQ, ASP.NET, and SQL. I have made a great amount of progress, but there is so much more to do.
I am optimistic about the future of my web sites but competition is fierce and I have to keep doing better work.
I would like to point out a few articles I am really proud of that I have written.
My new site is designed and implemented so much better than this Live Space. Putting my articles here is really a disservice to my readers. But I do hope to keep blogging here. I am not a serious blogger but I like to write.
I do have to keep my "pleasure" writing to a minimum, though, as I do so much coding and technical writing.
Thanks for reading! New Web Application: Anagram FinderI haven't blogged here in a bit, mainly because I have moved on to my own, custom website. It has much the same material on it, but with 10+ new articles already. I haven't given up by any means and I am dedicated to this cause. Mainly I am posting here because I have made a new program called Anagram Finder, that allows you to cheat at your favorite word game (Scrabulous, Scrabble, Boggle, Yahoo word games). It finds all anagrams in a word that are the same length as the word. My program is special because it has a decent GUI, no ads, and is very fast. The server is using an optimized database with indexes, etc. It all works very well but I seek to improve it further. Visit the new Anagram Finder at http://dotnetperls.com/anagram/. There is an accompanying article at Dot Net Perls Dot Com. Come visit; I think you'll like it. The anagram finder is fun to type into. New Code and Articles at DotNetPerls.com!Dot Net Perls Update #1There is new stuff at my source reference site, DotNetPerls.com. One article delves into SiteMapProviders, C#, recursion, and generating HTML. Includes code. An article about dealing with recursive file directories, with code that is more robust/logical than that on MSDN's site! In C#. Output caching and master pages. Some cool stuff about ASP.NET performance Have fun! Another update:The new site has code examples and pages on recursively finding file names in directories and subdirectories, counting words like Microsoft Word does in C#, full code examples of an NGEN.exe precompilation Installer Class, and some (possibly) amusing commentary on programmers and blogs. More stuff (#3)My Rot13 C# implementation, precomputed bitcounts, single instance Winforms apps without using a Mutex, 3 screenshots, an archive page, much better structure, and probably more. The new site is better in every way--no ads, 10x faster to load and smaller, code that is easier to copy/paste, a better source repository at Google Code, and a ton of improvements. Google has discovered it but hasn't indexed the latest and greatest. DotNetPerls.com New Site--MOVEDI have published a new article at my new web site, dotnetperls.com. This article has some brief samples of ASP.NET master pages, content pages, and code behind. It is the first article published on my new site layout. The new article is located here.
I am moving things to my own web site for the following reasons:
1. The new web site will make a better resource for my readers, most of whom find my site with Google and are looking for programming tips.
2. The new site will feature code that is easier to copy/paste.
3. I can learn ASP.NET and put my C# skills to more use, to a broader audience.
4. I may get a higher search engine ranking.
5. I don't get a lot of comments, and don't have a lot of "Internet friends".
6. Dot Net Perls is not really a blog, but a code resource. Static pages that are simpler will serve my audience better. The date each article was published is not important.
Here's some cool stuff I did on my new site:
1. More hyperlinks.
2. Text corrected.
3. Much easier navigation (you'll like this a lot--I do).
4. Smaller HTML, faster.
5. NO ADVERTISEMENTS, and I won't put any there any time soon!
You will like the new Dot Net Perls a lot, and I will update it with both old and popular content, and new and fresh stuff. At least for the time being.
Have fun! Micro-benchmark: Linq on Windows Controls MOVEDPlease see the Dot Net Perls Dot Com article on Micro-Benchmarking Linq!Excel Interop Performance--MOVEDI have edited this content and converted it into two articles. They have been improved, and put on a much nicer site (no ads). Improve Performance with NGEN: MovedI'm sorry, this content has been moved. Google will figure out eventually. Look for the new Installer class here. It works as well as ever, and it is free! It is available at Google Code from a link on the new site. My Take on Integer Parsing MOVEDThis post has been moved to a new home at Dot Net Perls Dot Com!Alphanum/Alphanumeric Sorting MOVEDNew Article Here--I have improved this post quite a lot and put it in a much better format at the link provided. Code is also available at the new site Optimizing SQLite/rowid: MOVEDThis page is now located at Dot Net Perls Dot Com. It discusses SQLite rowid joins, etc. Memory Allocation/Software BreakthroughIn software development, the most exiting (exhilarating) moments are when a change you just made not only works properly, but causes a massive improvement in the speed or quality of your product. I cherish those moments when, after literally staying awake for 10 hours all night, a complicated and difficult change finally compiles, and works properly. One change I made saved megabytes of RAM by using a special tree structure; it was a thrill after staying awake all night. When a novice developer first makes a database without an index, it will be very slow. But just by making his/her first index, the database will become a hundred times faster. These are decisive improvements that are indisputable. There aren't any benchmarks showing 1%, 1.5% improvements, but common sense and examination in passing can validate the improvement. These are the changes that make software design fun. Fixing bug #25 (or 1,000) is fine and important, and may well be critical to the health of the project, but this kind of change is more exciting. In the Mozilla project, the last change I thought was truly a big enhancement was the special back/forward cache. Basically, with that cache, the browser would store a previously-viewed page in its finished state and simply display it again when the user clicks back (or forward). Thus, the time for rendering a 10 MB HTML file could drop from 10 (30?) seconds, to .1 seconds. Recently, a change in the memory allocator in Firefox/Mozilla was made. A new allocator made by Jason Evans (and used mainly in various forms of BSD) was used to replace the system allocator on Windows. Now, the system Malloc() on Windows is fine a lot of the time, but even in .NET and Microsoft's own projects, it is not used. It is old and I don't think it is being improved by Microsoft. Dot Net uses a custom garbage collector. Over the last 10 years, Mozilla has had this behavior: start at 10-20 MB of RAM used, and gradually grow. There was no reduction of RAM really. So, after a day, I would see 100 MB. I restart/shutdown usually, but occasionally I would see 150 MB. I don't think it would stop, ever. JEMalloc has fixed this behavior for me. It changes the allocation patterns entirely. I see the browser get up to 60 MB, 70 MB, and it will stay there. If I open a bunch of stuff, the browser will get to 150 MB, but then when I close those documents, it will go to 60 MB again. The final effect is simple and that is that it fixes the endless growth of memory usage. I use other programs, as do most people, to actually be productive with my computer. Those programs use 100+ MB, 200+ MB, but they have more of a rationale for that. So, JEMalloc fixes the problem for me. Maybe it doesn't work indefinitely, but it is far better than before. It fixes probably the most hated Mozilla bug (on Windows?) of the last 10 years. Precomputed Bitcounts: MOVEDThis article is now located at Dot Net Perls Dot Com! Look Here! Enjoy! There's lots of code too. Scrabble in Perl: Moved (Code at new site)UPDATE: See below. Open source code is now available!
Look at http://dotnetperls.com/Content/Scrabble-Algorithm-Perl.aspx for the post and a link to my Google Code site for the source. C# Code MovedAll this code can now be found at Dotnetperls.com Single Instance Code; Using BeginInvoke on a Thread with a Timer; Open-Source CodeHere's some more open-source code I have developed or adapted. The first class enabled single-instance applications that actually works (most Mutex approaches on the 'Net will fail a lot). The process code is adapted from the work of a Microsoft engineer posted on a mailing list. The second file is a speciality class I use to make UI updates really polished and even. It works great. I will post more code in the coming days/weeks. Have fun.
Here's how to use ProcessChecker to create a single instance app: // the string "Launcher" must be contained in the window you will want to focus if it is running. if (ProcessChecker.IsOnlyProcess("Launcher"))
{
}
Here's how to use RenderScheduler.cs to make the screen updates of your app fluid and even:
// declare this in your class
delegate void UpdateGridDelegate(object ob);
// instantiate the object in your constructor for the form
_threader = new RenderScheduler(Properties.Settings.Default.UpdateThrottle,
new UpdateGridDelegate(BuildDataGrid), this);
// call this whenever you want to launch the threaded function (not on UI thread)
ThreadPool.QueueUserWorkItem(new WaitCallback(BuildDataGridThreader));
// use this function to do the processing
// the delegate UpdateGridDelegate will be used to call BuildDataGrid
// when the appropriate functions of _threader are called in this function.
void BuildDataGridThreader(object ob)
{
}
Hope that helps. Remember to have fun. NOTE: The source code is in my public folder and is linked to in later posts. Code MovedThis code and post is now entirely moved to Dotnetperls.com. |
Some languages I know (notice the omission of French)
Here are some programmers/etc. whose work I really admire
Public folders
I somehow learned how to use and actually used these techniques
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|