I’ve written a few times in the past about software like SABNZBd for downloading episodic content, and also about using my PS3 to play that content. For the past few months, I’ve been using an old PC with SABNZBd and PS3 Media Server to watch HD content on my TV, and it’s worked a treat. Unfortunately, the PSU on the PC died and that made me begin my search for a yet-better solution.
Having switched to a MacBook Pro full time for my work, after becoming heartily sick of having to fiddle around inside yet another broken PC, I’d hoped to come up with a way of avoiding having to have a “proper” PC as a media center. Commodity PC’s are noisy and unreliable. Something like AppleTV was suggested, but it’s expensive and would need hacking around with to do what I wanted. A Mac Mini would fit the bill, but it’s even more expensive.
A few days ago I stumbled on the WD TV Live from Western Digital. I’d seen media player devices like this before – dedicated hardware to play a variety of media types, but the trouble was that most don’t support additional software on the box and so wouldn’t let me use NZB downloaders like SABNZBd. And indeed, the WD TV Live doesn’t do that either.
Or so I thought. Turns out the firmware for the WD TV Live is GPL – the code for it is open source. Some enterprising coders have taken this and formed custom firmware, and the one I’ve installed is WDLXTV-Live. Out of the box, this gives the WD TV Live an ssh server, a bittorrent client, an NZB downloader, a web server, an FTP server, Python, Perl and PHP, a load of stuff for network sharing, and a bunch of other stuff like customisation of graphics and the interface of the WD TV Live. You can also add in application bundles, a few of which are already provided by the community.
The WD TV Live has two USB ports, so I bought a hard drive caddy, pulled the disk out of my broken PC, and hooked it up to the WD TV Live for 1 terabytes of storage. The media player attaches direct to my 42″ LCD TV, and plays movies, TV shows, music and shows photos, but also now pulls down NZB files automatically on a schedule. It’s tiny, fanless, and looks good next to my PS3 and TV, and it was £95.
What more could I want?
NHibernate on Mono with SQL Server – “Argument cannot be null. Parameter name: type”
April 22nd 2010, 1:39 pm in Mono, NHibernate.
When trying to use Mono on OSX to run an existing website, I was getting the above error thrown by NHibernate. Thanks to this post by “sta.blockhead” I was able to understand that switching my NHibernate adonet.batch_size configuration to zero will bypass the issue.
I’m a Ruby noobie, I admit it. Coming from a .NET background, Ruby has been a learning experience for sure, but I certainly feel lke I’ve learned something along the way. One aspect of the Rails framework I really like is the relaxed attitude to working with the database – I really rarely have to worry about it.
That said, I’ve been puzzling over the use of inheritance with Active Record. In .NET land and with NHibernate, I’d quite happily have this:
class AbstractUser
class AdminUser : AbstractUser
class StandardUser : AbstractUser
All the *User subtypes have their own extra properties, and the AbstractUser provides some common ones like email, password, username.
Ruby doesn’t actually provide for abstract classes, so that’s one issue. But another issue is the way in which ActiveRecord deals with inheritance. Only single table inheritance is supported via the user of a discriminator column. My issue with this is that there’s no good way to support extra properties on a subclass – the properties would have to be added to the Users table and therefore without some trickery would be available to all User subtypes.
One possible solution for this is as follows:
class AbstractUser < ActiveRecord::Base
end
class AdminUser < AbstractUser
has_one :admin_details
end
In this case, we have another model - and therefore another table - which provides the AdminUser's extra properties. This can then be used as follows:
admin = AdminUser.new
admin.admin_details.direct_line = '+44 567 7890'
This works fine, the values are off in a separate table and everything's separated out as I'd like. But the syntax is clunky. I don't really want to have to do admin.admin_details.direct_line, I want to do admin.direct_line. So I wrote a little extra method to do this:
class AdminUser < AbstractUser
incorporates :admin_details
end
All this does is set up a has_one as normal, but then provide extra methods for getting and setting all of the attributes of admin_details, meaning that admin.direct_line will work as expected. The code for incorporates has_one is up on github now - it's the minimum that was required to get this to work, so please feel free to fork it. I do wonder if I'm missing something that's already built into Rails, but if I am, it's damn hard to find.
This approach makes me pretty happy overall - in the scenario I've got right now, I never actually need a base User, which is why I'm referring to it as AbstractUser, and it would really be better if that could never be instantiated. But it's a minor niggle, and the whole setup plays well with Rails' polymorphic routing and suchlike, and works with Authlogic too. I can already see some improvements, so I hope someone forks the gist and I can learn something from Rubyists!
Getting IIS 7.5 (in VirtualBox and VMWare) to Serve Sites from an OSX Share
September 24th 2009, 9:57 am in IIS, OSX, VMWare Fusion, virtualbox.
A longwinded title, but this is mostly as a note for me. Assuming your Mac’s IP address is 192.168.1.101:
- You need matching users with matching passwords on both Windows and OSX. So, your main user on OSX is u:colin/p:password. You need a user on Windows u:colin/p:password. Casing is important!
- Enable SMB on OSX from File Sharing
- Share the OSX folder you want to serve up (let’s say it’s named “mysite”)
- Create a new site in IIS with the physical path as \\192.168.0.101\mysite
The first point is key, as is using the UNC path in the last point, rather than a mapped drive. I used this Stack Overflow question to get this up and running.
Update: I just tried to run some unit tests via the Resharper test runner and received a security exception. The following fixed the issue:
caspol -m -ag 1 -url “file://\\192.168.0.101\mysite\*” FullTrust -exclusive on
This post from backroom security tech and also this from .NET security blog helped here.
Update 2: In a new VMWare VM, I came across two additional problems. Using ” around the URL caused caspol to throw an error, and having spaces in the URL doesn’t work – replace them with %20.
Update 3: In some cases, such as writing across the UNC share to the virtual directory your site is running in, you may need to set up Impersonation in the web.config with your matching user. You may additionally need to set the AppPool identity to that shared user. Note that I now have this system working in VMWare Fusion.
I’m really excited that the final release of Ext JS 3/ is here, along with a preview of the Ext JS Designer application. This is built on top of Adobe AIR and allows developers to piece together their Ext JS app with a rich UI, tweaking configuration options and embedding components as required.
To my knowledge, there is no other JavaScript framework approaching the richness of Ext JS, and this designer takes it to the next level. I’m extremely excited about what the brilliant Ext JS team has in store for the future.
Start off by creating a fresh new drive of the size you’re after using the VirtualBox user interface. Then, locate both the your old, smaller HD and the new, larger one and run the following command:
VBoxManage clonehd --existing oldhd.vdi newhd.vdi
After some progress indicators ahve come and gone your HD should have been cloned to the larger one. You now need to use some software to expand your drive partition into the new space. Vista and W7 have this feature built in to Disk Management, or you could use something like GParted.
After yesterday’s post I didn’t really imagine that it’d attract the attention of anyone in the right departments – I guess I just assumed the problem would get fixed due to someone high up noticing it. What I didn’t imagine is that the problem would get replaced by another totally different issue:
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Cannot create an object of type 'System.Web.UI.WebControls.Unit' from its string representation 'r_height' for the 'Height' property.
Source Error:
Line 1559: <div class="sys_news">
Line 1560: <div class="sys_standardrepeater">
Line 1561: <asp:literal visible="false" id="D2_Count" runat="server" text="0" /> <contensis_controls:dataviewdatalist id="D2" runat="server" repeatlayout="Flow" cssclass="sys_standardRepeater" height="r_height" repeatdirection="Vertical" repeatcolumns="1" shuffledataset="False" displaytype="SpanLayout" onupdatecommand="dlUpdateCommand" oncancelcommand="dlCancelCommand" oneditcommand="dlEditCommand" ondeletecommand="dlDeleteCommand" onitemcommand="Link_Data_Click" datakeyfield="PageID"><itemtemplate><% D2_Count.Text=cstr(clng(D2_Count.Text)+1) %>
Line 1562: <h2 class="sys_repeaterItemInner">
Line 1563: <%# CustomProcessing_D2(DataBinder.Eval(Container.DataItem,"newsHeading"),"newsHeading") %>
What sort of process is in place to allow a developer to replace a known failing page with another failing page? Surely, knowing that the first version was failing you’d be double-eager to check the latest upload is working? Baffling.
My local council, Gateshead in the UK, recently had a notice on their website declaring that it would not be updated for two weeks as they were performing essential maintenance. This was WTF number one – I have no idea what happened behind the scenes to make them buy this nonsense but it smacked to me of technical incompetence. What do I know though – like I say, there could have been valid reasons for this decision and it’s really not that big a deal.
So today I went back on their website and it seemed to be up and running with some new updates. I hit the News section to see this message:
Server Error in '/' Application.
Compiler Error Message: BC30569: 'New' cannot be used on a class that is declared 'MustInherit'.
Source Error:
Line 341: DataviewObject(component).GetData
Line 342:
Line 343: Dim RSSWriter As New CMS_API.WebUI.WebControls.BaseRSSFeedWriter
Line 344:
Line 345: Me.Controls.Add(RSSWriter)
Source File: E:\websites\www.gateshead.gov.uk\Council and Democracy\news\home.aspx Line: 343
Ouch. This brought down the page with a bang, no decent error handling. What’s the problem? It looks like someone’s been trying to set up the RSS feed for that page but has used an abstract class instead of the concrete one. Fair enough, that’s a simple mistake but surely WTF number two is that this could be pushed to a production server?
A good provider would have a local test, a staging server, and then production, at the very least. It looks to me like this change has been pushed directly to the site without any kind of quality control.
A possible WTF number three arises when you think again about the error message in general, which should only be shown when debug information is available. This could mean that debug settings are enabled on the web server, which is a definite WTF. Showing any kind of information like this – such as drive names and file paths – probably isn’t a very good idea.
I wouldn’t really care if this was just some corporate website but I know that my tax has gone into the development of this system and it’s painfully clear that the developers are not up to the job. Are open bidding systems in place for this kind of contract? I don’t know, but I bet that even if they are they don’t go on merit. Gateshead Council: shame on you. Can I get a refund? I can certainly recommend so decent software companies with local ties:
Learning Ext JS is Up For the Packt Author of the Year Award
May 5th 2009, 5:50 pm in Ext, Personal.
The book which Cutter, Shea and I wrote is up on the publisher’s site for the Author of the Year award. Obviously in our case it’d be co-author of the year but it’d be really nice to be in with a chance. Packt have a microsite for the award and the actual poll is here. It’s up against some other great books so if you could spare a minute to vote it would certainly be appreciated!
The Ext JS 3.0 examples are online already, and I believe Jack made the announcement at the Ext Convention today. Take a look at this sample showing how to create a Microsoft Word-style ribbon UI with Ext JS 3.0. I really like the new button features and the GroupTabs. I’d expect some more examples on how to use some of the new features like the charting and Ext.direct and I’ll try and cover those when they appear.
Update: Cutter points out that there’s a new Image Organizer which shows off the Direct functionality but I can only see that in the download at the moment. The examples on the download also cover charting too.