Tuesday, October 20, 2009
Creating BlackBerry Playlist in C#
I dont have the Media Sync plugin for the Blackberry installed on my laptop yet so I wrote up few lines to create the playlist quickly.
Copy all your music to your blackberry and run the following script in a ASP.NET application.
protected void Page_Load(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (FileInfo file in new DirectoryInfo("YourDriveLetter:\\BlackBerry\\music\\Media Sync\\<Your music folder path>").GetFiles())
{
sb.Append("file:///SDCard/BlackBerry/music/Media%20Sync/<Your music folder path>/"+ HttpUtility.HtmlEncode(file.Name));
sb.Append("<br/>");
}
Response.Write(sb.ToString());
}
There you have it.
Labels: BlackBerry, C#, Music
Sunday, October 18, 2009
Sitefinity CMS and "There were errors during services initialization, check the error log for details" error
I use Sitefinity and have been getting this error on some websites including zubairahmed.net.
This error is so weird that it appeared randomly and vanished on subsequent page load. Recently I found something that I believe was causing this error.
It appears that this error is linked to the available memory on the server hosting your website, so as soon as the server reaches its limit it flushes the cache and the web application throws the error, to work around that Sitefinity has put a web.config setting to cache the web pages in Database, surprisingly Sitefinity did not tell anyone about this hidden feature until I googled it (not that I didn't do it before) and found it here.
So all it required was changing this in web.config
<cachedependency mode="InMemory">
to
<cachedependency mode="InDatabase">
and so far no issues, hope it helps someone out there.
Labels: Cache, Sitefinity, Web.Config