Tuesday, October 28, 2014

Xamarin comments

https://news.ycombinator.com/item?id=7954406

Friday, April 13, 2012

Web Service work

Working on Windows .NET Application that retrieves data from a web service.
Pulling data into a List.
Working on drag & drop.
From research, seems like it will work better with data in a list.

Monday, January 18, 2010

CRC CCITT

After failing to find the answer to VFP's SYS(2007) return value for CRC, I did a little more hunting and found there are other algorithms that produce different results. I ended up finding another page from www.sanity-free.org that actually did the trick (http://www.sanity-free.org/133/crc_16_ccitt_in_csharp.html). Using a CRC-16, CCITT Algorithm and passing 0xFFFF as an initial value, it produced the same return value as VFP.

A listing of the code is below:

public class Crc16Ccitt
{
const ushort poly = 4129;
ushort[] table = new ushort[256];
ushort initialValue = 0;

public ushort ComputeChecksum(byte[] bytes)
{
ushort crc = this.initialValue;
for (int i = 0; i <>
{
crc = (ushort)((crc <<>> 8) ^ (0xff & bytes[i]))]);
}
return crc;
}

public byte[] ComputeChecksumBytes(byte[] bytes)
{
ushort crc = ComputeChecksum(bytes);
return new byte[] { (byte)(crc >> 8), (byte)(crc & 0x00ff) };
}

