Archive for the ‘Uncategorized’ Category

More Downtime and a New Version

A few months ago, my (free) web host outgrew their servers and moved to bigger and better servers, resulting in a few weeks of downtime.  Everything seemed to be going fine until one of the new servers showed signs of hard-disk failure.  Naturally, my site was on said server, so my site suffered another week of downtime.  A week ago, my host was having trouble with cPanel and discovered an undocumented (and unchangeable) connection limit hidden within it.  The cPanel team said they couldn't fix it quickly, so my site was down for a few more days while my host reconfigured things to work around the problem.

Everything looks to be stable now, but I predict that in about a week, a series of tornadoes will strike the building housing the servers, and the following week, x10hosting headquarters will be attacked by a giant robotic space eel.

GlassCalc 1.28

On a more serious note, I've uploaded version 1.28 of GlassCalc which should fix the bottoms of letters getting cut off in the menu bar.  I've also reorganized the settings window and added a couple features to help set up unit conversions.  Last but not least, I've added support for something I'm calling "Scale Factors".  These are suffixes you stick on the end of numbers to multiply them by some number.  If you define a scale factor of K = 1000, you can write 1K for 1000. These have a higher priority than other operators, so 1/1K would be 1/1000, not 1/1*1000.

There are no scale factors defined by default, but you can define your own by editing your extensions.ini file (open More Settings->Extensions).  Add a [ScaleFactors] section and add one suffix per line under it.  The format is Suffix = Scale where Suffix is a string and Scale is a number.  Put a /i at the end of a suffix to make it case-insensitive. You can also use exponential notation when setting the scale. Here is an example ScaleFactors section which defines m (milli), c (centi), K (kilo), and M (mega) suffixes:

[ScaleFactors]
m = 1e-3
c = 1e-2
K/i = 1e3
M = 1e6

Suffixes do not have to be a single character. They can be of any length. You can also use regular expression syntax, but I don't recommend it. Using square brackets or equals will probably confuse the ini parser, starting with digits (and various other patterns) will confuse the math parser, and everything after the first forward slash is treated as modifier flags. If anyone wants more in-depth support for regular expressions here, ask and I'll find a way to make it work.

Downtime, Updates, and Glass!

First off, sorry about the recent downtime. My (free) host had a failing hard drive. Naturally, my site was on that drive, and it took a while to move everything to another server and reconfigure it.

