Plans for GlassCalc 2

2011

When I first started writing GlassCalc, I never imagined how many cool new features I would come up with later. With the way some parts of GlassCalc are written, it’s becoming harder and harder for me to add in some of the things I want to add, so I’ve decided that the next major version of GlassCalc will be a rewrite of much of the code.

I’ve just started planning GlassCalc 2, and there are a few other projects I want to finish up before I even start writing code for it, (in other words, don’t expect it any time soon) but here are some of the features I have planned:

UI Changes

  • Notify of updates with native Win 7 notifications if available. Clicking on notification bubble will open regular update window.
  • Replace separate constants,variables, functions views with a single block containing all three items. Maybe use an accordion style control like Opera 11’s mail panel. This should save some vertical space and not look ugly when it is taller than the window.
  • Replace function references block with a dedicated function reference window. Access it from the help menu. This window could also show the info that is currently in quickref.txt. Functions will be sortable alphabetically, by type, (trig, probability, etc.) or by the extension that added them.
  • When hovering over a variable or custom function, show an “x” button to delete it.
  • Remove “Input” text from input box. Put an “=” button to the right. Text/icon inside this button changes depending on context:
    • If no text input, show “=”
    • If auto-evaluate is on and input is simple, show result of expression. Button should smoothly expand to fit text.
    • If auto-evaluate is on and input is complex (commands, multiple expressions) show “=”
    • If another expression is still being evaluated, show spinner icon
  • Add button to header of the history view that toggles between the view’s regular styling and plain text. This will allow selecting multiple lines at once.
  • Redesign settings window. Most likely, place categories in list on the left like in Visual Studio. Keep window the same size no matter which category is selected.
  • Maybe add a code-completion tooltip that would show all constants, variables or functions starting with what you’ve typed. Could activate automatically or on Ctrl+Space.
  • Add option to display bases as a subscript, like 1001102

Internal Changes

  • Separate parser/evaluator from the UI thread so that GlassCalc will not freeze while performing long calculations.
  • Add an “auto-evaluate” mode which evaluates expressions and displays the results as you type.  Result of auto-evaluation will most likely appear to the right of the input box, though a dimmed result in the history view might work too.
  • Replace slow, unfindable xml config files with an ini settings file at %AppData%\GlassCalc.
  • Add extensions system. Extensions will be able to extend the default constants and functions and add scale factors. The user will be able to turn them on and off individually. Extensions will most likely consist of a single ini file with the extension’s name, author, and all the other info. If an extension requires a complex function that cannot be represented in a single GlassCalc expression, .cs scripts can be linked in. An xml file containing documentation can also be included.

GlassCalc 1.34

2011

I’m officially out of interesting titles for these update posts.

There are a good number of fixes and additions in this version. Check the changelog for all the changes, but here’s the highlights:

  • Added sinc, rect, nCr and nPr functions. nCr and nPr are for combinations and permutations, respectively.
  • Added phi and invphi functions. phi is the standard normal CDF function and invphi is its inverse. I’m not familiar with how this functions is supposed to work—I just used the implementation eli linked here—but it agrees with Wolfram Alpha for the few test values I tried. Please tell me if there are any cases where it gives a wrong answer.
  • The “ans” variable now sticks to the bottom of the list so you can find it more easily.
  • The side panel now shrinks a bit if you shrink the window so that the history view still gets at least half the width of the window.
  • User-defined constants are now colored as such in the input box.
  • Fixed a lot of formatting issues, especially with things not in base 10.

Check the GlassCalc page for download links.

Snow Day! (more transcriptions)

2011

Given today’s abundance of snow and lack of classes, I had some time to finish up a couple transcriptions I had been working on. Both are from Shakugan no Shana S (OVA) episode 4.

The first song is Ce qui fut sauve, which plays at the very end during the teaser for season 3. There is a slightly longer version from the Shakugan no Shana movie soundtrack, which I might transcribe later.

