GlassCalc 1.23

2010

I uploaded this a while ago, so I figured I should write a bit about what’s new in version 1.23. Most importantly, I reworked a lot of startup code, so GlassCalc should start up much faster than before. As a result of a change in the way settings are handled, is you will lose your saved variables, functions, and history when you upgrade. If you don’t want to lose them, you can export them before upgrading and import them afterwards. This is explained in greater detail on the main GlassCalc page.

This version also fixes the factorial function so it works on big numbers. It also now supports the factorial operator. For example, 5! now means 5 factorial. I also added a “clear all” command which clears user functions, variables, and saved history all at once.

The installer package is a bit bigger this time, because I added the .NET 4.0 web installer. The setup program should now make sure you have .NET 4.0 and (after asking you) automatically install it if needed. The upgrade installer does not include this, so it links you to the .NET download page instead.

GlassCalc 1.24 should be coming sometime soon. It will feature a little better handling of the size of the left pane, hiding the left pane when the window is very small, and basic support for unit conversions using Units.

Downtime and Stuff

2010

After about three weeks of downtime, my site is finally back up! My host moved everything to bigger and better servers, but my account was lost in the transfer. Good thing I keep nightly backups of my database! Some things may be broken for a while as I get everything working back the way it was.

Also, with the release of the .NET Framework 4.0, I have a new version of GlassCalc for you to try. It has a few bug fixes, a bunch of new features, and a pretty substantial improvement in startup performance. Download it here or click “Check for Updates” from GlassCalc’s help menu.

GlassCalc 1.22

2010

Version 1.22 fixes a number of bugs I introduced in versions 1.20 and 1.21 and some others I didn’t catch before. Syntax highlighting is fixed for exponential notation, the input box scrolls to fit its contents again, and I fixed a bug that kept you from defining functions if the function reference pane was hidden. I also improved the way equations are sent to the solve algorithm, so it should work on larger numbers now. Numbers are now no longer rounded to 15 decimal places when displayed, so you can work with very small numbers more easily.

I also added a number of new operators: ++ -- += -= *= /= ^= and %=. These are really just shortcut notations that let you do things like “x = x+1” by only typing “x++“, or “x = x*5” with “x *= 5” . All these operators except ^= behave like they do in C and C++. Since the ^ operator is for powers, ^= is assignment by power instead of assignment by bitwise XOR. Also, the increment (++) and decrement (–) operators cannot be used in the middle of expressions like they can in C. They must be by themselves, like “x++“, not in the middle of an expression like “(x++)^2“.

As with version 1.20, GlassCalc is now running on the .NET Framework 4.0. Microsoft has not yet released the .NET Framework 4.0, so you probably don’t have it. If you’re feeling adventurous, you can download the .NET 4 Release Candidate.

I’d love to hear what you think! If you have a suggestion, find a bug, or just use GlassCalc, please leave a comment!

System Requirements

  • Windows (Tested on 7, untested on earlier versions)
  • .NET Framework 4 RC
  • Visual C++ 2005 libraries (included in regular installer)

GlassCalc 1.21

2010

Version 1.21 improves startup performance a bit by loading some things in separate threads and not loading other things until they are needed. It also adds syntax highlighting for constants and the ability to evaluate multiple expressions at once. This means you can do things like “x = 0“, then keep executing “x = x+1; x^2” to print the squares of successive numbers.

As with version 1.20, GlassCalc is now running on the .NET Framework 4.0. Microsoft has not yet released the .NET Framework 4.0, so you probably don’t have it. If you’re feeling adventurous, you can download the .NET 4 Release Candidate.

System Requirements

  • Windows (Tested on 7, untested on earlier versions)
  • .NET Framework 4 RC
  • Visual C++ 2005 libraries (included in regular installer)

GlassCalc 1.20

2010

GlassCalc 1.20 adds a few new features that make it easier to tell what you are doing. Most importantly, it adds syntax highlighting, brace matching, and a degrees/radians mode indicator. The settings menu is also reorganized and some parser bugs were fixed. A full list of changes can be found on the changelog page.

Version 1.20 is not available as an auto-update for one reason: GlassCalc is now running on the .NET Framework 4.0. Microsoft has not yet released the .NET Framework 4.0, so you probably don’t have it. If you’re feeling adventurous, you can download the .NET 4 Release Candidate.

