Categories
Geeky/Programming Ramblings

Why is MFC Not Dead?

I was reading through some blogs this morning, and ran across this one, from my MSDN Feed.

Here is my answer (I wanted to leave a comment, but it wasn’t working, and I figured it would be a good blog post anyways)

Right now you can make an MFC app and it can run on win98,2k,xp,vista, etc – out of the box. Anything with .NET requires the framework, and if you want your app to just be downloaded and ran, then the framework limitation hurts you. Why make someone download and install a d 20+ MB framework?

I wish there was a way to deploy .net apps without the framework, maybe with just assemblies the apps needs.

But like I said, companies want apps to run on as many clients as possible, which just isn’t a reality with .NET, but it is with MFC.

I really think Microsoft is clueless on why people use MFC and not .NET or even an Web App. Finally, MSFT is starting to use .NET in their client apps here and there (WLW, SSMS, Zune, etc, etc)

Once all apps written by Microsoft use some form of .NET, and Windows 98, 2000, and XP are gone for good (or at such small % of market share they don’t matter, say < 1%), then we can actually write .NET client applications (and have to target the version of .NET on Vista, since that is the lowest common denominator) – OR… MSFT could push .NET as a critical update to XP and wipe the % of .NET installed down to a low enough number to make it feasible to create .NET client apps and get a good chunk of the market share..

There are always going to be people that use MFC for whatever reason, but ease of use is certianly not one of them. A small example is, in .NET, I can create an app that displays a toast message, has a systray icon, connects to FTP, handles web services, and much much more, in very little time, and with a small number of lines of code, whereas in MFC, doing those things is a huge undertaking, 1000's of lines of code, and even then some of it is very "hackish". Yes, doable, but not very easily.

Another argument could be as well, that if your app is good enough, people will download it and install the framework if they don't have it, and I think that is a very good argument (except windows 98 is out of luck – can't install .NET) – I think this last argument is the best – if people want it, and it is an awesome app, they will install whatever to get it to run.

Anyways, I am rambling.. probably could keep talking on this topic for another 100 paragraphs or so. 🙂

Categories
Geeky/Programming

Mac OSX 10.5 Leopard – Enable Root Access

Ok, maybe I am a real newb on Mac OSX, but I didn’t know this one. Took me some fooling around in the OS to get it working. A little background. I am getting into some iPhone development. I want to dig into the Native app dev, and using SDK.

Using the Native app stuff, I wanted to make some directories in /usr/local/ , but was getting permission denied errors.. ok.., its UNIX, lets SU… but what is the root password? hmmm..

Figured this out.. go to Application->Utilities->Directory Utility

Once that is open, go to the Edit menu, Enable Root User. You can then set a password up.

Now back in terminal, run “su” and you can put in the root password you just set up, now you have rights!

Categories
Geeky/Programming

HowTo: Hack Your PS3: Installing Yellow Dog Linux 6.0, and Actually Getting It To Work!

So, a couple of weeks ago, I bought a PS3, for the Blu-Ray disc capabilities. Since HD-DVD has died and I can get Blu-Ray discs through Netflix, and since the PS3 can be updated with new features, I figured I would give it a try. (The 100 dollar EB games credit I had made the decision easier as well)

After playing around with the PS3 (I bought one game disc ; Uncharted, Drakes Adventures, and one Online game; Pain) I figured it would be good to hack around and install Linux on it. With the PS3, Sony makes it really easy to install Linux.

linux_on_ps3

I decided to go with Yellow Dog Linux (YDL), version 6.0 (the latest). Other distros will work, but this is the main one they support – you can download it here – http://www.terrasoftsolutions.com/support/downloads/

After getting the 3.7 GB file, which took forever, I burnt the ISO to DVD using Active@ ISO-Burner (a sweet ISO burner BTW). Ok, all set to install. A few things to consider

1) You need a USB keyboard and mouse

2) You need a HDTV for this to work

In the PS3, go to settings, system settings, and then format utility. You can format a 10 GB partition for “Other OS”.  Restart the PS3

Then put in the Linux DVD, go back to settings, system settings, Install Other OS. YDL said /ps3/otheros/otheros.bld  … so, hit start. Then it will tell you how to get to the other OS.

Go then to “Default System” menu and choose Other OS, and then restart..

It should restart into Linux. It will be at a prompt, “kboot:” – hit enter, it should get into setup, you can follow the onscreen instructions from there. Everything is pretty much default and hitting yes to any prompts, a basic install. You set up a root password, etc. Reboot after it is done, it will go through some final setup steps (checking sound, etc), after that, you should be able to login.

