![]() |
| Home RSS Directory F.A.Q Try Custom Feed Sonneries Portable |
Latest Flows from this sub-category: random selection from this sub-category: |
commUNITY Wed, 08 Oct 2008 16:54:44 +0200 My son Clément really likes computers and Pocket PC devices. More than pens and papers. I even gave him my old HP Jornada 545. He’s also having some difficulties with handwriting and precision. So I thought I’d use that attraction to my Windows Mobile phone to make him practice a little. I made an application, called FirstPen, for practicing handwriting.
The idea is simple. You must complete the gray outline the best you can, without drawing outside. After each letter, the application calculates how well you did it.
This is a first draft, and I need feedback to make sure I’m on the right track. For example, a feature not yet implemented would be to make sure letters that must be done in a single or two strokes are made in a single or two strokes. Another one would be to make sure letters are started at the correct position. I’m also looking for fonts that best match how children learn to write at school. It seems every font I find has its flaws. Here are the fonts I’m currently supporting:
As you can see, some of them do not support accented chars, which is a problem for me, but isn’t for English users. Others have guiding lines. This can be very useful, but in order for my precision algo to successfully determine if a letter is well done or not, the letter to draw must be gray, and other decorations must be a lighter green or red. That’s why I must manually edit each letter to make those guiding lines green, like this:
This is a painful task I’d really like to get rid another way, but since I like the idea, I’ve completed the “DR BY 2” font as a proof of concept. This also opens the door to green helpers, like arrows for direction. So, if you want to try this out yourself, upload this CAB file to your Windows Mobile device, install it, and give me your impressions. I do not intend of charging for this app. If it grows better with your feedback, everybody will benefit from it, for free. By the way, the CAB file is 3 megs because of the embedded images, but I haven’t run PNGCrush on them yet. It should get smaller. Please note that it also requires the .NET 2.0 Compact Framework. It should work on Pocket PC 2003 devices, and Windows Mobile 5 and 6. Technorati Tags: FirstPen,handwriting Thu, 02 Oct 2008 23:15:04 +0200 Today, I released a minor update to slimKEYS, version 1.2.8479. The three most important new features are:
Another important change is regarding the trial message. Before, a notification pop-up appeared every 15 hotkeys you pressed. Now, every window will show a small clickable message at their bottom.
Rest assured, there is no time bomb in slimKEYS, and there will never be. If you like slimKEYS, but do not think it is worth 15$, you just have to tolerate this red message and ignore the end user license agreement… but don’t tell me! q;-) For the rest of the changes, take a look at the complete history. By the way, how do you like the new web site look? Mon, 04 Aug 2008 22:28:45 +0200
This application is a bill-splitting tool, but does not limit itself to making simple divisions. It automatically calculates who owes who depending on everybody’s contribution at the moment of paying the bill, and also the cost of their purchase. For example, your team is ordering lunch at the office, but the delivery guy comes in with a single bill. It adds up to 53.34$, Steve gives 35$ and John gives 25$. Mike and Lisa didn’t have cash. Now who owes who? You think it’s as simple as dividing 60$ by 4? But Mike took the expensive ribs, while John went for a simple salad. It wouldn’t be fair. Now, how do you split the tip? And when comparing the meal prices with the total amount paid, you also have to consider the taxes. No problems. Steve is a wise man. He kept a copy of the bill, and uses DutchTab to enter that bill. He creates a new bill:
The bill is new and empty. It’s time to add partakers:
DutchTab will show you all previous partakers, and lets you either add new entries manually, of quickly import them from your Outlook contacts:
Steve paid 35$, and took the chicken and a Sprite:
Lisa went for the finger-licking chicken fingers (with the honey-mustard sauce):
John paid 25$, took a salad for his line… and a Coke because a salad is not enough:
Finally, Mike got the famous ribs and a Coke, nobody’s complaining about his line… yet!
Now, on the bill’s summary, we can see that the total before taxes and tip is 49.85$. Steve entered the prices as they appear on the bill. No need to add the taxes, DutchTab will take care of distributing the taxes and tip proportionally.
DutchTab determines that Mike’s meal, with taxes and tip, was worth 20$. Since he paid nothing, the application tells him he should give Steve 20$. As for Lisa, her meal’s total price was 13$. She owes John 12$ and Steve 1$. Steve can now click on “Send email” to send everybody a nice reminder.
I hope this gives you a good idea of how useful DutchTab is.
Technorati Tags: DutchTab Sat, 12 Jul 2008 23:05:19 +0200
The idea behind the software is very simple: You enter how much each person actually paid, and also the cost of what they bought. The software automatically calculates who paid too much and who didn’t, and optimally determines who owes who. The number one challenge was that we didn’t share design, only the name. We headed in our own direction and waited only a few days before release before sharing a few screenshots and screencasts. We did make some adjustments, mostly wording, but kept each application’s personality. I really think this was a wise decision. Both platforms have their own design guidelines, and both devices have their own input methods. I’ll add that Pascal had the easiest part, since the iPhone does not have zillions of buttons. He could concentrate on touch gestures and actions, while I wanted to support buttons and touch screens. My goal is to run on both PocketPC and SmartPhone devices, but the current beta release fails on SmartPhones because I’m using an unsupported feature with combo boxes (dah). You can learn more about the Windows Mobile version of DutchTab here. This initial release is a beta version, and I’ll be offering those who submit meaningful comments a free license once I release the official version.
Technorati Tags: DutchTab Tue, 10 Jun 2008 16:26:47 +0200
In the first case, it was a long and tedious job of moving every string to a resource file, translate each one, localize each form and repeat the translation for each label. It was simply long, and boring. In the second case, I had a problem. Taking apart the numerous p-invokes throughout the code (but mostly in slimSIZE), slimKEYS is a fully managed C#-made application, except for one tiny portion of code used by slimVOLUME. The slimCODE.slimVOLUME.Vista.dll file is a mixed assembly made in C++. Normally, .NET applications don't have to care about the address space size. 32-bit or 64-bit systems don't matter, as long as the CLR implementation on both platforms is equivalent, and that your p-invoke signatures are correct. But in the case of slimKEYS, when the 64-bit implementation of the CLR was trying to load this mixed assembly, it caused a load error. An unmanaged 32-bit application can run flawlessly on 64-bit systems, but a 32-bit DLL cannot get loaded in a 64-bit CLR domain. Usually, unmanaged applications that wish to natively support both 32-bit and 64-bit systems offer two packages, each built exclusively for each platform. But that's totally against the logic behind managed applications. At least that's what I thought. It was easy for me to build two versions of my C++ DLL, but how could I use them from a single managed application? How could I keep offering a single and consistent package? After investigating, asking questions without getting precise answers and doing some trial and error, I chose a solution that isn't guaranteed, but seems to work well. My C++ DLL implemented a single class, called VistaVolumeControlsBridge. The managed plug-in declared a base class named VolumeControls, with two derivatives VistaVolumeControls and WmmVolumeControls. So there was already a level of indirection, where the VistaVolumeControls class was instantiated based on the platform, and using an instance of VistaVolumeControlsBridge under the hood. What I did is create a 64-bit version of the C++ DLL which implemented class Vista64VolumeControlsBridge, and its Vista64VolumeControls counterpart on the managed side. Now, the decision between creating a WmmVolumeControls or a VistaVolumeControls based on Environment.OSVersion had become a three dancers decision that looks like this: if( Environment.OSVersion.Version.Major >= 6 ) { if( IntPtr.Size == 8 ) { m_volumeControls = new Vista64VolumeControls(); } else { m_volumeControls = new VistaVolumeControls(); } } else { m_volumeControls = new WmmVolumeControls(); } Since VistaVolumeControls and Vista64VolumeControls are themselves managed classes, this doesn't seem to trigger loading of the 64-bit type on 32-bit systems by the JIT, and vice-versa. I could not find any reference if I could assume that a type that is never instantiated will never require its containing assembly from being loaded. But I'm ready to take the risk, and wait for your feedback if it breaks.
We used to say something at Xceed about those situations: Two wrongs don't make a right! This is a very good example. Creating a problem to avoid another one. I really think it was a stupid decision. Changing the output device on Vista requires 4 steps:
Failed. I'd be really happy to see an API for this in Windows 7. But if there are hackers reading this, can someone tell me what is called under that "Set as Default Device"? The API already exists, it's just not documented.
Tags: slimKEYS, slimVOLUME Tue, 10 Jun 2008 16:15:42 +0200 I wanted to upgrade my SmartFTP 2.5 to version 3.0 to overcome many crashes I get on Vista. Not only did the setup told me my maintenance was expired and had to renew it in order to use the upgrade, it told me the following applications were using files it had to upgrade:
You need to upgrade files in use by slimKEYS? Or by xplorer2? I ... don't ... think ... so! It would be great if advanced users could see the actual list of files the setup needs to update. Something else missing on that dialog (but that's Vista Restart Manager's fault) is a Retry button. You can't refresh the list after closing apps manually. Fri, 30 May 2008 16:14:06 +0200 I had an agreement. I gave my word. In order to win the book, I had to make a critique of it. I read it. I took notes. I enjoyed many topics, considering the book as a very good read for someone like me who's starting with web development and ASP.NET. But the critique never came. With my current time employment, it fell very low in my priorities. It could wait. Then I realized why it wasn't a priority: it isn't a great book. I would have written much earlier would I have been excited about it. On the other hand, I would have written earlier too if I thought it was that bad. It's average. The problem is, I have no idea who that book is intended for. What I initially though was a reference book for average ASP.NET developers, then transformed, while reading it, into a "one read" book for new ASP.NET developers who don't want to hit dead ends, and finally upon completion and working on a critique ended up in my mind as a clumsy agglomeration of unequal articles. And don't put to much importance on words like "clumsy" or "unequal", as the real keyword here is "article". In the real world, I only put forth a single suggestion coming from that book. Does this mean the rest is useless? Not at all, it's just not relevant for me right now. I have to agree with Jeff, or at least agree with its questioning. Books like "The ASP.NET 2.0 Anthology: 101 Essential Tips, Tricks & Hacks" aren't meant for paper. We should be able to find those articles quickly and easily, when needed or reading them as they come, from our main working tool: the computer. They're articles. Can't stop thinking that Jeff's initial thoughts on stackoverflow.com came from working on that book, as almost everything in that book would fit very well on that upcoming site. Best of luck, Jeff, and thanks again for the book. Mon, 07 Apr 2008 01:17:29 +0200 This morning, my Google alerts pointed me to this page, a Russian web site talking about a product called SLIMCODE. Google Translate tells me it's a box of capsules for a weight loss program. I'm fine with that. It's normal, on this planet, to have some name collisions, as long as the domains of business are different. Where it hurts a little is the logo on that box: "SLIM" is in a normal weight, "CODE" is in bold and uppercase. The only difference with my logo is "slim" in lowercase for mine. But the concept of "slim" versus "bold" is the same.
But don't worry. I may look mad, but I'm laughing about this. I'm sure the person who made that logo had no idea a software company existed with that name and similar logo, right? Right? Am I naïve? At least I'm complaining about something more obvious than Apple vs GreeNYC!
Sat, 15 Mar 2008 19:21:28 +0100 I'm getting crazy. Totally. I'm now convinced aliens kidnapped me in my sleep and changed my Vista installation. This morning, I tried to open a Command Prompt as administrator. I pressed Win-Z, typed "cmd", pressed Ctrl-Enter to get to the slimKEYS extended options, made sure the verb was "runas" and pressed Enter to launch the app as admin... But nothing. No UAC prompt, no Command Prompt, nothing. So I pressed the Win key, typed "Command" to highlight "Command Prompt" in Vista's start menu, pressed the context menu key, and selected "Run as administrator"... Nothing more. I could hear my fish breath. I went back to slimKEYS and tried launching "Notepad2" (my Notepad replacement) as admin, and it worked. I tried Windows' own Notepad, and it failed. Hun? Tried again with the Vista start menu, failed too. I decided to try checking the "run this program as an administrator" option and see what happened, but something I'd never seen before prevented me of doing so:
"Compatibility modes cannot be set on this program because it is part of this version of Windows". What? When did that "new feature" (!) appeared? I have ran Command Prompt and Notepad as admin in the past, I know this is new. But since when? And how the hell am I suppose to run a Command Prompt as admin now? What did I do to enable that counter-productive and stupid feature? Did I mess with something or did a Windows Update change that behavior? I tried looking for answers on the net, but either I'm not using the correct keywords, or it's a new problem nobody had before. What is happening to my Vista?
Thu, 13 Mar 2008 03:34:53 +0100
My phone has both a touch screen and sliding keyboard, two features that were important for me. I'm eager to try Opera Mobile 9.5, probably the closest thing to Safari on the iPhone, even though my device isn't multi-touch. I had to move to a monthly plan with a 3 year contract in order to get a rebate on the phone, but didn't go for the full rebate and data plan. Instead, I paid the phone a little more, but I have the smallest available plan, without a data plan. For the moment, that's enough for me, as I have Wifi access everywhere I need. The one single thing that kept bugging me, though, is that every time I ran an application that tried a network connection while Wifi wasn't available, a data connection was established. Without a plan, it would cost me 15$ a meg! Though I was always quick enough to click the Cancel button on the connection notification, it scared me. So I walked through the registry and found this key: HKLM\Comm\ConnMgr\Providers\{7c4b7a38-5ff7-4bc1-80f6-5da7870bb1aa}\Connections\CDMA1X\Enabled As expected, it was "1" by default. I changed it to "0", rebooted, and voilà!!! No more data connection in my way. Wifi or nothing, just what I needed. Now, if you'll excuse me, I have an application for Windows Mobile to work on. Can you guess what it is? slimKEYS Mobile anyone? If you already have suggestions, shoot!
Fri, 08 Feb 2008 16:43:25 +0100 With Scott's Visual Studio's theme rundown, I'm getting requests for my VS Settings file for my older example. I can't give you the exact same colors, as I've tweaked them a little. Fear not, the look is almost the same, but I did change the font. Here's the rationale: With a bigger LCD screen, I do benefit from ClearType. Then ProggySquare becomes useless, since it's a fixed size (12) bitmap font. That's why I switched back to Lucida Console. I don't have the slashed or dotted zero, but it doesn't seem to bother me. I do like Consolas, except for that weird "g". And the ClearType effect is not as great as with Lucida Console, probably because I tweaked it with their Verdana example, I don't know. But when working on my 15" laptop, Lucida Console and Consolas just don't cut it for me. ProggySquare becomes way better! I don't have TrueBright on my Dell laptop. Maybe that's why I need a crisp font without anti-aliasing effects... go figure. So here's the latest screenshot on my desktop:
And that's how it looks on my laptop:
And finally, you can download my VSSETTINGS file with the Lucida Console font.
Wed, 06 Feb 2008 21:17:16 +0100
The five nominations were made by Microsoft members upon submission, but one of those five developers will win the grand price, and this will be decided by popular votes. If you are an Xceed DataGrid for WPF fan, or any of the following products, I encourage you to go vote for Pascal, since he played a key role in designing and developing those products over the last 10 years at Xceed.
Congratulations Pascal! You deserve the spotlights!
Tags: MSDN Code Awards Wed, 23 Jan 2008 06:54:08 +0100 I just updated the web site and slimKEYS package for the newly released version 1.2.8069... 8069 you say? What's that? It's my new version numbering. Well, not that new, I stole the idea from Xceed, but it's partly my fault anyway if they use such a number. I even have a Vista widget, err, gadget displaying the current day's version number:
I've decided to use a version number I can change every day, so I can release alpha and beta versions of slimKEYS that have their own version number. No more beta 1, 2, 3... I really hope the new slimSMOKE plug-in finds some lovers, as I've grown to depend on it myself. I always know which window has the focus. Look at my current desktop: There are many other improvements, I'll let you check for yourself. This new release also coincides with a price increase. It was absurd for me to continue selling slimKEYS lifetime licenses for only 10$. It's now 20$, but it's the last 20$ you'll spend on slimKEYS. And if you don't think it's worth 20 bucks, I hope you'll take the time to write me and tell me what I need to change. I'm listening!
Mon, 10 Dec 2007 15:51:02 +0100 I just did something really stupid. I don't know where my mind was. I have to say I'm loaded with work because I accepted two contracts, and I'm a part-time daddy at home since my son is only attending kindergarten 3 mornings a week. I even had to postpone some promises. I was in my office and heard a "pshit" sound. It took me a fraction of a second to realize what it was, much faster than the actual mistake that led to this sound. Yesterday evening, I put non-rechargeable batteries in the charger! Thank God nothing bad happened in the night. I threw the batteries away, but I'll try to recover the charger. It doesn't look damaged, I only had to wipe the liquid. Should I interpret this event as a signal? ... Nah, too much work to do.
Sat, 17 Nov 2007 22:27:42 +0100 The second beta of slimKEYS 1.1.3 is now available for download. With this last beta before the release, I urgently need Vista testers. If you look at the list of changes, you can see a few pending or new Vista features. slimVOLUMETwo main things have changed with the slimVOLUME plug-in. First, the window display was redone completely, to use a true transparent window. The previous version copied an image of what was underneath the volume window, and drew on that image. Less than beautiful when you happened to Alt-Tab while the volume was still displayed or when the content was changing (ex: watching a video or movie). If you play games not in full screen mode, this new display will also work correctly. The "label style" is not implemented yet, so you'll get TV-like bars in both settings. The second big change is the use of the new Vista API for changing the main volume control. The previous version did not work on Vista, since all it did was change the volume of the sounds slimKEYS played... which is none! This needs to be tested more thoroughly by Vista users. For example, there is one known issue: if you change the output device, for example by plugging-in your USB headset, slimVOLUME won't notice, and will continue to change the previous device's volume. That will be fixed in the official release, I'm just waiting for some final information. So, mandate #1: Test slimVOLUME on Vista. slimSIZEIf you are using slimSIZE on Vista, you already know it cannot move windows that belong to either isolated or elevated applications. Maybe you did not know what was the reason it could not move all windows. Now you know! This a Vista security feature. Applications like Internet Explorer 7, run in a special isolated mode, which prevents it from accessing all Windows features, and as a side effect, prevents other applications from accessing the IE7 process as much as they'd like. Other example, if you are a Visual Studio .NET 2005 user under Vista, you must be running it as administrator. Such applications and their windows cannot be the target of window APIs either. Fortunately, this Vista security feature can be "safely" circumvented. The recipe isn't obvious, but it works (except*). If your application embeds a specially crafted manifest that includes a "uiAccess=true" entry, is digitally signed, and runs from the "Program Files" folder, it can target windows that belong to isolated or elevated processes. If it does not run from the "Program Files" folder, it can still target isolated applications, but not elevated ones. (*): With Microsoft, it could not be that easy. This miracle recipe is giving me one small headache: When slimKEYS is started from a StartUp shortcut (as it's the case almost 100% of the time), launching URLs takes an eternity when either FireFox or Opera is your default browser**. If launching other applications, those apps become sluggish and slow. At least, that's what I am experiencing on my machine. I made a small WinForms application with a similar manifest, strong name and digital signature, and a simple button that calls System.Diagnostics.Process.Start with an URL. If that application is started from a StartUp shortcut, clicking on the button takes 10 seconds for FireFox to open, and more than 2 minutes for Opera to open. But the same application, launched from the Windows Explorer, works perfectly, as does slimKEYS. If I remove the manifest, the problem also disappears (but you can't target isolated or elevated apps anymore). I have posted on the MSDN forums and Microsoft newsgroups, but I am getting no answer. That's where more testers are required. If I can get more information about this, I'll be able to challenge MS better. If I get enough feedback, I may also choose to spend money on opening an MS support case. For the moment, I officially can't since I'm using an OEM license of Vista, and I'm not an MSDN subscriber. Mandate #2: Tell me if slimSEARCH or slimLAUNCH.Delicious are slow to open web pages. Mandate #3: Tell me if applications open from slimLAUNCH look more sluggish or slower than usual, or if they happen to open web addresses themselves, cause the same problem as mandate #2. (**): I'll give a free slimKEYS license to the first person who can explain within a week from now why there is no delay when Internet Explorer 7 is your default browser. I'll give the answer later. slimLAUNCHA limited implementation of verb support is now available in slimLAUNCH. If you browse for an application or document to open, and press Ctrl-Enter to open the extended launch options, you will see a new "Verb" field at the bottom. Default verbs for the selected application are available in the drop-down list, and you can type in the verb of your choice. For example, typing "runas" will open that application as administrator. The last verb is remembered, but only used when pressing Ctrl-Enter. Mandate #4: Test a few verbs, test the "runas" verb, give comments about how this can be improved. slimSMOKEThe rest of the changes are fixes or featurettes, except for the new slimSMOKE plug-in. I'm using that plug-in full-time now, and have been enjoining it a lot. But I'm still waiting for other users' feedback. This second beta can also highlight not only the active window, but also all top-level windows which belong to the same process. Here are a few screenshots of (a part of) my desktop with slimSMOKE active. You can see the active application much easily. You think you could like this? Mandate #5: Test slimSMOKE and give me your impressions!
Sun, 28 Oct 2007 15:59:56 +0100 I'm beta testing Windows Live OneCare 2, and this morning, the automatic update failed, with a message redirecting me to this web page: Hello? Who's telling me this? A web page!!! If you decide to move your help and documentation online, at least tell your technical writers about it!
Tags: OneCare, Online Help Fri, 19 Oct 2007 22:40:22 +0200 I did it again. It's not the first time. I created something that looks very interesting, but I have yet to decide if it's useful in the first place. I called it slimSMOKE, and you probably guessed by its name that it's a slimKEYS plug-in. Does it happen often you work on your computer and start typing just to realize the active application is not the one you thought? It can get you in trouble if what you type has some matching actions in that other application. slimSMOKE dims inactive applications*, so the active window jumps out of the crowd. My initial feeling working with slimSMOKE is "cool", but I need feedback. If you like to test beta software, go get beta 1.1.3 and tell me your thoughts. The color, opacity and refresh rate are all configurable. You can toggle slimSMOKE on and off by pressing Win-M. If you try this new beta version on Vista, you'll also get the chance of testing Vista support for slimVOLUME (finally). I'll have more to say about this later, I have someone to thank about this, but he doesn't know. Have fun!
* (Actually, it dims everything except the active application. This means the desktop is also dimmed. I could have dimmed only top-level windows, but this extra processing is making slimSMOKE use too much resources for my taste, and the desktop itself can be "selected".)
Sat, 13 Oct 2007 17:46:37 +0200 A few weeks ago, for the release of slimKEYS version 1.1.0 (which quickly became v1.1.1), I decided to try submit-everywhere.com, to see if it could drive some more traffic. Before submitting, you must provide your existing download site credentials, or opt-out of their service for particular sites. I only had one account I wanted to handle myself, which was download.com. Once their submission process was rolling, they contacted me about not having my FileForum.BetaNews.com credentials, since they saw the previous version was already visible and well documented. Well, I don't have those credentials. I never had. But FileForum has always displayed my latest version, diligently, accurately, without myself having to lift a finger. My initial release of 0.9.5 quickly showed up there, after I submitted my software to neowin.net. Thursday, I rolled out a new build of slimKEYS v1.1.2, addressing a few bugs and limitations, but forgot to update the PAD file on my server. This morning, while looking at my referrer logs, I saw the usual FileForum entry for slimKEYS, and followed the link, and got a very pleasant surprise: version 1.1.2 was already displayed, with the correct list of changes. How do they do this? Are they monitoring specific web pages? Or the download section RSS feed? Anyway, FileForum, I give you 5/5! As for download.com... well... I'm still waiting for them to show version 1.1.1. The submission is so painful I never updated it since v1.0.3. Their estimated publish date says September 22nd! I decided not to wait, and pushed v1.1.2. This will delay my submission even more. In French, we say "tant pis pour eux". I can't find a correct English translation, but it's a polite way to say "screw them"!
Fri, 12 Oct 2007 05:00:20 +0200 While submitting a ticket to Roxio about a crash I can reproduce with Easy Media Creator 10 and its MyDVD component, bad luck continued to hit: Do you think I should open a ticket about this? q;-)
Fri, 28 Sep 2007 19:39:00 +0200 I was looking for a free and simple application to convert icon files containing multiple resolutions, to multiple PNG files. I'm sure there must be such an application out there, but the few I checked were too complicated for my needs. I did what too many programmers do: I reinvented the wheel. Turns out it was very simple. I did a minimally featured console application, who's code looks like this: using System; using System.Collections.Generic; using System.Drawing; using System.Text; namespace ConvertIcons { class Program { static void Main( string[] arguments ) { try { if( arguments.Length == 0 ) throw new ArgumentException( "No icon filename provided." ); // Default values int minSize = 1; int maxSize = 256; int stepSize = 1; string filename = null; foreach( string argument in arguments ) { if( argument.StartsWith( "-min", StringComparison.InvariantCultureIgnoreCase ) ) { if( !int.TryParse( argument.Substring( 2 ), out minSize ) ) throw new ArgumentException( "Invalid minimum size argument." ); if( ( minSize < 1 ) || ( minSize > 512 ) ) throw new ArgumentException( "The minimum size must be a value from 1 to 512." ); } else if( argument.StartsWith( "-max", StringComparison.InvariantCultureIgnoreCase ) ) { if( !int.TryParse( argument.Substring( 2 ), out maxSize ) ) throw new ArgumentException( "Invalid maximum size argument." ); if( ( maxSize < 1 ) || ( maxSize > 512 ) ) throw new ArgumentException( "The maximum size must be a value from 1 to 512." ); } else if( argument.StartsWith( "-step", StringComparison.InvariantCultureIgnoreCase ) ) { if( !int.TryParse( argument.Substring( 2 ), out stepSize ) ) throw new ArgumentException( "Invalid step size argument." ); if( ( stepSize < 1 ) || ( stepSize > 512 ) ) throw new ArgumentException( "The step size must be a value from 1 to the maximum size." ); } else { if( filename != null ) throw new ArgumentException( "Too many parameters." ); filename = argument; } } if( minSize > maxSize ) throw new ArgumentException( "The minimum size cannot be greater than the maximum size." ); if( filename == null ) throw new ArgumentException( "No icon filename provided." ); Program.GenerateImages( minSize, maxSize, stepSize, filename ); } catch( ArgumentException except ) { Console.WriteLine( except.Message ); Program.DisplayUsage(); } catch( Exception except ) { Console.WriteLine( except.Message ); } } private static void DisplayUsage() { Console.WriteLine( "ConvertIcons [-min###] [-max###] [-step###] icon_filename" ); Console.WriteLine( " where -min indicates the minimum image size to generate (default = 1)" ); Console.WriteLine( " -max indicates the maximum image size to generate (default = 256)" ); Console.WriteLine( " -step indicates the step of each size to generate (default = 1)" ); Console.WriteLine(); Console.WriteLine( "This application extracts multiple icons from a single icon file, and generates multiple PNG files." ); Console.WriteLine(); Console.WriteLine( "For example, to extract the 16x16, 32x32 and 48x48 icons from file 'foo.ico', use:" ); Console.WriteLine( "ConvertIcons -min16 -max48 -step16 foo.ico" ); Console.WriteLine(); Console.WriteLine( "This will generate files foo16.png, foo32.png and foo48.png, if those resolutions are found." ); } private static void GenerateImages( int minSize, int maxSize, int stepSize, string filename ) { string baseFilename = System.IO.Path.Combine( System.IO.Path.GetDirectoryName( filename ), System.IO.Path.GetFileNameWithoutExtension( filename ) ); for( int size = minSize; size <= maxSize; size += stepSize ) { try { Icon icon = new Icon( filename, new Size( size, size ) ); if( ( icon.Width == size ) && ( icon.Height == size ) ) { Bitmap bitmap = icon.ToBitmap(); string newFilename = baseFilename + size.ToString() + ".png"; bitmap.Save( newFilename ); Console.WriteLine( "Generated {0}x{0} image named {1}", size, newFilename ); } } catch( Exception except ) { Console.WriteLine( "Error generating {0}x{0} image: {1}", size, except.Message ); } } } } } Should I build a binary?
Wed, 26 Sep 2007 17:36:00 +0200 Something very strange just happened to me while searching on Yahoo!. First, a prelude: Half an hour ago, while performing a search on Yahoo!, I got an empty result, with a message telling me there was a problem, and that I should retry. I did not capture that screen. Retrying the search finally succeeded. Now, a few minutes ago, while performing another search on Yahoo! for "print single page outlook 2007", I got the following results:
As you can see, the advertising matches my search, but the results seems to indicate a search for "Pastor John Stirling Blog" (terms in bold), or something like that. That's scary. Very scary. Imagine my son searching for a child TV program, and ending on something for older eyes. Or it could simply make people think there's nothing about one subject while there should have been. Here's the full window, if you're curious. P.S.: Repeating the same search did give me the correct results. Tags: Yahoo! Tue, 25 Sep 2007 15:55:48 +0200 I've been a FireFox user since version 0.8 or something. What drove me to FireFox was add-ins. The huge amount of tools I could add was calling me, and the tabbed interface was for me a great advance. It wasn't speed. Back then, browsers were fast enough, maybe because web pages were lean enough. I don't know if it's really page sizes that is now killing me, but web surfing is painful, both in FireFox and Internet Explorer 7. I used both equally as my default browser on Vista since February, and they really feel sluggish. The worse part is opening a new instance. I don't keep my browser open. Why would I? Tabs are fun, but if you're done with all pages, why keep the browser open? It's only one more useless icon to go through when you switch between applications. In the past 4 years, I've been trying Opera from time to time, without committing to setting it as my default browser. Every time, it felt much faster, much better for browsing. But the same problem kept killing its chances: where are my add-ons? So it usually got uninstalled after a few days. Thanks Opera for the great browser implementation, but no thanks. Today, mark the date, September 25th 2007, I'm giving Opera a real chance. It will be my default browser for at least a month. At the end of October, I'll share with you my thoughts about it. I've added the del.icio.us buttons, which don't work like I would them to work, and the developer buttons, which gives me only a percent of what the FireFox Web Developer toolbar had. I'll search for better tools, but will live with those in the meantime. But this time, speed has become more important than tools.
Tue, 25 Sep 2007 06:01:00 +0200 Scott's post about a blog's heartbeat, and his Paint.NET template to create your own heartbeat image tag gave me the idea to try creating my own custom web control. For a non-web developer like me, that was fun. The following zip file contains the control, sources, and sample web page for testing. Feel free to play with it! Don't forget to clean up the "ppm" subfolder when you change the image rendering function. This folder must be writable by the ASPNET user. To use it in your page, register the control: <%@ Register TagPrefix="slim" Namespace="SlimCode.Web.Controls" And declare your instance: <slim:PostsPerMonthImage runat="server" Text="martinplante.com"
It will generate an image in the "ppm" subfolder, if this image is not already there.
Have fun!
Tags: PostsPerMonth Thu, 13 Sep 2007 20:03:44 +0200 For those interested in developing plug-ins for slimKEYS, I've updated the slimKEYS SDK to match the latest version. I added a slimSEARCH sample, which performs arithmetic operations when you enter something like "=pi*2" as the search term. This sample uses the free info.lundin.Math library, created by Patrik Lundin. Another new slimSEARCH sample is the FogBugz extension I've previously talked about, for searching case numbers. Those two samples could well become built-in samples one day. What do you think? You'll also find the other samples and full sources to the slimLAUNCH.Passwords plug-in that already comes with slimKEYS. The SDK also contains the developer document, but you can also take a look at it right here.
Wed, 12 Sep 2007 06:15:13 +0200 Just found out that Google allows you to search for pages that appeared either the past day, week, month and more. For example, you can search for "slimKEYS" only in the past day using this URL: http://www.google.com/search?as_q=slimKEYS&as_qdr=d Or the past week using this URL: http://www.google.com/search?as_q=slimKEYS&as_qdr=w I've added an entry in my slimSEARCH config. If you want to do the same, here's how:
Now, I can search in the last 7 days by either pressing Alt-7 after my keywords, or preceding them by "g7 ". Cool!
|
|
contact |