Posts

Showing posts with the label programming

Parsing UserForm and Code Modules in VBA

Image
Some research into what's possible with VBA and code generation of JavaScript for a proof-of-concept project . In order to parse a UserForm and VBA code modules, first enable Microsoft Visual Basic for Application Extensibility in the Tools / References feature: For this example create a simple UserForm: The Parse button should be wired up to call the Parse() subroutine in the Module1 code module. The entire source will be listed in the worksheet when this Parse routine is run. Here's the code to place in Module1: 1: Option Explicit 2: 3: Sub Macro1() 4: Form1.Show 5: End Sub 6: 7: Sub Parse() 8: Dim cmpComp As VBIDE.VBComponent 9: Dim cCont As Control 10: Dim lRow As Long 11: Dim lLine As Long 12: 13: Sheets("Sheet1").Activate 14: ActiveSheet.UsedRange.ClearContents 15: 16: lRow = 0 17: lRow = SetRow(lRow, "Show UserForm and VBA Code Modules") 18: lR...

How to Move Excel VBA to a Production Environment?!

Image
I was thinking of a quick-and-dirty solution for moving VBA to a server, but found it was essentially shot down by Microsoft a long while ago: Considerations for server-side Automation of Office https://support.microsoft.com/en-us/kb/257757 I have some other ideas of using an Excel VBA metaphor (in essence a stack of sheets) within a Node.js module, perhaps implementing a set of functions similar to Google Apps Script (GAS) to reduce the learning curve. A simple a way to move Excel VBA (which is very productive in a corporate Excel environment) to a web front-end for low volume self-serve production use is needed. Any idea has dozens if not more people around the world thinking about it - maybe someone has already solved this problem and I can just use it? There are postings on Stack Overflow to figure this out, but consolidated here for quick review. Here's an example of calling an Excel VBA Sub and Function from PowerShell.  PowerShell code: 1: $objExcel = new-...

Natural Order Evaluation of Spreadsheet Cells

Image
Instead of just tossing this bit of history in the trash I decided to scan and post it for posterity. In the mid-80s I worked for EMS/McGraw-Hill on a series of products for the Gregg division that were used to train students on how to use Lotus 1-2-3 and spreadsheets in general. We created a product called McGraw-Hill Integrated Software (MHIS) which included a spreadsheet module (written in C for MS-DOS). The memo I wrote explaining the implementation of natural order evaluation in a spreadsheet vs. column-order evaluation in a spreadsheet is below. It was fun to see that I was able to use my computer science education to bring a postorder traversal of a binary tree to the project!

Dolphin Write (WordPerfect 5.1 Compatible SW circa 1995)

Image
Ah, remembering programming in earlier years... Dolphin Inc. created software for a variety of educational publishers including Glencoe/McGraw-Hill and its Gregg line of keyboarding software products. Part of the product included a WordPerfect 5.1 compatible word processor that I created in my basement (of course!) around 1993/1994 shortly after coming to work for Dolphin in Gibbsboro, NJ (near Cherry Hill). The product was written in C and was an interesting, if intense, project created under a tight deadline and pressure from the client to replace a word processor ( NYWord ) that we had attempted to adapt unsuccessfully. A Gap Buffer  approach was used for managing the insertion of text and of course implementing base WordPerfect 5.1 functionality including the Show Codes feature, endnotes/footnotes, and even basic keystroke macros was fun. The first screen shot shows some of the features in action including indent, bold, italics, underline, footnotes, and endnotes. The ...

Phaser for HTML5 Game Development

Image
Just starting on an adventure in HTML5 game development using Phaser and thought I'd keep notes online. There's a bigger picture application goal that I have in mind, but it will start as a series of exercises and I want to record them while I'm learning. First I wanted to create an example of a polygon moving around the screen using the cursor keys. After some exploration of the examples and reading documentation it boiled down to this basic example. First the index.html file: 1: <!doctype html> 2: <html lang="en"> 3: <head> 4: <meta charset="UTF-8" /> 5: <title>Polygon Test</title> 6: <script src="js/phaser.js"></script> 7: <script src="js/polytest.js"></script> 8: </head> 9: <body> 10: <div id="phaser_game"> 11: </div> 12: <script type="text/javascript"...

Using Selenium with Excel VBA

Image
We had to change the names of 700 students in the student information system that I'm the product manager for at work. Instead of requesting that our support team write a database script, I figured it would be a good opportunity to try using Selenium ( http://www.seleniumhq.org ,  http://seleniumhq.wordpress.com ) to rename the students using the browser user interface. In the past I have written VBA (Visual Basic for Applications) scripts to control Internet Explorer and I wanted to extend that approach to control Firefox and/or Chrome. Excel VBA provides a very capable environment and the spreadsheet as an underlying model works very well for a class of problems. In this case we have a list of students already in the system and I added a couple of columns to contain the new first and last names. A simple loop through the rows using Selenium calls to manipulate the user interface and then record the results back in the spreadsheet is a straight-forward VBA macro. Of course, wi...

