The Data Platform Insider blog details how Microsoft have announced the first CTP of the SQL Server Migration Assistant for MySQL which can be downloaded from the Microsoft Web site. The toolkit works with MySQL 4.1, 5.0 and 5.1
“Microsoft SQL Server Migration Assistant (SSMA) 2008 is a toolkit that dramatically cuts the effort, cost, and risk of migrating from MySQL to SQL Server 2008 and SQL Azure. SSMA 2008 for MySQL v1.0 CTP1 provides an assessment of migration efforts as well as automates schema and data migration.”
Thanks to Paul Thurott for the original link.
 
I use Joomla on a couple of sites, and discovered one of them had crashed this morning with an error:
jtablesession::StoreFailed
DB function failed with error number 145
Table ‘.\joomla\jos_session’ is marked as crashed and should be repaired SQL=….
Googling, I found that the solution to this was to truncate the jos_session database table however I was unable to log onto the database using the mysql command line tool.
I found that restarting the database service and then truncating the table however did the track and everything is now back working.
 
In most programming languages, such as .NET or Java, if you wanted to create a Color object from an RGB, you would execute some method on a Color class passing in Red, Green and Blue values where these values are typically within the range 0 through 255.
If you want to do perform a similar operation in Cocoa, i.e. creating a NSColor object, you need to pass in color values within the range 0 through 1.
Typically, to create a NSColor object in Cocoa, you would use a method such as
[NSColor colorWithDeviceRed: green: blue: alpha:]
To convert RGB values into the appropriate values for this method, you need to add 1 to each separate RGB value and then divide by 256.
So, for example, Alice Blue with an RGB of (240, 248, 255) could be instantiated as a NSColor using the values:
Red: (240+1)/256 = 0.941
Green: (248+1)/256 = 0.973
Blue: (255+1)/256 = 1.0
[NSColor colorWithDeviceRed:0.941 green:0.973 blue:1.0 alpha:1.0] 
 
I’ve spent the last hour or so trying to track down a problem with a multi-threaded GUI Cocoa application that I’ve written.
The problem turned out to be that I was trying to update the applications UI from a background thread. In Cocoa apps, you should only really be updating the applications UI from within the main thread. If you don’t, you get strange results such as the app working in debug and not release or sometimes even hanging altogether.
I fixed the problem by updating the GUI from the background thread by using the performSelectorOnMainThread method. Something similar to below.
-(void)backgroundThread { 
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// .. Update main UI.
[self performSelectorOnMainThread: @selector(updateGui withObject:results waitUntilDone:NO];
// ..
[pool drain];
}
-(void)updateGui:(NSString*) results {
// Update the gui.
}
 
In Oracle, the default page and line size settings for SQLPlus are 14 lines per page and 80 characters per line respectively. This can make viewing large result sets difficult when using SQLPLus.

Fortunately, these settings can easily be changed using the SET command:
set linesize 1000
set pagesize 1000

Executing these commands however only changes the settings for the current instance of SQLPlus. The next time you run it, the values default back to their original values. If these settings are placed in a file calledlogin.sql in the current working directory however, they will be loaded when SQLPlus starts.
 
I’m managing a Windows 2003 systems and one of the things that I want to do is know how long the system has been up since rebooted.

On a Unix system I can issue a uptime command to see when the system was last rebooted. This command doesn’t natively exist on Windows though.

On a Win2K3 server however, you can get the uptime by issuing the following command:
net statistics workstation
 
I’ve been using Oracle JDeveloper for the past few days for JSF development and I must say, that I quite like it. The visual editors are pretty good and do make you much more productive.
I do have a couple of issues though that I can’t seem to solve, and as the title says, they are pretty simple tasks.
  • First of all, I want to create a new folder underneath my public_html folder. There must be a way of doing this, but I can’t find it.
  • Secondly, I want to refactor some JSP files and move them into a different directory. Again, I can’t find a way of moving JSP files within the web application. Surely this can be done?
 
Since I started learning JSF, most of my development has been done in either NetBeans 5.5 or Eclipse 3.2. Whilse both of these are good IDE’s, they don’t provide any great visual support for JSF development.
Now that I understand the basics of JSF, I’m going to try using the features of the IDE more to become more productive – there’s no point learning a technology if it takes forever to write applications in it!! I still maintain that its useful to learn a technology using the bare basics (e.g. editing the faces config XML file manually), but when you’ve done that a few times it starts to get a bit repetative and boring and thats where a good IDE becomes useful.
I’ve decided to try using Oracle JDeveloper 10g. I initially wanted to use Sun’s Java Studio Creator, but had problems getting this to run under Java 5 on a Mac.
Initial impressions about JDeveloper seem to be good. It has a visual page flow editor together with a visual drag and drop page designer. I’ve managed to develop a few JSF applications (running internally on OC4J) and then deploy them externally to GlassFish without any major problems.
Are there any other visual JSF editors that other developers use? I’m quite happy with JDeveloper at the moment, but I’d be interested to hear what other developers use.
 
In his blog, Keith poses a question “Are you using JSF or intending to?”. So here goes, these are my reasons for learning JSF.
  1. The answer Keith didn’t want. It’s a standard. I know this is a very boring and possibly not very good reason, but I’m interested in the new Java EE 5 spec and JSF is a part of the new spec.
  2. I don’t know JSF yet. This may sound pretty obvious, but I want to learn JSF because I don’t know it. If I don’t know JSF well enough to develop applications in it, I can’t really say whether it is fit for the types of applications I develop or whether I should be using some other framework like Struts or Wicket or Spring MVC.
  3. I want to learn Seam. Seam is based upon JSF, so its probably a good idea to get a good grounding in the basics before progressing to the next stage.
  4. JSF will supposedly allow me to develop web apps quickly. Whether this is true or not, I’m sure I’ll soon find out!
So, will I ever deploy an application with JSF? I don’t know, I’m still in the early stages of learning. I know there is plenty of information on the internet regarding peoples opinions of various technologies including JSF, but how much of it is FUD and how much is reasoned criticism?
 
As usual, when learning a new technology, the first application to write is a "Hello World" style application. To continue this tradition, I've written a very simple Hello World JSF application. After setting up the Faces servlet as described in my previous post, I've written a simple JSP page called hello.jsp which has the following contents:
<%@page contentType="text/html"%> 
<%@page pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<f:view>
<h:outputText value="Hello World" />
</f:view>
</body>
</html>
This simple JSP page specifies that the 2 JSF taglibs "core" and "html" are to be used and specifies their appropriate prefixes. The HTML is pretty standard up until the <f:view> tag. This tag tells the container we are going to start using JSF components. Inside this tag, the outputText component is used to print out the text "Hello World" to the browser.
This trivial application is started by pointing the browser to http://localhost:8080/LearningJSF/hello.jsf