Programming

Programming

Dictionaries, Reflection, Private Fields, and Me...

Hello. So the other day at work I was confronted with a problem.  A particular class we use extensively throughout an enterprise solution was using OO to hide a Dictionary<string, object> from me...BUT ALL FOR NAUGHT! Said class has a private field which is basically a Dictionary<string, object> instance.  You could add to it just fine via a public method created for that very purpose.  But as is typical with any ongoing large project, we suddenly needed the ability to remove from that field by a given key just for unit testing, and the powers that be frowned...

MongoDB and Me…

Quick post here as a reference both for you and me. I’ve been doing a lot of with lately with PHP and MongoDB using a VirtualBox build for development.  A big PITA is when, say, the power goes out or Windows restarts computer at night from automatic updates.  My Ubuntu image reboots just fine after, rarely having to do an inode check.  But often the MongoDB daemon does not start after.  It starts often enough to where I don’t think to verify the service is running after a reboot, so I will go in to do some PHP work...

jQuery, Ajax, onload, and Me...

Greetings... So, lemme describe a little pickle that I am sure is not new in the web development world. Problem: I inherit an ASP.NET MVC web application at work.  That, in itself, is always a problem.  However, the application does the following: Main view is loaded. User makes a selection. A partial view (we’ll call it PV #1) is loaded onto right side via async Ajax call. PV #1 displays existing items previously created by a user.  PV #1 contains two “versions” of said...

Programming the Atari 2600, and Me - Part 7

The last post promised a discussion of collision detection.  Well, actually the last Atari-based post was regarding a portable Windows solution for 2600 development.  The Atari-centric post before that was a script for setting up a Linux-based 2600 development environment.  But before that, I'd promised collision detection, and now, here 'tis... Collisions on the 2600 are extremely simple to conceptualize as well as handle.  A collision occurs when one object is drawn over another.  More specifically, when two objects have bits enabled on the same "pixel", you have a collision.  This distinction is important to make, actually, as two...

Portable Atari 2600 Development, and Me...

Greetings. So, I use PortableApps on an external hard drive formatted with TrueCrypt.  It’s a tasty, secure setup.  As with any of my computers, I try to do a re-install maybe 2 – 3 times a year to keep things fresh-n-tasty.  Whenever I do this with this external drive, I inevitably go through an initial PortableApps frenzy, installing / creating a bunch of apps on my menu I end up never using.  This time, however, there is an exception… Ladies and gentlemen, I present: the Portable Atari Programming System (with Machine Emulator and Archived References) (md5).  Or if...

Programming the Atari 2600 and Me – Linux IDE

Greetings! I’ve seen some activity on AtariAge re: wanting a Linux IDE.  I’ve scripted the setup for my first post to work currently under Ubuntu.  You can get the script here. Run the script as follows: sudo scriptname $USER The script will install / download everything you need and create a Dasm directory in your home's root (i.e. /home/Paco) Please let me know if you have any problems with it, and I’ll fix it ASAP. ~ZagNut atari,2600,programming,linux,ide,scite,stella,dasm

Google Maps and Me...

Greetings. I’ve been messing around with the Google Maps API v.3 for a client of mine.  I figure I would share my initial findings: The “app” is ASP.NET 3.5, but really it’s a bunch of auto-generated JavaScript.  The big map layout has a good 100+ markers placed designating various Acme Distribution Centers (I had just watched some Looney Tunes…).  When you select a state from the dropdown, the map will center and zoom in on that state, and the Acme Distribution Centers for that state will be listed on the right (actually the google.maps.Geocoder JSON result...

Programming the Atari 2600, and Me - Part 5

So, the last post was pretty long, running through basic kernels practically line-by-line to see how the 6507 instructs the TIA to do great things with our TV.  The remainder of our posts really, then, have to do simply with performing various functions on the 2600.  How do I show a sprite?  How do I position it on the screen?  Sounds, collisions, etc...This post, however, will be one last smackdown on the relationship between our machine cycles and the TV rastering.  This time, we're getting into cycle counting and troubleshooting our assembly code. If you've been farting around...

Programming the Atari 2600, and Me - Part 3

In our previous post in this series, we went over the environment within which our 2600 game must live.  It is a harsh, barren environment by today’s standards, which makes this all the more bitchin’.  Anyway, let’s take a quick look at what we’ve covered: Our game will be running through a 1.19Mhz 6507 CPU.  This CPU can direct commands to a custom Atari chip – the Television Interface Adapter (TIA) – which we use for updating the display, receiving collision notifications, and initiating audio.  The TIA, indeed the entire system, is clocked so that it is in sync...

Programming the Atari 2600, and Me - Part 2

Greetings. Now that we have an IDE set up for creating our 2600 game, we need to know what we’re actually having to program.  Here’s a breakdown of (what I’ve garnered is) the core of the Atari 2600 architecture: We have a game cartridge [A], our program ROM.  We have [B], a MOS 6532 RAM / IO/ Timer (RIOT) chip.  [C] is a MOS 6507 microprocessor, practically identical to the 6502 of fame.  Last we have [D], a custom Television Integrated Adapter (TIA) chip designed specifically for the machine. The links above will give...

Linq, the Postage Stamp problem, and Me...

I had at one point been farting around with algorithms to "solve" efficiently a problem where, given a dartboard with R regions of values V0, V1, ... VR, find the set of regions with the greatest minimum sum you cannot get with N darts.  This is basically the Postage Stamp problem (see also the Coin and Knapsack problems). One of the solutions I was working on used some Linq.  A central component to the solution was to find that least sum.  So I used Linq to find all “throwable” sums (say set ST), then compare that...

Programming the Atari 2600, and Me - Part 1

UPDATE: Linux-based version of this solution is here Greetings… I have always had an urge to test my programming patience against the Atari 2600, but to start, always lacked the game idea.  I have a two year old and 6 month old, and recently in my lack of sleep, had a revelation for the lamest game ever.  I have since not been able to stop my attempt to realize this game. This series will be for aspiring Atari 2600 programmers.  I know there are many, many of you out there.  Perhaps seeking fame, perhaps fortune.  Either one won’t be...

JSON.NET, Linq, Extension Methods, and Me...

Greetings! Been long time no post!  A two-year-old + three-month-old = time bye bye.  Whatever… I have been doing a lot of web work lately.  One library that has been retardedly fantastic is JSON.NET for all your JSON needs.  If you have love for JSON, you must use this library, because it’s plain tasty. I found myself needing a quick and dirty JSON diff tool, so I threw down this extension method: static public JObject JsonDiff(this JObject jobj1, JObject jobj2) {     return new JObject(         (from p1...

Conway's Game of Life, Pong, Screensavers, and Me...

Greetings, all: Due to the massive increase in my blog traffic (I think I het around 20 / week or so) after I initially offered up my Game of Life screensaver, I now offer, in celebration of the new year, GoLPong! That's right, for 2009 you now can have a fancy new Game of Life screensaver.  BUT THIS ONE'S PACKED WITH NEW FEATURES!  Well, what are they? Game of Life does both trails and no trails Flickers between trails and non-trails Pong played...

C++, Conway's Game of Life, and Me...

NOTE as of 5.03.08Update to code. It actually works now. (what do you expect in 30 minutes)NOTE as of 06.23.08C++ source is now available through this pageNOTE as of 01.13.2009ALL NEW C++ Game of Life screensaver, with PONG! Get it (and source) here!Ok, just trying to get back into C/C++ for work and decided to quick write Conway's Game of Life. I have named it thusly YAGOL (Yet Another Game Of Life). I so hate C/C++ Win32 programming after working in C#. Been working on it for a few days and nights and had...

«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910