Showing posts with label Programming. Show all posts
Showing posts with label Programming. Show all posts

Tuesday, January 13, 2015

Super Sweet Startup Digs

Today I found out that I was one of the winners of the Super Sweet Startup Digs Contest put on by ABQid and FatPipe. Thanks to the organizations for giving away office space and coaching/mentoring. I'm not positive who, or if all the winners, won the $350 for a business wardrobe makeover, and a spa treatment in Albuquerque. As a particularly well dressed ex-girlfriend can attest to, I definitely could use a business wardrobe makeover! I'm excited to go in tomorrow to FatPipe and see what's going on and find out more information. I'm pretty sure I got free office space out of the contest, and tomorrow I'll figure out the details.

Also thanks to my friend, Mariya Tseptsura, for editing my application and offering me lots of suggestions on making it better.


Tuesday, November 18, 2014

MySQL Weirdness

Does anyone else think this is weird? It looks like the shortcut 'show create procedure' lacks the ability to go INTO OUTFILE. Maybe this is just me not understanding, but it seems like I should be able to INTO OUTFILE more than just a SELECT.

mysql> show create procedure mydbr.COMPANY_esnq_site INTO OUTFILE 'COMPANY_esnq_site.sp.sql';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO OUTFILE 'COMPANY_esnq_site.sp.sql'' at line 1
mysql>

mysql> SELECT routine_definition FROM information_schema.routines WHERE  routine_name = 'COMPANY_esnq_site' AND routine_schema = 'mydbr' INTO OUTFILE 'COMPANY_esnq_site.sp.sql';
Query OK, 1 row affected (0.27 sec)


Friday, July 18, 2014

Netbeans on Ubuntu = Requires an Advanced Computer Science Degree

I literally spend hours (about three) trying to get Netbeans 7.3 installed on Ubuntu 12.04. This is not a fun process. Netbeans crapped out while displaying "Loading cached objects" for me, after it looked like it installed perfectly using the Oracle JDK. The solution I found was:
  1. Actually, fully, installed OpenJDK. The mistake I was making here is that Ubuntu LOOKED like it installed OpenJDK, but it didn't actually finish the installation until I ran: 

     sudo apt-get install openjdk-7-jdk
  1. Install Netbeans, using the OpenJDK installed in step #1. 

I have no idea WHY the Oracle JDK failed Netbeans, but it seems like this is a fairly common problem. Hopefully this post will help other people avoid the same dark fate as my lost three hours. 


Thursday, July 10, 2014

Bandojo on GreenLight

I've been working with the startup Bandojo for the past few months. Most of my involvement up to this point has almost entirely been on getting our C/C++ program to build on Windows, and now I'm doing more web development for them, and (sort of) managing an intern that is also into web development. The intern (David Heyer) suggested we submit to Steam. Since no one at Bandojo really knew what Steam was, he explained it to us, and it sounded like a great idea. So I submitted our software to Steam.

Steam sounds like a very, very cool software distribution platform. Basically, they handle all the money, all the copy protection, upgrades, and a bunch of reporting for you. They mostly sell games, but also sell other pieces of software (like our music creation application.) Getting into their store sounds like a bit of a dog and pony show though (i.e. you need to win a popularity contest before they consider you.) Since I have never been through this dog and pony show before, I have no idea how (if?) it will end.

So, if you feel like clicking "Yes" (I would buy this game if it were on Steam) then check out this link. Or send me an email if you've been through the Steam cleaner before and have any tips.

Bandojo 

Thursday, November 28, 2013

Ask A Programmer - Part 2

I received two more questions from a Fiverr gig I have called "Answer A Programming Questions In Written English."

1. What kind of coding languages/programming/software would typically sit behind online 'article spinners? Some examples of article spinners:

       http://www.spinrewriter.com
       http://thebestspinner.com

