Get Blogged by JoKi

"The only frontiers are in your mind"
28 | 01 | 2012
Navigation
Syndication
RSS feed syndication RSS 2.0
Latest Tweets
Most Read Articles
Related Resources
Article Time Line
About me
Microsoft MVP - Visual Developer for Visual FoxPro 2006 & 2007

Microsoft Certified Professional

Get in contact

Sharing is caring

Recent books

  • MCTS 70-536 - .NET Framework 2.0 Application Development Foundation
  • Code-Centric: T-SQL Programming with Stored Procedures and Triggers
  • Microsoft .NET Framework-Programmierung in C#

Community

deutschsprachige FoxPro User Group

Microsoft Community Leader/Insider Program

International .NET Association

O'Reilly Verlag
Sponsoring
If you like the information on these pages, your support is highly appreciated.
Thank you very much!
Validation

Valid XHTML 1.0 Transitional
Valid CSS!
Valid RSS
Valid Atom 1.0

Spacer for layout formatting
Get Blogged by JoKi

Jochen Kirstaetter (2008)

The only frontiers are in your mind, welcome to my blog sphere. Your host is Jochen Kirstätter aka JoKi.

Dive into the weird world of a professional software developer and follow his daily victories and struggles with modern technology. I am a Microsoft Certified Professional (MCP) for Visual FoxPro, was Microsoft Most Valuable Professional (MVP) for Visual FoxPro in 2006 and 2007, and from spring 2004 until end of 2006 I organized monthly user group meetings as regional director of German FoxPro User Group (dFPUG). Based on this community activities I am also member of Microsoft Community Leader/Insider Program (CLIP) and PASS Deutschland e.V.

This blog is also about the beautiful island of Mauritius, my home.

Sincerely, JoKi



Microsoft Virtual Academy PDF Version
Development
Thursday, 13 October 2011 11:15

Carpe Diem

It's been since a while that I could write an article for this blog but alas, I was (and still am) very busy with customer's work. Which is actually good. So, what is this article going to tell you? Well, in general, just what I already tweeted, that life is constant process of learning - especially as software craftsman.

Due to an upcoming new customer project in ASP.NET I had to seize the opportunity to get my head deeper into latest available technologies, like Windows Azure and SQL Azure. I know... cloud computing and so on is not a recent development and already available since quite a while but I never any means to get myself into this since roughly two weeks ago.

Microsoft Virtual Academy

I can't remember exactly what guided me towards the Microsoft Virtual Academy (MVA), oh wait... Yes, it was a posting on Facebook from an old CLIP community friend. He posted a shortened URL with #MVA tag that caught my attention. Thanks for that Thomas Kuberek. After the usual sign in or registration via Live ID I was a little bit surprised that Mauritius is not an available country option... Quick mail exchange with the MVA Decan, and yeah, apologies for the missing entry. So, currently I'm learning about Microsoft products and services, and collecting points under "Not Listed Country" until Mauritius is going to be added. Hopefully soon, as MVA honors your effort with different knowledge ranks that are compared to other students with public profiles. I think it's a nice move to add some game and competition factor into the learning game.

The tracks and their different modules are mainly references to publicly available material online, namely on either MSDN, TechNet, Channel9, or other Microsoft based sites. The course material therefore also varies in different media and formats, ranging from simple online articles over downloadable documents (.docx or .pdf) to Silverlight / Windows Media streams with download options.

Self-assessment and students ranking

Each module in a track can be finished by taking part in a self-assessment. Up to now, the assessment I did (and passed) were limited to 10 minutes available time, and consisted of six to seven questions on the module training material. Nothing too serious but it gives you a glimpse idea how Microsoft certification exams are structured.

Conclusion

Nothing really new but nicely gathered, assembled and presented to the MVA students. At the moment, I wouldn't dare to compare the richness and quality of those courses with professional training offers, like Pluralsight .NET Training, LearnDevNow, VTC, etc. at all, but I think that MVA has potential.

Give it a try, and let me know about your opinions.

 
Some mail details about Orange Mauritius PDF Version
User Rating:rating indicator fullrating indicator fullrating indicator fullrating indicator fullrating indicator blank / 3
PoorBest 
General
Friday, 11 February 2011 10:34

