Thursday, October 13, 2011
This old blog has served me well since 2004, but it is time to move on to a simpler and more flexible platform.
I will also be blogging about my hobby, Music Technology and Audio Engineering, so watch out for that.
http://kogzee.wordpress.com/
Monday, October 03, 2011
I was trying to get InfoPath Forms Services working, but when I tried to activate the site collection feature I got an error about a dependency on the “Premium Site” feature. This is one of those hidden features that is usually activated automatically, but some glitch made it deactivated.
I tried to activate it through the following command line:
stsadm -o activatefeature -id "8581a8a7-cf16-4770-ac54-260265ddb0b2" -url http://es
But then I got this error:
“The InfoPath Forms Services support feature is not properly activated. Document library could not be found at FormServerTemplates.”
But this was fixed by running two more commands:
STSADM.EXE -o activatefeature -filename IPFSWebFeatures\feature.xml -url http://es -force
and
STSADM.EXE -o activatefeature -filename IPFSSiteFeatures\feature.xml -url http://es -force
All good now!
Sunday, March 13, 2011
I was playing around with Access Services today. This allows you to “upsize” an Access Web Database to Sharepoint. The tables become Sharepoint Lists and the reports become Reporting Services reports. Sounds like it has potential, eh? Anyway I found the steps required to set this all up quite painful! Eventually I got through in through.
The last hurdle was getting Reporting Services to display the report. I got this error when I tried to open the report in SharePoint:
An attempt has been made to use a data extension 'ADS' that is either not registered for this report server or is not supported in this edition of Reporting Services
I think I installed Report Services before Sharepoint, but according to this article it is easier if you do things the other way around:
http://technet.microsoft.com/en-us/library/ee662542.aspx
Here is the text from the article on what I had to do:
To install the Reporting Services Add-in for Connected Mode
-
Install the SSRS Add-in either before or after SharePoint Server installation according to the session above.
-
Configure Report Server Integration in SharePoint Central Administrationhttp://msdn.microsoft.com/en-us/library/bb326213(SQL.105).aspx
-
Modify the C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config file on the Reporting Services server. Under the <Data> node, under the <Extension> node, add the ADS data extension. For example:
<Extension Name="ADS" Type="Microsoft.Office.Access.Reports.DataProcessing.AdsConnection, Microsoft.Office.Access.Server.DataServer, Version=14.0.0.0, Culture=Neutral, PublicKeyToken=71e9bce111e9429c"/> -->
-
Modify the rssrvpolicy file on RS server.
- Add the following XML code in the file under the <NamedPermissionSets> node.
<PermissionSet class="NamedPermissionSet" version="1" Name="ReportExpressionsDefaultPermissionSet">
<IPermission class="SecurityPermission" version="1" Flags="Execution" />
<IPermission class="Microsoft.Office.Access.Server.Security.AccessServicesPermission, Microsoft.Office.Access.Server.Security,
Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" version="1.0" Flags="CalculationCallback" />
</PermissionSet>
- In the <CodeGroup>node, find the following line and change PermissionSetName from “Execution” to “ReportExpressionsDefaultPermissionSet”
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Execution" Name="Report_Expressions_Default_Permissions"
Description="This code group grants default permissions for code in report expressions and Code element. ">
-
Enable Remote Errors for Reporting Services by following the instructions at http://go.microsoft.com/fwlink/?LinkId=183457&clcid=0x409.
Saturday, September 18, 2010
If you haven't tried Uzu on the iPad yet, you just gotta!
Have a look at www.uzumotion.com for more info.
I've been hanging out the the update that allow VGA output from the iPad so I can capture video output from this thing.
I'm planning on putting together a video to accompany a musical performance for Uni.
Saturday, July 10, 2010
I was putting together a demo of this concept for a class I am teaching in Port Moresby this week.
Using this technique you can have multiple implemenations of an interface, while the client application can be written to be completely agnositic about the implementation.
Here we use Activator.CreateInstance to late bind the implementation class.
Here's the interface:
public interface IErrorLog
{
void LogMessage(string message, string location);
string DisplayLog(string location);
}
Here's a text file implementation:
using System;
using System.Text;
using System.IO;
public class LogToFile : IErrorLog{
public void LogMessage(string message, string location){
FileStream fs = new FileStream(location, FileMode.OpenOrCreate, FileAccess.Write);
StreamWriter w = new StreamWriter(fs);
//Set the file pointer to the end.
w.BaseStream.Seek(0, SeekOrigin.End);
Log(message, w);
w.Close(); //Close the writer and underlying file.
}
public string DisplayLog(string location){
FileStream fs = new FileStream(location, FileMode.OpenOrCreate, FileAccess.Read);
StreamReader r = new StreamReader(fs);
r.BaseStream.Seek(0, SeekOrigin.Begin);
StringBuilder sb = new StringBuilder();
//While not at the end of the file, write to standard output.
while (r.Peek() > -1) {
sb.Append(r.ReadLine());
sb.Append("\n");
}
r.Close();
return sb.ToString();
}
private void Log(string logMessage, StreamWriter w){
w.WriteLine("{0}, {1}, {2}", DateTime.Now.ToString("d/M/yyyy"), DateTime.Now.ToString("HH:mm"), logMessage);
w.Flush();
}
}
Here's a database implementation:
using System;
using System.Data;
using System.Data.SqlClient;
public class LogToDB : IErrorLog{
public void LogMessage(string message, string location){
SqlConnection cn = new SqlConnection(location);
cn.Open();
Log(message, cn);
cn.Close();
}
public string DisplayLog(string location){
SqlConnection cn = new SqlConnection(location);
SqlDataReader dr;
SqlCommand cmd = new SqlCommand();
string strLog = "";
cn.Open();
cmd.CommandText = "select * from LogTable";
cmd.Connection = cn;
dr = cmd.ExecuteReader();
while (dr.Read()){
strLog = strLog + Convert.ToDateTime(dr[0]).ToString("d/M/yyyy")
+ ", " + Convert.ToDateTime(dr[1]).ToString("HH:mm")
+ ", " + dr[2].ToString() + "\n";
}
cn.Close();
return strLog;
}
private void Log(string logMessage, SqlConnection cn){
try{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "INSERT INTO LogTable(LogDate, LogTime, LogMessage)"
+ " VALUES('" + System.DateTime.Now.ToString("M/d/yyyy")
+ "', '"
+ DateTime.Now.ToShortTimeString() + "', '"
+ logMessage + "')";
cmd.Connection = cn;
cmd.ExecuteNonQuery();
}
catch (SqlException eException) {
foreach(SqlError eErr in eException.Errors){
System.Windows.Forms.MessageBox.Show(eErr.Message);
}
}
}
}
Here's the app.config file, where we can specify which implementation or client will spin up:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Type"
value="LogToDB"/>
<add key="Location"
value="Data Source=.;Integrated Security=SSPI;Initial Catalog=LogDB"/>
<!--
<add key="Type"
value="LogToFile"/>
<add key="Location"
value="c:\testlog.txt"/>
-->
</appSettings>
</configuration>
And here's out client application. Note there is no hard coding of any implementation classes here. Beauty, eh?
public IErrorLog ErrLog;
public string LogLocation;
private void Form1_Load(object sender, EventArgs e)
{
string logType = ConfigurationManager.AppSettings["Type"];
LogLocation = ConfigurationManager.AppSettings["Location"];
//late binding
ObjectHandle handle = Activator.CreateInstance(
"WindowsApplication1", logType);
ErrLog = handle.Unwrap() as IErrorLog;
}
private void btnLogMessage_Click(object sender, System.EventArgs e)
{
ErrLog.LogMessage(txtMessage.Text.ToString(), LogLocation);
}
private void btnDisplayLog_Click(object sender, System.EventArgs e)
{
MessageBox.Show(ErrLog.DisplayLog(LogLocation));
}
Friday, May 21, 2010
Tuesday, August 11, 2009
I just got a nice new 32 GB iPhone 3G S yesterday from the Apple Store in Sydney. It's quite an interesting shop, but that's another story. Anyway, my hotel doesn't have wireless internet in the rooms which is a pain in the butt, so I was wishing I had one of those 3G modems. I had heard of hacking the iPhone to make it a 3G modem, but now I find out it's legit! It's called Internet Tethering. Here is an article that I followed to set it up.
http://blog.cameronlaird.com/2009/06/easy-internet-iphone-tethering-with-telstra.html
Make sure you read all the comments etc. before getting started as some of the links are mixed up. I got mine working with the telstra.internet not the telstra.iph one. Also I am using the USB connection as bluetooth would just chew up the phone battery.
It's nice and fast and means no more need for those 3G dongle things.
Wednesday, June 17, 2009
I just bought a new laptop, and because I am studying Music Technology part time at university now, I decided to get a Macbook Pro so that I could use Apple's Logic program for music projects as well as run all my development apps like Visual Studio/SharePoint/SQL Server etc.
Setting up the dual boot with Mac OSX and Vista 64bit was no problem at all. (Andrew Connell has a great blog post about this http://www.andrewconnell.com/blog/archive/2008/07/10/Triple-Boot-Goodness-on-the-MacBook-Pro.aspx)
I have quite a few Virtual PC and Virtual Server images that I use for training as well as software development, but I was wondering if it would be possible to have the same VM's run from either the Mac OS or Vista?
Well, you can exclude VPC right off the bat. They did have a Mac version, but it is now discontinued and I'm not sure if the same .vmc could be opened in Mac and Windows anyway.
VMWare has Fusion for Mac, but it costs a few bucks.
So a collegue of mine recommended I try Sun's FREE VirtualBox, which runs on damn near anything.
So I did, and I have to say, I am amazed at this product. Not only was it easy to install and configure on both Mac and PC, but it runs my existing VPC images as is (well after uninstalling the MS Virtual Machine Additions and installing the VirtualBox Guest Additions)
And the bonus is - the exact same image can be started up in either the Mac of Windows OS - perfect for my situation.
Plus I was getting weird scrolling lag issues in VPC that completely disappeared in VirtualBox. Everything is stable and rock solid.
VirtualBox also has a really nice feature called “Seamless Mode“, where your guest OS applications are not run on a separate window, they are run in their own independent windows on the host OS desktop. You have to see it to appreciate it.
Anyway, I'm totally impressed and it has been a long time since I've been able to say that about a piece of software, especially a free one.
Saturday, April 04, 2009