Before I researched this question, I was unfamiliar with the term "article spinner." After researching that term, I realized that the purpose of article spinning is to generate multiple copies of an article, all of which are different enough to convince a search engine that they are not the same - which results in having 'more content' for a search engine to index. This is a way to game the search engine, and actually contributes nothing of value, but is a strategy to get a higher search engine ranking (because you have 'more content.')

Despite the fact that I try to create high quality, interesting, funny, articles, and think spinning is total crap, there are still numerous technical aspects to it that are pretty cool. 

I believe that the underlying mechanism that spinners use is found in probability, specifically random variables. A random variable represents a number of outcomes, each with a probability. For an article spinner, it would make sense that synonyms can be represented with a random variable, and the 'closer' the synonym, the higher the probability of it's replacement. For example, we could have the word "car" as a random variable associated with many terms. This can be expressed as

car = {(auto, 0.98), (automobile, 0.95), (truck, 0.80), (ford, 0.75), (chevy, 0.70) ... (boat, 0.001)}

Where the first value in the tuple () is the term we want to substitute, and the second value is the associated probability (which has to be between 0-1.) So, substituting "auto" for "car" can work in 98% of cases. For our spinner to work well, we need to have a LARGE number of terms we can substitute on (random variables) and a LARGE number of HIGH PROBABILITY substitutions to make. Think of the article spinner playing mad-libs, but with high probability substitutions. The quality of the spinner is going to depend on the quality of the synonym lists.

OK, so we have our term substitution outlined above, what does our software actually conceptually look line? Something like this: 


And then you hit the "Go!" button, and the software makes a number of articles based on your input article (with how many depending on how far you cranked the "number of spins" knob), and those articles match somewhere between 0 (with this being a mad-lib, where the grammar of the language holds, but not much else) and 1 (where the articles perfectly make sense, but use different words that mean EXACTLY the same thing.) The output is a series of articles. "Max" is going to be the maximum articles that can be generated by counting the permutations on the synonyms found in the spinner and original article. Any spinner that guarantees 'infinite' spins is either:
  1. Ignorant of combinatorics
  2. Lying
  3. Performing very, very, very, low probability/acceptability substitutions on already spun articles. This would result in a computer playing the game 'telephone' where the message is continuously distorted (which, mathematically speaks, still results in a finite number of articles, but would be large enough for all practical purposes.) 
This describes the conceptual framework for how I imagine an article spinner works. Compared to the dudes I hang out with, I suck at math. Most of the guys I spend time with are super, duper, smart and good at programming, computer science, and math. I have a BS and MS in Computer Science, which is sort of like getting an undergraduate minor in math, which isn't very much math. I'm all right, but please excuse me if my probability terms aren't perfect. I'm not sure about the second knob and using an actual random variable - I'm describing something similar, but not exactly like a random variable. 

I imagine that these spinners are subscriptions to websites. Which means that a large portion of their implementation is web programming : HTML, CSS, and JavaScript. However, the algorithm I described above would make sense to implement server-side, so that someone cannot just look at your JavaScript code and have access to your spinner logic. 

With regard to programming langues, I'd like to implement this in a programming language called "Python" since I'm pretty good at writing programs in Python. Since it would need to be part of a web page, I'd probably take a look at a framework called "Django" which is not to be confused with probably the first Quentin Tarantino movie I ever liked, called "Django Unchained." Basically though, any kind of server-side language would work. Php is super popular as far as server-side languages go. One of my friends uses Java as part of the Tomcat framework for server-side work. This is all based on the idea that someone is selling a web-based subscription to a spinner, as used through a web page. If someone were selling a binary (.EXE on Windows) then any language which compiles into an .EXE could be used - like C++, or any compiled language.

2. What languages/coding/software would be required if I wanted to add extra features like bring up url lists of top 10 youtube videos, or newspaper articles, or Flickr photos - all based on the main article keyword. Eg. An article with a keyword of "good running shoes" would bring up links for good shoe videos and pictures and online articles from reputable news sources (to get good quotes and statistics).