Being an internet service provider is not easy after all for a lot of companies. Luckily, there are quite some good international operators in this world. For example Orange Mauritius aka Mauritius Telecom aka Wanadoo(?) aka MyT here in Mauritius.

The local circumstances give them a quasi-monopol position on fixed lines for telephony and therefore cable-based DSL internet connectivity. So far, not bad but as usual... the details. Just for the records, I am only using the services of Orange for mobile but friends and customers are bound, eh stuck, with other services of Orange Mauritius. And usually, being the IT guy, they get in touch with me to complain about problems or to ask questions on either their ADSL / MyT connection, mail services or whatever. Most of those issues are user-related and easily to solve by tweaking the configuration of their computer a little bit but sometimes it's getting weird.

Using Orange ADSL... somewhere else

Now, let's imagine we are an Orange ADSL customer for ages and we are using their mail services with our very own mail address like " This e-mail address is being protected from spambots. You need JavaScript enabled to view it ". We configured our mail client like Thunderbird, Outlook Express, Outlook or Windows Mail as publicly described, and we are able to receive and send emails like a champion. No problems at all, the world is green. Did I mention that we have a laptop? Ok, let's take our movable piece of information technology and visit a friend here on the island. Not surprising, he is also customer of Orange, so we can read and answer emails. But Orange is not the online internet service provider and one day, we happen to hang out with someone that uses Emtel via WiMAX or UMTS..

And the fun starts... We can still receive and read emails from our Orange mail account and the IT world is still bright but try to send mails to someone outside the domain "@intnet.mu" or "@orange.mu". Your mail client will deny sending mail with SMTP message 5.1.0 "blah not allowed". First guess, there is problem with the mail client, maybe magically the configuration changed over-night. But no it is still working at home... So, there is for sure a problem with the guy's internet connection. At least, it is his fault not to have Orange internet services, so it can not work properly...

The Orange Mail FAQ

After some more frustation we finally checkout the Orange Mail FAQ to see whether this (obviously?) common problem has been described already. Sorry, but those FAQ entries are even more confusing as it is not really clear how to handle this scenario. Best of all is that most of the entries are still refering to use servers of the domain "intnet.mu". I mean Orange will disable those systems in favour of the domain "orange.mu" in the near future and does not amend their FAQs. Come on, guys!

Ok, settings for POP3 are there. Hm, what about the secure version POP3S? No signs at all... Even changing your mail client to use password encryption with STARTTLS is not allowed at all. Use "bow.intnet.mu" for incoming mail... Ahhh, pretty obvious host name. I mean, at least something like pop.intnet.mu or pop3.intnet.mu would have been more accurate. Funny of all, the hostname "pop.orange.mu" is accessible to receive your mail account. Alright, checking SMTP options for authentication or other like POP-before-SMTP or whatever well-known and established mechanism to send emails are described. I guess that spotting a whale or shark in Mauritian waters would be easier. Trial and error on SMTP settings reveal that neither STARTTLS or any other connection / password encryption is available. Using SSL/TLS on SMTP only reveals that there is no service answering your request.

Calling customer service

So, we have to bite into the bitter apple and get in touch with Orange customer service and complain/explain them our case and ask for advice. After some hiccups, we finally manage to get hold of someone competent in mail services and we receive the golden spoon of mail configuration made by Orange Mauritius:

SMTP hostname: smtpauth.intnet.mu

And the world of IT is surprisingly green again.

Customer satisfaction?

Dear Orange Mauritius, what's the problem with this information? Are you scared of mail spammer? Why isn't there any case in your FAQs?

Ok, talking about your FAQs - simply said: they are badly outdated!

Configure your mail client to use server name based in the domain intnet.mu but specify your account username with orange.mu as domain part. Although, that there are servers available on the domain orange.mu after all. So, why don't you provide current information like this:

POP3 server name: pop.orange.mu
SMTP server name: smtp.orange.mu
SMTP authenticated: smtpauth.orange.mu