System Requirements

  • Windows (Tested on 7, untested on earlier versions)
  • .NET Framework 4 RC
  • Visual C++ 2005 libraries (included in regular installer)

Setting Shell Context Menu Icons

2010

If you google something like “shell context menu icons”, I can almost guarantee that you won’t find much information on changing the icons in Windows Explorer’s right-click context menus. Actually, if you’re not afraid to edit your registry, it’s not that difficult to put icons on your own shortcut menu items, but the information on how to do it is a little scarce.

I don’t think this is Windows 7 specific, but the example I’m going to use is catered towards Windows 7 users. In Windows 7, if you use any of the “run command prompt here as administrator” examples floating around, you’re not likely to see the elevation icon appear in your context menu. This example shows how to add an elevated command prompt item to the context menu for right clicking the background of a folder, then two methods to put the elevation badge icon next to it. The second method can also be extended to put any icon you want next to a context menu item. For all instructions below, do not copy the quotes. Also, messing with your registry can mess up your computer. If you follow these instruction exactly, there shouldn’t be a problem, but if you don’t have a clue what you’re doing, backup your registry first.

To create the context menu item:

  1. Open regedit. Type “regedit” into the start menu and hit enter, or press Windows Key+R, type “regedit” and hit enter.
  2. Locate “HKEY_CLASSES_ROOT\Directory\Background\shell“. You should already see a key (the folders are keys) named “cmd” inside it.
  3. Right click “shell” and click on New->Key. Name it “runas”. By naming it “runas”, we tell Windows that this should be run as an administrator.
  4. Click on the new “runas” key, then on the right side of the window, double click on “(Default)”. Change the value to the text you want to appear in the context menu. Something like “Elevated command window” will work. Click OK.
  5. Right click in the right pane and choose New->String Value. Name it “NoWorkingDirectory”. You can leave the value blank.
  6. If you only want this to appear when you Shift+Right-Click to open the context menu, create another string value and name it “Extended”. Again, the value should be left blank.
  7. Right click again and choose New->Key. Name it “command”. This will be the command executed when you click the item.
  8. In the command key, double click on “(Default)” and change the value to cmd.exe /k pushd %V

To add the icon:

There are two ways to add the elevation badge icon. The first is probably the way you should do this, but the second will let you use any icon you want.

To add just the elevation badge icon, go to “HKEY_CLASSES_ROOT\Directory\Background\shell\runas” and create a new string value. Name it “HasLUAShield” and leave the value blank.

To add any icon you want, go to the same key and create a string value named “Icon”. Double click it and change its value to the path of the icon you want. Most default Windows icons are stored in either shell32.dll or imageres.dll inside the C:\Windows\system32 directory. You can use an icon inside a DLL by entering the path to the DLL followed by a comma, then the number of the icon. For DLLs in system folders like shell32.dll and imageres.dll, you don’t need the full path–just the name–so since the elevation badge is the 73rd icon in imageres.dll, enter “imageres.dll,73“. You can use a free tool called IconViewer to look at the icons stored inside DLLs and executables. I have not tried, but you can probably enter the path to a .ico file as well.

Cygwin: Override Command Here

2010

Windows Vista introduced a nice little feature where Shift+Right Clicking the background in explorer added a “Open command window here” option. Unfortunately for us Cygwin users, this just opens cmd without running bash. Since you probably installed Cygwin for the unix shell, this is kinda annoying. But fear not. I have a hack.

Copy the following into a text file, change its extension to “.reg”, and run it. Make sure to change the path at the beginning if you have a different Cygwin directory. Now “Open command window here” will start the bash shell at the current directory.

Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd\command]
@="c:\\cygwin\\bin\\bash.exe --login -i -c \"cd \\\"`cygpath -u '%V'`\\\";bash\""
 
[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="c:\\cygwin\\bin\\bash.exe --login -i -c \"cd \\\"`cygpath -u '%V'`\\\";bash\""

For those of you who like regedit, here’s the same thing unescaped:

HKEY_CLASSES_ROOT\Directory\Background\shell\cmd\command
c:\cygwin\bin\bash.exe --login -i -c "cd \"`cygpath -u '%V'`\";bash"
 
HKEY_CLASSES_ROOT\Directory\shell\cmd\command
c:\cygwin\bin\bash.exe --login -i -c "cd \"`cygpath -u '%V'`\";bash"

Have fun!