I actually built something like this for scraping yellowpages.com. My scraper would accept a term and a zip code, and then grab all the results and put the results in a database. For any of these things, you need a 'scraper' which is a piece of software that crawls through a target website, and collects information. For the most recent scraper I wrote, we only cared about yellowpages.com. I would put the results into a MySQL database, so that different programs and/or web services could use the results from my scrapes.

Since Youtube, Google News, and Flickr all have different interfaces (ways of accepting input, and displaying results) you'd need a scraper for each one. Scrapers may exist, but I haven't had very good luck in finding existing scrapers, so I always write my own. You may be able to take advantage of RSS feeds if you were interested in very general top results, but for results for a specific term, I'm pretty sure you'd need a scraper.

I love using Python and BeautifulSoup for scraping. Putting the results into a database makes a lot of sense usually, since then any other program can use the power of a database to access the scraping results.

Things have been super, super busy with my software company, but I like this Fiverr gig. It gives me interesting questions to answer (for money) and helps me build my blog content (without article spinning!)

Saturday, September 21, 2013

Hammer.js + PhoneGap

PhoneGap developments are coming along well. If you already have a massive HTML5 canvas + JavaScript application (like my customer does) and you want to convert it to an app, PhoneGap may be the tool for you to consider. I have had a lot of fun, and not too much frustration, with developments.

Right now, I am using a library called hammer.js ("You CAN touch this!") for multitouch support. I highly recommend it. One of the only issues I ran into with hammer.js was it's event loop having some issues with JavaScript's event loop, when I (incorrectly) listened for hammer events on the body. When I listened for events only on my canvas, things worked all right.

Below are some images of the app running on my Samsung Galaxy 3S.


App Running. It can be a bit slow with tons of nodes, but is WAY better if my phone isn't running a ton of other crap. We're doing all the rendering in JavaScript. 


After a pinch-to-zoom.


Click on a node, and bring up information about them...


...and edit a node to bring up the on screen keyboard.


Or rotate your phone if you like landscape more.


I've been very happy to work on this project with a fun customer, that is paying me to learn about PhoneGap development and make a cool app. Eventually we may try deploying this on an iPad!

Monday, September 16, 2013

Ask A Programmer - Part 1

Since starting my own custom software development company, I occasionally pick up small gigs on different programming sites like oDesk, Freelancer, and Fiverr. On one of those sites, someone offered to pay me to answer five six (after an additional question) questions for them. Since I write blog posts basically for free I decided to take this customer up on his offer. Below are his questions, and my responses.

This customer asked me about 'trust seals' in an email before he actually asked his five below questions.

1- Is it possible to have a badge shown on the url area. there is usually a site lock and ssl verification, what is the process of adding one of your own? say on the right?

A trust seal is basically an image that says your website is trusted. Most modern browsers show images in the URL area when a site is using a properly signed (by a trusted organization, not a self-signed) certificate for SSL. These type of trust seals are built into the web browser.

However, you can show other icons to represent the page. The favicon is an icon that people use to show a quick, small, image representing the page used for shortcuts. With modern browsers, those are not shown in the URL area, but along the title bar, or with the tab. I believe they USED to be shown in the URL, but a quick test on modern IE, modern Chrome and modern Firefox show that is no longer the case.

As far as I am aware, it is not possible to show icons in most standard browsers in the place the 'lock' (for recognized SSL sites) or the 'broken lock' (for sites that have SSL problems) go. 

However, I sometimes like to add the W3C validated image on a site that I make, after the W3C validation engine validates it. That is the only trust seal I've ever put into my site, and I put it in just as an image when I'm writing HTML. This is not in the URL area though.

I have no idea if this website is valid or not. I just added the trust seal here. 

2 and 3 - server and website verification( as i read on wikipedia ) performs tests on servers and websites to ensure that they are not vulnerable. Are these web crawlers that do this? What program scans so intensely and how do you go about creating one?