It's not difficult, is it? In my humble opinion not really and you would provide clean, consistent and up-to-date information for your customers. This would produce less frustation and so less traffic on your customer service lines. Which after all, would improve the total user experience and satisfaction level on both sides.

Without knowing these facts. Now, imagine you would take your laptop abroad and have to use other internet service providers to be able to be online... Calling your customer service would be unnecessary expensive!

 
Using Lightbox with _Screen PDF Version
User Rating:rating indicator fullrating indicator fullrating indicator fullrating indicator fullrating indicator full / 4
PoorBest 
Development
Sunday, 31 October 2010 12:06

Although, I have to admit that I discovered Bernard Bout's ideas and concepts about implementing a lightbox in Visual FoxPro quite a while ago, there was no "spare" time in active projects that allowed me to have a closer look into his solution(s). Luckily, these days I received a demand to focus a little bit more on this. This article describes the steps about how to integrate and make use of Bernard's lightbox class in combination with _Screen in Visual FoxPro.

The requirement in this project was to be able to visually lock the whole application (_Screen area) and guide the user to an information that should not be ignored easily. Depending on the importance any current user activity should be interrupted and focus put onto the notification.

Getting the "meat", eh, source code

Please check out Bernard's blog on Foxite directly in order to get the latest and greatest version. As time of writing this article I use version 6.0 as described in this blog entry: The Fastest Lightbox Ever

The Lightbox class is sub-classed from the imgCanvas class from the GdiPlusX project on VFPx and therefore you need to have the source code of GdiPlusX as well, and integrate it into your development environment. The version I use is available here: Release GDIPlusX 1.20

As soon as you open the bbGdiLightbox class the first it, VFP might ask you to update the reference to the gdiplusx.vcx. As we have the sources, no problem and you have access to Bernard's code. The class itself is pretty easy to understand, some properties that you do not need to change and three methods: Setup(), ShowLightbox() and BeforeDraw()

The challenge - _Screen or not?

Reading Bernard's article about the fastest lightbox ever, he states the following:

"The class will only work on a form. It will not support any other containers"

Really? And what about _Screen? Isn't that a form class, too? Yes, of course it is but nonetheless trying to use _Screen directly will fail. Well, let's have look at the code to see why:

WITH This
.Left = 0
.Top = 0
.Height = ThisForm.Height
.Width = ThisForm.Width
.ZOrder(0)
.Visible = .F.
ENDWITH

During the setup of the lightbox as well as while capturing the image as replacement for your forms and controls, the object reference Thisform is used. Which is a little bit restrictive to my opinion but let's continue.

The second issue lies in the method ShowLightbox() and introduced by the call of .Bitmap.FromScreen():

Lparameters tlVisiblilty
* tlVisiblilty - show or hide (T/F)
* grab a screen dump with controls
IF tlVisiblilty
Local loCaptureBmp As xfcBitmap
Local lnTitleHeight, lnLeftBorder, lnTopBorder, lcImage, loImage
lnTitleHeight = IIF(ThisForm.TitleBar = 1,Sysmetric(9),0)
lnLeftBorder = IIF(ThisForm.BorderStyle < 2,0,Sysmetric(3))
lnTopBorder = IIF(ThisForm.BorderStyle < 2,0,Sysmetric(4))
With _Screen.System.Drawing
loCaptureBmp = .Bitmap.FromScreen(ThisForm.HWnd,;
lnLeftBorder,;
lnTopBorder+lnTitleHeight,;
ThisForm.Width ,;
ThisForm.Height)
ENDWITH
* save it to a property
This.capturebmp = loCaptureBmp
ThisForm.SetAll("Visible",.F.)
This.DraW()
This.Visible = .T.
ELSE
ThisForm.SetAll("Visible",.T.)
This.Visible = .F.
ENDIF

My first trials in using the class ended in an exception - GdiPlusError:OutOfMemory - thrown by the Bitmap object. Frankly speaking, this happened mainly because of my lack of knowledge about GdiPlusX. After reading some documentation, especially about the FromScreen() method I experimented a little bit. Capturing the visible area of _Screen actually was not the real problem but the dimensions I specified for the bitmap.

