Thursday, September 18, 2008

Leopard and SBS 2003 Still Don't Play Nice

For the most part, my life after the "switch" to the Macintosh has been great. No more antivirus software. No more fear of viewing an HTML email. No more long boot-ups and sluggish performance.

One constant point of misery remains, however...

As a .NET developer, I must continue to use a Microsoft SBS 2003 server to get my job done. Alas, the Mac and the Windows Server don't like each other. Shocking, I know.

The simple act of copying a file from my Mac to a shared folder on the Windows Server is like playing Russian Roulette. Sometimes it works. Sometimes the file never copies, we end up with a zero byte file in the folder, then the server crashes. Kaboom!

This has been going on for 9 months now. I have all the latest patches from Apple and Microsoft. I've followed all the online guides. I have scoured the web for any tip, trick or kludge to work around it -- no luck. Grrrrr.

  • It's an Apple problem, because real Windows PCs can work on the file share for weeks on end and NEVER have this problem.
  • It's a Microsoft problem, because regardless of what the Mac does it should NEVER crash the server.
  • It's my problem, because I'm stuck in the middle, rebooting and trying again and again like a deranged circus monkey.

Hope springs eternal. Microsoft has recently release Windows SBS 2008, and Apple will release Snow Leopard this winter. Maybe then I can truly achieve OS harmony. Until then....

...can anyone help?


PS: Windows Guy: Please spare the "Get rid of the Mac" comments. Mac Guy: Please spare the "Get rid of Windows" comments. Linux Guy: No one cares. Thanks!

Wednesday, July 2, 2008

Sam & Max are coming to the Wii

The big news yesterday was that we finally made the jump to HD in the PixelFlop household. A new Pioneer 50" Plasma TV was delivered in the early afternoon, and the wife came home from Target with a Nintendo Wii shortly after. It was like Christmas in July.

Today, that Christmas just got even better.

IGN just released news that Sam & Max, Freelance Detectives are coming to the Wii.

What a fantastic idea. Point and Click adventures like Sam & Max, Curse of Monkey Island and Day of the Tentacle are amongst my favorite types of games. They've fallen out of favor in the high paced, shoot shoot shoot world of console gaming that dominates this decade, but for my money, they top the list when it comes to enjoyment.

I hope this little experiment proves successful, and we see a Renaissance of adventure gaming on the Wii.

Monday, June 16, 2008

My Visions Are Coming True

OK, so I may not be Nostradamus, but in the past few weeks a few of my rants about things I want have come to pass...

Earth to HBO, Get With The Times! / March 28, 2008

HBO has started selling some of their shows an iTunes. We're still a long way from getting new episodes of Entourage within a day or two of when they air. They only have six titles for sale, none are still on the air, and not all the episodes are available, but it's a start...

Better Exchange Support Coming to Apple Mail? / March 8, 2008

This one wasn't hard to predict, but sure enough, Apple has announced that full Exchange support will be part of the next version of Mac OSX, code named Snow Leopard. This means that Apple Mail will potentially be on equal footing with Outlook when it comes to interacting with Exchange Server.

I'm sure the nay-sayers will still come up with a reason to protest, but in my mind, this knocks down one of the final barriers keeping the Mac out of mainstream business. Couple this with the push-back Microsoft is getting on Vista, and I expect Apple's market share to grow substantially in the next 3 years.

I guess it's time for me to start the speculation machine up again. I need to keep ahead reality!

Hmmmm. Let's see...... Ah, I've got one:

I predict that I will win the lottery this week.

Here's to hoping...

Tuesday, June 3, 2008

List ALL Stored Procedures in an SQL Server Database

Today I ran into a unique problem. I needed to reassign the permissions on a bunch of Stored Procedures in an SQL Server database. What a joyless task.

Now, I could do this by hand. Just open up Microsoft SQL Server Management Studio, right click on the Stored Procedure, and assign the permissions. In my case, however, I had hundreds of Stored Procedures to change. Doing this one by one would make me want to claw my eyes out.

The solution is to use some hidden system tables to get the list for me.

SELECT [name]
FROM sys.sysobjects
WHERE (type = 'P')

This gives me the list I want, but I can do a bit better:

SELECT 'GRANT EXECUTE ON OBJECT::[dbo].[' + name + '] TO [MyUserID];' AS Expr1
FROM sys.sysobjects
WHERE (type = 'P')
AND (LEFT([name],3) = 'DNN')

With this SQL, I generate the actual command needed to grand the new permissions to the Stored Procedure. I also use a WHERE condition to limit the effect to just Stored Procedures beginning with DNN, so I don't do this to everything, just the ones I want.

Once I run this, I just copy the results, paste it back into the SQL section of Microsoft SQL Server Management Studio, and execute. Bingo! My permissions have been altered.

Enjoy.

Friday, May 23, 2008

Generating Google Base XML files in VB.NET

This may be a bit obscure, but since I struggled with this, I'm sure someone else in the future will struggle with it too. Hopefully this little post will help.

Goal: Create an XML file in RSS 2.0 format using VB.NET for use with Google Base


Challenge: Getting the .NET XmlSerializer object to generate the XML for you with the correct "g:" prefixes on the Google specific tags.

Making XmlSerializer generate basic XML is rather trivial. A quick search of the Interwebs will show you numerous examples. Essentially you just generate a class that matches the basic layout of the XML you want, populate the class, and send XmlSerializer off to covert it to XML.

Getting it to generate the Google specific XML needed for Google Base is a much more difficult problem, however. It becomes a bit tricky when you need some of the xml tags to be generic (for example, <title>), and others to have the Google prefix (ala <g:price>)


Solution: The key lies in a few hints you include in the Class definition to tell XmlSerializer what to do. Here's an example of the class I used:


RSS.vb



