Thursday, July 03, 2008

Sharepoint Check-In/Check-Out issues

My most recent project at work involved grabbing a PDF off of a Sharepoint Document Library via it's UNC path, attaching an additional page, saving it to a different location, and then deleting the directory that the original file was located in.

It would always work for me on my dev box and on the 2003 server.... just not for other people...

Turns out that the file was checked out to me in Sharepoint and so I could always delete it if I wanted to, but nobody else could until I checked it in.

I hit my head against a wall for several days over this issue.

Work

I am currently working on for Mid-Columbia Engineering, on contract at Energy Northwest, a nuclear power plant. I have programmed a couple of web apps for them, re-wrote a windows app to make it a web app that everyone can use with a custom back end permissions structure.

Haven't had much time lately to work on my XNA Game, but since I'm gonna be in the country for a while I"m sure I'll find time at some point.

The "nice" part about this job is that I'm finding out all about software that I never want to use, like Oracle and Passport. I can't believe that Oracle does not have a Boolean data field, it blows my mind. It makes me realize how much I love MS SQL.

The Plan

The plan was to go to Tokyo Christian University this fall, after all I was accepted for last year, postponed it a year already, may as well go this year...

Then my wife got pregnant, very high risk one no less. So for the sake of my wife and the baby we are staying here in the US.

Friday, May 25, 2007

Gimp

Most people probably have heard of Gimp, if not I'll fill you in. Gimp is a free Graphics manipulation program that many people, myself included, compare to Photoshop, except of course Gimp is free and open-source.

Well for some reason my install of Gimp got corrupted, well just script-fu but that basically means the entire thing is shot since all the actions are script based, so I went and downloaded a new copy from their site. They have a windows and linux install, which is really nice. When i was on Source Forge downloading it I noticed that there was an option to view the stats about this project. Gimp is downloaded approx 40,000 times Per DAY! That's crazy. But Wow.

Inkscape, a free opne-source vector drawing program which is also really awesome, gets downloaded a measly 5,500 times a day, approx. The currently most active project on Source Forge, which is Azureus a Bit Torrent client, is downloaded, on average, over 70,000 times a DAY!

That is allot of daily downloads, but it just goes to show you that people are using these programs.

Thursday, May 24, 2007

Tiled Map Editor, Written In XNA

So I had been working on my game in XNA for a while when I decided that Tiled, a free open source Tiled Map Editor see: http://www.mapeditor.org/, that I had been using didn't support some of the features I wanted my Map Editor to have. This wasn't surprising since some of the features I wanted were somewhat Game Specific. Though I will tell you now that Tiled is an awesome Tiled Map Editor and by default it outputs saved files as XML. While I didn't copy any code from it when making my Map Editor I did take allot of ideas from the interface, tools, etc... and have to give the creator's allot of credit.

Tiled Map Editor Screen Shot:




The TileSet I am using in this screen shot is the same one that was used in the tutorial on XNA Resources, see: http://www.xnaresources.com/pages.asp?pageid=23. My TiledMap Engine was originally the one from that Tutorial. But I have made so many changes to it since that point that I would be surprised if anything is the same as that Tutorial anymore. I actually have several other tilesets I've built but this one is a nice one for testing since I haven't taken the time to really polish my other tilesets.

As you can see from the screen shot I have a decent interface setup with my pallet on the right side, Layers on the left side, Map right in the middle. Most of the important tools in the toolbar work, right now Lasso Select, Ellipse Select, Tile Picker, Cut/Copy/Paste, and undo/redo don't work yet. But I will start working on them later. Since I have the basic paint tools: Pencil, Eraser, Fill working and the basic selection tools: Magic Wand, and Rectangle Select working I decided to work on saving/loading. I am XML serializing the objects and so far I have quite a few of them capable of being saved.

Right now I am able to export/import TileSets, with the actual tileset texture image embedded in the file. I say embedded but really all I did was create an array of unsigned int's that represents the Texture and then use SetData to load them back into the texture.

