Jojit Soriano's Blog

July 13, 2009

Silverlight 3 Released to Web

Filed under: Silverlight — jojitsoriano @ 9:08 am
Tags:

 The much-awaited release of Silverlight 3 came last Friday, July 10. Read on the following blogs about the release, the installers, and the new features of Silverlight 3:

1. Scott Guthrie’s blog – http://weblogs.asp.net/scottgu/archive/2009/07/10/silverlight-3-released.aspx.

2. Tim Heuer’s blog – http://timheuer.com/blog/

 

I recommend that you read Tim Heuer’s blog because of the more detailed discussion of the new features of Silverlight 3.

 

The links to the installers are listed below but for more information you can visit this website: http://silverlight.net/GetStarted/.

1. Microsoft Silverlight Tools for Visual Studio 2008 SP1

2. Microsoft Expression Blend 3 + SketchFlow RC

3. Deep Zoom Composer

4. Silverlight 3 Toolkit July 2009

5. Offline CHM Documentation

 

Enjoy!

July 2, 2009

Use C# to Create iPhone Applications

Filed under: Uncategorized — jojitsoriano @ 4:55 am
Tags: , ,

The same initiative that has brought Silverlight to the UNIX world comes up with an initiative to allow developers to create iPhone and iPod Touch applications using C#. iPhone and iPod Touch applications are written in Objective-C but with MonoTouch, “the Mono edition for Apple’s iPhone and Apple’s iPod Touch devices”, C# can now be used. This initiative is being developed by the open source community that handles the Mono Project which aims to allow UNIX developers to create cross-platform .NET applications like Silverlight. MonoTouch acts as a bridge between C# and Objective-C as it compiles C# application to run on iPhone and iPod Touch devices. According to the MonoTouch website (http://mono-project.com/MonoTouch), a limited beta is expected in August and a release is expected in September.

Requirements: a Mac, MonoTouch installer, XCode and iPhone SDK. Unfortunately, XCode and iPhone SDK do not work yet on a Windows machine. Looking at the brighter side, this should speed up the creation of iPhone prototypes as it reduces the learning curve as far as Objective-C is concerned.

July 1, 2009

Flex Workaround: ActionScript Does Not Support Method Overloading

Filed under: Uncategorized — jojitsoriano @ 8:43 am
Tags: ,

C#, VB.Net, and Java support method overloading, i.e. one can define two methods of the same name but with different parameters. For example, you can have a method named ShowName with a string parameter named pstrFirstName and you can have another method with the same name but with two string parameters named pstrFirstName and pstrLastName. This is method overloading and this is available also to class constructors. A class may be defined with multiple constructors. For example, you can have a default constructor, i.e. no parameters, and you can have two other constructors but with varying number of parameters depending on your requirement.

Unfortunately, ActionScript does not support method overloading! You cannot have two methods or two constructors having the same name even though they have different sets of parameters. The good news is that ActionScript provides …(rest) parameter to allow the developer to define a method that can accept any number of parameters. For example, if you want to create a single method that can add two, three, four, or more numbers, you can use the …(rest) parameter. This parameter declaration must be the last parameter specified.

The following code snippet shows a constructor for a class named AppBase that inherits from Canvas. My goal for this constructor with …(rest) parameter is to be able to use this class as a control in an MXML but at the same time to be able to instantiate the class with certain parameters. When you create a control and you want that control to be declared in MXML, the constructor of the control must have no parameter. In this snippet, I named the …(rest) parameter as …p_Args and is an array from which you can obtain the elements by specifying its index.

private var mstrAppId : String;
private var mstrJSessionId : String;
private var mstrServerUrl : String;
private var mstrWsdl : String;
public function AppBase(…p_Args)
{
    super();
    if(p_Args.length == 4)
    {
         mstrAppId = p_Args[0];
         mstrServerUrl = p_Args[1];
         mstrJSessionId = p_Args[2];
         mstrWsdl = p_Args[3];
    }
}

Flex Workaround: HTTPService Does Not Return Response Headers

Filed under: Uncategorized — jojitsoriano @ 5:03 am
Tags: ,

I am surprised that HTTPService of Adobe Flex does not return response headers!