Imports System.Xml.Serialization

<XmlRoot(ElementName:="rss", Namespace:="")> _
Public Class rss
<XmlElementAttribute("channel")> _
Public channel As New rssChannel()
<XmlAttributeAttribute("version")> _
Public version As String = "2.0"
End Class

Public Class rssChannel
Public title As String
Public link As String
Public description As String
Public language As String = "en-us"
<XmlElementAttribute("item")> _
Public item As New rssChannelItems()
End Class

Public Class rssChannelItems
Inherits CollectionBase

Public Sub Add(ByVal Item As rssChannelItem)
Dim I As Integer = List.Add(Item)
End Sub

Default Public ReadOnly Property Item(ByVal Index As Integer) As rssChannelItem
Get
Return CType(List.Item(Index), rssChannelItem)
End Get
End Property
End Class

Public Class rssChannelItem
' Required
Public id As String
Public title As String
Public description As String
Public link As String
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public price As Double

' Recommended
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public provider_class As String
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public year As Integer

' Optional
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public agent As String
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public area As String ' Sq Ft
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public lot_size As String
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public property_taxes As Double
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public school_district As String
<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _
Public zoning As String
End Class

Notice this part of the code:



<XmlElement(Namespace:="http://base.google.com/ns/1.0")> _

It is telling the XmlSerializer that I want the element to have the g: prefix. That's the revelation. Once you have that in place, you just create an instance of the class, populate it, and save the XML to disk.


Export.vb



Sub GenerateGoogleBase()
Dim rssFeed As rss = Nothing
Dim rssItem As rssChannelItem

Try
rssFeed = New rss

With rssFeed.channel
.title = "one"
.description = "two"
.link = "three"
End With

rssItem = new rssChannelItem
rssItem.id = "1234"
rssFeed.channel.item.Add(rssItem)

Dim xml As New XmlSerializer(GetType(rss), "http://
base.google.com/ns/1.0")
Dim strFile As New FileStream("C:\Test.xml", FileMode.Create)

Dim xmlns As New XmlSerializerNamespaces()
xmlns.Add("g", "http://base.google.com/ns/1.0")

xml.Serialize(strFile, rssFeed, xmlns)

Catch ex As Exception
End Try
End Sub

Wrap Up: As I said up front, yeah, this is a bit random and obscure. I'm sure I won't be the only person who struggles with this though. My hope is that the next person down the line will find this post and be helped by my struggle.


Big Thanks to Phil Weber for the basic RSS code, and Martin Honnen for helping me with making it work with Google Base.

Friday, March 28, 2008

Earth to HBO, Get With The Times!

Why isn't HBO content available for sale on iTunes?

Sure, I know the standard answer. "HBO is a subscription service. If you want to watch HBO, you must sign up for it. If they sold their shows on iTunes, why would anyone pay their cable company for HBO?"

Blah, blah, blah.

Let's face facts, folks. There are some people who will always subscribe to HBO. It's convenient, it's practically forced down your throat when you sign up for cable, and it's ideal for channel surfing. Those people aren't going to ditch the monthly subscription for iTunes.

There are also a group of people that will never subscribe to HBO. They're not going to pay $15 per month -- every month -- for the few times that a movie comes on that they haven't already rented at NetFlix or BlockBuster. It's just not worth it to them to pay that much for an occasional movie. They might, however, pay $1.99 for an episode of Entourage.

Unfortunately, HBO does not allow that. They have the All or Nothing mentality. Subscribe, or you get nothing until the box set comes out a year later.

Here's a hint, HBO Execs. What you're really telling people is "Steal our content on Bit Torrent". If you don't offer a legal alternative where consumers can purchase your shows ala-cart, it will be stolen instead. That's the reality of the 21st century. It's your responsibility to provide the content when and where people want it. You no longer get to dictate how your shows are watched.

Maybe you should take a page out of Showtime playbook. They sell every one of their original series on iTunes. Weeds, The L Word, Californication, Penn & Teller BS -- everything. They don't seem to be suffering. In fact, what they are doing is making more money with their existing content, and by exposing people to their shows, they're probably getting a few extra subscribers as well.

So, get with the program HBO. It's 2008. Time to listen to your customers and embrace new technology.

Saturday, March 8, 2008

Better Exchange Support Coming to Apple Mail?

On Thursday, Apple announced its Roadmap for the future of the iPhone. Great fanfare was made of the forthcoming SDK and the Enterprise features being introduced in the 2.0 release of the iPhone software. There was much rejoicing.

One interesting tidbit mentioned during the press event was that Apple has licensed the Microsoft ActiveSync technology to tightly integrate the iPhone with Micrsoft's Exchange server. This nifty bit of software will allow things like push email, calendar and contact updates from the server to the iPhone. In a nutshell, Mail on the iPhone will now have the same tight integration with Exchange that Outlook does on the Windows OS.

This raised an interesting question in my mind....

Will Mail.app on OS X also benefit from this licensing deal?

Mr. Jobs and the Apple leadership went to great lengths to show that the iPhone is really just a small Mac. It runs the same underlying operating system code. It runs the same Objective-C based applications. It's a Mac in every sense, with a few minor enhancements.

If that's true, why couldn't the desktop versions on Mail.app, iCal and Address Book benefit from this new ActiveSync integration like the iPhone versions will? It should be fairly trivial to make the changes in both places, right?

Many corporate users have bemoaned the lack of true Exchange support in Mail.app. For that matter, even Entourage 2008 doesn't have full Exchange support. Both use IMAP4 to interact with the Exchange server. It works, but it's not the most elegant (or reliable) solution.

I may be reading the tea leaves incorrectly, but I'm guessing we're about to see a much more robust version of Apple Mail coming to a Mac desktop near you very soon. Here's to hoping...