Thursday, December 18, 2008

Carbide C++ IDE is free, even for Professional Edition

Yes, you are not wrong. Under the stiff competition from Apple's iPhone & Microsoft Windows Mobile 6.1, Nokia decides to release their native app builder, Carbide C++ IDE for free, for OEM, Professional & Developer Edition (seems there's no need for Expression Edition anymore).

New features added on this versions are:
  • Sensor APIs allow applications to connect to and receive data from various sensors on an S60 device.
  • Tactile Feedback Client API is used for producing tactile feedback for different touch events.
  • Touch UI Utilities API provides a mechanism to detect long-tap events on the touch screen.
  • Title Pane Touch Observer API allows an application to observe the user tapping on the title pane.
Here's some simple steps for settings up the development environment:
1) Get the Carbide C++ IDE version 2.0 & Nokia S60 5th SDK.

2) Install the S60 5th SDK first by extracting the zip & running the setup.exe.

3) Here's the content of the installation package if customized installation. Choose the one that meet you needs.

4) Point the Eclipse installation path for plug in if you want integration with it.

5) After S60 5th SDK installed, you can start installing Carbide C++ IDE version 2.0, and this is the Welcome screen.

6) And yes, this screen telling you it's free for all editions!

7) You can either choose OEM, Professional or Developer Edition here. I wonder who will need Developer Ed. when you have at least Professional Ed. Save disk space?


8) After Carbide C++ IDE installed, you can start it from "Start" menu and you will be welcomed with splash screen.

9) Carbide IDE is based on Eclipse, so those Eclipse user should familiar with it. You can either choose "Workbench", "Tutorials", .... Here're tutorials available.



10) Go back "Workbench", and you can start coding. Choose "New" from "File" menu. Here're the available templates. Take note on "S60 GUI Application with UI Designer". This feature is not available when i played around with Expression Edition 2~3 years ago. How envy i was last time for this feature of Rapid Application Development (RAD).

11) "UI Design Selection" for type of app.

12) Screenshot of Form Designer & Toolbox (in Visual Studio term)

13) After you build the project (yes, even without adding any feature, it's runnable with basic skeleton), a desktop emulator version of exe will be built.

14) Epoc will be trigger if you run or debug, and here's the simple application from S60 GUI application.

Online library get be reached here.

#p/s: Microsoft has launched a new project, for running apps in Apple's iPhone, named SeaDragon. The future of computing is on mobile!

Sunday, December 14, 2008

Application.StartupPath != Environment.CurrentDirectory

When developing the .NET app, you are not only creating an .exe. Most of the time, you will need some other files like .bmp, App.Config, and .xml. For those resource files(data or images), you could simply embed into the main exe and access it class "ResourceManager", though it might increase the size tremendously. But what if for those XML file that need user customization? You might put them along with your main executable file during deployment, for initialization. Thus you will need to find where your .exe starts, and to read XML file that relative to it. So now you might think you got at least two choices, "Environment.CurrentDirectory" & "Application.StartupPath".

From the MSDN, the definition of:
a) Environment.CurrentDirectory
Gets or sets the fully qualified path of the current working directory.
b) Application.StartupPath
Gets the path for the executable file that started the application, not including the executable name.

They look similar & match your purpose. "Environment.CurrentDirectory" looks good, especially it is located inside "System" namespace, so you no need to add any reference; while "Application.StartupPath" needs to add reference to assembly "System.Windows.Forms". You might think the former one is better for console application, and even windows service! Windows service does not need any GUI and would suppress any messagebox from pop-up. So using "Environment.CurrentDirectory" seems a good choice to prevent the developers simply calling messagebox in windows service if without adding reference to assembly "System.Windows.Forms", from design perspective.

So I decided to use "Environment.CurrentDirectory" for my dll, which is eventually called by the windows service, and the code to load the XML file would be similar to this:

Dim strXMLFile As String = Environment.CurrentDirectory & "\" & INITIALIZATION_XML
If Not File.Exists(strXMLFile) Then
Throw New FileNotFoundException("The initialization file " & INITIALIZATION_XML & " does not exist.")
End If
I created a WinForm for test harness of the dll, and everything was fine. Then this dll consumed by the windows services. Bang! I get an "FileNotFoundException" exception. I use Debug.Print to find that my XML look-up path was at: "C:\WINDOWS\system32"???

Why? It's because Windows service applications run in their own security context.
and more definition for "Environment.CurrentDirectory":

Gets and sets the fully qualified path of the current directory; that is, the directory from which this process starts.

Using the Reflector:
a) Environment.CurrentDirectory

b) Application.StartupPath


So, the "Environment.CurrentDirectory" is equivalent to "Application.StartupPath" when running as WinForm/console app and will become variable "%SystemDirectory%" eventually if run under windows service! A lesson learned.

p/s: You could use reflection from class Assembly as well, to find the start-up path.

Friday, November 28, 2008

Free booklets from Symbian

Symbian has published few booklets online, for free in SDN (Symbian Developer Network). You might ask, what the heck the booklet is. They are probably books contains small amount of pages.