My next problem with save/load is that the tiles in the maps are actually references of the tiles in the tilesets, so when I load a map I'll have to re reference all the objects, but when I XML serialize the maps I do know the ID of the tile, from which I can deduce the parent TileSet, so it shouldn't be a big deal.

After that I will need to finish my redesign of Zones and get it so those can save, along with all child maps, and then The World! or I should say my World object which contains a grid of Zones and other settings for the World. Once I can Save/Load, Export/Import all of the objects as a group or individually then I will start working on more features.

Truthfully I am getting tired of having to redo the same steps every time I debug... Click this menu, load that file, do this, do that... now I can finally test it, nope, didn't work, do it all again.

Saturday, May 05, 2007

Complaints About Ajax Control Toolkit: SlideShow

If you are using the Ajax Control Toolkit for ASP.Net you might have noticed that there is an included SlideShow object, see live preview here: http://ajax.asp.net/ajaxtoolkit/SlideShow/SlideShow.aspx

I am currently using this on my website but have run into difficulties that the developers were not able to solve for me on the forums: When you use a SlideShow object you pass in the name of an Asp:Image object to attach to. When the SlideShow shows pictures this is where it will show them. Now here is the issue: If you read the value of the current picture programmatically from the Asp:Image it will not give you the path of the current picture. This information is actually being inserted using Java Script and is not being done in .Net at all! Also, all of the events that you can hook into related to the actual loading/changing of slides for the SlideShow object are all Java based events and there is no built in hooking of them with C#. So if you want to do something in Code based upon the current picture, like in my case add the ability for the user to rate the currently shown picture, you can't do it, or at least not with any ease.

But there is a solution: role your own SlideShow. This is actually incredibly easy to do. Here's what you need:
  • Write a class, static or not, that will return to you a collection of strings in a string array. Each string will be the path to an image to display in our SlideShow.
    • I did this by reading in a list of all *.jpg files in a folder and then for each file adding it's path as a new string in the array. You can use the value of the number of file entries found to set the size of the string array.
  • Create a new CustomControl. Add to it an UpdatePanel, inside the UpdatePanel add a Timer and have it tick every 5000 or so, so 5 second intervals. Also add an Asp:Image.
  • Create a Timer onTick event and a page load event.
  • In the onLoad event load from your class the list of files to display. You will need to create two object level variables: a string array to hold the list and an int to keep track of our position. Store the returned string array in the string array variable and set the int to 0.
  • Now on tick check to see what the current position in the list is. If our int == length of our array then set it to 0 again to start over. Otherwise int++. Finally set the Asp:Image's Image URL property *I think that's what it's called* to the value of string_array[int]. That's all there is to it.
Maybe I'll post the code to this at some point. Note that this assumes you already have ScriptManager on the parent page.

How Microsoft Tells You VB.Net is not for Pro's

So I was helping my brother out with some code he needed for a class project. It was just some basic XML File reading/search/add values/write code... but he needed it in VB.Net... Well I haven't touched VB.Net in over 2 years and had no real desire to do so, but I went ahead and downloaded VB.Net 2005 Express edition and threw the code together.

Onto how Microsoft tells you VB.Net is not for Pro's:
  1. Have you ever tried to create an XML file in VB.Net Express Edition using the Add New Item list? You will have noticed that it is not on the list... Why wouldn't you put XML file as an option? It is in C#. Well C# is for pro's though... I guess.
  2. Splash Screen... They put Splash Screen on the Add New Item list but not XML files! You figure that one out.
  3. We won't go in to personal feelings like: Coding VB.Net makes me feel sick. I mean if you don't turn on Option Strict and Option explicit then you can just use new variables out of the blue and not even think twice. Not to mention that it is not case sensitive, still supports way to much VB 6, which is really not as object oriented as it should be. They really should toss VB 6 Support and Force people to either continue using VB6 or switch totally to VB.Net.
