Paul

6 years, 330 days


These are Posts that have been published by Paul

Maplesoft Employee

Paper Models of 3D Plots

September 09 2011 by Paul 290 Maple

 

                

3D Paper Physical Model

Classic Triangle Peg Board GameIn high school I was briefly fascinated by a triangular "jump all but one" game, commonly found at Cracker Barrel restaurants.  The basic premise is that any peg can "jump" over an adjacent peg to occupy the empty hole next to the jumped peg.  The jumped peg is then removed.  The goal is to continue jumping pegs until there is only one left.  


The instructions on the face of the Cracker Barrel version of this game say, "LEAVE ONLY ONE -- YOU'RE A GENIUS".  Wanting to claim the right to call myself a genius, unlike ordinary kids, who might just play the game a few times, I sat down on my Turbo-XT and started writing BASIC code.  The algorithm I came up with ran a bit slow, so I directed output to my printer and let it run over night.  In the morning the program was still chugging along.  I advanced the paper feed on the dot-matrix lineprinter -- the kind that used continuous feed paper with perforated edges and holes on each side.   Into view came 3 solutions represented by a string of numbers.   A quick check verified that I was now a genius.  

The following interaction with Maple's Excel link came to my attention today.  I thought it had many interesting points that lead to insights about Excel and Maple that are worth sharing. 

Maplesoft Employee

Lucky 13??

June 03 2009 by Paul 290

2

1

The Canadian Press reported last week the fortune of 13 women working on the 13th floor of an Edmonton bank tower winning a $50-million lottery jackpot. Combine this with the recently released version 13 of Maple and one might claim that notorious number 13's luck is changing.

Early in the development of Maple 13 the question of whether to use "13" was raised. From Apollo 13 to hotels with a missing floor, superstition surrounds this number.  Microsoft Office 2010 is slated to be released as version 14.0; the previous version was 12.0. Corel's WordPerfect Office marketed their version 13 as "X3" -- combining a roman numeral and decimal digit.

In a previous post I described how to call OpenMaple from a C# application (see: Using OpenMaple with C#) Now, I'd like to tackle the reverse problem: how do I call a C# .dll from within Maple? The way to do this involves using Component Object Model (COM) interoperability in the Microsoft .NET Framework. Because Maple's kernel is written in an "unmanaged" language, a wrapper is needed in order to bridge to your managed C# code. This article will outline the steps needed to create this bridge and get Maple talking to C#.

I wanted to see how difficult it would be to use the OpenMaple API from a C# program.  It turns out that it is pretty easy to access C .dlls from C#.  I was able to reproduce a commandline equivalent (minus the command history and editing features). 

The source code can be found here: openmaple.cs

Attached (sim.mpl) is a simple game simulation with data from last years World Series champion Red Sox. Bump up infolevel to see what's going on during a game (as shown below). In the "Maple Baseball" post I wanted to see if the number of runs our team was scoring was appropriate. Obviously, the rule of thumb, 3-hits = 1 run is poor at best. What I really want to find out is if there is a way to improve our scoring chances. The standard baseball batting-order uses the following heuristic:

  • lead off with someone with a high on-base percentage (and who can maybe steal a base)
  • next 2 are good contact hitters
  • batter 4 is your "clean-up" hitter; someone with power
  • etc.
Maplesoft Employee

Maple Baseball

August 08 2005 by Paul 290 Maple
Early this season, after the Maplesoft team came out on the wrong side of a 13-6 loss, we were frustrated by the team's inability to score more runs. The previous year we averaged 14 runs a game. This started me wondering, just how many runs can our team expect with a given lineup? Suppose you assume that it takes three hits in an inning to start scoring runs. Now, let's assume you have five .500 hitters coming up to bat. What is the probability that you'll get 3 hits among those five batters, thus scoring one run?
Page 1 of 1