The modifications - step by step

First of all, it is to get rid of restrictive object references on Thisform and to change them into either This.Parent or more generic into This.oForm (even better: This.oControl). The Lightbox.Setup() method now sets the necessary object reference like so:

*====================================================================
* Initial setup
* Default value: This.oControl = "This.Parent"
* Alternative: This.oControl = "_Screen"
*====================================================================

With This
.oControl = Evaluate(.oControl)

If Vartype(.oControl) == T_OBJECT
.Anchor = 0
.Left = 0
.Top = 0
.Width = .oControl.Width
.Height = .oControl.Height
.Anchor = 15
.ZOrder(0)
.Visible = .F.
EndIf
Endwith

Also, based on other developers' comments in Bernard articles on his lightbox concept and evolution I found the source code to handle the differences between a form and _Screen and goes into Lightbox.ShowLightbox() like this:

*====================================================================
* tlVisibility - show or hide (T/F)
* grab a screen dump with controls
*====================================================================
Lparameters tlVisibility

Local loControl
m.loControl = This.oControl

If m.tlVisibility
Local loCaptureBmp As xfcBitmap
Local lnTitleHeight, lnLeftBorder, lnTopBorder, lcImage, loImage

lnTitleHeight = Iif(m.loControl.TitleBar = 1,Sysmetric(9),0)
lnLeftBorder = Iif(m.loControl.BorderStyle < 2,0,Sysmetric(3))
lnTopBorder = Iif(m.loControl.BorderStyle < 2,0,Sysmetric(4))

With _Screen.System.Drawing
If Upper(m.loControl.Name) == Upper("Screen")
loCaptureBmp = .Bitmap.FromScreen(m.loControl.HWnd)
Else
loCaptureBmp = .Bitmap.FromScreen(m.loControl.HWnd,;
lnLeftBorder,;
lnTopBorder+lnTitleHeight,;
m.loControl.Width ,;
m.loControl.Height)
EndIf
Endwith

* save it to a property
This.CaptureBmp = loCaptureBmp
m.loControl.SetAll("Visible",.F.)
This.Draw()
This.Visible = .T.
Else
This.CaptureBmp = .Null.
m.loControl.SetAll("Visible",.T.)
This.Visible = .F.
Endif

Are we done? Almost... Although, Bernard says it clearly in his article:

"Just drop the class on a form and call it as shown."

It did not come clear to my mind in the first place with _Screen, but, yeah, he is right. Dropping the class on a form provides a permanent link between those two classes, it creates a valid This.Parent object reference. Bearing in mind that the lightbox class can not be "dropped" on the _Screen, we have to create the same type of binding during runtime execution like so:

*====================================================================
* Create global lightbox component
*====================================================================

Local llOk, loException As Exception
m.llOk = .F.
m.loException = .Null.

If Not Vartype(_Screen.Lightbox) == "O"
Try
_Screen.AddObject("Lightbox", "bbGdiLightbox")
Catch To m.loException
Assert .F. Message m.loException.Message
EndTry
EndIf
m.llOk = (Vartype(_Screen.Lightbox) == "O")

Return m.llOk

Through runtime instantiation we create a valid binding to This.Parent in the lightbox object and the code works as expected with _Screen.

Ease your life: Use properties instead of constants

Having a closer look at the BeforeDraw() method might wet your appetite to simplify the code a little bit. Looking at the sample screenshots in Bernard's article you see several forms in different colors. This got me to modify the code like so:

*====================================================================
* Apply the actual lightbox effect on the captured bitmap.
*====================================================================

If Vartype(This.CaptureBmp) == T_OBJECT
Local loGfx As xfcGraphics
loGfx = This.oGfx

With _Screen.System.Drawing
loGfx.DrawImage(This.CaptureBmp,This.Rectangle,This.Rectangle,.GraphicsUnit.Pixel)
* change the colours as needed here
* possible colours are (220,128,0,0),(220,0,0,128) etc.
loBrush = .SolidBrush.New(.Color.FromArgb( ;
This.Opacity, .Color.FromRGB(This.BorderColor)))
loGfx.FillRectangle(loBrush,This.Rectangle)
Endwith
Endif