Quoted from one of the booklets:
This booklet is targeted at absolute beginners wishing to develop C++ code on Symbian OS. We help you to choose the right tools and development environment, and list everything you’ll need - from the software development kits you’ll use,to the hardware you’ll work with.

These booklets are essentially the starting guide for the absolute beginner, who are getting started with the coding in Symbian OS, either UIQ or S60. Though most of them are less than hundred page, i think it inspires the community to grow bigger. There are under three categories (I don't count translated category as one, though i listed it):
a) Essential Symbian OS booklets
  • Coding Tips
  • Performance Tips
  • Coding Standards
b) Using Symbian OS booklets Essential
  • Getting started
  • P.I.P.S.
  • Carbide.c++
  • Ready for ROM
  • Platform security for all
c) Essential UI booklets
  • Essential UIQ: Getting Started
  • Essential S60:Getting Started
  • Creating Location-Aware Applications
d) Translated booklets
  • Chinese Getting Started
  • Chinese Coding Tips
  • Japanese Coding Tips
  • Chinese Essential UIQ Getting Started
  • Chinese Performance Tips
  • Japanese Performance Tips
  • Korean Coding Tips
  • Japanese Data Sharing Tips
  • Japanese P.I.P.S.
  • Spanish Getting Started
  • Japanese Carbide.c++
  • Chinese P.I.P.S.
  • Japanese Getting Started
  • Korean Getting Started
  • Russian Getting Started
  • Chinese Coding Standards
  • Japanese Coding Standards
  • Chinese Platform security for all
  • Persian Getting Started
  • Russian Carbide.c++
  • Italian Quick Recipes Taster
Personally, i think these 2 books are not bad:
a)"Essential S60:Getting Started" and

b) "Carbide.c++"

And actually you could get more at Forum Nokia, under section "Documentation". While you might interest to develop Symbian-based apps using C#, you might be a bit disappointed, this booklet is purely based on Net60, which is a propriety tool of Red Five Labs, and you got to pay for it.

So, why wait, get a copy of S60 Platform SDKs & Carbide.c++ Express (free IDE), and start coding!

#p/s: I think I am going to buy a Nokia N95 and create some simple apps as well, it looks great.
another #p/s: Nowadays, it becomes a common practice for every OS vendors host their sites, with the name like "XXX Developer Network", and "XXX Platform SDK". Familiar? See Microsoft Developer Network(MSDN) & Windows Platform SDK.

Tuesday, November 4, 2008

Screenshots from VS2010 CTP

After several days of suspension due to internal problem, Visual Studio 2010 and .NET Framework 4.0 CTP was up again to public on Monday. It's recommended for you to get the latest information from the Connect mainpage, instead of the link I provided on last post.

The downloads for vhd file are around 7GB and after extraction, it consumes nearly 24GB. What a huge space it takes. While still going thru' all the new features, here are some screenshot for dear readers :

VHD is using OS Windows Server 2008 SP1; 54 days left to activate

Now you know why it used up 24 GB; It comes with MS Office, MSSQL 2008, VS2008 & of course, VS2010

The start page got a face-lift.

About box of VS2010. We got 103 day left for trying.

WiX-based Windows Installer MSI file is came along with this CTP.

Wednesday, October 29, 2008

Visual Studio 2010 and .NET Framework 4.0 CTP released

Almost one month after Microsoft unveiled the press release, Visual Studio 2010 and .NET Framework 4.0 CTP can be downloaded from here: Microsoft Pre-release Software Visual Studio 2010 and .NET Framework 4.0 Community Technology Preview(CTP), and it is available in VHD format.

Here're some overview:
  • Democratizing Application Lifecycle Management
  • Enabling emerging trends
  • Inspiring developer delight
  • Riding the next generation platform wave.
Pick it up fast, and you could be the next MVP!
(Following image is external link)

Monday, October 27, 2008

Will Microsoft targets Autodesk Next?

Autodesk has acquired Softimage recently. This might not an important news to those programmers/software developers. But it might make a huge impact to those 3D Modellers, since now we sees 3ds Max, Maya, and Softimage are now under one roof. How are Autodesk going to position each of them, since they share so much similarities among them?


(From left to right: Autodesk 3ds Max, Softimage, Autodesk Maya)

So do you still remember these names?

1) WordStar (word processor application)
2) Lotus 1-2-3 (spreadsheet program)
3) Borland & Watcom C Compiler (C compiler)
4) OpenGL (3D graphics API)

These are the software products that once lead in its own fields, and now Microsoft had beat them with its own products, with Microsoft Word, Microsoft Excel, Visual C++ & Direct 3D, respectively.

After defeating several software giants, MS is targeting Adobe, with its SilverLight & Expression Studio. How long will Adobe (and Flash) last? Will Microsoft targets Autodesk next, especially MS has bought Carigari, the creator of trueSpace? Let's wait and see.

p/s: Dear developers, you might interest to see how .NET can be used in Autodesk product as well, at here: Developing for AutoCAD® Using F#
Gentle reminder, you might need to prepare yourself for it sooner or later :)