There are web crawlers that do this. Most of these crawlers are created by malicious individuals, and/or government organizations that want to find vulnerabilities and exploit them for their own purposes. Metasploit is a well developed program which will automatically attack targets using a set of canned exploits. Another program which is useful in fingerprinting systems to determine which versions of programs (services) they are running is called nmap.

Whenever I've created something like this, I used a programming language called Python  and a package called BeautifulSoup to scrape and post to websites. Basically, any programming language can be used to accomplish this, but some are better suited to accomplish it quicker. Depending on what people are targeting, they will use a combination of unknown ('zero day') exploits and widely available, extremely well know, vulnerabilities.

If you run a server online, and you run a service called secure shell (ssh), you will immediately (within 10 minutes) start seeing people 'rattling your keys' with common username / password combinations trying to login to your system. Whenever I put together a website using a system called Drupal, I start seeing bots (web crawlers) signing up for accounts, and posting random crap to the Drupal site. These are pieces of malicious software trying to exploit, trying to be annoying, or just put together as an experiment for someone to learn from.

All of this is a reason to keep your software up to date, and run software that you trust.

5- instagram app, being able to upload to different social networks and managing different accounts in one place, like instagram or whatever. Such platforms seem very easy to build or create, but are they? are they expensive to build and maintain?

Social networks that have millions of users are extremely complicated pieces of software. They rely on gigantic server farms, and took lots and lots of time to build. They are very time consuming and difficult to build and maintain. If I remember the Facebook book correctly, it took Mark Zuckerberg like 6 months of programming all the time to get Facebook even kind of usable, and he sounds like he was a bad-ass. Even then, they had a few servers and multiple programmers working on Facebook full time. Building a social network is not easy. I spent some time working on a project using a tool called Social Engine for a customer, and that was my one clear failure in the year of programming. That failure happened for a variety of reasons, but one reason was that the software for that is extremely complicated (and I did not know much about Zend, the underlying system on which it was built.)

This may not be true for small social networks built on top of Drupal or WordPress but eventually if your social network continues to grow you'll have to hire some super smart dudes.

6 - Like you I am an entrepreneur and the questions I asked before where purely for research. What I want to know is how willing are people in your end of the world ( America) willing to adopt new products. I live in Botswana and before I launch anything I always second guess myself because in Botswana, its not only super behind on technology it's also super conservative and.. well pretty african.
So how willing are businesses and people in general willing to try out new products given the times you find your self in? Just your opinion.

People in the United States are willing to try new technological and business things very quickly, if properly sold on the concept. I believe our technological skills in the United States are the best in the world, and so are our sales skills. American salespeople are always trying to convince potential customers to try something new (as long as you speak English.) We are always looking for ways to do things more efficiently, with more profit, less waste, and more fun. Our minimum wage is very, very high, which discourages companies and individuals from hiring minimum/low wage people. It is much more efficient to try and replace a low skill, minimum wage person with technology even if somewhat more expensive, because software and robots do not cause any of the problems that people can in our society. The high minimum wage, combined with the the pragmatism Americans have, make it so we are interested in trying new products, especially if they can go back to the old way if the new way isn't any better.

Thanks!

Sunday, July 14, 2013

PhoneGap on Ubuntu 12.04 VirtualBox Guest with Windows 7 Host

My favorite customer hired me again to work with her, this time on a Javascript-based project. She wants to port her existing Javscript, HTML and CSS code base to both Android and IOS native (ish?) apps. We're getting started with PhoneGap to accomplish this single-codebase-two-platform project. I thought I would put together a quick post about the "gotchas" that I ran into while setting up my development environment. All of the guides I found don't really cater to a virtualized Ubuntu setup, so I figured that some of the problems I overcame might help someone else.