What if an application written in Flex would want to communicate with a system written in J2EE and was using the Set-Cookie response header to get the JSESSIONID for login validation? This is what I have experienced when I started to work on a project that aims to evaluate the capability of Adobe Flex. Luckily I was able to do a workaround but I had to reuse the .Net WCF-based service I created in another project. My WCF-based service contains an OperationContract or a web method named MakeRequest. It accepts the parameters target url, request method, i.e. POST or GET, an array of header names, an array of header values, an array of parameter names, and an array of the values to post. The key to this web method is the WebClient
class from the System.Net namespace because it returns response headers together with the response body. The output string of this web method is the response body plus the response headers delimited by “@@@@@”.

[OperationContract]

public
string MakeRequest(string pstrTargetUrl,


string pstrMethod,


string[] pstrHeaderNames,


string[] pstrHeaderValues,


string[] pstrPostValueNames,


string[] pstrPostValues)

{


string returnString = “Bad Request”;


// This is a GET request with no form values and optional Basic auth


if (pstrMethod.ToUpper() == “GET”)

{


using (WebClient wc = new
WebClient())

{

wc.Proxy = null;


if (pstrHeaderNames != null && pstrHeaderNames.Length > 0)

{


for (int i = 0; i < pstrHeaderNames.Length; i++)

{

wc.Headers.Add(pstrHeaderNames[i], pstrHeaderValues[i]);

}

}

returnString = wc.DownloadString(pstrTargetUrl);

}

}


// This is a POST request with form values and optional Basic auth


if (pstrMethod.ToUpper() == “POST” && pstrPostValueNames != null)

{


using (WebClient wc = new
WebClient())

{

wc.Proxy = null;


if (pstrHeaderNames != null && pstrHeaderValues != null)

{


for (int i = 0; i < pstrHeaderNames.Length; i++)

{

wc.Headers.Add(pstrHeaderNames[i], pstrHeaderValues[i]);

}

}


var data = new
NameValueCollection();


for (int i = 0; i < pstrPostValueNames.Length; i++)

{

data.Add(pstrPostValueNames[i], pstrPostValues[i]);

}

 


byte[] result = wc.UploadValues(pstrTargetUrl, “POST”, data);


byte[] responseHeader = wc.ResponseHeaders.ToByteArray();

 

returnString = System.Text.Encoding.UTF8.GetString(responseHeader) + “@@@@@” + System.Text.Encoding.UTF8.GetString(result);

 

}

}


return returnString;

}

 

At the Flex side of the code, use the mx.rpc.soap.WebService to call the web method above with the required parameters. A sample of the header and parameter key-value pairs is shown below. Note that headerNames and headerValues should have a one-to-one correspondence, i.e. each element of the headerNames array should correspond to each element of the headerValues array. paramNames and paramValues should also have a one-to-one correspondence.

var headerNames : Array = new Array(“Content-Type”);

var headerValues : Array = new Array(“application/x-www-form-urlencoded”);

 

var paramNames : Array = new Array(“USER”, “CLIENT_PASSWORD”, “DATABASE”); var paramValues: Array = new Array(“username”, “password”, “dbname”);


 

May 7, 2009

Convert PNG, JPG, and GIF Files to ICO Online

Filed under: Uncategorized — jojitsoriano @ 8:42 am