Saturday, October 25, 2008

How much difference between your salary with geek in googleplex

Feel your annual salary is low?
Think you are smart?
Sad why google not hire you?
Before all that, this might interest you: Salaries At Google, Microsoft And Yahoo .
(This image is external link, and I hold no rights)

Wednesday, October 22, 2008

10 Developer-must-have apps

While so many bloggers have suggested the usable tools to their audience, how could i lag? Although Scott Hanselman have covered most, and it's a mountain high to climb, let me introduce my favourite top 10 developer-must-have apps:

1) Notepad++ (Language: neutral)
when you need it?
a) View Unix files in Windows platform, especially during Java development.

when you open a come-with-JDK Java file using notepad

when you open it using Notepad++, it's well-formatted

b) Need to probe the _ViewState of ASP .NET web page to see how stateless HTTP retains value after post-back, using base64 decode. (you can try it here)

A normal ASP .NET with its HTML source

Copy the content to Notepad++

Decode it to base64, you can see your state retained

c) Determine Byte-Order-Mark of a file, whether it's saved in following formats: UTF-8, UTF-16, UTF-16 (LE), UTF-32 (BE), UTF-32 (LE), UTF-7, UTF-1, UTF-EBCDIC, SCSU, BOCU-1. And it's exactly .Net method GetPreamble trying to do.

Did you see extra three bytes ahead your file content?

d) it's lightweight, unlike Visual Studio IDE, although Noah Coad might beg to differ.
e) Hey! "All I've mentioned above, other editors have the same features as well". Well, simply I like its UI also.

2) Unlocker (Language: neutral)
when you need it?
a) When you want to delete a file which is being viewed/locked by hidden host. That's nothing more annoyed than this.

b) When a file get locked by your app, especially using class File.IO to write it without closing the stream properly.
c) When you try to delete an old ASP .NET version 1.1 web projects in "Inetpub" that's being locked by IIS.

3) Dependency Walker (Language: native)
when you need it?
a) When you need to determine a EXE is a native exe or .NET managed exe. Why, because you can decompile the source accordingly later :)

A .NET exe

A VB6 dll

b) Of course, find the exe/dll dependencies, as the name implies. When you were in the pre-NET era with only Visual C++/Visual Basic 6 & Package Deployment Wizard, there's no such thing called MSI technology, which can help you to determine most of the dependencies for you.

4) Process Explorer (Language: neutral)
when you need it?
a) When you need to find out what process/apps/service is running secretly. You'll never know your employer have planted a window service for software inventory control on your laptop, until you run it.

b) Check the thread state of a stopped thread, probably due to Timeout of Three-Way Handshake in FTP uploading/downloading, when you suppose to have a multi-threaded app run without stopping FTP upload/download.


5) Microsoft Network Monitor (Language: neutral)

when you need it?
a) When you have written a FTP client app running well on uploading files, but FTP server complaint it never receive. You can show this to prove.


b) When you need to sniff network traffic, especially on FTP since all the commands are transferred thru' Cleartext.

Wow, you can see user-name and password!

6) Reflector (Language: .NET)
when you need it?
a) When you need to re-generate the source that lost and you do not have any source control previously, with the aid from plug-in, FileDisassembler


b) When you need to find the difference between the exe/dll you deployed, with the another aid from plug-in, Diff

7) DebugView (Language: native/.NET)
when you need it?
a) When your app only with issue happens intermittently, you need your app to run in verbose mode using Debug.Print without additional tracer running side-by-side, that might affect the performance, or introduce new bug/maintenance issue. This works well for native app too, using Win32.

8) 7Z (Language: neutral)
when you need it?
a) It supports most of the commercial format, yet without asking you to purchase every time it loads, eg. WinZip, Winrar. Furthermore, it able to compress more to save your disk-space.

b) When you need to find out how the zip file is created. Either SharpZipLib or Windows built-in zipping tool; compression method is either DEFLATE, Implode, or Store. You can get the Host OS and CRC as well.

this zip file is compressed using SharpZipLib with DEFLATE method

this zip file is compressed using Store method

this zip file is compressed using Windows built-in zipping tool

9) Microsoft Virtual PC (Language: neutral)
when you need it?
a) When you wish to be beta tester yet you do not want to jeopardize your existing system.
b) When you found virus, and you need to cultivate it in order to trace the originator, so that... counter-hack!
c) When you need to test your web app in different OS. MS has prepared it for you to use it until January, 2009. Flavours available: Windows XP SP3 with IE6 VHD file, Windows XP SP2 with IE7 VHD file, Windows XP SP3 with IE8 Beta 2 VHD file, and Vista Image with IE7 VHD file. (see: Internet Explorer Application Compatibility VPC Image)
d) When you wish to play around with different *-nix OS.


10) Windiff (Language: neutral)
a) Basically for file compare and directory compare. I have used it since development in Visual C++ 6.0. Though it might not user-friendly, eg, cannot compare in separate panes, cannot compare Unicode/UTF-8 files. But it comes with Visual C++ 6.0 and have been with me so long, I feel hard to say goodbye to it.