PLATO Access Lists

Image
At work today we discussed the need for a relatively sophisticated permissions system for controlling access to various features at a site we are building. I realized that something similar to what we were talking about was designed and built way back in the early 1980s on the PLATO system. Here's an Antiques Roadshow tour of PLATO Access Lists using a game I worked on in college as an example.... (if you want the PDF version contact me ). Avatar: A Multi-Player Dungeons and Dragons Game http://en.wikipedia.org/wiki/Avatar_(PLATO_system_video_game) An Access List is a system-provided capability on PLATO that allows authors (developers) to create custom flags that can then be used to control access to various features of a lesson (program). The example shown here is for Avatar, a popular RPG on PLATO. Keep in mind that this was created in the early 1980s and 512 x 512 plasma (orange) panel screens were state-of-the-art at the time. http://en.wikipedia.org/wiki/PLATO_...

Messaging for Mobile Apps (XMPP)

I've been looking around for a solution to messaging between devices since I'd like to experiment with creating a lite version of a game (Avatar) that I worked on in college as a learning experience. More about that at another time. http://en.wikipedia.org/wiki/Avatar_(video_game) XMPP (Jabber) looks interesting. What's really attractive is that I may design the App with no server-side component with just message handling on the Internet. It's different since Avatar in college depended on shared memory (common) and only used a message queue for a portion of the game. Here's video that got me started (Hulu developers): Building Asynchronous Communication Layer w XMPP, Ruby, Javascript by Andrew Carter and Steve Jang http://www.youtube.com/watch?v=3ZynQ04BuN8 And an interesting article: http://wiki.secondlife.com/wiki/Message_Queue_Evaluation_Notes And a JavaScript library to experiment with: http://strophe.im/strophejs/ Jabber server to experimen...

Alvin Roth Wins Nobel Prize

Image
I was fortunate to have worked my way through college as an Undergraduate Research Assistant with the Economics department at the University of Illinois working on multi-player bargaining experiments funded by some NSF grants where one of the researchers was Al Roth. He was already well known in game theory at the time these experiments were conducted. The Sveriges Riksbank Prize in Economic Sciences in Memory of Alfred Nobel 2012 was awarded jointly to Alvin E. Roth and Lloyd S. Shapley "for the theory of stable allocations and the practice of market design" http://www.nobelprize.org/nobel_prizes/economics/laureates/2012/ Three of his earlier papers where we (Ron Harstad, Michael Barr, myself) contributed by building multi-player experiments on PLATO: Expectations and Reputations in Bargaining: An Experimental Study (1983) https://web.stanford.edu/~alroth/papers/1983_AER_Expectations_and_Reputations.pdf The Role of Information in Bargaining: An Experime...

Pre-Agile Ideas: Jim McCarthy Videos

Image
I've been a fan of Jim McCarthy since I heard a recorded session of his talk at one of the Microsoft developer conferences back in the 90s. The thoughts represented are echoed in Agile practices today. There is a nice set of short videos at: http://www.mccarthyshow.com/the-23-rules-of-thumb/ which are also available on YouTube: http://www.youtube.com/user/McCarthyShow#g/u He also has a recent (Dec 2013) keynote at InfoQ: Culture Hacking http://www.infoq.com/presentations/culture-hacking-singapore Some my selected favorites: Rule 1 - Don't know what you don't know Rule 4 - Don't go dark Rule 5 - Use feature teams Rule 6 - Use Zero Defect Milestones Rule 7 - Don't flip the bozo bit Rule 8 - Beware of a guy in a room Rule 13 - If you build it, it will ship (daily build) Rule 23 - Get the team into ship mode

Video: Learning from StackOverflow.com

Joel Spolsky  has one of the higher rated programming blogs and goes into the thought behind StackOverflow.com . It's a site designed to share programming information efficiently. Some interesting timecodes: 01:00 he worked on FogBugz 05:00 some interesting discussion about competing information exchange approaches 16:00 he worked on Excel VBA (a source of consulting work for me for years) 25:00 discussion about .NET stack and performance of C# being great 37:40 Things You Should Never Do (don't rewrite a software product from scratch) 44:00 stackoverflow.com is #1 resource for new programming technologies http://www.youtube.com/watch?v=NWHfY_lvKIQ

Managing Programming Projects: Don't Lose Sight of Reality

If you're a project manager who came from a programming background it's amazingly helpful to dig back down into code for a day just to remind yourself of how the process really works. Regardless of the approach to project management (Agile, Waterfall, etc.), at the most basic level the development process remains an exercise in code / test / repeat. It's a very satisfying exercise, but it makes you appreciate that there is a lot of detail behind each feature or requirement. It's my belief that the greatest productivity gain for programmers individually is to have as rapid a code / test loop as possible. This is one of the biggest advantages of interpreted script languages (e.g. JavaScript) over compiled languages. There are obvious productivity benefits to being able to see your work quickly and there are psychological/motivation benefits as well.