One important lesson I learned at my last 9-5 job was to take advantage of the tools and support an integrated development environment (IDE) can provide you with. A lot of the Android + PhoneGap documentation is present for Eclipse, so that's what I went with.


This is what my first virtual Android device looks like.


I'm using Eclipse with the Android Development Tools (ADT) pre-bundled, and linking in PhoneGap version 2.9.0 on my Ubuntu 12.04 Virtual Machine running inside VirtualBox.

The main things I learned so far are:
  1. Running the ARM emulator takes a TON of resources. For the basic web development I mostly do, my Ubuntu VM is normally sufficient. I had to add another gig of RAM and double the processing capability to make this even responsive at all. It was basically taking about 5 minutes for the Android virtual device to boot before increasing the resources. After making this VM stronger, it became feasible to develop inside it.
  2. 3D acceleration inside VirtualBox and the 3D acceleration for the Android simulation don't play well together. Simulating 3D inside a simulated 3D environment seems like it might have some problems. I disabled 3D acceleration for VirtualBox, and now I only get one warning from Android. I'm pretty sure this is 100% not supported but it seems to be working for me, right now. Previously, I received a ton of errors.
  3. super.loadUrl("file:///android_asset/www/index.html");         super.loadUrl("file:///android_assets/www/index.html");

    are not the same. If you make this mistake, you will receive a "There was a network error. (file:///android_assets/www/index.html)" error. It needs to be "asset" not "assets." This is a little bit tricky, since inside Eclipse and my file system, you have "assets/www/" but when this gets moved to a phone, it's "android_asset/www/". 
PhoneGap development has been fun so far, even if I just barely finished with getting a "Hello World" program running. I'm not sure if I'll end up getting a Mac, or running on some sort of a weird virtualized Hackintosh to compile this for IOS using XCode. I don't yet have access to my customer's code base, so I cannot take the next reasonable step of trying to get their code running to see how native it looks, or if it works.

With getting this to actually run on my physical device, I had to install the Oracle VM VirtualBox Extension Pack on my Windows 7 host. I installed version 4.2.16. Then, my host went through some additional USB configurations, I rebooted the host and my guest, and I was able to see my phone from my Ubuntu VM.

DDMS Perspective in Eclipse

Inside my VM, I switched Eclipse to the perspective to DDMS. I didn't really know what DDMS stood for, or what it was, but all the other options seemed wrong. That was the correct guess, and I could select my device. I went to "Run" -> "Run", selected my device, clicked OK and then cheered when my Hello World program showed up on my screen.

Screen Shot of my Actual Screen - I'll try to take a picture, but my phone cannot take a picture of itself.

Task Manager While Running

The running app seems like it's taking a decent amount of memory. This is likely because PhoneGap requires a big .JAR file to be included with the project, in order for it to work.

Hopefully this post helps someone else, or me the next time I need to setup a PhoneGap development environment.

Tuesday, July 19, 2011

First Squish Testing Problem Overcome

I have been working on getting Squish testing going for the application my company produces, FLOW-3D. So far, we have been very happy with the level of support FrogLogic is giving us, and Squish seems like a great product. My involvement with this technology is just beginning, and I like it. Others' at my organization have more experience using Squish than I do.

One difficulty I was able to overcome that I wanted to post about was the "Either the application could not be started, or it was started but Squish failed to connect to it" error message I was receiving. After Google'ing this error message, a number of posts said that this was due to an incompatible version of Qt.

Error Message I was Receiving

However, I have Qt correctly configured on my machine, and selected the correct Qt directory while installing Squish.

The problem was because I was trying to test a debug version of our software. After selecting the non-debug version, everything worked fine. The installation documentation mentions this:
Using Squish with Qt debug libraries

The prebuilt binary packages are built against release versions of the Qt libraries—not against the debug versions. If you want to use Squish with Qt debug libraries you will need to build Squish from source. (See Installation for Testing Pure Qt 4 Applications (Section 3.1.2.2).)