public Crc16Ccitt(InitialCrcValue initialValue)
{
this.initialValue = (ushort)initialValue;
ushort temp, a;
for (int i = 0; i <>
{
temp = 0;
a = (ushort)(i <<>
for (int j = 0; j <>
{
if (((temp ^ a) & 0x8000) != 0)
{
temp = (ushort)((temp <<>
}
else
{
temp <<= 1;
}
a <<= 1;
}
table[i] = temp;
}
}
}
}

Here is the code I wrote to produce the result:


System.Text.ASCIIEncoding encoding=new System.Text.ASCIIEncoding();
byte[] byteKey = encoding.GetBytes(strKey);
Crc16Ccitt crcChecksum = new Crc16Ccitt(InitialCrcValue.NonZero1);
intCheckSumReturn = crcChecksum.ComputeChecksum(byteKey);



Thursday, January 14, 2010

C# Research - CRC16

I'm working on a decryption tool in C# for text that has been encrypted using Visual Foxpro 9.0's SYS(2007) function, which is used for generating CheckSum's. From my research, the use of "Checksum" in this case is not accurate, as it is actually a CRC 16, also known as a 16-bit Cyclical Redundancy Check (see http://fox.wikis.com/wc.dll?Wiki~CRC16)

I am using Ascii Encoding in C# to call a CRC 16 Checksum function that I found online (see http://www.sanity-free.org/134/standard_crc_16_in_csharp.html). I modified the code to return an Integer instead of a ushort. The result for one set of bytes is different than the results from running SYS(2007) in VFP with the same bytes.

The next step is to continue my online research for either someone who has achieved this effort or more breadcrumbs. One thing I am testing is using different Encoding, as I'm not certain ASCII is the proper choice here.

To be fair - I have done little with CRC or Checksum's, even in my VFP days, so this is very much a learning process that started last night.



Thursday, July 30, 2009

WCF Basics

This is so chalked full of good stuff and a great, easy video with absolutely no bugs.


after googling on "windows communication foundation", following a link to http://msdn.microsoft.com/en-us/netframework/aa663324.aspx
and choosing "Beginners Guide"...which brings you to the second link above. "Creating Your First WCF Service" is the top link.

This video was easy to follow, easy to code and will be the basis, I am sure, of many cool things in my programming future!


Monday, January 26, 2009

XNA Research

Hello everyone,

I figured I should go ahead and start a blog for some of the XNA research I am doing. I'm sure there are lots of sites out there that already have all the info I'll blog, but I have had to go to so many different places to figure out how to get started. I was typing out instructions for an XNA beginner and I thought - may as well post it for more people to take advantage of. So here it is. As I learn new XNA things, I'll just keep blogging here. And anyone else who wants to chime in, please...feel free.
---


Getting Started
First - the software that you would use to create the games is FREE, which is sweet!
You will need to load two different things - Visual C# 2008 Express and XNA Game Studio 3.0.
You can get those at the following links:
Visual C# 2008 Express: http://www.microsoft.com/express/download/#webInstall
Click on the Download button inside the green box, run and install.

After downloading C# to one system, I actually went ahead and downloaded the entire Visual Studio Express editions Offline Install (at the bottom of the page). This gave me an ISO image file that I was able to burn to a DVD. Now I can load it as many times as I wish without the internet.

Back to the software....
If you know some VB syntax and want to use that, you can, but we'll be on different languages because I use C#. C# is a newer language that combines some of the best of VB and C++. I would recommend C# if you are new to programming.

Game Studio 3.0: http://www.microsoft.com/downloads/details.aspx?familyid=7d70d6ed-1edd-4852-9883-9a33c0ad8fee&displaylang=en

Click on the Download button at the top, run and install.
Once you have both of these running, you can launch Visual C# and create XNA GS (Game Studio) 3.0 games.

One web site that was very helpful and is the entry point for XNA programming is XNA Creators Club Online. http://creators.xna.com/en-US

You can create a login if you like, but many things you can explore without it.
Something to note...even though the software above is free, if you want to create games and play them on your XBOX, you'll have to buy a Creator's Club (CC) membership. I bought mine while logged in on the XBOX, but I'm sure you can purchase it on the CC web site as well. They have it for 4-mos. and 1-year. It's like $50 and $100 respectively. But...you do NOT need that in order to play and program on the PC. In fact, you can create multi-player games on the PC and play with a friend (only locally - not across the internet) for free as well. We can get into that later if you can not figure it out.

There are several tricks to learn - but I have tested it and it works. I also bought a CC Online account for $50 and have ported games written on the PC to the XBOX. Once ported, they stay on the XBOX without a PC connection. Another cool thing -- if you come up with a game you can post it online at CC. If it is approved, you can list it for sale and make $$. Nice!

Current Project
One of the programs I am currently researching is Net Rumble.
This game is a Starter Kit from the CC website that you can get for free.
Here is a link to the main page with some overview:
http://creators.xna.com/en-US/starterkit/netrumble

Follow either of these links to get the Net Rumble starter kit download.
Windows GS 3.0: http://creators.xna.com/downloads/?id=216
XBOX GS 3.0: http://creators.xna.com/downloads/?id=217
You can play single or multi-player. I have had it running on 3 PC's simultaneously, but have not loaded it on the XBOX yet. I have also played with some of the class libraries and made some adjustments to shield power, ship speed, mines, lasers -- pretty simple - but look out!
I set the ships shields so high and the laser power so high that I blew myself and my buddy's spaceship out of the boundary! Pretty neat though. I think we'll have to start with a new project though!

Once you have the starter kit installed, you can then create a new project in Visual Studio for Net Rumble. Incidentlally, I have only downloaded the Windows version - I am putting off XBOX programming until I understand more game concepts. There is a lot to learn and a lot of code to review, but it covers most of the basic 2-D code. And on that note - save yourself the CC Membership until you can start to write games - the XBOX code does work - but you'll start paying for membership and the clock starts ticking. If you are still in "research" mode, you're wasting your money! I suggest waiting until you are ready to start doing some serious programming.

Previous experiments
Creator's Club starter kits I have downloaded and experimented with:
Ship Game (Premium - you'll have to have a CC account for this). Very cool 3-D Starter Kit. I've played this on the XBOX as well. I have a lot of research to do on this - and I wouldn't start here if I were you. Much harder to understand 3-D over 2-D.

Space War - another 2-D ship game -- didn't spend much time on this.

Network Game State Management -- http://creators.xna.com/en-US/sample/network_game_state_mgt_sample

This is where I learned about the GUID issue. It's just a basic lobby/session connection project to learn the code for how to connect multi-player.

The first site I actually started on for XNA was XNA Resources.
http://www.xnaresources.com/

There is a tutorial called Star Defense inside the Tutorials tab http://www.xnaresources.com/pages.asp?pageid=8

This takes you through writing code from scratch in 12 parts.
I learned a lot starting here for how to setup the project, connect to the XBOX, create a CC account, as well as learning some of the fundamental game design of 2-D games.
However, once porting to the XBOX, I was a little disappointed. I think some of the game play isn't quite right - there are some kinks to work out with timing and lag.
But overall it was a great project to learn from!

Gotcha's/Lessons Learned
> Trying to connect two PC's to run a multi-player game: To do this, you'll have to make sure the GUID inside the AssemblyInfo.cs file (for the Net Rumble project...and probably any standard Windows 3.0 game you start).
If these are not the same, when one system creates a session and another system tries to join a session, the second system will not see the first system's session.
This is because with different GUID's, the games are technically "different" and are not aware of each other.

> Windows Live: So I guess since I had only played on XBOX Live before I started into the XNA world, I didn't realize there was such a thing as Games for Windows Live.
This can be used on the PC for creating local profiles or logging into your XBOX Live account and playing across the internet.
One thing to note - you will have to have TWO CC account to play across the internet with the PC or the XBOX while you are still developing.

Friday, December 19, 2008

Introduction

December 19, 2008

In an effort to learn ASP.NET, I started placing many of my business functions that I used to perform using Excel into an internal website. Soon...that turned into doing all of the work on my business external website. After many years and changing technologies, I think I am getting close to my goals - but there is always more to learn! And when Microsoft and MSDN fail me (or confuse me) - which they usual do - I lean heavily on the input of the web community. So now I hope to share a little of my effort. Whenever I figure out something cool - I'll just make a post and if anyone wants to comment, I'd love to hear what my fellow coding colleagues have to say.