charlescfenwick.com

November 12, 2008

Wow time flies

Filed under: Uncategorized — chuck @ 7:55 pm

wow time flies I totally forgot I even put this up. Since my last post I’ve since made a flash game and it’s currently on a commercial site, not really there yet so I’m not going to mention it.
Otherwise I started on yet another tower defense game with has been a learning experience. I’d say I’ll post it soon but I’d been lying so I’ll just post it next time I think about it.

June 3, 2008

I want to write a flash game

Filed under: Programing — Tags: , , , , , , , , , , — chuck @ 2:39 am

I’ve always wanted to write a flash game. It’s been so intimidating not just the having to learn flash but the how do I make a fun and addictive game. Well the first hurdle I think I’ve gotten over. Recently I’ve had to opportunity to learn flex. It’s kind of like flash, well at least I know actionscript 3 fairly well. So l sat down last week and started playing around with things and let me say all the shit I talked about flash I take it back it’s pretty damn fun to program, like python there is a whole world of things you can do with it. I’ve made some fun little things with papervsion3d which in itself is just freaking amazing so more on that later. After playing with it[papervision] really got to wanting to build a sudo 3Dish flash game, I quickly learned that papervision was probably overkill for what the simple thing I want to do so instead I’ve decided to go with a simple Isometric view game based on sprites. I have no artistic ability. I did get my friend to do some artwork so I can thank him for the grass, dirt and little hut, but until I con someone into doing a whole lot of art for free I went with some free isometric sprites I found here.

So after roughly two days of fleshing out an isometric view type thing I’ve got this.

Click on the flash app then use the arrow keys to move the little dude around. I’m still very far from a game but this is a great start.

May 9, 2008

Dear house of representatives, and shortly the senate.

Filed under: Uncategorized — chuck @ 3:18 pm

How are you? I’m ok things haven’t been going that well I’m burried under student loan debt, oh it’s my fault I know but I dpay you off lobby you in their best interest. So just for your reference here some things going on in the world and in the Untied State besides some copyright infringement. You can start with these things feel free to add more though.

Voting machines that don’t work, Global warming, alternative energy, dwindling oil supply, quality of education, highest proportion of citizens incarcerated in the world( 7 million), War in Iraq, coming war in iran, failing education system, obesity, health care cost, lack of funding for education, lobbyist, economy, inflation, rising food cost, federal reserve, human rights violations, Massive stealing accidental over billing of money by companies such as KBR and Haliburton(not to mention no bid contracts, and a certain man in a high position of power that was formerly employed by them)

Like I said feel free to add more I probably will.

May 1, 2008

I :heart: python + SimpleXMLRPCServer

Filed under: Uncategorized — chuck @ 3:55 pm

Not much to say other than I’ve played with it and it’s the coolest thing ever. I’m thinking a crazy ec2 setup using these is in order. More later.

April 22, 2008

Credit Card Debt Calculator

Filed under: Programing, flex — Tags: , , — chuck @ 5:03 am

Credit cards are great you can cover some of your expenses if you come up a little short and as long as you can pay them off in a reasonable amount of time they are great deal.

If you use them in that way, on the other hand, you can use them to live beyond your means, you didn’t need that 52inch LCD 1080p 120hz TV but you sure as hell wanted it. I sure as hell wanted that LCD TV.

As a newly graduated college student I found how far my money really does go. It’s not that far. Especially when you have a credit card payment to pay, of course I could of just paid the minimums, but use the debt calculator and you can see how much of a bad idea that really is. Moral of the story if you can pay more than the minimums do it, even if it’s 5 bucks more do it. It makes a huge difference in the long run. Remember you’re borrowing money so they have to get a pay off for letting you borrow it, that’s where the interest comes in. Take for example if you have the average interest rate or 12.99% APR and you have a 10k balance, you are going to pay 108.25 in interest. That sucks.

I finally got mine paid off it was a huge relief of course now I have to pay off the student loans. That’s another story all together, I took out way more than I should of, I’ll pay for it. For the next 10 years.

In the mean time heres a quick calculator for your credit card debt it’s still beta so if you start playing with the numbers too much you can have it go into an infinite loop, which is no fun if that happens force quit/end task your browser and start again. I’ll work on the calculator more as I go along, as well has a nifty calculator for student loans and home mortgages since I’m hoping that I can build up my savings and get a house in the next few years.

Note: I’m not an accountant I made this tools for myself, it’s not going to be spot on but it should be pretty damn close.





April 20, 2008

Pictures from Lhasa, Tibet

Filed under: Uncategorized — Tags: , , , , — chuck @ 5:41 am

I took a trip a few years back with my sister. She was living in Hong Kong at the time and I was at her place and she mentioned that she could take some time off and if I could go some place, where would I want to go? Some of the choices that were thrown out there where like Main Land China or New Zeland. Then it hit me…. Tibet.

So a few days later off we went to Tibet. It was a fun trip on the way there we had two layovers so I got to see some parts of Main Land China.

Tibet was beautiful the air smelled fresh all the time, you could get a coke and some M&Ms but there was not a McDonald’s in sight. Where else can you get an 80 degree temperature swing from day to night. It was beautiful but at 10,000+ feet above sea level breathing becomes a problem. Simple task such as walking up two stairs, not two flights but two stairs while carrying some luggage, was a like running a marathon, at the least it was the first night we got there. Eventually things got slightly easier. I did resist the urge to rent an oxygen tank, because they were available, but I didn’t want to hang on to that crutch the whole time I was there, plus what kind of jack ass would I look like walking around with that thing in tow.

