Wednesday, November 18, 2009

create Document Library based on user template

it took me a while to figure out that the Lists.asmx web service doesn't support creating a document library based on user template, the only way to do it is via a customized web service.
the code for web service can be found at http://blogs.msdn.com/sridhara/archive/2008/06/07/getwebtemplate-web-method-does-not-return-addlist-web-method-does-not-recognize-my-custom-list-templates.aspx

In my code, I also need to check whether the docLib already exists which can be done via the standard Lists.asmx web service.

Tuesday, November 10, 2009

AD Distinguished Name and special character

I wrote a script to send out password expiration notifcations a while ago, recently I got told that some users didnt' receive their notification.
After looking into it, I realized that the OU structure got changed recently and some OU name contains special characters, in this case if you use GetObject("LDAP://"& DN) to get user Object, DN has to be encoded for special characters.
In my case, a '/' was causing the issue and has to be replaced with '\2F' (hex).

Monday, November 2, 2009

Phoenix Online Data Mining Utility

Here it is at http://69.197.142.200:8080/Phoenix/ , our group project for cs9323 course. this web app basically does some data mining tasks online. Not really a brilliant idea to do data mining online but that was what we were given.

Wednesday, October 21, 2009

Moving database file and renaming database file

exec sp_helpdb DatabaseName

datach:

exec sp_detach_db 'MyDatabase', 'true'

attach:

exec sp_attach_db 'MyDatabase',
'C:\Program Files\Microsoft SQL Server\MSSQL\data\MyDatabase_Data.MDF',
'C:\Program Files\Microsoft SQL Server\MSSQL\data_log\MyDatabase_Log.LDF'

Change logical file name:

alter database MyDatabase modify file (name='test', newname='MyDatabase')
alter database MyDatabase modify file (name='test_log', newname='MyDatabase_log')

source: Timothy Chen Allen

Tuesday, October 20, 2009

A quick tutorial on using hibernate for webapp

Directly from Netbeans KB:
http://www.netbeans.org/kb/docs/web/hibernate-webapp.html
However, don't expect to learn much from this over simplified tutorial.

Monday, October 19, 2009

Using Netbeans and Eclipse side by side with SVN

while I was doing the group assignment for comp9323, I thought about using netbeans and eclipse side by side. Initially I preferred Netbeans but after all I was using Eclipse for the project.
After playing around Subversion and Netbeans/Eclipse for a while, I actually realize that this can be setup in a way that netbeans and eclipse can be used side by side in same project. In my case, I created the source repository in SVN then synchronize it with Eclipse, later I use Netbeans to check out a copy then follow the instructions to create netbeans project, when it complaints about existing build folder, just remove the build folder then you can proceed.

Monday, September 28, 2009

"Media is Write Protected" in windows server 2008 shared drive

Just solved an issue with users at Melbourne office, apparantly something got changed to their mapped network drive and they can't write to the shared drive.

Agains, a technet article explained this and the solution:

You may see "Media is Write Protected" Error or VDS error 80070013 after bringing SAN disk online via Diskpart in Windows Server 2008
http://support.microsoft.com/kb/971436

Disable Microsoft Defender for Cloud for Visual Studio Subscription (MSDN)

I use a visual studio pro subscription which comes with $150 azure cloud credit, for some reason Microsoft Defender for Cloud was turned on ...