This is cool! I came across with this site (http://converticon.com/) while trying to find how to convert PNG, JPG, and GIF files to ICO. Try this one. You don’t have to install anything. You just have to provide the PNG files and it will give you the files in ICO format and in the size of your choice. Cool, huh?

April 24, 2009

Configuring MS Project to Connect to Project Server

Filed under: Uncategorized — jojitsoriano @ 2:47 am
Tags: ,

Microsoft Office Project Professional 2007 (MS Project) provides the capability to publish the project schedule to the Project Server for access by other members of the team and centralized tracking of the status, issues, documents, etc. MS Project requires some configuration to be done to allow it to connect to the server.

  1. Click the Tools | Enterprise Options | Microsoft Office Project Server Accounts… menu item.

  1. In the Project Server Accounts dialog box that appears, click Add.

 

  1. In the Account Properties dialog, enter the following information:
    1. Account Name is an arbitrary name of the account or connection.
    2. Project Server URL is the address or URL of the Project Web Access (PWA).
    3. Check the Set as default account checkbox.

       

  1. Click button to save the account and close the Account Properties dialog box.
  2. Click OK button to close the Project Server Accounts dialog box.
  3. Close MS Project.
  4. Open MS Project again. You will now be prompted to select the Profile to use.
  5. Select the Account you created earlier. If you don’t need to update the PWA, you can select the Computer profile instead.

     

 

  1. Click the Enter User Credentials to enable the User Name and Password fields.
  2. Enter the credentials you use to login to the Project Web Access.

     

 

  1. Click the OK button to log-in.
  2. After successful connection to the server, MS Project is now ready. You can work on your project plan and publish it to Project Server.

Setting the Duration Field to Hours

Filed under: Uncategorized — jojitsoriano @ 2:29 am
Tags:

By default, Microsoft Office Project Professional 2007 has days as the unit for the Duration of a task. To change this to hours, click on Tools | Options to launch the Options dialog box. Under the Schedule tab, set the Duration is entered in: field to Hours. Click the Set as Default button to save this setting for subsequent sessions of MS Project.

April 20, 2009

Tracking Methods in Project Server 2007

Filed under: Uncategorized — jojitsoriano @ 9:47 am
Tags:

Here is a comparison of the three tracking methods available in Project Server 2007 and I’m quoting this from the book Microsoft® Office Project Server 2007: The Complete Reference by Dave Gochberg and Rob Stewart.

Percent of Work Complete – This method assumes that the task starts on the scheduled date, and users simply enter a percentage (from 0 to 100) of completed work. Project Server will calculate the actual work based on the percentage complete of planned work.

Actual Work Done and Work Remaining – Regardless of the calendar time, the resource enters overall actual work and remaining work for a task.

Hours of Work Done per Period – Resources are expected to enter their actual work over a given time period. They can enter remaining work on the task to indicate variance from the planned work. This is the preferred option for a best practices approach.

This is important to note because I have experienced a number of fields moving or recalculating as a result of some fields being changed in Microsoft Project. This is frustrating when one does not know what fields automatically recalculate.

March 30, 2009

March 2009 CTP of Silverlight LOB Controls from Infragistics Now Available

Filed under: Silverlight — jojitsoriano @ 7:25 am
Tags: ,

I know I’m one week late to announce this in my blog. March 2009 CTP of Silverlight LOB controls from Infragistics is now available for download! I’ve been watching out for this as early as the first week of March and I was surprised to read in a blog this morning that the March CTP was released last March 23. I don’t know yet what really are in it but what is significant to know is that this release is built on Silverlight 3 Beta. That’s the main reason I haven’t explored it yet. My project is currently developed in Silverlight 2 and I will have to setup another development environment to test if my source code will work in Silverlight 3 Beta. For the meantime, I’ll just believe while not seeing for myself what’s new based on the following links:

Product Overview: http://www.infragistics.com/Product.aspx?id=7781#Overview

Release Blog: http://blogs.infragistics.com/blogs/devin_rader/archive/2009/03/25/netadvantage-webclient-silverlight-march-2009-ctp.aspx

I know you gonna ask this same question: Why Silverlight 3 Beta for this CTP? Here’s the answer: http://blogs.infragistics.com/blogs/jason_beres/archive/2009/03/27/silverlight-product-version-strategy.aspx

I’ll just wait for the right time to upgrade to Silverlight 3 Beta and that may be as early as next week after demos to the project stakeholders are all done. J

March 25, 2009

Register ASP.NET 2.0 to IIS

Filed under: Uncategorized — jojitsoriano @ 10:49 am
Tags:

After installing IIS, I opened the Internet Information Services Manager under the Administrative Tools and examine the Web Service Extensions node. I was wondering how come it had an entry for ASP.NET v1.1.4322 with the Allowed status but no ASP.NET 2.0 even though .Net Framework 2.0 was already installed in this machine. Anyway, I asked Mr. Google and he pointed me to a number of websites. I tried one of the suggestions and it worked, i.e. run

C:WindowsMicrosoft.NetFrameworkv2.0.50727aspnet_regiis.exe -i

in a command prompt console to register ASP.NET 2.0 to IIS. Take note of the -i option and the version folder. After this, the Web Service Extensions node of the IIS will now have the ASP.NET v2.0.50727 entry with the status set to Allowed.

Next Page »

Blog at WordPress.com.