The food was wonderful pretty much all meat there was yak. I really enjoyed yak and I figured, outside of coming back to Tibet I probably wouldn’t get that many chances to try yak, so I lived it up. Too bad I’m allergic to yak. Stomach pains constant feeling I’m going to vomit, and all my muscle were sore. For most normal people they might catch on after eating something that does this to them maybe after 2 or 3 times. Not me took me 5 miserable days of just toughing it out.

We saw a bunch of palaces met a bunch of cool people, had lots of rice tea. It was over all a wonderful experience, despite the constant feeling I’m suffocating and the yak meat making me want to vomit, I would do it all over again in a heart beat.

Heres some random pictures from around Lhasa, not that many I’ll post more, but I at least want to say something about each picture rather than just a mass post of all that I have.

April 19, 2008

Star Trek: Voyager Mosaics

Filed under: mosaic, python — Tags: , , , , , , , — chuck @ 5:55 am

Nothing new going algorithm wise here just used the closest color then segmented histograms and then the minimum distance methods to make these. They didn’t turn out as well as I hoped but I started with some crappy source images anyways I’m looking forward to trying more. But even more excited to get some Star Trek: The Next Generation mosaics going. You can never have enough Jean Luc Picard, the man with the most peculiar french accent in existence.


See them all in their Voyager goodness

April 11, 2008

New Algorithm

Filed under: LOST, mosaic — chuck @ 6:39 pm

I sat down read a few papers and came up with a new way to select tiles, nothing crazy first the closest color algorithm is used to find the top find the top 1000 matches then the histograms of the source’s tile image is compared to the tile image to get a number form 0-1 indication the closeness.
The results were actually very encouraging.

Here is a quick sample at 45 tiles per image. I’ll have some lower tile count images later.
The new algorithm looks great except the colors came out a little washed out, this is most likey due to using the grayscale histogram when comparing the images. I chose to that because I was already choosing a group of tile images based off of color so the histogram comparison was mostly comparing the bright and dark spots of the images. Also if you check the new algorithm it suffers from the same effects the closest color image does. Namely the banding that occurs when like images appear next to each other, this can be easily fixed by running the minDistance algorithm on the image.

After that I want to look into other matching algorithms including comparing the images full color histogram instead of using closest color to prescreen the images then use the grayscale histogram to weed those out. Also check out using error diffusion to help select tiles (like when an image’s palette is reduced also referred to as dithering)

I bet ultimatly the best method of selecting tiles is going to be a weight combination of different methods.

Click on the thumbnails see the larger versions


New!

Closest Color

Closest Color +
Mindistance

April 8, 2008

SecurityError: Error #2122: Security sandbox violation: Loader.content: http://somesite.com/something.swf cannot access http://www.somesite.com/plop.gif. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.

Ahhh a sandbox violation if you are stating to pull content from other sites or even pull external content period to your SWF get used to them. They really do suck and at first it is overwhelming when you get them all the time, take it from me though after some time getting your hands dirty with Actionscript these things become a thing of the past.

First up, why do I get these errors?
Easy it’s to protect everyone on out there in the tubes.
These cross domain scripting errors happen because code from one domain is not allowed to modify content from another domain. This is so that say you are browsing your bank’s site doing your normal bank things but at the same time you are also browsing Matt Evilphen’s site. He has some code on there that detects that you are your banking site and transfer all your money to his account, oh no, you’re broke. Well fortunately you cannot do this, oh course there are million other ways to have you bank account drained, this is not one of them.

It’s very strict too. www.charlescfenwick and blog.charlescfenwick.com are not the same and neither is www.charlescfenwick.com:8080

So how does one get around this?
well first off you need a crossdomain.xml file on the server which the remote is being accessed from.

 
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <allow-access-from domain="*" />
</cross-domain-policy>

This is an example of course you’ll probably want to change the * to what ever domain the swf is coming from.

then as usual load your content, but take special note of the LoaderContext class

View CodeACTIONSCRIPT
  // don't forget these
  import flash.system.LoaderContext;
  import flash.net.URLLoader;
  import flash.net.URLRequest;
 
  // create your request to the resource
  var request:URLRequest=new URLRequest("http://www.somesite.com/someresource");
  // create the loader to do the actual load
  var loader:URLLoader=new URLLoader();
  // this is the loader context
  var context:LoaderContext = new LoaderContext();
  // set the check policy flag in the loader context
  context.checkPolicyFlag=true;
 
  // add the handler for when the event completes
  loader.addEventListener(Event.COMPLETE, completeHandler);
 
  // retrieve the resource
  loader.load(request, context);

April 6, 2008

LOST, the pictures.

Filed under: LOST, Programing, mosaic, python — chuck @ 6:40 pm

I gave it a shot and ended up with some ok results there is still a lot that can be done to improve things.

Using just the closest color ends up with ok results but when there are large areas of an almost solid color the results are less than desirable. These can be seen in the closestColor gallery.

To further extend things I created an algorithm that tries to insure that a given image doesn’t appear more than once in a given radius. This seems to work really except when two tile images are fairly close together. These can be seen in the Closest Color + Minimum Distance 16 gallery.

check them out in the links below

Jack Kate sayid
Jack Mosaics Kate Mosaics Sayid Mosaics

Back to making this thing better.

Newer Posts »

Powered by WordPress