I'm a nerd, yep I admit it freely. I read slashdot and my job title is Software Engineer. These are my rambling on .NET, C++, Programming, and Technology overall.
Internet Explorer 8 beta 1 is out
Get link
Facebook
Twitter
Pinterest
Email
Other Apps
-
IE 8 from MS is now out in beta 1. I haven't had a chance to download and play with it yet but it's here.
I recently ran into a situation where I had to do some string manipulation. I had to replace some bad text with valid text. All this had to do with creating valid xml element names. So we had to string white space and some other invalid characters and replace them with valid xml element formatting. To do this we ended up using the Regex.Replace static method. Simply because there was some complexity involved that would have entailed using more then 1 String.Replace call when we can do it all with one regular expression. This caused some discussion about how heavy the regex class is and when to use it. I decided to do some testing and these are my results. First the code static void Main( string[] args ) { // this is our test value string testValue = "This is a test string"; int count; // run the regex replace DateTime regexStart = DateTime.Now; for( count = 0; count < 10000000; count++ ) { string newValue = Regex.Replace( testValue, &qu
Sometimes you need to have a C# windows form application run in full screen mode. Like you see on a kiosk at a mall or some stand alone machine. It's fairly easy you just need to set some of the properties on the Form either in it's OnLoad method or directly in the designer. In the OnLoad method of the main Form set these values, or again set them directly in the designer. this.MaximizeBox = false; this.TopMost = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
So working on an asp.net page I found I needed a numeric only text box that allowed numbers from 0-100 with no decimals. I found a range validator would do most of the work but I wanted to keep users from typing in bad values. So after some searching I found javascript has a good solution. I like whitespace so shrink if you're one of those white space freaks. Update: someone was kind enough to point out an error in my JS! So I went through and made sure it works. And it did need a minor tweak to be correct. So thanks to the poster the corrected script and usage are below. Update Again: This is the new and improved function to allow for the tab key to tab out of the text box. IE allows this by default however Firefox really tightens down the text box and doesn't allow anything you don't specify. So I had to add the tab key press. I also cleaned up the code so it isn't a huge chunk of if blocks and is now much more succinct. Please feel free to test and us
Comments