Logging in, first thing I wanted to do was get networking set up. I am not using the wired connection, rather I am using wireless, with WPA. Here is where the fun starts, and why I hate Linux.

YDL doesn’t support WPA out of the box, isn’t that awesome? The wifi was there in network config, etc, and I could put in settings, but it would never connect. I do love the error it gives you as well… “Check Cable?” umm… well, I would but Linux, remember we are configuring a Wi-Fi Connection? No Cable?

Anyway’s.. debacle time.. found this after some searching – http://dachaac.blogspot.com/2007/08/guide-to-get-wpa-psk-working-on-ps3-ydl.html

This works… I just connected to a “linksys” for 2 seconds to download the RPM (or you can just put it on a flash drive as well), and then disconnected. Going through that tutorial though,there was one thing I was getting hung up on. The networking commands were not working for me. I was logged in a regular user, so I tried “su” to switch to root. Still no dice. I had to logout, and login as root, and run through that tutorial (unpacking the RPM with –force works with “su”).

Awesome, my networking is working and I am using WPA… yesssss! Now, just check a few things, email, reader, Facebook, cool. How about YouTube… wait… no flash. Check Adobe’s site.. no flash for PPC architecture.. WTF? So no flash at this point…which stinks..

Whew, all the Linux hacking is making me thirsty.. ok, lets boot back to the PS3 OS…wait.. how?

After doing some more digging, there should be a command “boot-game-os” you can run from the terminal and it should reboot. Wait, trying to run that command, it says “command not found”… another WTF…

After some more digging, it turns out the command resides in the “/sbin” directory, which users don’t have access to… (even root? man…)

So we need to make a sym-link. You can do this as a regular user, but you need to “su”, then run

cd /bin

ln -s /sbin/boot-game-os boot-game-os

Then, you can just go to the “start” menu in TDL, and there is an option then to “Boot Game OS” – works like a charm, reboot and you are back to the PS3

Categories
Geeky/Programming

iPhone: Firmware 1.1.4 – Mobile Safari – Login/Password won't save – Cookie Permission Issue

When I first picked up my iPhone, I unlocked/jailbroke using SSH (yikes!), and then after a few firmware updates and revirginzings, there were tools. I have been using Independence (on my Mac) lately, and then getting Installer.app on there over SSH, and then unlocking, etc from there.

With 1.1.4 I decided to try the new kid on the block, Ziphone. It worked, flashed, activated, jailbroke, unlocked. Now with the new Pwnage Tool that was released today, I will probably use that from now on, but looking back to the first firmware OTB to now, I have probably used 5 different methods, all resulting in the same thing, and unlocked iPhone.

Now, I after putting 1.1.4 on, I noticed my cookies weren’t working. Or in other words, logins/passwords weren’t saving in Mobile Safari. Basically, I had to put in my Facebook, Google Reader, etc login/password every time I hit the site – which really sucks.

My first guess is.. Cookie folder can’t be written to for some reason. I did some research, and yes, people with 1.1.4 unlocked or not are having this issue. Seems like a random issue with 1.1.4 on all iPhones.

Well, you can wait for the next firmware from Apple, try downgrading back to 1.1.3 (no way!) or , just fix it yourself.

What you need to do is either set the owner on the Cookies folders to “mobile” instead of “root”,

chown mobile /var/mobile/Library/Cookies/
chown mobile /var/mobile/Library/Cookies/Cookies.plist

or you need to allow write/modify access to the Cookies to all users.

chmod 777 /var/mobile/Library/Cookies
chmod 666 /var/mobile/Library/Cookies/Cookies.plist

 

What I did was change the owner to “mobile”. Your phone must be jailbroken, and have SSH installed. You can use Putty to SSH to your phone and do the fix. Here is the screencast:

You can tell that it works if you the go to a site, like Facebook, login, then in the Cookies directory on your phone, do a

ls -lat

you can see the last modified time and it should be updated to the time you just logged into your site.

Headache… resolved!

Categories
Geeky/Programming

Updated to Leopard

Yesterday I picked up Apple’s latest OS, Leopard OS X 10.5. What is really cool is the boot camp feature. I am now dual booting Windows Vista and OSX on my little 13 inch MacBook. If I had the cash I would have gotten a MacBook pro, but it is just so expensive. I have 37 GB partitions for each OS, so not huge, but it works.