I recently finished a Visual Studio 2010 extension that automatically closes braces (because Microsoft still hasn't implemented it, and there's no way I'm buying something like ReSharper). Because I am boring and unoriginal, I have named it Brace Completer. You can find it in the software section.

I also updated my Opera/Firefox userscripts with a couple enhancements. The accented character shortcuts script loads a bit sooner on Opera, and the MangaFox script can now use session/localStorage to cache image urls, making things load faster if you return to a previously loaded chapter.

Lastly, I have an update for GlassCalc, which fixes an overflow error with base conversions, a freeze with long input strings of all the same letter, a bug with updates, and a few other things. The full changelog can be found here. Also, I decided that, for a program named GlassCalc, my calculator didn't have nearly enough glass. I have now remedied this oversight.

Glass UI

Go to the Options->More Settings page and check Full Glass UI to turn it on. You'll obviously need Vista or Windows 7 for it to work.

Speaking of things named GlassCalc, as it turns out, the name I chose in an inspired moment of uncreativity has been in use by an English software company for some 25 years. Whoops. They asked if I would link to their site, which I will gladly do here and now (as well as some other places around the site).

Glass Software UK
Glasscalc Ltd are the leading software developers in the specialist field of Pricing / Costing and Invoicing systems for the Glass Industry.

If you happen to be looking for software that deals with actual glass, go check it out!

GlassCalc 1.25

GlassCalc version 1.25 fixes a crash when you check for updates while GlassCalc is already checking for updates. It also reads an "extensions.ini" file, which currently allows you to define extra constants, but may be expanded to let you extend GlassCalc in other ways in the future.

User-defined Constants

To add your own constants to GlassCalc, go to the More Settings menu and open the Extensions tab. You will see two sections: Global Extensions and User Extensions. Global extensions are system-wide and reside in GlassCalc's program files directory. This means modifying them on Vista/Win 7 requires elevation. (I have not tested this on XP, so please tell me if it gives you trouble) User extensions apply only to your user profile and reside in GlassCalc's application data directory. For normal cases, I suggest you use only user extensions. If both extensions files are present, user settings will override global ones.

To create the extensions settings file, click Create extensions.ini. The settings file will be created with the default settings and opened. (If you don't have file associations for .ini files, you should get an Open With dialog. Pick a text editor.) Constant definitions go after the line with [Constants]. Everything on a line after a semicolon is ignored. Each line can contain one definition in the form "name = value", where "name" contains only letters, numbers, and underscores and doesn't start with a number. "value" can be any number (exponential notation is supported) or any numeric field, constant, or property defined in mscorlib.dll. (If you are not a .NET programmer, you can safely ignore that last bit.) If the value is not defined in System, you must provide the full namespace as well.

Here is an example file showing some of the ways constants can be defined:

;Stuff after a semicolon is a comment.
[Constants]
euler = 0.577215664901532860606512090082 ;Euler's constant
planck = 6.6260689633e-34 ;Planck's constant using exponential notation
pi = Math.PI ;pi using .NET's built in constant

GlassCalc should update its constants list when you close your text editor. If it does not, try clicking Edit extensions.ini from the settings menu and closing your text editor again. If all else fails, restart GlassCalc and it will pick up the updated settings. If you defined a new constant with the same name as an already present variable, you will need to restart GlassCalc for the changes to take effect.

If any of this isn't clear or isn't working, don't hesitate to ask in the comments section below!

Downloads are on the main GlassCalc page.

GlassCalc 1.24

I uploaded version 1.24 about a week ago, but now that finals are out of the way, here's a bit about the latest version of GlassCalc.

GlassCalc now automatically sizes the left pane to fit its contents. It also automatically hides the left pane if you make the window very small. If you liked the previous behavior, you can switch it back by unchecking Resize left pane automatically and Hide left pane when window is small in the settings window.

Unit conversions!

The biggest change in version 1.24 is support for unit conversions. If you use something like in to cm (or in:cm) after an expression, GlassCalc will insert the appropriate conversion factor. You can also place unit conversions in the middle of expressions, so sqrt(8 ft^2 to in^2) in to cm is valid. Note that GlassCalc doesn't care what types of units you use as long as each conversion is valid. For instance, you could evaluate 1 weeks:fortnights in:cm.

Important bit about unit conversions!

GlassCalc supports unit conversions, but it doesn't come with a unit converter out of the box! GlassCalc requires GNU Units to do its unit conversions. The upside of this is that GlassCalc can convert to and from just about any unit you can imagine. The downside is, you have to install another program. Thankfully, this is very easy to do if you follow my handy guide to installing Units! GlassCalc does not yet support all of the features of GNU Units, namely the special syntax required for non-linear conversions (like temperatures). Since temperature conversions are common (and simple), GlassCalc will handle conversions between Fahrenheit, Celsius, and Kelvin itself. You can use the units fahrenheit, celsius, and kelvin or the abbreviations tempF, tempC, and tempK.

What's next?

I plan on attempting to port MTParser, the math parser used by GlassCalc, to .NET. If I'm successful, GlassCalc won't need to mess with DLL registration, and I won't need to package Visual C++ libraries with it. This means GlassCalc will become a much smaller download, and it won't require installation, so it can be run as a portable app on any computer with .NET 4.0 installed. It will also make it much easier for me to write plugins for the parser, which may eventually lead to things like high precision math for slower, but much more accurate results. Hopefully, sin(pi) will actually be 0, not 1.22460635382238E-16!

Downloads are on the main GlassCalc page.

GlassCalc 1.23

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

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

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

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

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)


Test

Do not be alarmed. This is only a test.