Create an additional property Opacity to specify the grade of translucency you would like to have without the need to change the code in each instance of the class. This way you only need to change the values of Opacity and BorderColor to tweak the appearance of your lightbox. This could be quite helpful to signalize different levels of importance (ie. green, yellow, orange, red, etc...) of notifications to the users of the application.

Final thoughts

Using the lightbox concept in combination with _Screen instead of forms is possible. Already Jim Wiggins comments in Bernard's article to loop through the _Screen.Forms collection in order to cascade the lightbox visibility to all active forms. Good idea. But honestly, I believe that instead of looping all forms one could use _Screen.SetAll("ShowLightbox", .T./.F., "Form") with Form.ShowLightbox_Access method to gain more speed. The modifications described above might provide even more features to your applications while consuming less resources and performance. Additionally, the restrictions to capture only forms does not exist anymore. Using _Screen you are able to capture and cover anything.

The captured area of _Screen does not include any toolbars, docked windows, or menus. Therefore, it is advised to take this concept on a higher level and to combine it with additional classes that handle the state of toolbars, docked windows and menus. Which I did for the customer's project.

 
Using 3G/UMTS in Mauritius PDF Version
User Rating:rating indicator fullrating indicator fullrating indicator fullrating indicator fullrating indicator full / 4
PoorBest 
Linux
Wednesday, 20 October 2010 14:12

After some conversation, threads in online forum and mailing lists I thought about writing this article on how to setup, configure and use 3G/UMTS connections on Linux here in Mauritius. Personally, I can only share my experience with Emtel Ltd. but try to give some clues about how to configure Orange as well.

Emtel 3G/UMTS surf stick

Emtel provides different surf sticks from Huawei. Back in 2007, I started with an E220 that wouldn't run on Windows Vista either. Nowadays, you just plug in the surf stick (ie. E169) and usually the Network Manager will detect the new broadband modem. Nothing to worry about. The Linux Network Manager even provides a connection profile for Emtel here in Mauritius and establishing the Internet connection is done in less than 2 minutes... even quicker.

Using wvdial

Old-fashioned Linux users might not take Network Manager into consideration but feel comfortable with wvdial. Although that wvdial is primarily used with serial port attached modems, it can operate on USB ports as well. Following is my configuration from /etc/wvdial.conf:

[Dialer Defaults]
Phone = *99#
Username = emtel
Password = emtel
New PPPD = yes
Stupid Mode = 1
Dial Command = ATDT

[Dialer emtel]
Modem = /dev/ttyUSB0
Baud = 3774000
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+cgdcont=1,"ip","web"
ISDN = 0
Modem Type = Analog Modem

The values of user name and password are optional and can be configured as you like. In case that your SIM card is protected by a pin - which is highly advised, you might another dialer section in your configuration file like so:

[Dialer pin]
Modem = /dev/ttyUSB0
Init1 = AT+CPIN=0000

This way you can "daisy-chain" your command to establish your Internet connection like so:

wvdial pin emtel

And it works auto-magically.
Depending on your group assignments (dialout), you might have to sudo the wvdial statement like so:

sudo wvdial pin emtel

Orange parameters

As far as I could figure out without really testing it myself, it is also necessary to set the Access Point (AP) manually with Orange. Well, although it is pretty obvious a lot of people seem to struggle. The AP value is "orange".

[Dialer orange]
Modem = /dev/ttyUSB0
Baud = 3774000
Init2 = ATZ
Init3 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init4 = AT+cgdcont=1,"ip","orange"
ISDN = 0
Modem Type = Analog Modem

And you are done.

Official Linux support from providers

It's just simple: Forget it!

The people at the Emtel call center are completely focused on the hardware and Mobile Connect software application provided by Huawei and are totally lost in case that you confront them with other constellations. For example, my wife's netbook has an integrated 3G/UMTS modem from Ericsson. Therefore, no need to use the Huawei surf stick at all and of course we use the existing software named Wireless Manager instead of. Now, imagine to mention at the help desk: "Ehm, sorry but what's Mobile Connect?"

