Archive for the ‘Computers’ Category

Unreal Engine 3 Support for Adobe Flash Player Announced | Epic Games Community

Wednesday, October 5th, 2011

Holy crap! This is so amazing, I can’t even explain it. I’ve done a little bit of 3D stuff in Flash, and it was pretty clunky. This is an epic vault up in capabilities for the Flash player. Maybe all my 3D skills weren’t wasted after all…

Unreal Engine 3 Support for Adobe Flash Player Announced | Epic Games Community.

regular expression to check for prime numbers

Thursday, June 23rd, 2011

http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/

The way it works in checking if n is prime is to make n copies of some character. (The original article uses 1′s to confuse us with the \1 pattern match, so I’ll use “x” instead.) It first trivially checks for 0 or 1 of those (0 and 1 are not prime). Then it checks for (xx+?)\1+ which will iterate over successively minimal matches of two or more x’s, and then see if the remaining x’s can be matched by copies of that minimal match from the beginning. If it can be matched, the number was obviously not prime (we just divided it into some unknown number of equal segments). If it can’t be matched, it tries the next most minimal initial matching.

As an example, let’s take 15. We create the test pattern “xxxxxxxxxxxxxxx” and run it through its paces to see if it matches our composite pattern.

  • Does it match “” or “x”? Nope.
  • Does it match “xx”\1+? Hmm. “xx” “xx” “xx” “xx” “xx” “xx” “xx” “x” Nope!
  • Does it match “xxx”\1+? “xxx” “xxx” “xxx” “xxx” “xxx” YES! NOT PRIME!

If we used 17 instead, we’d never find any substring that could be repeated to match the rest of the pattern, and our match would fail, meaning that 17 is prime!

Karaoke

Wednesday, July 1st, 2009

On Monday night, our lab went to Everett’s new apartment in K-town for Mr. Pizza. Joel regaled us with tales of his adventure in Ibiza, and then we all walked over to a Korean karaoke establishment. It was much fun! I had 1 glass of beer the whole night, and then drove people home safely. I got home and crashed at about 3am.

Tuesday morning I woke up at 7am, expecting a possible call from Nepal. The call didn’t happen, so I tried to go back to sleep. I was very uncomfortable and finally decided it just wasn’t working and I should get up and get coffee, but when I looked at the clock it was 9am. I’d slept 2 hours and didn’t even notice.

Tuesday evening I got home from work around 8pm with a few groceries I’d picked up on the way home. While putting them away, I spotted a cockroach on my refrigerator. Immediately I went into cleaning mode, cleared all the bags and boxes and plates and trays from the top of the refrigerator, and wiped the whole thing down with a hot soapy rag. It actually cleaned up pretty well, but while I was washing some of the big plates we’d stored up there, I turned and saw that I’d disturbed some more cockroaches. Even as tired and as hungry as I was, I was more angry that these little bastards were invading my living space, and I was determined to exterminate them all. I even tried to move the old refrigerator to clean behind it, until I started worrying that it might break.

Anyway, after all that effort I went to bed with one more clean area in the kitchen, and creepy crawlies in my head. I laid awake for 3 hours in the dark before my consciousness time traveled to morning. 5am. Allergies had kicked in. Coffee. World of Warcraft for my jc daily quest. Then some mindless travel while reading the news on the web, drinking coffee, and generally being a zombie. By about 10am I was again tired and went down for another shot at sleep. This time the dreams came almost immediately, and I knew I was dreaming because Saranya jumped on my back and tried to poke me in the eye like she often does, while Sangeeta yelled from the other room telling Saranya to leave me alone. I thought “oh, this must be a dream” and then it changed into something less memorable. After an hour of REM sleep though, I feel much much better.

Blogging for no good reason

Wednesday, June 17th, 2009

Anyone reading this blog will notice that I haven’t been sick much lately, so I haven’t been posting anything. Today I’m taking the time to remind my future self what I was thinking about and doing way back in June.

Sangeeta is getting ready to take Saranya to Nepal for a month. She’s got a week left to get everything ready, her car is in the shop with a major intermittent coolant leak that they can’t seem to find, and she just got addicted to Korean soap operas so she spends all day sitting in front of the computer watching them and reading the subtitles.

World of Warcraft is holding less and less of my attention. I still log on every day to do my jewelcrafting daily quest, and sometimes I take a break and do some Argent Tournament stuff. Oh, and I have calendar reminders to check and renew my Mysterious Eggs on 5 different characters. I can do all this while only actually paying attention to the game for as little as 30 minutes per day. The rest of my time I’m either programming, reading about programming, reading literature on human memory models, or studying math/statistics.

I’m the only employee of Insight Learning Technology, Inc. who’s not on vacation. I’m using the time to take cars back and forth for repairs, and to rework, refactor, and modernize all my PLM server code. I had to fake object orientation before, but PHP5 lets me write code the way I’m used to thinking about it. We’ve got at least two big projects coming up this summer, so I’m scrambling to get some of this background work done and tested before I have to focus on deliverables. The hope is that all this will make later projects easier.

I’ve been studying Psychological journals to see what other people have been doing in the field. Phil Pavlik and John Anderson have a nice model that predicts forgetting and recall time, and I think I’d like to adopt a similar model. Our system has a couple of arbitrary parameters, and I need to figure out a system for making them less arbitrary.