I wanted to create a quick post to help others (both inside my organization and outside) if they encountered this error message and didn't know why. For me, it was because I was trying to test a debug version of my software, which the Squish installer does not support.

Saturday, June 19, 2010

AI For Video Games - Final Project

It has been almost two years since I took my "Artificial Intelligence for Video Games" course, but the topic still comes up quite frequently. I find myself using my blog as a resource for when I am talking with people about different concepts and programs. As a result of this, I decided to include a post where I actually show what the final game came out to be like.

I realize this kind of messes up my blog's layout. Since I am mostly interested in showing people the game, as opposed to my layout, I'm OK with this.





Click here for a full screen version.


It's been a while since I worked on my sheep herding game, and Jon Bradley is responsible for the code as much as I am (entirely for the sheep behavior). Please leave me a comment if you would like to talk about this.

Friday, August 28, 2009

Leader Tech

I have been greatly enjoying my new job at a small software company in Albuquerque called Leader Technologies. The job is right next to the north diversion channel trail, so I can ride 9.3 miles each way to work safely, I work on very applicable projects which customers are interested in, and I work closely with very intelligent and nice people. Overall, I am very glad I choose to experience private industry.

Lately, I have been working on a number of data visualization routines. When I first started here, I was working on a general framework to replace our existing chart generation software. I have some before and after pictures. Before and after pictures are usually interesting, either with houses, people's physique, or computer programs. These before and after pictures aren't the most stunning things in the world, but I thought my blog would be a good venue to share what I've been up to.

These are generated with Java code, using the JFreeChart graphing library. Currently, I am working on a project to apply some of these chart types to visualize our mail server's log, so our customers will be able to understand what is going on with our system in a visual way.



VBAR - Before



VBAR - After



VSTACK - Before


VSTACK - After




PIE - Before



PIE - After (3D)



PIE - After (2D)



HSTACK - Before




HSTACK - After




LINE - Before




LINE - After



AREA - Before



AREA - After

Monday, June 22, 2009

Email Scraper - In Python with urllib and regular expressions




The past few weeks I have been messing around on the site rentacoder.com. Most of my work at Sandia lately has been writing (documents in English), with some IT work / configuration thrown in. This site seems to be a cool way to make some extra cash ($20 so far, only one success) and have fun writing programs.

One potential customer wanted someone to manually go to a bunch of web pages and harvest contact information. I started an email conversation with the guy, mentioning that I think there was a better way to automate this. Currently, I have a quick prototype I put together using urllib and regular expressions in python. If he picks up the project, I think I can find/create a better regular expression for email and clean up the data. Right now, I wanted to mess with writing some sort of email harvester; I just thought it would be fun (I have no aspirations towards becoming a spammer).

The code takes a list of fully qualified URLS, one per line. Here is the list the potential customer gave me.

http://weprintbarcodes.com
http://accstation.com
http://escan3d.com
http://edealsdepot.com
http://sandboxthreads.com
http://wildlifewonders.com
http://foreverbamboo.com
http://topsecretautomaticmoney.com
http://armormount.com
http://myjones.com

Here are the results after running my program:

brian@ubuntu-bind:~/tmp/other_programs/rent_a_coder/web_grabber$ time ./grabber.py
customerservice@weprintbarcodes.com
href="mailto:feedback@edealsdepot.com">Contact
freebies@sandboxthreads.com
src="https://p10.secure.hostingprod.com/@sandboxthreads.com/ssl/ecomby_128bit2.gif"
src="https://p10.secure.hostingprod.com/@sandboxthreads.com/ssl/paypal.gif"
Sculpture","http://ep.yimg.com/ip/I/wildlifegifts_2055_31879747","795","-@NULL@-");var
href="mailto:info@wildlifewonders.com">info@wildlifewonders.com

real 0m9.527s
user 0m0.312s
sys 0m0.208s
brian@ubuntu-bind:~/tmp/other_programs/rent_a_coder/web_grabber$


