GlassCalc 1.29 and Widgets!

2010

GlassCalc 1.29 doesn’t add any new functions, but it adds a number of formatting features to make GlassCalc easier to work with or just fit into your theme better.  GlassCalc now has support for thousands separators, and you can choose between commas, spaces of various widths, or enter your own separator.  GlassCalc can also replace asterisks (multiplication operators) with dots or times symbols.

You can now choose between three different formats for exponential form: 1.00e10, 1.00E10, and 1.00×1010.  GlassCalc defaults to a lowercase e to give a clear separation between the number and exponent.  More color settings are available, and the font sizes of the history, input, and other panes are now configurable as well.

Widgets!

I recently created two Opera Widgets, which are essentially desktop applications built with HTML, CSS, and JavaScript.  You need to install Opera before they will work, though Opera does not need to be running to start the applications.

Search Organizer

If you are an Opera user and wished you could reorder your custom search engines, check out my Search Organizer widget.  Feed it your search.ini file and it lets you drag and drop your search engines into a new order.  Save and restart Opera for your changes to apply.

CSS Fix

My second widget isn’t exclusively for Opera users, though it may be more useful to them.  Occasionally, I’ll run into a site that looks blocky and ugly in Opera, but smooth and pretty in Firefox and Chrome, even though Opera supports most or all of the features used *cough* Twitter *cough*.  There’s no reason these sites should look any worse in one browser compared to the others, except that the web developers left out some key CSS properties, like the unprefixed border-radius and box-shadow.

CSS Fix aims to solve this problem by generating CSS patches to fix sites.  It knows most of the equivalent CSS properties used by Opera, Firefox, Chrome/Safari, and Konqueror and can translate between them.   Simply enter the URLs of a offending sites and/or CSS files, choose the browser(s) you want a patch for, and CSS Fix will download the files and generate a new stylesheet with all the missing CSS properties.  You can export the patch as user CSS or user JavaScript, install the patch in your browser, and see sites the way they were meant to be seen.  (You could also ask the site admins to kindly add in the missing properties, but for big sites like Twitter, you’d be lucky to get anywhere)

I’ve created a Twitter patch for Opera using CSS Fix that gives Twitter the rounded corners and most of the other pretty effects it’s supposed to have.

I am also working on a web-based version of CSS Fix that lets you paste in CSS and a user JavaScript version which will fix inline styles on the fly.  I can’t estimate when either of those will be done though.

More Downtime and a New Version

2010

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.

GlassCalc 1.25

2010

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

2010

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

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.

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)