Anyways I got the code worked out fine no problems and I got to relearn some basic VB syntax... not that I need it.

Picasa Google Data API, .Net Version

Google has added a Pages feature to their google groups. One of the pages is a Features Request page. I have added a feature request for a .Net version of the Picasa Data API. PLEASE add yourself as a plus + to this feature so that hopefully we can get it sooner.

Link: http://groups.google.com/group/Google-Picasa-Data-API/web/api-feature-requests

Tuesday, May 01, 2007

Visual Studio SP1: Installing it Again...

So I already installed Visual Studio SP1, I know for a fact I did. How could anyone forget an installation that takes as long as it does, over an hour maybe 2 if I remember correctly.

Well when I installed Visual Studio C# Express Orcas it really messed up my Programming Environment. I did run a repair on C# Express 2005 after removing Orcas and in the end actually totally uninstalled/reinstalled it since it was still acting up... but to no avail. Then I noticed, in my Windows Update window, using Vista so I have my own Windows Update window, that Visual Studio 2005 SP1 was on the updates list... So some how it got removed... or maybe just maimed... Which could explain the very very frequent crashes I'm experiencing with C# Express.

So basically since I'm reinstalling it right now I have time to kill and thought I'd mention it.

Visual Studio Orcas Beta 1: No New Image Library, yet

So recently I started using the included Visual Studio 2005 Image Library. It is really nice and has tons of good toolbar icons, which is what I wanted. I had read on a post on Microsoft's website that there would be even more updated new icons released with Orcas though. So I took the time, and used the space, to download all 8 pieces of the DVD version, extracted it, and installed it. Turns out that if you go to the directory where the Image Library is "C:\Program Files\Microsoft Visual Studio 9.0\Common7\VS2005ImageLibrary" you will notice it's still VS2005.

I literally downloaded the whole 6 or 7 GB DVD of Orcas Beta 1 just for a new Image Library... and then there wasn't one. So I uninstalled Orcas. Maybe when Beta 2 comes out there will be a new Image Library.

Right now it's not that I don't have interest in what Orcas and what .NET 3/3.5 has to offer it's just that I can't use it on my website project, since the hosting provider is .NET 2.0 and I can't use it with XNA, yet. So for now I just wanted a new Image Library... So it goes

Fun With Debugging Tools For Windows

So I've been having troubles with Visual Studio C# Express Edition and decided to try and debug it. Well I think I found the problem and that's not really the point of this post.

As part of the Debugging Tools there is a special tool... Called Kill. Excerpt from the help file to show you just how powerful this tool is:

Terminate forcibly

The following command terminates processes whose names begin with "my*." It does not prompt for confirmation. This command succeeds even when this process is a system service:

kill /f my*

Notice carefully the words "does not prompt for confirmation" and "This Command succeeds even when this process is a system service"!! Well after reading this, and seeing the example... my mind made the obvious next step. 'what happens if i run kill /f *' I couldn't resist the temptation... so I ran it from the command prompt... It blue screened and I'm fairly sure kept right on killing things in the background until it force ably restarted itself. After doing it I was like, "... wow that was awesome" and then got back to work. I was kind of half thinking and kind of half not thinking it wouldn't work. I mean something that kills all processes, including system ones! without prompting... kind of cool. You might be able to run it against a remote computer too, using another tool included with the Debugging Tools for Windows.There really are allot of cool features and things you can do with the tools, including Kernel Debugging on Windows Vista, if you change a setting.

Link: http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx

The Beginning

I thought I would raise this blog from the dead and give it some purpose. I was thinking I needed a blog to post programming stuff on anyways, so I don't clutter up my Tri-Cities AnimeFest blog with unrelated stuff.

I have a game in XNA I am working on, a contracted website I'm building, a Group/Club website I maintain, and various other projects I work on from time to time. So when I work on things my goal is to post what I've learned, post source code, maybe whole projects, screen shots, stuff like that so that people can see it and hopefully find what I'm posting useful in their own endeavors.