Not too great, but pretty good for about an hour and a couple of questions to my friend Aaron, who is awesome at Python. If I ever seriously want to write an email scraper (either for myself or a customer), I'll get a better regular expression, clean the output up, make it multithreaded and dump the email addresses to a database.

I may or may not ever actually post the code to this one, depending on how the rentacoder.com sales go. If you would like to see the code, leave me a comment with how to get in touch with you.

Saturday, November 15, 2008

AI for Video Games Project Update

Today I spent about 5 hours at Starbucks working on getting the dog I jacked from this dude to follow a path in ActionScript. Right now, I solved the problem related to applying the points on the incorrect place and getting the dog to follow the points on the path. I still want to clear the path after the dog has finished following it, make the sheep run away from the dog and work on the dog's animation a bit. I think once I get the sheep running from the dog and the path cleared though, I am going to setup SVN and work on the splash screen and some other non-AI components of the game. My partner Jon has done an awesome job creating the AI framework, and we agreed to have him do a bit more AI and I would focus on the other structural points of the game. Our professors wanted to make sure all group members did AI related stuff, so path following seemed like a good place for me to work.





Click here for a full screen version.


Code is available here in case you want to see how I did path following in ActionScript. If you have any questions / suggestions, let me know. I see that a lot of people have been searching for algorithms and data structures related to ActionScript, but I never receive any feedback from you guys. Leave me a comment if this is useful.

Monday, November 10, 2008

AI for Video Games Final Project

For my final project, Jon Bradley and I decided to work together on a video game he has an idea for. The game is all about herding sheep. So far, Jon has done a huge amount of work. Today I made some progress on implementing path following in the ActionScript framework Jon developed. I still need to make something actually follow the path, as well as figure out why my path adding is getting messed up with regards to clicking on a sheep or the shepherd whenever you are trying to add a path.

Anyways, here is a sample of what we have coming. I'm going to hold off on posting any code until the assignment has been turned in. My path algorithm is the same one that Bill Klein implemented in Processing, which is probably the same one from "Artificial Intelligence for Computer Games" by Ian Millington.





Click here for a full screen version.


Number one is getting the points to be correctly placed when you click on the shepherd or sheep. After that, comes getting something that looks like a dog to following the path, then setting up SVN so we don't have to email our code back and forth. After that, I am going to work on an intro screen, a level loader, a sound track (hopefully just finding one) and the other animation sequences, probably in that order. Jon has already finished the brunt of the AI, I he's going to add some obstacles, make a pen for the sheep to go into, add a little bit of state information and make it so flocks can be broken up. As long as I can get my pieces done, there isn't a ton more to do, since Jon has been working so hard!!

Sunday, November 9, 2008

Finished A* Finally

Hello,

I finally implemented an OK heuristic (Manhattan distance / Taxicab geometry from the current node to the end node). Everything looks the same, but the code is a bit different.

My full implementation of A* in ActionScript is available here.

Wednesday, November 5, 2008

A* for ActionScript, with an incomplete heuristic function

I have finished my (first completely working) implementation of A* for ActionScript. However, the heuristic function is a constant function and thus not implemented, so 'A*' is just breadth first search. Technically, I believe it is correct to still call it A*, but I'm not certain since I'm not keeping track of my path cost, and my heuristic is more of an artful description of something that always returns the same value but has not been implemented... I suppose I am feeling a bit discouraged since the assignment is due tomorrow at 5 p.m. and it is 3:21 a.m. and I still have a bit to do in order to make it perfect. However, I think choosing which path to recurse down first based on a heuristic shouldn't be too big of an addition now that everything else is working well.

I feel very happy that I choose to implement this in ActionScript. I like being able to share my programs with people online and notice the Google search terms that bring others to my site. I gain satisfaction when I see that someone from China, Spain, or some other distant place, spent 20 minutes reading about some technical issue on my site.



