Categories
Geeky/Programming

Can you be too Web 2.0?

Can a site be “too much” Web 2.0? I think so, yes.

I am heading out for the airport here shortly, Seattle, WA, then Portland, OR. I want to create an online trip to upload photos, track things, and there are a few Web 2.0 sites out there, TripWiser, TripTie, TripHub, TripMates, Matador. Of all these sites, I didn’t find one that I particularly liked, so I don?t know what I will do yet, but anyways..

TripWiser – Nice look, seems snazzy. Web 2.0’ish, Ajaxy, the whole nine yards. Thing is, I think they are going overboard on the 2.0 stuff. One thing that struck out with me is, their Ajax is slow. Also, on search results, I could never get past the 1st page!! Something with JavaScript/Ajax I assume.

Should sites give you an option for a “Web 1.0” look, that they can promise will work? One other thing I have noticed on sites is, some stuff works in IE, some in FF, and vice versa. If you want to deliver the best solution to the most people, you better make sure it works in both!

Cut back on the Ajax, get it working first, then tweak it, or make an option to turn on the Ajaxiness. Windows Live Hotmail is kind of doing this. Classic View, and New View. Good idea.

Well, I can always track my trip in notepad, and My Pictures folder 🙂

 

Technorati tags: , , , , , , , , , , ,
Categories
Geeky/Programming

GPS Update

Well, If you look at the right side of my blog, I have an update. I have been working all day on getting the GPS stuff to work. I made an app to sync with my Bluetooth GPS, and upload the coordinates in decimal to my website. Then I read it and create a Google Map. There is a lot more to come, but it is pretty good for  2 for 1’s at G Allen’s outside (of course, the GPS works). Check it out!

 

Technorati tags: , ,
Categories
Geeky/Programming Life

T-Mobile Dash + GPS + Mologogo = Debacle

I have my cool new T-Mobile dash, and my Pharos Bluetooth GPS, but I just want more.

Currently I can see where I am on the phone using Windows Live Search Maps,  but I just want more.

I want to be able to post up my coordinates every minute or so, save them or map them or what have you.

Mologogo seems to be the answer to that, but there are always issues. First off, the site can’t seem to stay up for more than 10 minutes at a time. I did some digging and found the IP address, so I added that to my host file

216.127.82.54 www.mologogo.com

Second, the SmartPhone version seems buggy, not feature complete like the other versions, etc. There doesn’t seem to be a place to set up a remote URL feature so I can post up the coordinates to my own server, which is really what I want to do.

Also, I am looking into GPS.Net again. I will play with the trial, #1 because the final version is 250 bucks, and previously I could never get it to work right. Maybe if I get something going I will just use that and forget mologogo.

Hopefully I can get something going here this weekend, I want to be able to track my coordinates as well as take a picture, upload to flickr or some URL and save it with the waypoint. Then I want to create .kml files for Google Earth so I can track where I have been, and photo tag them. Tall order for this weekend , but we will see. I will be on vacation in Seattle/Portland starting middle of next week and I want to track my vacation, like where I go, etc. We will see 🙂

Technorati tags: , , , , , , , , , , ,
Categories
Geeky/Programming

Visual Studio 2005 – C++ Unit Testing – Not so good

So, as of late, I have been programming more in C++ than in C#/.NET. The first order of business was getting everything to Visual Studio 2005, which has been accomplished. In .NET, there is built in Unit Testing, Code Coverage, Refactoring, etc. In Visual Studio C++ unmanaged/native C++, you don’t get any of that. (Thanks Microsoft!) Now, if you code in managed C++, you get all the nice features (I’m pretty sure you get all of them).

What you can do, and there are some articles/blogs on the net, is set up a Unit Testing project in managed C++ and then link in your managed C++ projects. This works. Sometimes. It looks better on paper than when you actually try to implement it, depending on your environment and how you have things laid out.

We are making static MFC (probably the first problem – MFC :)) libs for a Core library, and we had to tweak a bunch of settings (ie: make a new build configuration), just so we could link into the managed C++ projects. There were numerous issue, just too many to list here. Things just don’t work nice together.

When we managed to get things to actually compile, and run, then the code coverage would show all the Microsoft API’s as not covered, since the libs were statically linked in to the test project.

Overall, my experience with Visual Studio 2005 and unit testing has been a good one. As long as you are using VB.NET or C# 🙂 

It is so nice since it is integrated into the IDE, and it can make unit tests for you from existing code. This all would be a god send for C++, yet, there isn’t anything there.

And as long as I am griping about it, intellisense in C++ really isn’t that good. I did some research and found Visual AssistX, and we purchased it. Really is worth the money. Adds refactoring and intellisense on crack compared to the built in intellisense.