Whenever we create a new module for adaptive training, we have to decide what sort of performance reflects sufficient learning that the learner will be able to correctly answer the item (or an item from the same category) after a delay. We also have to determine the parameters that tell us approximately how long to wait after an item is presented before we show it again. Right now, these parameters are arbitrary and independent, but I think we need to come up with a system for not only generating these parameters automatically, but for relating them theoretically. That’s a path we’ve been loathe to tread, but access to funding for research in the field lies down that road, and we need to show our feet thereupon before the monetary gates will be opened to us.

Then there’s math and statistics. I’ve been looking at performance data from an earlier experiment, and trying to find a pattern of accuracy following particular patterns of problem presentation. I guess I need to learn some data mining and regression techniques to figure out the relationships. My lack of statistics background is holding me back, so I think I’m going to try to sit in on some classes next year.

If I still have a job…

Annoyances.org – Remove the Microsoft .NET Framework Assistant (ClickOnce) Firefox Extension

Sunday, May 31st, 2009

I just realized that Microsoft is trying to screw me over again. It seems that with their .NET Framework v3.5 upgrade, they silently install a Firefox extension that YOU CAN’T UNINSTALL! Well, not through the normal means of clicking the Uninstall button, anyway. It turns out you have to remove a registry key, reset a Firefox configuration parameter, and then delete a folder, which it turns out may require a reboot depending on what other software you’re running.

Here’s the complete removal procedure:

Annoyances.org – Remove the Microsoft .NET Framework Assistant (ClickOnce) Firefox Extension

Monday (False Memories)

Tuesday, May 5th, 2009

Okay okay so it’s not Monday anymore. This is about Monday though. I’m finding things I thought I did yesterday (Monday) that I apparently didn’t do. Specifically, a database update and a version control commit. I really thought I had done these things while I was at the lab, but when I got home I found that I hadn’t done the commit with the new files I added. Then when I woke up this morning (Tuesday) I had email requesting that I please apply the database update from yesterday’s files, which I was sure I also did at the lab.

What’s going on in my head? Is this typical for Mondays? I seem to remember that it is, but I seem to be developing false memories so I don’t trust them so much anymore.

Alright, that’s enough writing without coffee. I think I made coffee. Let me go check…

[edit] Hey! Now I update my code and I see the files I thought I committed yesterday! WTF?!?

Minesweeper: Advanced Tactics

Wednesday, April 15th, 2009

Minesweeper: Advanced Tactics

I like playing Minesweeper. This guy goes into some detailed but not difficult statistics to try to figure out a difficult board position, and the thinking is fascinating, but I would have quickly hit the 50/50 choices (bottom center and top left) and if I survived those, I’d have hit the bottom-right corner square next. It’s got a better than 90% chance to not be a mine, and 60% chance to not be adjacent to a mine (thus opening more free squares and yielding more information about the remaining mine placement).

Of course, if one of those 50/50/90 choices had got me blown up, I’d have just started a new game.

One variant I like to play is where you don’t mark the positions of known mines, leaving them unmarked until the end when you’ve clicked off all the non-mine squares one by one. It’s quite difficult and often slower than the marking method (you can’t use the trick of clicking both buttons to reveal all unmarked adjacent squares) but it sure is a memory challenge. If you like playing minesweeper, you should try it.

Windows 7

Saturday, March 14th, 2009

xkcd – Windows 7

Excel and fractions

Wednesday, January 7th, 2009

I’ve been working with MS Excel quite a bit lately, and one of the things that’s been driving me nuts is fractions. You can represent an improper fraction as text, and you can format a proper fraction numerically, but whenever you use it in a formula it’s the decimal that’s utilized. Given a large spreadsheet with a mixture of numbers, fractions, mixed numbers, and text already there, how do I make sure that my numeric fractions are preserved in my formulas in other cells?

Well, I decided to convert them to text. Automatically. I made a formula that did this, and I want to save it here for future reference:

=IF(ISNUMBER(A2),TEXT(A2,”### ###/###”),A2)

Actionscript 3

Thursday, September 25th, 2008

For the last few weeks I’ve been learning Actionscript 3. For those of you who don’t know what that is, I’ll tell you: Actionscript is a scripting language used by Adobe (and previously by Macromedia) to control things in Flash movies. Actionscript 3 (AS3) is the latest version of Actionscript, and it’s a complete rewrite.

Learning a new language is a difficult task. Fortunately, much of AS3 is the same as AS2, which I learned last year. Unfortunately, almost all of the parts of AS2 that I hacked my way through to design and implement a PLM client framework last year were the same parts that were rewritten, changed, or scrapped in AS3. XML handling is different. Event distribution and handling is different. Display management and interactivity is different. So I had to learn all the new stuff and then figure out how to rethink my hacks into the way AS3 lets you do things.

It’s coming together now, in the 4th week of the process, and it’s really a lot cleaner than it used to be. It uses about half the code to get the job done, since the new tools built into AS3 take some of the burden off of the PLM. I just can’t wait for this thing to be finally working! I’m going to go back and hammer on it some more now…