Press space bar to switch between blocking off nodes, selecting a start position and selecting an ending position.

Click HERE to view this in it's own web page.


My sister would be proud of my photoshopping skills on the waving hand. I also have to give a shout-out to Michael Baczynski for the cool data structures library (I didn't have to write my own FIFO thanks to him.)

As always, my complete source code is available. Please don't hesitate to contact me if you have any questions. I plan on making it more of an actual A* implementation, and if time permitting, possible using Michael Baczynski's graph data structure and implementing A* in his (very well designed) framework. I did not plan on doing that from the beginning, even though I'm sure it would have saved me time, since I did not see him code until after I already made my own graph, and adjacency list, management routines.

Thanks for Laurie Phillips for finding a bug in my code.

Monday, November 3, 2008

A* for ActionScript

For my class titled "Artificial Intelligence for Video Games" I have been working on an implementation of the algorithm A* in ActionScript. I've been pretty happy that the professors allow us to use ActionScript, instead of Processing, because it makes sharing my work on the Internet much easier. In addition, I think having substantial ActionScript skills is a marketable quality, as opposed to skills in the programming language "Processing." Hopefully I also will develop skills in artificial intelligence, to transcend any of the language-specific focuses I may have in mind.

As of this post, I have no actually implemented A* in ActionScript. What I have done is to implement a mechanism to draw and manipulate a relatively straighforward graph. This graph has the edges layed out in a regular, rectangular, pattern.

Here is a SWF of what I have so far:





Click to block/unblock a node, and press space bar to alternate between different modes of selecting a node. Eventually, the blue square will be for the starting position, and the green square will be for the ending position. Once I finish implementing A*, the path between start and end will be drawn in red squares.

Most likely if you are reading about my implementation of A* in ActionScript, you are interested in seeing my code. At this point, the most interesting thing will be how I keep track of adjacency lists for each node.

I will make another post when I finish everything, but I like making things available as I work so I can view my own progress. Here is a .zip of all the files for my project so far. I ask that if you use them, please somewhere link to my blog and email me so I can get some satisfaction.

Wednesday, September 17, 2008

Artificial Intelligence for Video Games - Assignment 1

This semester I am taking a course titled "Artificial Intelligence for Video Games" for my masters degree here at UNM. Our first assignment is to implement seek, flee and arrive in a programming language called "Processing" (basically Java). For this assignment, I started off with simple geometric shapes, but after finishing a few days early I decided to try and make something a little more funny.

What would be an interesting scene involving one object chasing another? One of the first things that came to my mind would be Michael Jackson chasing a child. Hopefully everyone finds this humorous and not in (too) bad taste.

Click this image to view the video in Flash



Click here for the movie in .AVI.
For you Mac fans, I've got it here in .MOV.

If anyone has experience with Processing/Java, I was having some trouble getting the sounds to work. I thought it would be funny to have a sound when Michael "catches" the boy, and possibly when the program starts. I also have a few ideas for future expansion of this concept, but I want to keep things a surprise until I see future assignments. One thing I REALLY want to do is to implement this stuff in ActionScript instead of Processing. I'm not sure if my professors will be OK with that and for this assignment I didn't have the time to write two versions.

This is a video of my "arrive" code - thanks youtube for the hosting


Shout outs go to my sister Autumn for doing the photoshop on Michael and the boy, Jeremy Pepper for general support and Oleg Semenov for help talking about the geometry I was messing up.

I'll post the code after I turn in the assignment tomorrow. If you want it, and I forget to upload it, please leave me a comment.

Friday, May 16, 2008

Actual Final Image


2048 x 2048 - 256 samples / pixel
Flipped Image (I trace my image reverse from how I index into my textures)
real 309m15.909s

Wednesday, May 14, 2008

Next Go

Here is my final image showcasing Perlin noise.



1024 x 1024 - 256 samples / pixel


A little different view point


Even Further to the Side - You can see where my star texture repeats