And Linux after all might give the call operator sleepless nights... Who knows?

Anyways, I hope that my article and configuration could give you a helping hand and that you will be able to connect your Linux box with 3G/UMTS surf sticks here in Mauritius.

 
Yes, I did it - Skydiving in Mauritius PDF Version
User Rating:rating indicator fullrating indicator fullrating indicator fullrating indicator fullrating indicator full / 6
PoorBest 
General
Saturday, 16 October 2010 10:36

Finally, I did it or better said we did it. Already back in November last year I saw the big billboard advertisement of Skydive Austral Mauritius near Caudan Waterfront in Port Louis and decided for myself that this is going to be the perfect birthday gift for my wife. Simply out of curiosity I would join her tandem jump with a second instructor. Due to her pregnancy of our son I had to be patient... But then finally, her birthday had arrived and on our midnight celebration session I showed her her netbook with the website preloaded.

Actually, it was the "perfect" timing... Recovery from her cesarean is fine, local weather conditions are gorgious and the children were under surveillance of my mum - spending her annual holidays on the island.

So, after late wake-up in the morning, we packed our stuff and off we went. According to Google Maps direction indication we had to drive for roughly 50km (only) but traffic here in Mauritius is always challenging. The dropzone is at the Zone Industrielle Mon Loisir Sugar Estate near Riviere du Rempart at the northern east coast. Anyways, we were not in a hurry and arrived there shortly after noon. The access road to the airfield are just small down-driven paths through sugar cane fields and according to our daughter "it's bumpy!". True true true...

The facilities at Skydive Austral Mauritius are complete except for food. Enough space for parking, easy handling at the reception and a lot to see for the kids. There's even a big terrace with several sets of tables and chairs, small bar for soft drinks, strictly non-alcoholic.
The team over there is all welcoming and warm-hearthy! Having the kids with us was no issue at all. Quite the opposite, our daugther was allowed to discover a lot of things than we adults did. Even visiting the small air plane was on the menu for her. Really great stuff!

While waiting for our turn we enjoyed watching other people getting ready in the jump gear, taking off with the Cessna, and finally coming back down on the tandem parachute. Actually, the different expressions on their faces was one of the best parts while waiting. Great mental preparation as my wife was getting more anxious about her first jump...

First, we got some information about the procedures on the plane about how to get seated, tight up with our instructors and how to get ready for the jump off the plane as soon as we arrive the height of 10.000 ft. All well explained and easy to understand after all.
Next, we met with our jumpers Chris and Lee aka "Rasta" to get dressed and ready for take-off. Those guys are really cool and relaxed for their job. Cool

From that point on, the DVD session / recording for my wife's birthday started and we really had a lot of fun... The difference between that small Cessna and a commercial flight with an Airbus or a Boeing is astronomic! The climb up to 10.000 ft took us roughly 25 minutes and we enjoyed the magnificent view over the turquoise lagunes near Poste de Flacq, Lafayette and Isle d'Ambre on the north-east coast. After flying through the clouds we sun-bathed and looked over "iced-sugar covered" Mauritius. You might have a look at the picture gallery of Skydive Mauritius for better imagination.

The moment of truth, or better said, point of no return came after approximately 25 minutes. The door opens, moving into position on the side on top of the wheel and... out! Back flip and free fall! Slight turns and Wooooohooooo! through the clouds... It so amazing and breath-taking! So undescribable! You have to experience this yourself!

Some seconds later the parachute opened and we glided smoothly with some turns and spins back down to the dropzone. The rest of the family could hear and see us soon and the landing was easy going. We never had any doubts or fear about our instructors. They did a great job and we are looking forward to book our next job. I might even consider to follow educational classes on skydiving and earn a license.

By the way, feel free to get in touch with Skydive Austral Mauritius. Either via contact details on their website or tweeting a little bit with them. Follow the tweets of Chris and fellows on SkydiveAustral.

 
« Start : Prev : 1 : 2 : 3 : 4 : 5 : 6 : 7 : 8 : 9 : 10 : Next : End »

Page 1 of 58
Spacer for layout formatting