Anyways, I will follow up with a few more posts with my experiences on C++ unit testing. I tried a few other frameworks, and actually got CppUnit to work well, so I will blog on the steps I took to make it work.

Just because you develop in C++ doesn’t mean you can’t develop with an Agile mindset, it is just a little bit harder to get started. Unit Testing, Refactoring, Code Coverage, and then Continuous Integration. Hopefully over time I will get some more posts up about these things and how as a C++ developer using Visual Studio 2005 you can accomplish them (or at least the way I did it) 🙂

By no means am I saying I know the best way, but it seems that there isn’t much out there talking about this stuff for a native/unmanaged C++ dev using Microsoft technologies, or maybe I just can’t find it.

Technorati tags: , , , , , , , , , , , , , , ,
Categories
Geeky/Programming

C++ OutputDebugString()

I have programmed in many different languages, and as much as I can remember, one of the best things you can do is write debug ouput to an output window

VB 6.0 – Debug.Print “Debug Output”

.NET – System.Diagnostics.Debug.WriteLine(“Debug Output”);

and recently I have been doing some VC++ programming, and I didn’t know how to output to the output window, so I decided to figure that one out. Came across OutputDebugString();

Now I can stop throwing MessageBox’s all over the place when trying to debug something. What is cool to is that there are utlities that will read the messages from a debug output, like SysInternals Microsoft’s DebugView

One thing that is kind of weird, is that even if you build in Release mode, debug messages still come out. You could and probably should I am guessing wrap then OutputDebugString() in a DEBUG define, or even better IsDebuggerPresent()

Anyways, I’m glad to have taken 2 minutes out of my coding to find this instead of going along thinking there aren’t easier ways. 🙂

Categories
Geeky/Programming

First-chance exception at 0x7c812a5b in : Microsoft C++ exception: CError at memory location

If you are programming and you have some calls to ShellExceute in your code, and you are debugging, you might see this fly across the output window

First-chance exception at 0x7c812a5b in : Microsoft C++ exception: CError at memory location

The app will be your exe name, and location will be a memory location.

You can reproduce this by calling ShellExecute with a url as the file param like so:

ShellExecute(NULL, “open”, “http://www.stevienova.com” , NULL, NULL, SW_SHOWNORMAL);

You should have a path to a file, but what Windows does is look for the http:// or .com and then does a lookup in the registry for the default handler, which more than likely is Internet Explorer, or Firefox, or whatever is your default browser. More info here

INFO: Use ShellExecute to Launch the Default Web Browser KB 224816

I haven’t tried catching the exception, but I can’t figure out a way to get rid of it. It doesn’t seem to hurt anything and actually doesn’t throw up an error. Just an annoying little quirk in Windows and C++.

I did a little digging on Google and didn’t seem to find any more info, so I guess it isn’t a huge deal. Ahh, the mystery of Windows!!!

Categories
Geeky/Programming

ASP.NET C# – Grabbing a posted file and save to disk

Sometimes you want to grab a file posted to a page, maybe an image upload or other file upload

HttpFileCollection logFiles = Request.Files;
string path = System.Configuration.ConfigurationManager.AppSettings[“LogPath”];
if (logFiles.Count > 0)
{
HttpPostedFile logFile = logFiles.Get(0);

logFile.SaveAs(path + System.Guid.NewGuid().ToString() + “.log”);
}

As you can see, I am setting the log path from the config. The reason for this is, the path to save to is absolute, something like c:blahblahwhatever

I am saving the file with a GUID as the file name, for uniqueness, but you can grab the name form the file object as well. There are some other gotchas. 4MB limit on files, unless you tweak the HTTP runtime in the web.config, also, you need to make sure that Network Service or ASPNET user has rights to modify the log folder you are writing too. Otherwise you can impersonate a user in the web.config, and make sure that user has rights.

Categories
Geeky/Programming

C++ – Release Your Buffers

I am in the process of taking some 3rd party c++ source code, and converting it to VS2005. One thing I noticed over and over, is that when you are reading in file contents, you need to make sure to release the buffer, but with the length of the file as the parameter.

For example, this code:

CString myData;

if (file.Open(lpszFilename, CFile::modeRead))
{
DWORD dwLength = file.GetLength();

file.Read(myData.GetBuffer(dwLength), dwLength);
myData.ReleaseBuffer();

file.Close();
}

will throw an assertion when in debug mode

GetData.JPG
to fix, add the dwLength value to your ReleaseBuffer()

myData.ReleaseBuffer(dwLength);

if you run the bad code in release mode, nothing happens, which suprises me, you would think that the runtime would croak, but it doesn’t. Anyways, make sure to release your buffers.

Categories
Geeky/Programming

error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'

If you are updating from VS2003 to VS2005, C++, you might run across an error like this. What it means is that they changes the return types from 2003 to 2005. You just need to change the UINT to an LRESULT and you should be good to go.