I do have a USB hard drive (250) that I use for OSX, and then I have one for Windows, so it is all good. Installing OSX was easy, few clicks, done. Did the updates, etc. Then ran Boot Camp assistant, rebooted, installed Vista, put in OSX DVD, installed the rest of the drivers needed, and then did the Windows updates.

Pretty slick setup. I might get some more RAM for this laptop, since it only has 1 GB, but it is performing OK.

I don’t think I will ever buy any new laptop that isn’t a MacBook (preferably a MacBook Pro). There just isn’t any other way to go IMHO.

Categories
Geeky/Programming

Google Maps Street View comes to Madison!

image

Although, not as exciting as my street view in Portland, I live way back in the apartments in the back. No street passes by it. Although this is pretty cool. Good way to find your way around, or at least not get lost. But remember, Google Maps gets you lost!

Categories
Geeky/Programming Ramblings

Windows Live Writer – API Open (not really) – I Want To Download Existing Posts

So, I am sitting here scratching my head again. I use Windows Live Writer (WLW) to post to my blog. I like it, it rocks. There is a plugin architecture, which is cool, and some other API’s for doing things.

WLW saves drafts and posted posts as .wpost files to a directory in your My Documents. The files are in a proprietary binary format. It is cool though as all your posts are saved and you can open existing ones, edit, and republish easily.

I want to go through my posts and add WordPress tags. Not technorati tags, but WordPress tags, so I can have a cool little tag cloud. WP 2.5 support WLW tags by default, WP 2.3 (which I am running) can get tags from WLW through a little REG hack which I have applied and it works for new posts.

What I want to do, is update all my historical posts through WLW instead of WordPress web interface.

Since I have reformatted, changed computers, started blogging before WLW came about, of course I don’t have all my posts on this machine. So I thought, why not download them from my blog and create .wpost files so I have them?

First I looked for a plugin, no dice, doesn’t even seem that anyone has wanted to do this. I searched forums, blogs, Google, whatever. Found little info.

Next I dug into the API, nothing there that would really help me. What I would do is just access my posts through the XML-RPC interface WordPress has and create new .wpost files in my directory, you wouldn’t think it would be that tough..but it is.

It would be nice if the .wpost file was open and had a documented spec, that way I could do it easy as 1,2,3. Even if there was some API with WLW to create new posts and save them (you can create new posts, but only by programmatically opening WLW).

Well, I guess I will keep my eyes open for anything that comes along that will make this possible, until then, it is using the WP web interface. I suppose I could write an app to just directly edit the post tags through the XML-RPC API, and save them, but I want them on my machine as well. Just another good backup I suppose.

Categories
Geeky/Programming

Salon Transcripts (STX) – Using Remotely – Opening Ports, Port Forwarding

A little background: Salon Transcripts (STX) is a Salon Management program for Mac’s. It is used by salon’s all over the country, small and large shops. The site they have is basically for sales. Tech support is 18 dollars per call/email, etc. They don’t have much for documentation, much less connecting remotely. I was tasked with getting it working remotely.

My first step was get remote access to a machine inside the network. For this I did 4 things.

1) Install DynDNS client for Mac

DynDNS (Dynamic DNS) allows you to create a faux domain name for an IP behind a NAT, and the little client will update DynDNS service so it is always up to date. Basically make a dynamic IP static. I installed this on a computer at the salon that is always on.

2) Install Vine VNC Server for Mac

Vine is a VNC server, I installed this on the same computer as the DynDNS client on the internal network

3) Install Chicken of the VNC for Mac

On the client computer (laptop) I installed Chicken of the VNC (love the name). Read somewhere this was the best VNC client for Mac, so I went with it.

4) Port Forward Port 5900 on the AirPort Express to the Machine Internally

Using the app in the Utilities folder on the Mac internally, AirPort Utility, I forwarded port 5900 (vnc port) to the computer with Vine and DynDNS

So far so good. I could then connect to the server on the internal network, change any settings, open more ports, etc. I could just use STX on the server machine, but it was really slow over VNC. Initially I was going to just have them use VNC and then FolderShare or email PDF reports back to the laptop so they could print them remotely, but just to slow.

I decided to get STX on the laptop to connect remotely over the Internet to the server on the internal network. Since there is NO documentation on this, I had to do some digging. First, what ports does STX use, and what is the STX server IP internally? Getting the IP is trivial, there is a setting in STX->Preferences->System where you can set the IP, so I had that. Finding out the ports, I fired up Terminal on the server, and ran