The second song happens near the end of the episode as Shana stops hijacking Junko’s existence and lets her fade away. I have no idea what this song is called, so I’m calling it Junko’s Disappearance Scene until I find out what it’s really named.

Ce qui fut Sauve (Season 3 Teaser ver.)

Junko’s Disappearance Scene

Please tell me what you think! Comments, suggestions on what to transcribe next, etc. are all welcome!

Shakugan no Shana S: Junko’s Disappearance Scene

This song is… actually, I have no idea what it’s called, since it isn’t on any of the released soundtracks yet. It is used near the end of episode 4 of the Shakugan no Shana OVA as Shana stops hijacking Junko’s existence and lets her fade away. I’m calling it Junko’s Disappearance Scene until I find out what it’s really named.

Transcriptions: Yasoukyoku, Surechigai

2010

I’ve finished two more transcriptions—both piano solos from the anime, Nyan Koi! (にゃんこい!): Yasoukyoku (夜想曲) and Surechigai (すれちがい). You can find the sheet music download links and links to the songs on YouTube from my (appropriately named) sheet music page.

Nyan Koi!: Surechigai

Nyan Koi!: Yasoukyoku

I’m going to go try and pass my last two finals now.

Please tell me what you think! Comments, suggestions on what to transcribe next, etc. are all welcome!

GlassCalc 1.33

2010

GlassCalc 1.33 is a small update, but it adds one feature that should make it a little more convenient.  Brace highlighting in the default mode now matches braces when the cursor is next to them but not between them.  This means, when you type a closing brace, its opening brace will be highlighted so you can immediately see which brace you just closed.

Version 1.33 also fixes a bug where the code that found function aliases also matched things it shouldn’t have.  For instance, when you type atan2(y, x), GlassCalc changes it to atan(y, x).  Before this fix, GlassCalc would also change batan2(x) to batan(x).

Also, if you downloaded before November 10, I didn’t properly update the version number of the program, so GlassCalc would keep thinking it needs to be updated. This is now fixed.

Check the GlassCalc page for download links.

Fractions!

2010

Today, I bring you yet another update to GlassCalc.  Version 1.32 can now display output as fractions using an algorithm by John Kennedy described here.  To display a result as a fraction, end it with ->frac, i.e. 0.5->frac = 1/2.   The -> operator (for output in fractions and different bases) also has syntax highlighting now.

I got a bug report earlier alerting me that 22.4 - 21.5 resulted in 0.899999999999999.  This happens because there are some numbers which cannot be represented exactly as floating point numbers.  22.4 and 0.9 happen to be two of those numbers. (If you don’t believe me, check out this floating point applet and enter “22.4” in the decimal box.  GlassCalc has 64 bit precision instead of 32, but the same idea applies.)  As a result, 22.4 - 21.5 almost equals 0.9, but not quite.

Unless someone invents a computer that operates in base 10, there’s no way to really fix this problem, but there are a couple ways to hide it.  One is to use higher precision floating point numbers to reduce the error, but I can’t do that until I finish porting MTParser to C#.  The other is to round results to hide the error in the last decimal place.  By default, GlassCalc now rounds to 14 places when displaying numbers.  You can change how much GlassCalc rounds (or turn rounding off) from the settings menu.  This rounding only applies to the numbers when they are displayed, so your calculations will be just as accurate (or inaccurate) as they were before.

Pi is another number that cannot be represented exactly in floating point. (It can’t be represented exactly in decimal either)  As a result, cos(pi/2) and sin(pi) resulted in very small, but non-zero numbers.  I’ve added a couple overrides into cos() and sin() so that they will return exactly 0 when they’re supposed to.  Again, this isn’t perfect.  sin(11pi) won’t return exactly 0, but it’s better than nothing.

Other improvements in the version include: smarter detection of changes in extensions.ini, single digit exponents are no longer padded with a zero, saved history no longer forgets the bases of results, and switching between radians and degrees scrolls the history list to the bottom.

Check the GlassCalc page for download links.