netstat -na | grep ESTA

To see what connections were established

stx_netstat

As you can see there are 3 ports that were going the server (the server was 10.0.1.100) – 9090, 4000 and 20260. These are the 3 ports you need to open up on a router and use port forwarding to the server to connect STX remotely.

Once again, the ports to use Salon Transcripts (STX) remotely are:

Port 9090
Port 4000
Port 20260

Those 3 tidbits would have saved me some time 🙂

After port forwarding those to the server, I tried connecting the laptop client over the net to my DynDNS host and it worked!

One thing I noticed though is running reports is VERY SLOW over the Internet, almost locks up STX.

Categories
Blogging Geeky/Programming

WordPress on IIS 6.0, Windows 2003 – Some Tweaks (URL Rewrite and SMTP)

OK so I lied. Everything wasn’t working after I set up my WordPress blog on IIS 6.0 on Windows 2003. Two things were broke: SMTP (email from the blog) and URL Rewrites/Permalinks.

SMTP worked through IIS just fine, I could telnet and send email out, but from WordPress, it was getting a 501 error. From what I could tell, it was the way that WordPress was formatting the outgoing “mail from” with <From Name>from@address.com . IIS was bombing on the <> in the string (I am pretty sure). I tried some tweaking on WordPress, some plugins for SMTP, couldn’t get them to work. I tried MailEnable, I couldn’t get that to work either. I did fine hMailServer and that does work after configuring it. Like IIS, I have it just set to local, and port 25 is blocked anyway so outside relays won’t work.

The other thing that wasn’t working was my permalinks. By default WordPress doesn’t use permalinks with a rewrite, it just uses ?p=<post id>, but I have mine changed to year/month/day/title. In Linux/Apache, there is mod_rewrite for rewriting URLs, but in IIS 6.0 there isn’t anything (IIS 7 has more functionality). I could have gotten a rewrite DLL and wrote rules, but I found a sweet plugin that does it for me, especially for WordPress permalinks – http://www.binaryfortress.com/wordpress-url-rewrite/

Other than that, everything seems to be working fine. On other news, I have been looking into other blogging engines, comparing/contrasting, etc. Not sure where I will go with that though.

Categories
Business Intelligence Geeky/Programming SQLServerPedia Syndication

SQL 2005, SSAS 2005: Using ascmd.exe To Create SQLAgent Jobs That Give You Completion Status

In SQL2005, you can create SQL Agent jobs. They can be scheduled, have multiple steps, alert, notify, etc. Pretty great setup. There are some downfalls though.

Like in order to call a job from a job, you need to execute the second job with T-SQL. Thing is, it doesn’t run synchronously. It runs asynchronously, which really stinks if you want to wait to see if the second job completes successfully or what not.

Another thing, if you call an XMLA script from a SQL Agent job, if the XMLA query or command fails, the SQL Agent job still reports success – that’s no good! What can you do? Use ascmd.exe!

ascmd.exe is a utility that you actually have to download the SQL Samples from CodePlex (http://www.codeplex.com/SqlServerSamples/Release/ProjectReleases.aspx?ReleaseId=4000) and then build the ascmd solution, to get ascmd.exe A few notes. The samples are VS2005, and I don’t have that installed ,so I had to open with VS2008, then it is digitally signed, and when building couldn’t find the .snk file to sign it, so I turned that off as well, after I had it built, I did some testing locally and made sure it would work as I wanted it to.

You can test by just calling it from the cmd line, for example:

ascmd.exe -S SSASServerName -d SSASDatabaseName -i MyXMLA.xmla

you can use -Q and try to pass in XMLA, but then you have to handle all the special characters and what not, which is a pain. Now, if you just put this on your C drive, (or wherever), then create a SQL Agent Job to call this command, it will fail the job if the ascmd.exe reports back failure. Exactly what we want!!

You will notice in the SQL Agent job setup that you can specify the value for a failed command  – 0 is the default and that is what we want.

Now, get some XMLA that you know works, set it up in the xmla file and test it, the job should succeed. Now just change something in the xmla (like CubeId) to some fake value and test it, the job should fail, and you can have it alert your DBA’s or whoever.

Pretty sweet, but I wish SQL Agent would handle failed XMLA like a failed query and report failure, I am not sure if in SQL 2008 it does that or not, but it would make life a lot easier. Otherwise you could be scratching your head trying to find where stuff is failing, looking in logs, etc, but not seeing any failures. The only way you would be able to tell is to run the XMLA manually, ugh 🙂