Planet FoxPro

May 21, 2013

Alex Feldstein

Photo of the Day


Bat Flower (Tacca Chantrieri)
Native to China and Malaysia
Fairchild Tropical Gardens - Miami

by Alex Feldstein (noreply@blogger.com) at May 21, 2013 05:00 AM

Sandstorm's Blog (Home of ssClasses)

ComboBox in a Grid - Combobox Trick # 2


I have promised last time I will show another combobox trick but totally forgot about it.  Then yesterday another member asked about a combobox inside a grid saying while it is working on his end, whatever is selected on the active combobox does not appear.  It appears only when the combobox on the current record looses focus.

While working directly with grids do not appeal to me, I played with his requirement and indeed it does not show the combobox' DisplayValue.  So I got curious because if I recall properly, I fixed that problem on my end before but in the end working directly on a Grid does not really appeal to me that I discarded the entire concept and went back to Add To Table approach.

Anyway, here is a working sample of that if you need one, and on the bottom note the reason why:




loTest = Createobject("Sample")
loTest.Show(1)

Define Class Sample As Form
      Caption = 'Combobox in a Grid'
      AutoCenter = .T.
      Width = 240

      Add Object grid1 As Grid WITH ;
      ColumnCount = 1,;
      RowHeight = 22,;
      Width = 220,;
      DeleteMark = .F.

      Procedure Load
            Set Autoincerror Off
            Close Databases All
            Create Cursor junkdata (jdpk I Autoinc, prodfk I)
            For lnloop = 1 To 5
                  Append Blank
            Next
            Go Top

            Create Cursor junkproduct (prodpk I Autoinc, products c(30))
            Insert Into junkproduct Values (0,'Coke')
            Insert Into junkproduct Values (0,'Pepsi')
            Insert Into junkproduct Values (0,'Sprite')
            Insert Into junkproduct Values (0,'Mirinda')
            Insert Into junkproduct Values (0,'Royal')
            Insert Into junkproduct Values (0,'7-Up')
      Endproc

      Procedure grid1.Init
            With This
                  .RecordSourceType =1
                  .RecordSource = 'junkdata'
                  With .Column1
                      .Width = 200
                        .ControlSource = 'junkdata.prodfk'
                        .AddObject('Combo1','MyCombo')
                        .CurrentControl = 'Combo1'
                        .Combo1.Visible = .T.
                        .Sparse = .F.
                  Endwith
            Endwith
      Endproc

Enddefine

Define Class MyCombo As ComboBox
      RowSourceType = 2
      BoundColumn = 2
      BoundTo = .F.
      RowSource = 'junkproduct.products,prodpk'
      Value = 0
      Style = 2
      ControlSource = 'junkdata.prodfk'
Enddefine


See that it is showing the proper DisplayValue on the active combobox immediately after you selected on its dropdown portion?  Well the problem, AFAIK, is about the .BoundTo property.  While I mostly preferred it to be set to .T., in this case it is giving that adverse effect of hiding what has been selected in the dropdown portion when it disappears so it should be set to .F..

Study the sample and Enjoy!


by Jun Tangunan (noreply@blogger.com) at May 21, 2013 03:08 AM

Rahul Desai's Blog

May 20, 2013

Rahul Desai's Blog

Windows Azure in Australia! How does that change your security outlook?

Great piece of information covering the security aspects of Azure in Australia – from Rocky Heckman…

Windows Azure runs in data centres managed and operated by Microsoft Global Foundation Services (GFS). These geographically dispersed data centres comply with key industry standards, such as ISO/IEC 27001:2005, for security and reliability. They are managed, monitored, and administered by Microsoft operations staff that have years of experience in delivering the world’s largest online services with 24 x 7 continuity….more information at the link below:

Windows Azure in Australia! How does that change your security outlook? – Enabling Digital Society – Site Home – MSDN Blogs

by Rahul Desai at May 20, 2013 11:30 PM

Windows Azure expands Downunder

Exciting announcement and news….

The new Windows Azure major region in Australia will consist of two sub-regions located in New South Wales and Victoria. These two locations will be geo-redundant, offering our customers the ability to back up their data across two separate locations, both within Australia…more at the link below:

Windows Azure expands Downunder – Microsoft Australia Blog – Site Home – MSDN Blogs

by Rahul Desai at May 20, 2013 10:35 PM

Articles

VMware Kernel Module Updater hangs on Ubuntu 13.04

VMware Player has a nice auto-detection of kernel changes, and requests the user to compile the required modules in order to load them. This happens from time to time after a regular update of your system. Usually, the dialog of VMware Kernel Module Updater pops up, asks for root access authentication, and completes the compilation.

vmware-kernel-module-updater-info
VMware Player or Workstation checks if modules for the active kernel are available.

In theory this is supposed to work flawlessly but in reality there are pitfalls occassionally. With the recent upgrade to Ubuntu 13.04 Raring Ringtail and the latest kernel 3.8.0-21 the actual VMware Kernel Module Updater simply disappeared and the application wouldn't start as expected. When you launch VMware Player as super user (root) the dialog would stall like so:

vmware-kernel-module-updater-compile
VMware Kernel Module Updater stalls while stopping the services

Prior to version 5.x of VMware Player or version 7.x of VMware Workstation you would run a command like:

$ sudo vmware-config.pl

to resolve the module version conflict but this doesn't work anyway.

Solution

Instead, you have to execute the following line in a terminal or console window:

$ sudo vmware-modconfig --console --install-all

Those switches are (as of writing this article) not documented in the output of the --help switch. But VMware already documented this procedure in their knowledge base: VMware Workstation stops functioning after updating the kernel on a Linux host (1002411).

 

by Jochen Kirstaetter (jochen@kirstaetter.name) at May 20, 2013 10:19 PM

Beth Massi - Sharing the goodness

Use Your MSDN Benefit to Convert Your Office 365 Developer Preview

The easiest way to get started developing SharePoint apps with LightSwitch is to sign up for a free trial of an Office 365 Developer account at dev.office.com. Because Office 365 has moved from preview to release, if you signed up for a preview account, you have until May 31st to convert it to a paid subscription. Doing so will save all your content.

You can use your MSDN subscription benefit to get a year free. Here’s a step-by-step slideshare by Randall Isenhour (@SharePointDev) from the Office content team.

I just converted mine and it took about 5 minutes.

For more details see the Apps For Office and SharePoint Blog:
Convert your Office 365 Developer Subscription Preview to a General Availability subscription to save your content

Enjoy!

by Beth Massi at May 20, 2013 08:58 PM

Articles

Programming Windows 8 Apps with HTML, CSS, and JavaScript - All you need in one title

Programming Windows 8 Apps with HTML, CSS, and JavaScript by Kraig Brockschmidt (Microsoft Press)It took me a while to work through the 800+ pages of this title. And yes, I really mean working not reading...

Since the release of Windows 8 it should be obvious to any Windows software developer that there are new ways to develop, deploy and market applications for a broader audience. Interestingly, Microsoft started to narrow the technological gap between the various platforms - desktop, web, smartphone and XBox - and development of modern apps with HTML, CSS and JavaScript couldn't be easier. Kraig covers all facets of modern Windows 8 apps from the basic building blocks and project templates in Visual Studio 2012 over to the thoughtful use of specific APIs to finally proper deployment in the App Store and potential monetization.

The organisation of the book is lied out like step by step instructions or a tutorial. Kraig literally takes the reader by the hand and explains in detail in his examples about the reasons, the pros, and the cons of a certain way of implementation. Thanks to cross-references to other chapters he leaves the choice to the reader to dig deeper right now or to catch up at some time later.

Personally, I have to admit that I really enjoyed the relaxed writing style. App development is not dust-dry rocket science and it should be joyful to learn about new technologies. And thanks to the richness of the various chapters and samples you could easily adapt and transfer the knowledge gained in this title to other platforms like Windows Phone 8.

And last but not least: The ebook is freely available at Amazon, Microsoft Press and O'Reilly. Don't think about it, just get the book. Now.

Update:

I already mentioned this title in other blog entries which are related to Microsoft certification. Feel free to read on and to discover more online resources:

by Jochen Kirstaetter (jochen@kirstaetter.name) at May 20, 2013 08:50 PM

The Problem Solver

Unit testing code depending on the ASP.NET #WebApi HttpClient

In a previous post I showed how to unit test an ASP.NET WebAPI Controller. But with a REST service there is both a client and a service component. Assuming for a moment the client part is also written in C# we should test that as well.

In this case the client application contains the following class to load books from the REST WebAPI controller:

   1: public class BooksClient
   2: {
   3:     private readonly HttpClient _httpClient;
   4:  
   5:     public BooksClient(HttpClient httpClient)
   6:     {
   7:         _httpClient = httpClient;
   8:         BaseUrl = new Uri("http://localhost:63895/api/books/");
   9:     }
  10:  
  11:     public Uri BaseUrl { get; private set; }
  12:  
  13:     public IEnumerable<Book> GetBooks()
  14:     {
  15:         var response = _httpClient.GetAsync(BaseUrl).Result;
  16:         response.EnsureSuccessStatusCode();
  17:         return response.Content.ReadAsAsync<Book[]>().Result;
  18:     }
  19:  
  20:     public Book GetBook(int id)
  21:     {
  22:         var requestUri = new Uri(BaseUrl, id.ToString(CultureInfo.InvariantCulture));
  23:         var response = _httpClient.GetAsync(requestUri).Result;
  24:         response.EnsureSuccessStatusCode();
  25:         return response.Content.ReadAsAsync<Book>().Result;
  26:     }
  27:  
  28:     public Tuple<Book, Uri> PostBook(Book book)
  29:     {
  30:         var response = _httpClient.PostAsJsonAsync(BaseUrl.ToString(), book).Result;
  31:         response.EnsureSuccessStatusCode();
  32:         var newBook = response.Content.ReadAsAsync<Book>().Result;
  33:         var location = response.Headers.Location;
  34:         return new Tuple<Book, Uri>(newBook, location);
  35:     }
  36: }

This class uses the HttpClient to request the data from the service and extracts the books from the body before returning them.

 

Testing the BooksClient class

If we want to test this class we need to pass in an HttpClient object. This might not sound like a big deal but as this class doesn’t implement an interface we can’t use most of the standard mocking frameworks like Moq to replace the HttpClient with a test fake.

It turns out that this isn’t a big issue though as you can replace the internal pipeline of the HttpClient instead. This is done by passing in an HttpMessageHandler. This HttpMessageHandler is used as the pipeline to send requests and we can completely replace this with our own implementation. The easiest way is by creating a dummy DelegatingHandler and overriding the SendAsync() function to just return a fake response instead of actually doing an HTTP request.

 

The TestingDelegatingHandler<T> class

Creating a dummy DelegatingHandler  isn’t hard but using the TestingDelegatingHandler<T> makes this really easy. The complete code is below and is pretty simple:

   1: public class TestingDelegatingHandler<T> : DelegatingHandler
   2: {
   3:     private Func<HttpRequestMessage, HttpResponseMessage> _httpResponseMessageFunc;
   4:  
   5:     public TestingDelegatingHandler(T value)
   6:         : this(HttpStatusCode.OK, value)
   7:     { }
   8:  
   9:     public TestingDelegatingHandler(HttpStatusCode statusCode)
  10:         : this(statusCode, default(T))
  11:     { }
  12:  
  13:     public TestingDelegatingHandler(HttpStatusCode statusCode, T value)
  14:     {
  15:         _httpResponseMessageFunc = request => request.CreateResponse(statusCode, value);
  16:     }
  17:  
  18:     public TestingDelegatingHandler(
  19:         Func<HttpRequestMessage, HttpResponseMessage> httpResponseMessageFunc)
  20:     {
  21:         _httpResponseMessageFunc = httpResponseMessageFunc;
  22:     }
  23:  
  24:     protected override Task<HttpResponseMessage> SendAsync(
  25:         HttpRequestMessage request, CancellationToken cancellationToken)
  26:     {
  27:         return Task.Factory.StartNew(() => _httpResponseMessageFunc(request));
  28:     }
  29: }

The most important function is the SendAsync() which returns a new Task. Did I mention that the WebAPI is completely async enabled? Well it is so we just have to return a new Task that returns the HttpResponseMessage instead of the HttpResponseMessage directly.


Testing the GetBooks() function

The GetBooks() function gets all books from the REST service. A test is pretty simple. The only thing to be aware of is that in order to use the TestingDelegatingHandler we also need to create an HttpServer object and pass in an HttpConfiguration object. Normally an empty HttpConfiguration will be enough.

   1: [TestMethod]
   2: public void WhenGettingAllBooksTheyShouldBeReturned()
   3: {
   4:     // Arrange
   5:     var books = new[]
   6:     {
   7:         new Book{Id = 1, Author = "Me", Title = "Book 1"},
   8:         new Book{Id = 2, Author = "You", Title = "Book 2"}
   9:     };
  10:     var testingHandler = new TestingDelegatingHandler<Book[]>(books);
  11:     var server = new HttpServer(new HttpConfiguration(), testingHandler);
  12:     var client = new BooksClient(new HttpClient(server));
  13:  
  14:     // Act
  15:     var booksReturned = client.GetBooks();
  16:  
  17:     // Assert
  18:     Assert.AreEqual(2, booksReturned.Count());
  19: }


Simple enough right?

 

Testing the GetBook(int id) function

Testing this method is not much harder but we need to test both a positive and a negative result. The positive is just as simple as above:

   1: [TestMethod]
   2: public void WhenGettingAValidBookItShouldBeReturned()
   3: {
   4:     // Arrange
   5:     var book = new Book { Id = 2, Author = "You", Title = "Book 2" };
   6:     var testingHandler = new TestingDelegatingHandler<Book>(book);
   7:     var server = new HttpServer(new HttpConfiguration(), testingHandler);
   8:     var client = new BooksClient(new HttpClient(server));
   9:  
  10:     // Act
  11:     var bookReturned = client.GetBook(2);
  12:  
  13:     // Assert
  14:     Assert.IsNotNull(bookReturned);
  15:     Assert.AreEqual("Book 2", bookReturned.Title);
  16: }

 

The negative case isn’t much harder, all we need to do is make sure our dummy service returns an HTTP 404 Not Found status. With the overloads for the TestingDelegatingHandler<T> this is easy enough. See below:

   1: [TestMethod]
   2: [ExpectedException(typeof(HttpRequestException))]
   3: public void WhenGettingAnInvalidBookItShouldThrow()
   4: {
   5:     // Arrange
   6:     var testingHandler = new TestingDelegatingHandler<Book>(HttpStatusCode.NotFound);
   7:     var server = new HttpServer(new HttpConfiguration(), testingHandler);
   8:     var client = new BooksClient(new HttpClient(server));
   9:  
  10:     // Act
  11:     client.GetBook(-1);
  12:  
  13:     // Assert
  14:     Assert.Fail();
  15: }

 

Nice and simple right?

 

Testing am HTTP POST action

Testing an HTTP POST action to add a new book is slightly more complex. Not a whole lot but the REST convention is to return both an HTTP 201 Created status as well as the location of the new resource in an HTTP header. For this purpose the TestingDelegatingHandler<T> has an overload where you can just pass in a lambda to create the response. This gives us full flexibility and with that the test is simple enough.

   1: [TestMethod]
   2: public void WhenPostingABookItShouldBeAdded()
   3: {
   4:     // Arrange
   5:     var book = new Book { Id = 2, Author = "You", Title = "Book 2" };
   6:     var testingHandler = new TestingDelegatingHandler<Book>(request =>
   7:     {
   8:         var response = request.CreateResponse(HttpStatusCode.Created, book);
   9:         response.Headers.Location =
  10:             new Uri(string.Format("http://domain.com/api/books/{0}", book.Id));
  11:         return response;
  12:     });
  13:     var server = new HttpServer(new HttpConfiguration(), testingHandler);
  14:     var client = new BooksClient(new HttpClient(server));
  15:  
  16:     // Act
  17:     var result = client.PostBook(new Book());
  18:  
  19:     // Assert
  20:     var bookReturned = result.Item1;
  21:     Assert.IsNotNull(bookReturned);
  22:     Assert.AreEqual("Book 2", bookReturned.Title);
  23:  
  24:     var location = result.Item2;
  25:     Assert.AreEqual(new Uri("http://domain.com/api/books/2"), location);
  26: }

 

Of course we still need tests for updating existing resources as well as deleting them but with these examples those should be easy enough :-)

 

Enjoy!

by Maurice at May 20, 2013 03:37 PM

Articles

Learning from jQuery - Solid fundament for experienced jQuery developers

Learning from jQuery by Callum Macrae (O'Reilly)Frankly speaking, I had to sleep a night over before typing this review.

And even now it is not an easy, straight-forward task to write this recension. I'm not sure whether I'm the right kind of audience this title is actually addressed to. It clearly states that this book is for web developers which are very familiar with jQuery library but would like to extend their knowledge to vanilla JavaScript. Not being part of this particular group it felt strange to go through the various chapters after all. This title is clearly addressed to experienced jQuery users and developers especially while looking for improvements in performance and better ways of optimisations. Sometimes just to simplify the existing jQuery code in order to avoid the heavy load of the complete jQuery library and sometimes for the better understanding of JavaScript and its syntax.

Callum's style of writing is clear and the numerous code samples used to emphasize the various techniques are good ones and easy to understand. Quite interestingly, it put a light smile on my face when I compared his sample code of sending an AJAX request to some code in one of my own blog articles I wrote back in 2006 (in German language). JavaScript is clearly a mature language and certain requirements are simply done this way. And Callum explains the nuts and bolts of JavaScript very well.

Personally, I gained most out of this book from chapter 5 - JavaScript Conventions. The paragraphs and code snippets on Optimizations and Common Antipatterns gave me a better understanding on various aspects of JavaScript development, and I definitely have to revise a couple of code fragments I have written in the past.

Overall the book provides solid information on JavaScript for jQuery developers and is worth the money spent. Just be sure that you're part of the targeted audience.

by Jochen Kirstaetter (jochen@kirstaetter.name) at May 20, 2013 06:21 AM

Alex Feldstein

Rahul Desai's Blog

Install Microsoft Dynamics CRM 2011 on Windows Server 8 (Windows Server 2012)

Microsoft has released support for Windows Server 2012 in its UR13 update. With the availability of UR13, you should NOT need to read this blog post in the case that you intend to use UR13+ as your development environment. If your plan is to not use the latest rollup but rather stay with a rollup prior to UR13, then you can still use the techniques in this blog post (link below).

Daniel Cai’s Blog: Install Microsoft Dynamics CRM 2011 on Windows Server 8 (Windows Server 2012)

by Rahul Desai at May 20, 2013 02:45 AM

May 19, 2013

Alex Feldstein

May 18, 2013

Alex Feldstein

Sandstorm's Blog (Home of ssClasses)

Removing Ghost Devices from your unit


This is actually asked inside the forum and I said, hey this is likewise a good topic to add here in my blog, so...

What are Ghost Devices?

Well we can simply say this.  A ghost is believed to be an entity that is there but cannot be seen.  So a Ghost Device is on your unit but is hidden.  Also a ghost is a remnant of your physical being.  Ghost Devices likewise are remnants of your previous device installations like a scanner or printer that is no longer plugged into your machine, a mass storage device, a mobile phone, etc.  And even a single device can have several Ghost Entries on a single unit based on which port you plug that device to.

A ghost device is also sometimes referred to as a Phantom device.

How to manually clean Ghost Devices?

I will simply refer you instead to this Microsoft article:  http://support.microsoft.com/kb/315539

Is there a way to prevent Ghosting?

Yes there are but not totally foolproof.  I will tackle here the normal way first and then later the alternative ways.

The normal way

The normal way is via Safely Remove icon in the notification area.  While we can easily unplug devices without removing it safely which works as long as there is no read/write activity on the device, it is still not fully safe.  There is a chance you'll run on data corruption or in case of mass storage devices, Safely removing it will also include parking of the head which will prevent scratches on the disc inside it.   For flash drives, there is no head and disc to scratch so yes it is less prone to hardware failure as long as it totally stops blinking (meaning there is no more read or write activity going on).

However, aside from parking the head and closing open files, one purpose of that safely removal actually is for the OS to know that the device will be no longer be used and so it can free up the resources it is using.

I am missing Safely Remove icon in notification area, what to do?

This happens every now and then. So what to do if safely remove icon is not there?  You can call up the HotPlug Manager.  To do that, click Start, Run and then type RunDll32.exe shell32.dll,Control_RunDLL HotPlug.dll

What again are the alternatives?

If you are so conscious against ghosting or your line of work is dependent on constantly removing those ghost devices like when you are engaged in mobile services (repairs, upgrades and maintenance), then you may possibly encounter problems due to ghost devices that you may require removing the related phantom entries before you can successfully detect or operate the mobile device.  In which case, I would recommend that you rather acquire:

a.  Faronics' DeepFreeze software. http://www.faronics.com/products/deep-freeze/

What DeepFreeze do is give you control over restricting installation of new hardware or software (after you have frozen your unit), freeze specific drives, etc.  That when you reboot, all newly detected devices or newly installed apps will likewise be lost.  This is actually good and we are using it on Internet Caffe's because that involves less maintenance against malware detections and removals.  With internet user's, you cannot fully control on which site they will go and what they will click.  So in that case, DeepFreeze is a really good alternative solution.  And also you won't have to worry about ghost devices as well.

b. If your concern is only for these ghost devices, here is a good tool for that aptly named GhostBuster.  http://www.downloadcrew.com/article/27671-ghostbuster

But while I am pointing you to these alternatives, I am not giving any guarantee that every thing would be okay as it is normal that on case to case scenarios, there may be some adverse effects especially that these touches registry entries as well.




by Jun Tangunan (noreply@blogger.com) at May 18, 2013 12:14 AM

May 17, 2013

Alex Feldstein

Rahul Desai's Blog

Surface Pro hits Australian shores on May 30

On May 30, the Surface family of PCs will be growing in Australia with the launch of Surface Pro. Surface Pro with Windows 8 Pro will be available for purchase online via the Microsoft Store and through JB Hi-Fi and Harvey Norman.

Surface Pro hits Australian shores on May 30 – Microsoft Australia Blog – Site Home – MSDN Blogs

by Rahul Desai at May 17, 2013 12:42 AM

May 16, 2013

FoxCentral News

West Wind Web Service Proxy Generator 1.25 for Visual FoxPro released

 West Wind Technologies has released an update to the Web Service Proxy Generator, which automates the process for creating FoxPro clients to complex SOAP 1.x Web Services. The tool makes calling Web Services as easy as calling methods on a generated FoxPro proxy class. This release adds the ability to access some natively unsupported .NET types like Long and Single from FoxPro. A new HttpLogin() method has been added to the FoxPro proxy to simplify remote authentication in a more discoverable fashion. The Proxy Wizard now automatically requests Administrative Permissions from Windows UAC to run without permission failures. The Proxy Generator is available as shareware and registered users can simply re-download the registered version for a free update.

by West Wind Technologies at May 16, 2013 10:30 PM

FoxProWiki

UpcomingEvents

A place to list upcoming Visual FoxPro events like conferences, meetings, user groups, open training sessions...

May 16, 2013 10:30 AM

Alex Feldstein

Sandstorm's Blog (Home of ssClasses)

Grid Dynamic Property via a Method way

Usage of Dynamic Properties of a Grid seems to still baffles others because the sample that we can gleam in case of DynamicBackColor when using the Grid Builder using Ledger Style is via the IIF() condition.

Something like this:

This.Grid1.Column1.DynamicBackColor = ;
      'IIF(MOD(RECNO(),2)=1,RGB(255,255,255),RGB(192,220,192))'

And so by looking at that sample, we can create some more conditions like this:

This.Grid1.Column1.DynamicBackColor = ;
      'IIF(fld1= 1,RGB(255,255,255),RGB(192,220,192))'


So the natural instinct of some developers is that when the need is based on more than two conditions, they would expand above conditions with additional IIF()

This.Grid1.Column1.DynamicBackColor = ;
      'Iif(fld1= 1,Rgb(255,255,255),Iif(fld2 = 2,Rgb(255,255,0),;
           Rgb(192,220,192)))'

Or in case of higher VFP versions that support this, an ICASE() condition:

This.Grid1.Column1.DynamicBackColor = ;
      'ICASE(fld1= 1,Rgb(255,255,255),fld2 = 2,Rgb(255,255,0),Rgb(192,220,192)))'


But what if you have 10 conditions or more?  What if you have 50?  That would be a very long IIF() or ICASE() wouldn't it?  Well, this post is about showing an alternative way of achieving that which is via a Form Method.  Instead of that very long IIF() or ICASE() conditions, we can create a method and put the conditions there via DO CASE... ENDCASE conditions.  Here is a sample of that:



loTest = Createobject("Sample")
loTest.Show(1)

Define Class Sample As Form
      Caption = 'DynamicBackColor via Method'

      Add Object grid1 As Grid

      Procedure Load
            Create Cursor junk (fld1 i)
            Insert Into junk Values (1)
            Insert Into junk Values (2)
            Insert Into junk Values (3)
            Insert Into junk Values (4)
            Insert Into junk Values (2)
            Insert Into junk Values (1)
            Insert Into junk Values (3)
            Insert Into junk Values (1)

            Go Top
      Endproc

      Procedure grid1.Init
            With This
                  .RecordSourceType =1
                  .RecordSource = 'junk'
                  .SetAll('DynamicBackColor','Thisform._ChangeColor()','Column')
            Endwith
      Endproc

      Procedure _ChangeColor
            Local lcColor
            Do Case
                  Case fld1 = 1
                        lcColor = Rgb(255,255,0)
                  Case fld1 = 2
                        lcColor = Rgb(235,235,0)
                  Case fld1 = 3
                        lcColor = Rgb(225,225,0)
                  Case fld1 = 4
                        lcColor = Rgb(245,215,0)
                  Otherwise
                        lcColor = Rgb(255,255,255)
            Endcase
            Return (m.lcColor)
      Endproc
Enddefine

And there you have it.  A much easily readable condition using a form method and DO CASE... ENDCASE.  Hope this helps.  Cheers!

by Jun Tangunan (noreply@blogger.com) at May 16, 2013 05:58 AM

Alex Feldstein

May 15, 2013

Sandstorm's Blog (Home of ssClasses)

Choosing the Fastest Internet Connection Setting near you!


Normally your Internet Service Provider (ISP) controls the settings you can use to connect to internet.   They also have their own Domain Name System (DNS).  But accidentally I found out that while that is the normal way, we can still improve its speed.  And the trick lies in not relying blindly onto the DNS used and provided by our ISP.

What is DNS anyway?

An often-used analogy to explain the Domain Name System is that it serves as the phone book for the Internet by translating human-friendly computer hostnames into IP addresses. For example, the domain name www.example.com translates to the addresses 192.0.43.10 (IPv4) and 2001:500:88:200::10 (IPv6). Unlike a phone book, the DNS can be quickly updated, allowing a service's location on the network to change without affecting the end users, who continue to use the same host name. Users take advantage of this when they use meaningful Uniform Resource Locators (URLs) and e-mail addresses without having to know how the computer actually locates the services   - Wikipedia

It simply says that because we as humans remember names better than number combinations, then DNS is responsible in translating for instance sandstorm36.blogspot.com into its corresponding IP Address.   Imagine if we don't have DNS, then instead of saying "google it", you would end up saying "74.125.237.116 it!".  LOL!

So how does choosing the best DNS affects our browsing speed?  Well the better and more complete the phone book is, the better result we can get.



And since our internet response is really very slow here in Papua New Guinea, that I really needed to do a constant refreshing/reloading of the webpage just so I can browse it,  I decided to look for an alternative  DNS, the one that is likewise best nearest to this City and Country.

And the best tool (the one I know so far) is GRC's  Domain Name Server Benchmark Tool provided to us by Steve Gibson.  The size of that tool is very small and what it will do is perform a benchmark test of the available DNS and tells you which of those are best for your need based on your location.  Here is a sample image of that tool in action.


The first benchmark I ran on my end shows our ISP's DNS to be 4th in the ranking.  Number one is of course our server's domain followed by Google's Public DNS of 8.8.4.4. and on the 3rd slot its 8.8.8.8.  Second run moves our ISP's DNS down to the 6th place while Google's retain its top positions. Third and fourth run show's our ISP to be on the 2nd beating Google's Public DNS.

But since I have been using our ISP's DNS and never got a satisfactory result, I tried using Google's 8.8.4.4 and my oh my, I am impressed with the renewed vigor of browsing speed.  While sometimes I still need to reload the webpage, its occurrence is now comparably minimal.

However, just to make sure I will get the best of both worlds, I put all three DNS making 8.8.4.4 as the preferred followed by 8.8.8.8 and last our ISP's.  That is just an added precaution that should the preferred DNS fails, I have the other two as fallback.

You can find the tool for DNS Benchmarking here as well as some write-ups over that.  https://www.grc.com/dns/benchmark.htm

Another alternative good Free DNS that is always within the top 10 of the benchmark test I ran is OpenDNS' 208.67.222.220 and 208.67.222.222.  Check it out here:  http://www.opendns.com/

Anyway, the purpose of this blog is to let you know how to check for alternative DNS and on how  to choose wisely via the DNS Benchamarking tool plus performing your own tests.  And for this to work, you have to make your DNS configuration Static.  I hope that switching to Google's Public DNS or any of the top DNS that will be shown on the benchmark result may prove to be faster on your end as in mine.

Cheers!

by Jun Tangunan (noreply@blogger.com) at May 15, 2013 07:55 AM

Alex Feldstein

Rahul Desai's Blog

Connecting SharePoint Online and CRM Online using BCS – 2013 Edition

Nice post….

This blog post is a simple step-by-step walkthrough on connecting SharePoint Online (SPO) to CRM Online using the Business Connectivity Services (BCS). This can be useful in a number of situations including self service portals, executive dashboards, etc. The end goal for this post is to have CRM account information displayed within SharePoint as illustrated below (nothing fancy) but you can easily extend this sample to include additional scenarios such as pulling additional entities/tables, create/update CRM data, charts/dashboard, mashups with ERP and much more.

Connecting SharePoint Online and CRM Online using BCS – 2013 Edition – Girish Raja’s Blog – Site Home – MSDN Blogs

by Rahul Desai at May 15, 2013 12:30 AM

May 14, 2013

Alex Feldstein

www.atoutfox.org - Contributions

Matériel Session FOXYPREVIEWER rencontres Roissy 2013

Voici la documentation complète pour FoxyPreviewer. Toutes les fonctionnalités présentées dans les réunions sont expliquées dans l'article.

Il s'agit de la première version de ce document, s'il vous plaît laissez-moi savoir si vous trouvez quelque chose qui n'est pas très claire ou incomplète, et je serai heureux de mettre à jour!

1 - FoxyPreviewer documentation
2 - FoxyPreviewer downloads

by Cesar Ch at May 14, 2013 05:26 AM

May 13, 2013

Alex Feldstein

The Problem Solver

Filtering the data in an #AngularJS ngRepeat element

 

Index:

  1. Getting started with AngularJS
  2. Creating an AngularJS Controller
  3. The AngularJS $scope is not the MVC Model
  4. Using repeating elements in AngularJS
  5. Filtering the data in an AngularJS ngRepeat element

 

Showing a list of items like in the previous post is nice but if the list is large most users appreciate the possibility to search in it. Turns out that AngularJS has that already build in so it is really simple to do.

 

We are using exactly the same controller as before, all it contains is a list of people.

   1: function DemoCtrl($scope) {
   2:  
   3:     $scope.people = [
   4:         { firstName: 'Maurice', lastName: 'de Beijer' },
   5:         { firstName: 'Jacob', lastName: 'Smith' },
   6:         { firstName: 'Sophia', lastName: 'Brown' },
   7:         { firstName: 'Mason', lastName: 'Lee' },
   8:         { firstName: 'Emma', lastName: 'Wilson' },
   9:         { firstName: 'Ethan', lastName: 'Martin' },
  10:         { firstName: 'Emily', lastName: 'Taylor' },
  11:         { firstName: 'Wiliam', lastName: 'Wong' },
  12:         { firstName: 'Emily', lastName: 'Campbell' },
  13:         { firstName: 'Liam', lastName: 'Williams' }
  14:     ];
  15: }

 

To let the use filter the list we are going to add the AngularJS filter directive.

image

The change to the markup is minimal. I did change the items to be an ordered list but that is not important. The important part is adding the “| filter:filterText” to the ng-repeat directive. This filters the data in the array to containing the text in the filterText property. And the filter text is the result of the input element I added and data bound using the ng-model directive.

 

   1: <!DOCTYPE html>
   2: <html lang="en">
   3: <head>
   4:     <title>AngularJS Demo</title>
   5:     <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
   6: </head>
   7: <body ng-app ng-controller="DemoCtrl">
   8:     Search:
   9:     <input type="text" ng-model="filterText" autofocus />
  10:  
  11:     <ol>
  12:         <li ng-repeat="person in people | filter:filterText">
  13:             {{person.firstName}} {{person.lastName}}
  14:         </li>
  15:     </ol>
  16:  
  17:     <script src="Scripts/angular.js"></script>
   1:  
   2:     <script src="App/Controllers/DemoCtrl.js">
</script>
  18: </body>
  19: </html>

 

Nice and simple, just the way I like it :-)

by Maurice at May 13, 2013 07:51 AM

Alex Feldstein

Earl Scruggs And Friends - Foggy Mountain Breakdown

This one is from 2010. RIP Earl Scruggs.

Written by Earl Scruggs
Earl Scruggs, banjo - Glen Duncan, fiddle - Randy Scruggs, acoustic guitar - Steve Martin, 2nd banjo solo - Vince Gill, 1st electric guitar solo - Marty Stuart, mandolin - Gary Scruggs, harmonica - Albert Lee, 2nd electric guitar solo - Paul Shaffer, piano - Jerry Douglas,
dobro - Leon Russell, organ - Glenn Worf, bass - Harry Stinson, drums

image

by Alex Feldstein (noreply@blogger.com) at May 13, 2013 06:23 AM

Articles

Essentials for software developer or any computer job

I have been talking about the following on many occasions during the last years already. Actually, it is always part of my consulting services when companies ask for advice on what they should do to improve the overall satisfaction of their software developers. But in general, it's pretty simple: The following are my essentials for any software developer or craftsman that is taking her or his profession seriously. Originally, I started my list with the first four topics only but experience taught me that there is more to this. And even nowadays, I would clearly say that this overview scratches the surface only.

Touch-typing

After being introduced to a team of software developers and/or testers by project or company management, I really enjoy myself to ask this particular question at a very early stage:

"Do you touch-type?"

I can tell you the expressions of their faces says more than any written book I've read so far. It's absolutely amazing how such a simple question puts everyone in the room into a dazzling state and gets them to look, uhm sometimes even to gaze at me with a touch of glare in their eyes, as if I just spoke in an unknown language. The reactions are mixed but usually the responses are similar to this short selection:

  • "What?"
  • "Sorry, I don't understand."
  • "What do mean by touch-typing?"
  • "No... ?"

Honestly, I have to admit that I totally understand this kind of answer based on the fact that absolutely nowhere young programmers or developers are educated and trained in an efficient way to use their daily tools of future work. Seriously, that question would be comparable to ask an architect whether she uses a calculator on her job. Only, that her reply would be more like this: "Of course."

So what is the actual problem about the fact that most developers I meet here on the island are not capable to touch-type, or sometimes don't even know what I'm actually talking about? Sincerely, I have no straight answer to this but it seems obvious to all of them that working 6+ hours per day at the PC, using the keyboard to get the work done, doesn't necessarily require to be fast and efficient.

Definition of TOUCH-TYPE
: to type by the touch system
-- touch typist noun
Source: Definition taken from Merriam-Webster - http://www.merriam-webster.com/dictionary/touch-type

Know your tools... well, getting a glimpse at the various curriculum at the tertiary educational institutes reveals a little bit more. Touch-typing isn't part of the education and therefore ignored. Any software developer without touch-type capability would have difficulties with my equipment - das keyboard Ultimate:

Das Keyboard ultimate is a blank keyboard and the ultimate experience of touch-typing
das keyboard Ultimate is a keyboard with blank keys and the ultimate experience of touch-typing

Most people really don't understand the consequences. It's not only about time, effort and cost but also plays a great role in daily motivation. I know that developers want to write code first, uhm, maybe I should say to type code first. But what's the purpose of creating wonderful code when your physical capabilities are far behind your mental ones? It's like producing a lot of output that gets finally stuck in the I/O buffers of your body.

Latest generation of hardware and software

Obviously this should be a no-brainer but reality bites and quite often developers' machines are not top-notch. There are various reasons for that and hundreds of excuses made by an employer but frankly speaking at least every two to three years latest it is necessary to upgrade the work equipment. Again, this is also something I clearly advice to other companies: Faster machine, less time-consuming and more efficiency of their developers and software testers. When I begin to work with new teams I like to get a better understanding of their opinion about their work, and as you might have guessed already... The computer they are using is usually part of those conversations. Either because I ask about it or they already tell me that they are not happy about their PC. Usually, they have more powerful machines at home, either for gaming or to develop on private projects. Imagine the frustration they have coming to work and only finding a dead-slow machine. The pain of waiting until the IDE has started and loaded the recent projects finally. Some of them even switch on the machine, wait to login and then go for their cup of coffee until auto-started software applications enter a state of readiness.

In rare cases I witnessed that they even brought in their own laptop and left alone the hardware provided by their employer. How embarrassing this might be...

Anyway, latest hardware means faster processing, lower latency and higher productivity of each single employee. Or at least it is plausible to cut off that argument that a job couldn't be done due to hardware-related limitations, etc. blah blah.

Oh before I forget to write about that one: Get yourself at least a second screen!

Working with multiple screens increases a software developers productivity
Working with multiple screens increases a software developers productivity

No matter the screen size, okay at least 19" should do, put an additional screen on your desk. If you are working on a laptop, use the VGA or HDMI output for the better. In worst case you could use an older machine and install Synergy on both of them.

The rise in your productivity using a second screen compared to switching applications is outstanding. And the return of investment (ROI) is incredible fast. I really wonder how archaic certain software companies are when they don't provide a second screen to their employees. Here is a little anecdote from the past: It was on my explicit request that my former employer started to introduce additional screens at work desks after I simply demonstrated to the manager that it is more efficient and productive to work on multiple screens. At that time I was used to work on three screens since years on my private machine at home, and it was absolutely frustrating to go to work. A couple of days later, I got a new graphics card, a second screen and my boss was overly happy with his own dual-screen machine. ;-)

Next, let's talk about software. Once again, stay on top of the game and work with the latest and greatest version that is currently on the market. Not only to show your commitment to your job but also to have access to the state-of-the-art on productivity. Just recently, I worked as consultant for a local company here in Mauritius and honestly I was shocked to see the numerous installations of Visual Studio 2005 on their Windows 7 machines. And to make things even worse, team leaders had either Visual Studio 2008 or 2010 on their machines. Taking into consideration that Visual Studio 2012 was in the final stages to hit the market, I urged them to plan and run a general upgrade on all machines.

Eventually, you might ask for the reason. Well, there were several of them and I'm going to discuss them in no preferential order.

Cost of licenses

True, software licenses do cost money and unfortunately it isn't obvious to some people that you have to take expenses on licenses into your annual budget planning. So no money planned, no upgrades available. Interestingly, while addressing this dilemma to my clients they are not aware of certain subsidizes programmes offered by the software producers. For example, as Registered Microsoft Partner you can purchase tailor-made variations of MSDN at an affordable price.

I'm always working on the latest available version of Microsoft Visual Studio, Microsoft SQL Server or Xamarin Studio. And if time allows even on the beta versions...

Project circumstances

The project is targeted to version X of the operating system and has to work with version Y of that product. Well, software changes and so should your development environment. There have been rare cases that a newer operating system simply sucked but in general go for the latest. Simply to leverage the improvements, read: bug fixes, and the new features that those software packages are offering. And to be prepared just in case that the client is going to ask you:

"Is (y)our software working properly on the upcoming OS?"

It's always better to say something like this

"Yes, it does (with some minor modifications). We already tested it some weeks/months ago while in beta stage."

than to shrug your shoulders and respond something like that "We don't know."

Maintenance of deployed applications

Oh yes, the crux with legacy code and the demons from the past. Well, in that case do yourself a big big favour and virtualise the environment. Simple as that, get a copy of either Microsoft Hyper-V, Oracle VirtualBox or VMware Workstation or Player, and move that old-fashioned piece of code over there. I'm going to write more on software virtualisation later in this article.

Proper chair

Remember what I wrote about touch typing? As a software developer you are likely to sit between six and eight hours every day at your workplace. Okay, there are these 'unpleasant' interruptions to either have a break or to attend a meeting but at the end of the day you are sitting most of the time at your desk. Either to code, to test or to read about your active tasks. Again, I think it is absolutely essential that you have an ergonomic chair that is well-suited for your body. Don't save money on your health! In case that you're employed and not comfortable with your chair or desk, speak to your manager or superior and evaluate possible solutions. It will be in their interest that you are confident and happy to come to work instead of having that annoying tension in your right shoulder or aches in your spine after an intensive coding session.

You will be surprised what a difference a good chair can make compared to one of those standard office chairs that you get for cheap. and it doesn't have to be expensive but at least there should be a couple of decent features:

  • Height adjustable
  • Adjustable back shield
  • Support for your lower spine and pelvis
  • Adjustable arm rests
  • Mesh fabrics

Well, you might think that I can easily speak of that being self-employed. But hey, no wait a second... even being an employer I took care of the well-being of my employees at their work space. As said, it is crucial that you feel comfortable at work.

Comfort = happiness = motivation = results

It's that simple!

Again, when consulting companies I usually ask them whether they have an initial budget for each new employee or even an annual allowance for the existing ones that could be used for the working environment. Of course, there is none... What would be the benefit of this? Hm, isn't it obvious that if an employee is allowed to 'design and implement' her work desk based on her choices is eventually higher bonded emotionally to this environment and therefore less likely to change later on? No?

Virtualisation and isolated project environments

This might not be applicable in all cases but nonetheless I think it is worth to mention and discuss it here, too. Frankly speaking, I use virtualisation of software since more than a decade. If I remember correctly, I used to have an early copy of VMware Workstation at that time, and it was quite an experimental experience to run multiple copies of Windows on the same computer. But it was absolutely delightful to be able to work on Windows 2000 and to test the software on Windows 98 or Windows NT 4.0 without the necessity of having another physical machine. Actually, virtualisation software is always one of the first software packages that I install on a new (or re-installed) machine.

Furthermore, as soon as you are working on multiple projects or for a number of clients, virtualisation always provides me with a clean development environment. Do you remember the old days of DLL hell? Yes? Well, I don't! ;-)

When I was assigned to work a new project I either asked the responsible project manager to give me a virtual machine, or if not available I created a master image which I put an the company's file server for all my team mates. The purpose of the virtualised environment is simply to avoid any kind of unpredictable behaviour of your development conditions. Furthermore, I am able to design and create the virtual image exactly to the likings of one of the customer machines. Later on, I used to run VMware Converter in order to virtualise one of the client's computer into a virtual one. This way, I was able to develop, run and test the software under more 'real' conditions.

And compared to my colleagues I had absolutely no trouble to install patches, upgrades and newer versions of software packages that are involved in the development process of a particular project. If it happened that it didn't work for the better, revert to latest snapshot and tada I'm back on track without any serious delays or whatsoever. Again, this also allows any developer to install and experience new versions of their IDE or additional software packages. Well, at that time it was mainly about incompatibility of different ActiveX controls or versions of Microsoft Office.

In case that you have to provide support for older operating systems for your customers. No problem, put that old-faggot in a VM and enjoy the latest OS you can get on your amazing hardware.

Virtualise your work environment to ease your life
Virtualise your work environment to ease your life

Need to test your latest web project with various browsers on another operating system or older versions of a particular browser, use a virtual machine and be happy!

Don't forget that this also shows your expertise and knowledge towards your clients. If it runs on your machine doesn't necessarilty mean that it runs on any machine. So be prepared and test it as much as you can. I recently had the situation that one of my clients had their website designed and implemented by another web designer. Fair enough everything was displayed and working as expected until I started to run my usual cross-OS and cross-browser tests in order to check my modifications in the code behind. You can't imagine the visual differences on various browsers on Mac OS X, Linux, Android or an iOS-based device. 'Unfortunately', it was a real eye-opener for the client and more work for the web designer to improve the site.

Ergonomic desk and working environment

do-not-disturb
Source:imgur.com

Well, this chapter is related to your proper choice of chair but goes a little bit beyond that. I'm going to leave my point of view on the working desk, on some accessories and constraints on your surrounding. You should pay some attention to your work desk, mainly on the height of the surface which is supposed to align properly with the position of your arms, especially your wrists. In case that you don't have access to a height-adjustable desk, you might be surprised what wonders a couple of bricks can do...

Talking about elevation, last year I saw a couple of alternatives to the conventional sitting position. Personally, I was mainly impressed by the concepts of the standing desk and the treadmill desk. The first one comes in quite handy and could be realised easily with only a few additional items whereas the latter might not be the best choice for your surrounding after all. But in case that you are working in your noise-reduced cubicle or even in your own office room. Yes, why not work-out while pouring those challenging software requirements into lines of code and test cases.

Next, take care that you spend some bucks on the keyboard, mouse, touch pad or trackball that you are using all day long. Based on my own experience I can tell you to take this dead-serious. At the beginning of my programmer's career I was always wondering about a tensed neck and shoulder. Finally, I found out that this was caused by hand movements on the mouse! And as soon as I replaced the mouse with a trackball I never had any issues of that kind anymore. There are serious, chronically injuries reported for any kind of typing work. Don't ruin your health because you (or rather your employer) saved some bucks on a proper keyboard. It's absolutely not worth it. The problem here is that the symptoms are not visible at the beginning but slowly sneak in after some months or even years of working at the desk. Listen to your body and change your equipment in case of problems. Just give it a try and see how it works.

Also, take care that your surrounding is calm and quiet. Put your maximum effort into your working comfort. If there's a problem, address it - ad hoc. Do not ignore it or push it away from you. Again, if you are not happy with your workspace your motivation will start to decay. Treat yourself with a professional environment and also don't be afraid of talking to your manager. It is very simple to describe your show-case and to proof that the circumstance might have a negative impact on your ability to focus, to concentrate and to deliver proper results as expected. A quick and cheap solution to 'dis-connect' yourself from your surrounding is to put on headphones or earplugs. Not only do you block any disturbing sounds but you also visualise to your colleagues a simple yet effective 'Do not disturb'. Again, I can tell you out of my own experience it works incredible well. I used to yell (and sometimes even swear) at my mates when they came to my desk and talked to me out of the blue. Guys, my apologies for that but we found a solution. After I discussed this with my boss, we came up with a simple system that in case of questions or issues to speak about to notify each other through an instant message. It worked flawlessly from day one on, and was quickly adapted by all colleagues.

This paragraph might be restricted to offices in Mauritius only but you never know... Comfortable temperature!

I cannot recall how many times I went into a freezer instead of an office for software developers here over the island. It is sheer insanity of some companies on how they set the temperature of their air conditioning. As a rule of thumb the inside temperature should not exceed a difference of 5 degrees Celsius compared to the outdoor temperature. Anything else is not healthy and will get you sick. Can you imagine to see computer workers sitting in long-sleeves or even cardigans at their PC while everything else outside is literally melting away and daring for water? No? Then you should come to Mauritius...

Clean desk policy

Another hot topic that you should pay some attention to are those 'unnecessary extras' on your work desk.

Golden rule #1: No food on or near the desk!

Seriously, do not keep any kind of food or snacks or whatsoever edible in the reachable surrounding of your work desk. It is not only disgusting to have crumbs of bread between the keys of a keyboard but also unhealthy for your body as you tend to eat mindless and unconsciousness. And leaving your desk to have a drink or to have a snack gives you the ability to chat and exchange with your co-workers, too.

Please, feel free and tell me in the comment section about how your desktop currently looks like. If you'd like to, take a picture and send it to me via email. I would be glad to write a follow-up article on this one with your contributions, seriously. Looking at my desk at the moment, I'm not too happy either. And as a matter of fact I just interrupted my work on this article, cleared up my desk and took a picture for you:

Keep your desk as clean as possible to avoid any kind of distraction
Keep your desk as clean as possible to avoid any kind of distraction

Now, I'm feeling more comfortable and more important: Less distracted!

Golden rule #2: Divide your daily tasks into chunks!

You don't have to monitor your email inbox every minute, don't need those nasty notification popups, or check your buddies' status on any social network. Instead, just have your instant messaging software up and running minimized, and focus on your main work: Coding.

Same as you are off from your desk occasionally, take care of this kind of tasks on specific times or bind them to other activities. For example, my mail client is usually closed during the day and only on certain activities, like ie. going to the tea kitchen to drink some water or to have my lunch break, etc. I check my mails and reply to them immediately. Don't forget, email is actually an asynchronous way of communication and you might assume that your communication partner is not expecting an answer within a couple of minutes. If they do, sorry then the choice of medium is rather poor; in such cases it would be better to use either instant messaging or pick up the phone and call the person.

Golden rule #3: Put your mobile away!

If your (personal) cellular or your smartphone isn't involved into your development process, simply do yourself a favour and put it out of your sight. Best would be to switch it into 'Meeting' profile and simply leave it in your bag. Please don't forget that you are at work, and not somewhere at a cafe or in a pub.

But there might be some kind of emergency case, you might argue. True but honestly, everyone is (or should be) aware of that you are actually at work and that they should call at the office in order to reach you. And let's not forget that the battery could be down, you forgot your mobile at home, etc. So, in case of an emergency it is way safer to call at the office.

Access to literature and training

Apart from writing software it is absolutely compulsory for any serious software developer to read books, blog articles and technical advisories, to watch tutorials or even to attend conferences on the technology you are working in. Actually, this is common to any kind of profession! Maybe I might be wrong here but for example doctors have to document their annual progress on latest research and products in the medical field. And so should software developers, too.

  • When was the last time that you read a book on a specific technology?
  • Do you know how many software-related books you read during a year?
  • Did you read any book since you left university?

Again, these are some of my standard questions when working with a new team of software developers. As for my part, I read approximately 5 to 6 technical titles in one year. Sometimes, I don't even need the content on an active project but the title did attract my attention and therefore I go for it. Interestingly, there had been occasions where that non-related title gave me an advantage on future work.

Nowadays, there are endless possibilities to gain access to high-quality material, especially in the field of software development. If you are a Windows developer go and check out MSDN and TechNet. Microsoft's latest achievement is called Microsoft Virtual Academy which provides online material and video courses on specific topics - for free! The recorded material is top-notch and you are able to download it for latter reference. Furthermore, I highly recommend you to get a subscription to one of the many eLearning platforms like Pluralsight, Lynda, TekPub, etc. just to name a few. And not to forget, check out the online tutorials from tool and libraries; ie. Telerik TV is a great resource in case you are working with their products.

Pick up the challenge and go for certifications. Yes, certifications will help you massively to know where you are standing with your knowledge, how to isolate blank spots and give you a deeper insight on the technologies you are dealing with on a daily base. Depending on your position, you should classify certifications as an investment into your future and to be able to stand out against other competitors on the market. As an employee you might like to discuss certifications as being part of your annual performance report. Not only do you show your employer clearly that you care for your job but it also increases your value for your employer. And honestly, it is a simple win-win situation for both parties. You get the chance to proof your knowledge and the certifications are personal, and your employer knows that you are able to deliver high quality results at a certain standard.

Learning on the job or during your spare time is essential as a software craftsman. Keep yourself educated and valuable to yourself, your employer and your clients.

by Jochen Kirstaetter (jochen@kirstaetter.name) at May 13, 2013 06:03 AM

Alex Feldstein

Photo of the Day


De Havilland Canada DHC-1B-2-S5 Chipmunk (1956)
@Sun-N-Fun

by Alex Feldstein (noreply@blogger.com) at May 13, 2013 05:00 AM

May 12, 2013

Alex Feldstein

A wonderful long-distance flight

I flew with a pilot friend in his Cessna 206 yesterday all the length of Florida.

He wanted to take some aerial pictures of a property he has near the town of Live Oak in Northern Florida. This is just south of I-10 about an hour west of Jacksonville and an hour east of Tallahassee, and close to the Georgia border.

He has a beautiful plane, which averaged about 130 miles per hour.

We departed from Homestead General Airport in South Florida and flew due north.

We flew IFR just in case of weather. The weather was great in the flight there but not so much on the way back. The flight took just under 2-1/2 hours for the 317 miles or so distance (510km).

The plan made us fly right over Lakeland Linder airport,the place I visited last month for the Sun-N-Fun airshow. That is far from my home in Miami, and it was just about half way to Suwannee County!

FltPlanX51_24J

(map courtesy of Fltplan.com)

As I said, the weather was gorgeous. We flew at 8,000ft and the view was spectacular.

We passed by a nice rail yard near Bartow. The aerial images are a little off due to having to shoot through glass and haze.

After 2-1/2 hours we reached the Suwannee County airport in North Florida. This was taken just before turning into final for landing:

RedBarnAcres

(map courtesy Skyvector.com)

We refueled in this airport then took off for the 6-mile trek to the private airstrip we were there to visit. This is a beautiful 57-acre place with a house, a hangar and a grass runway, called Red Barn Acres.

My friend keeps a car there as this is his summer home.

We drove into town for lunch but before that he drove to the nearby Suwannee river. There is this old abandoned bridge, closed to traffic but you can walk on it.

From the bridge you can see the Suwannee river:

We drove back to town and had a very nice lunch, then back to the house for some more photos.

The weather in the afternoon was starting to worsen as expected, and even though we took off with some sun, we promptly got into some clouds and rain. We asked for permission to go over the top of the clouds. We asked the traffic controller who did not have the information so he asked a passing airliner on his descent into Tampa. He said the tops were at about 11,000ft and it was clear above. We requested and it was granted. It was not too bumpy crossing the clouds. just a little, certainly less than I had expected. The top of the clouds was beautiful with blue skies above and wonderful cloud formations all around. At times the clouds were higher and as we were not allowed to go higher due to traffic into Tampa International airport, nor did we want to as we were flying in an unpressurized aircraft, every so often we had to go through clouds and it was a little bumpy inside, but not that much. It is certainly nice to be able to fly IFR were weather is not an issue. Had we flown VFR we would have had to stay in in Suwannee most of the day and wait.

The flight south was nice, as I learned a lot about IFR flying, ATC control and navigation. We arrived back at Homestead General a little after 4pm without incident.

It was a wonderful experience.

Update: The flight was recorded by Flightaware.

Flight going north shows the very nice weather we had (big storm to the west):

Return flight:

This shows the storm that was coming but still was hours away in the west. It also shows the small cells we went through on the way back.

by Alex Feldstein (noreply@blogger.com) at May 12, 2013 10:30 PM

Space Oddity

A revised version of David Bowie's Space Oddity, recorded by Commander Chris Hadfield on board the International Space Station.

Astronaut Chris Hadfield, commander of the ISS, did a wonderful version of David Bowie’s Space Oddity, as a farewell to the station.

image

This is the new NASA.

by Alex Feldstein (noreply@blogger.com) at May 12, 2013 09:40 PM

The Problem Solver

Unit testing a ASP.NET WebAPI controller

One of he goals of the ASP.NET WebAPI is to make REST style API controllers more testable than more traditional WCF services where in the past. For the most part that is true but there are cases where an ApiController depends on the actual incoming request and its data and things can become a bit more difficult.

Testing a simple ApiController that gets data

Suppose we have the following ASP.NET WebAPI Controller with two Get methods, the first returns the complete list of books and the second returns the book with the requested ID.

 

   1: public class BooksController : ApiController
   2: {
   3:     private readonly IBooksRepository _repo;
   4:  
   5:     public BooksController()
   6:         : this(new BooksRepository())
   7:     {
   8:  
   9:     }
  10:     public BooksController(IBooksRepository repository)
  11:     {
  12:         _repo = repository;
  13:     }
  14:  
  15:     // GET api/books
  16:     public IEnumerable<Book> Get()
  17:     {
  18:         return _repo.GetBooks();
  19:     }
  20:  
  21:     // GET api/books/5
  22:     public HttpResponseMessage Get(int id)
  23:     {
  24:         var book = _repo.GetBook(id);
  25:  
  26:         if (book == null)
  27:         {
  28:             return Request.CreateResponse(HttpStatusCode.NotFound);
  29:         }
  30:  
  31:         return Request.CreateResponse(HttpStatusCode.OK, book);
  32:     }
  33:  
  34:     // Remainder ommitted

 

Testing the Get() method

The Get() method that returns all books is easy enough to test. There are no dependencies on WebAPI bits, all it does is return a enumeration of books.

   1: [TestMethod]
   2: public void WhenGettingItShouldReturnAllBooks()
   3: {
   4:     // Arrange
   5:     var controller = new BooksController();
   6:  
   7:     // Act
   8:     var books = controller.Get();
   9:  
  10:     // Assert
  11:     Assert.AreEqual(5, books.Count());
  12: }

 

No big deal there :-)

 

Testing the Get(id) method

When getting a specific book things are a bit more complex. The requested Id might not exist and in that case we should return a specific HTTP response status code of 404 NotFound. This results in that the ApiController method uses the Request property to create a new HttpResponseMessage with the specific HTTP status code. If we just call this method we will receive an ArgumentNullException in the CreateResponse() function.

System.ArgumentNullException: Value cannot be null.
Parameter name: request

Just setting the Request property to a new instance of HttpRequestMessage is a start but not quite enough. With just this change you will see an InvalidOperationException with the following message:

System.InvalidOperationException: The request does not have an associated configuration object or the provided configuration was null.

To fix this we need to add a HttpConfiguration object through the Properties dictionary as below:

   1: [TestMethod]
   2: public void WhenGettingWithAKnownIdItShouldReturnThatBook()
   3: {
   4:     // Arrange
   5:     var controller = new BooksController
   6:     {
   7:         Request = new HttpRequestMessage()
   8:         {
   9:             Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } }
  10:         }
  11:     };
  12:  
  13:     // Act
  14:     var response = controller.Get(1);
  15:  
  16:     // Assert
  17:     Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
  18:     var book = response.Content.ReadAsAsync<Book>().Result;
  19:     Assert.AreEqual(1, book.Id);
  20: }

 

Testing for getting with an invalid ID is equally simple:

   1: [TestMethod]
   2: public void WhenGettingWithAnUnknownIdItShouldReturnNotFound()
   3: {
   4:     // Arrange
   5:     var controller = new BooksController()
   6:     {
   7:         Request = new HttpRequestMessage()
   8:         {
   9:             Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } }
  10:         }
  11:     };
  12:  
  13:     // Act
  14:     var response = controller.Get(999);
  15:  
  16:     // Assert
  17:     Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode);
  18: }


Testing an HTTP PUT operation

Testing an update using an HTTP put is just as simple as a testing a get action. The implementation looks like this:

   1: // PUT api/books/5
   2: public HttpResponseMessage Put(int id, Book book)
   3: {
   4:     if (!ModelState.IsValid)
   5:     {
   6:         return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
   7:     }
   8:  
   9:     var newBook = _repo.UpdateBook(book);
  10:     return Request.CreateResponse(HttpStatusCode.OK, newBook);
  11: }

And the related test goes as follows:

   1: [TestMethod]
   2: public void WhenPuttingABookItShouldBeUpdated()
   3: {
   4:     // Arrange
   5:     var controller = new BooksController()
   6:     {
   7:         Request = new HttpRequestMessage()
   8:         {
   9:             Properties = { { HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration() } }
  10:         }
  11:     };
  12:  
  13:     // Act
  14:     var book = new Book() {Id = 1, Title = "New Title", Author = "New Author"};
  15:     var response = controller.Put(book.Id, book);
  16:  
  17:     // Assert
  18:     Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
  19:     var newBook = response.Content.ReadAsAsync<Book>().Result;
  20:     Assert.AreEqual(1, newBook.Id);
  21:     Assert.AreEqual("New Title", newBook.Title);
  22:     Assert.AreEqual("New Author", newBook.Author);
  23: }


No big surprises there :-)

 

Adding new data using an HTTP POST action

Testing an HTTP POST used to add a new book is a little, but not much more, involved. The main reason for this is the HTTP convention to return a 201 Created status code and to include the HTTP Location header with an URI where the new resource can be found. The implementation is as follows:

   1: // POST api/books
   2: public HttpResponseMessage Post(Book book)
   3: {
   4:     if (!ModelState.IsValid)
   5:     {
   6:         return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
   7:     }
   8:  
   9:     var newBook = _repo.AddBook(book);
  10:  
  11:     var response = Request.CreateResponse(HttpStatusCode.Created, newBook);
  12:  
  13:     var uriString = Url.Link("DefaultApi", new { id = newBook.Id }) ?? string.Empty;
  14:     response.Headers.Location = new Uri(uriString);
  15:  
  16:     return response;
  17: }

 

If we try to test this with a similar setup action as the previous tests we will see a KeyNotFoundException below:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Not a very helpful message, what key is not found? The stack trace gives a clue and it turns out we need to configure the HTTP routing on the HttpConfiguration object. Easy enough as just calling WebApiConfig.Register() with the configuration should do the trick.

However this just leads us to an UriFormatException as the Uri.Link() function returns null.

It turns out we also need to add the HttpRouteData to the Request Properties dictionary with the controller name. No big deal but not exactly obvious.

The correct unit test is as follows:

   1: [TestMethod]
   2: public void WhenPostingANewBookShouldBeAdded()
   3: {
   4:     // Arrange
   5:     var httpConfiguration = new HttpConfiguration();
   6:     WebApiConfig.Register(httpConfiguration);
   7:     var httpRouteData = new HttpRouteData(httpConfiguration.Routes["DefaultApi"], 
   8:         new HttpRouteValueDictionary { { "controller", "Books" } });
   9:     var controller = new BooksController()
  10:     {
  11:         Request = new HttpRequestMessage(HttpMethod.Post, "http://domain.com/api/books/")
  12:         {
  13:             Properties = 
  14:             {
  15:                 { HttpPropertyKeys.HttpConfigurationKey, httpConfiguration },
  16:                 { HttpPropertyKeys.HttpRouteDataKey, httpRouteData } 
  17:             }
  18:         }
  19:     };
  20:  
  21:     // Act
  22:     var response = controller.Post(new Book()
  23:     {
  24:         Title = "A new book",
  25:         Author = "The author"
  26:     });
  27:  
  28:     // Assert
  29:     Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
  30:     var addedBook = response.Content.ReadAsAsync<Book>().Result;
  31:  
  32:     Assert.AreEqual(string.Format("http://domain.com/api/Books/{0}", 
  33:         addedBook.Id), response.Headers.Location.ToString());
  34: }

 

The arrange section might be a bit more verbose but once you know what to add no big deal.

 

Enjoy :-)

by Maurice at May 12, 2013 07:04 PM

Alex Feldstein

VisualFoxProWiki

UpcomingEvents

A place to list upcoming Visual FoxPro events like conferences, meetings, user groups, open training sessions...
Closest at the top please, and please remove past events.

May 12, 2013 01:48 AM

May 11, 2013

Alex Feldstein

May 10, 2013

The Problem Solver

Using repeating elements in AngularJS

 

Index:

  1. Getting started with AngularJS
  2. Creating an AngularJS Controller
  3. The AngularJS $scope is not the MVC Model
  4. Using repeating elements in AngularJS
  5. Filtering the data in an AngularJS ngRepeat element

 

In the previous  posts I showed how to get started with AngularJS and use some of the basic AngularJS directives to data bind. In these examples I uses a really simple single element to bind to. However in lots of business cases you really need to display a list of repeating elements. Fortunately this is really easy to do.

 

The AngularJS ng-repeat directive

Whenever you need to repeat a specific block of HTML markup for each item in an array the ng-repeat directive is your friend. Take a look at the simple list of people below.

image

 

The data for this list is contained in an array that is added to the $scope object in the controller. The actual controller is real simple, see the code below.

 

   1: function DemoCtrl($scope) {
   2:  
   3:     $scope.people = [
   4:         { firstName: 'Maurice', lastName: 'de Beijer' },
   5:         { firstName: 'Jacob', lastName: 'Smith' },
   6:         { firstName: 'Sophia', lastName: 'Brown' },
   7:         { firstName: 'Mason', lastName: 'Lee' },
   8:         { firstName: 'Emma', lastName: 'Wilson' },
   9:         { firstName: 'Ethan', lastName: 'Martin' },
  10:         { firstName: 'Emily', lastName: 'Taylor' },
  11:         { firstName: 'Wiliam', lastName: 'Wong' },
  12:         { firstName: 'Emily', lastName: 'Campbell' },
  13:         { firstName: 'Liam', lastName: 'Williams' }
  14:     ];
  15: }

 

The markup to generate the list in the screenshot is also real simple:

 

   1: <!DOCTYPE html>
   2: <html lang="en">
   3: <head>
   4:     <title>AngularJS Demo</title>
   5:     <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
   6: </head>
   7: <body ng-app ng-controller="DemoCtrl">
   8:     <div ng-repeat="person in people">
   9:         {{person.firstName}} {{person.lastName}}
  10:     </div>
  11:  
  12:     <script src="Scripts/angular.js"></script>
   1:  
   2:     <script src="App/Controllers/DemoCtrl.js">
</script>
  13: </body>
  14: </html>

 

The DIV element containing the ng-repeat, and everything inside it, is simply repeated for every person in the array of people. Simple right :-)

 

Editing the people

Editing the people in the list is really easy, just add an input control and use the same ng-model directive as before.

   1: <!DOCTYPE html>
   2: <html lang="en">
   3: <head>
   4:     <title>AngularJS Demo</title>
   5:     <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
   6: </head>
   7: <body ng-app ng-controller="DemoCtrl">
   8:     <div ng-repeat="person in people">
   9:         <input type="text" ng-model="person.firstName"/>
  10:         {{person.firstName}} {{person.lastName}}
  11:     </div>
  12:  
  13:     <script src="Scripts/angular.js"></script>
   1:  
   2:     <script src="App/Controllers/DemoCtrl.js">
</script>
  14: </body>
  15: </html>

 

In the screenshot below I am changing Jacob to Bob and as I type in the input element the text behind it is updated immediately.

image

 

Enjoy :-)

by Maurice at May 10, 2013 07:30 PM

FoxProWiki

UpcomingEvents

Editor comments: Chicago FUDG May meeting

May 10, 2013 05:00 PM

ChicagoFUDG

Editor comments: May 14 meeting

May 10, 2013 04:58 PM

Rick Strahl's Web Log

Publish Individual Files to your Server in Visual Studio 2012.2

In Visual Studio 2012 Update 2 there's a sweet little new gem, that I championed for some time in the past, and that has finally made it into the VS box: You can now publish individual files to the server without having to publish the entire site. You can now publish 1 or more files simply by selecting them in the Solution Explorer and using the Context Menu's Publish Selected Files or Publish File xxxx.xxx.

PublishIndividualFile

In the past if you wanted to publish your site, it was an all or nothing affair: You basically had to rebuild and re-publish the entire site. Publishing works great when you're making major updates that affect binaries and configuration settings. In that case you do want a full publish to push up your binary file changes as well as web.config transformations etc. This is a great feature and the cornerstone of publishing which is as it should be.

But on more than a few occasions I've:

  • Forgotten to include some content file like an image in a full publish
  • Had to make a really minor change to a content file or image and need to push it up
  • Make some quick iterative changes repeatedly to a file to tweak the UI or an image on the server

Now, with Update 2 you have another option to publishing the entire site -you can now publish an individual file.

I know this is a minor thing, but I can't tell you how often I use this for quick image or CSS updates. Sometimes I actually prefer making changes to these sorts of things on a live site rather than firing up the local copy first especially if the live site is running with a full set of data. It's often convenient to just push individual files. This is especially true for my personal content sites, more so than typical business applications.

 

Web Deploy Getting Easier

As a side note I've been a big fan of Web Deployment in Visual Studio - it's such a tremendous time saver over manually uploading files to the server and trying to figure out what needs updating. Prior to Web Deploy features in Visual Studio I actually had used a custom solution I cobbled together using FTP that provided much of the same functinality including the abililty to push individual files which I found very useful.

It's also great in a team environment, since publish settings are typically shared in source control. This ensures that everybody is pushing up code consistently to the staging or live server using the same settings that are configured only once. It's great when a new developer comes on board especially - they don't have to configure anything they are just ready to go.

When Web Publishing was introduced the intial versions were horrible to the point of unusability. In VS 2010 it improved somewhat, but the server side installation of Web Deploy was still a major pain in the ass. Getting Web Deploy configured properly on the server has been a real pain in the ass with 3 different installs required and several manual configuration steps.

With the latest Web Deploy 3.0 release though, Microsoft finally seems to have gotten Web Deploy right to where it's a single simple installation on the server that just works once installed. There no longer are any finicky configuration settings and it just works off the single install. Inside of the Visual Studio 2012 Web Publish client also has made the Publish Settings dialog a bit more user friendly and more flexible in what you can use to connect to the server. VS now understands pure site urls and virtuals as opposed to the base site url and Site ID/Name that was required previously and was always confusing.

WebPublishSettingsDialog

The end effect is I no longer dread setting up Web Deploy for the first time on a server, nor do I have to go look up the configuration for another site to figure out what put in the boxes :-).

It's kind of sad that it took so long for Web Deploy to get it all right, but now the whole thing is ridiculously smooth. There are a still a few issues with web.config transforms that are difficult to deal with from time to time, but that's not really Web Deploy's problem, but a problem of how to partition developer specific settings in configuration files which is always a problem.

In any case, I hope some of you find the new single file or selected file publishing feature as useful as I have. It's just one more little tweak that makes life easier and shaves a few minutes off the development process. Score!

© Rick Strahl, West Wind Technologies, 2005-2013
Posted in ASP.NET  Visual Studio  

by Rick Strahl at May 10, 2013 09:29 AM

Alex Feldstein

May 09, 2013

Beth Massi - Sharing the goodness

Saving Data Across One-to-One Relationships

I’ve had a couple questions recently on how you could add data to tables that have a one-to-zero-or-one relationship in Visual Studio LightSwitch. Depending on whether the related record is mandatory (required) or not you have a couple different options when inserting data. So in this post I’ll show you a couple different options for doing that in both the desktop and mobile clients.

Our Data Model

Let’s take a simple data model of Customer and a related table CustomerNote. A customer can have zero or one note as defined by the relationship.

image

When we create our Customer screens, LightSwitch will automatically bring the CustomerNote fields in as well. For edit screens this is exactly what we want because this allows the user to edit fields across both tables on one screen. However, on AddNew screens, LightSwitch will not automatically add a new record to the CustomerNote table – we need to write code for that depending on if the note is mandatory or not.

image

Adding Code to the Silverlight Client

In order to support this in the Silverlight desktop client we need to write some VB (or C#) code.

Mandatory: Always add a related record

If you want to always add a related record, use the _Created event. Open the data designer to the parent record (in my case Customer), select the DesktopClient perspective and then write code in the _Created event to add the related record every time the parent is inserted.

image

Write the code in bold.

VB:

Public Class Customer
    Private Sub Customer_Created()
        Me.CustomerNote = New CustomerNote()
    End Sub
End Class

C#:

public partial class Customer
{
    partial void Customer_Created()
    {
        this.CustomerNote = new CustomerNote();
    }
}

Now when we run the desktop client and add a new customer, the note fields are enabled.

image

Optional: Allow the user to decide

If the related record is optional and you want to have the user decide, add a gesture (like a button) to your screen. Open the screen designer and add a button, select “Write my own method” and call it AddNote, then edit the CanExecute and Execute methods.

image

VB:

Private Sub AddNote_CanExecute(ByRef result As Boolean)
    'Only enable the button if there is no note
    result = (Me.CustomerProperty.CustomerNote Is Nothing)
End Sub

Private Sub AddNote_Execute()
    ' Add the note
    Me.CustomerProperty.CustomerNote = New CustomerNote()
End Sub

C#:

partial void AddNote_CanExecute(ref bool result)
{
    // Only enable the button if there is no note
    result = (this.CustomerProperty.CustomerNote == null);
}

partial void AddNote_Execute()
{
    // Add the note
    this.CustomerProperty.CustomerNote = new CustomerNote();
}

 

Adding Code to the HTML Client

In order to support this in the html client we need to write some JavaScript code.

Mandatory: Always add a related record

Open the data designer to the parent record, but this time select the HTMLClient perspective. Then write JavaScript code in the _Created event to add the related record every time the parent is inserted.

myapp.Customer.created = function (entity) {

    entity.CustomerNote = new myapp.CustomerNote();
};

Notice the use of the myapp object here. You can use the myapp object in a variety of ways in order to access data and screens in the HTML client. Check out some other uses here- How to: Modify an HTML Screen by Using Code

Now when we run the HTML client and add a new customer, the note fields are enabled.

image

Optional: Allow the user to decide

Open the screen designer and add a button, select “Write my own method” and call it AddNote, then edit the CanExecute and Execute methods. Then write this code:

myapp.AddEditCustomer.AddNote_canExecute = function (screen) {
    // enables the button (returns true) if the note doesn't exist
    return (screen.Customer.CustomerNote == null);

};
myapp.AddEditCustomer.AddNote_execute = function (screen) {
    //Add a new note
    screen.Customer.CustomerNote = new myapp.CustomerNote();
};

Wrap Up

So those are a couple different ways you can manage data participating in one-to-zero-or-one relationships. Keep in mind that these tables are in the same data source, but they don’t have to be, you can set up virtual relationships this way as well. If you do have separate data sources, however, you’ll also need to tell LightSwitch the order in which you want to update them. For more information on that see: Customize the Save command to save to multiple data sources

Enjoy!

by Beth Massi at May 09, 2013 08:59 PM

Alex Feldstein

Articles

Upgrade to Xubuntu 13.04 - Raring Ringtail

Over the last couple of years, I had various levels of upgrade experience with Ubuntu, or more precise Xubuntu in my case. Those ones range from complete disaster (due to hardware issues) over good fun with some minor tweaks up to seamless. Following describes the steps and aftermath I did to upgrade my main working machine from Xubuntu 12.10 Quantal Quetzal to version 13.04 aka Raring Ringtail.

Preparations

In general, it is highly recommended that you read the official upgrade documentation of Ubuntu. Next, get your recent system up-to-date before you consider to upgrade. Also, take care that there are no pending partial upgrades or packages on hold. This might have a negative impact on the installation process of the newer packages. There are two possibilities to take of that: UI or terminal.

As for the UI, launch either the Ubuntu Software Centre or Synaptic Package Manager and check the status of your system.

ubuntu_software_centre
Check your system's status in Ubuntu Software Centre

synaptic_package_manager
The Synaptic Package Manager is a good alternative to check your system

and for those ones who prefer to work on the console, you might already know the procedure

$ sudo apt-get install -f
$ sudo apt-get update && sudo apt-get upgrade

And in worst case you might even consider to clean up a little bit before continuing with the release upgrade

$ sudo apt-get autoremove
$ sudo apt-get clean && sudo apt-get autoclean

That should do the work to put your machine in a clean state. One last step: Terminate any kind of screen saver or screen locker applications. The upgrade process will update libc6 and therefore is going to remind you that you might take the risk to get locked out of you system. Now, we are set for the next steps.

Initiate the upgrade

Start the process graphically via Applications menu > Settings Manager > Scroll down to section 'System' > Software Updater

settings_manager
Accessing the Software Updater in the Settings Manager

or run the following command to launch the visual Software Updater

$ sudo update-manager

Eventually, you have to adjust your settings for the available Ubuntu versions. Simply open the settings dialog and check that 'For any new version' is the selected value.

software_updater_settings
Check your notification setting on new Ubuntu versions

Afterwards, the updater should offer you Ubuntu version 13.04 as upgrade path.

In the console you have to modify your repository paths first. Open your favourite console text editor and change all occurences of 'quantal' into 'raring'

$ sudo nano /etc/apt/sources.list

Your file should look similar to this one:

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mu.archive.ubuntu.com/ubuntu/ raring main restricted
deb-src http://mu.archive.ubuntu.com/ubuntu/ raring main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mu.archive.ubuntu.com/ubuntu/ raring-updates main restricted
deb-src http://mu.archive.ubuntu.com/ubuntu/ raring-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mu.archive.ubuntu.com/ubuntu/ raring universe
deb-src http://mu.archive.ubuntu.com/ubuntu/ raring universe
deb http://mu.archive.ubuntu.com/ubuntu/ raring-updates universe
deb-src http://mu.archive.ubuntu.com/ubuntu/ raring-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mu.archive.ubuntu.com/ubuntu/ raring multiverse
deb-src http://mu.archive.ubuntu.com/ubuntu/ raring multiverse
deb http://mu.archive.ubuntu.com/ubuntu/ raring-updates multiverse
deb-src http://mu.archive.ubuntu.com/ubuntu/ raring-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes

And temporarily comment all the additional third-party repositories for the upgrade. We are going to enable them after the core update. Afterwards, simply type this

$ sudo apt-get update
$ sudo apt-get dist-upgrade

Now, it's time to lean back, wait for the packages to be downloaded and confirm a couple of questions from time to time. Depending on your amount of installed packages and your bandwidth it will take some while to get everything. As a reference, I had to upgrade 1720 packages with a total download size of approximately 1.1 GB. Due to my restricted bandwidth I left my machine alone overnight and do all the fun stuff. Next morning, some minor checks and rebooting the machine. The first fresh boot took a little longer than usual but the graphical login screen appeared as expected and after successful login my system was up to date.

ubuntu_uptodate
When all is said and done, work can be fun!

In case that you like to be on the safe side, you might consider to download the packages completely first and then do the upgrade itself afterwards:

$ sudo ap-get dist-upgrade -d

Doing the aftermath

This mainly depends on your package selection. In my case, I only had to take care of two specific applications: Skype and VMware Player. Well, as for VMware Player I had to re-install the application. You should use at least version 5.0.2 which is known to work out of the box on Ubuntu 13.04. Just in case that you don't have the latest version, get it from VMware and run the following in the directory with the bundle file:

$ sudo vmware-installer -u vmware-player
$ sudo chmod +x VMware-Player-5.0.2-1031769.x86_64.bundle
$ sudo ./VMware-Player-5.0.2-1031769.x86_64.bundle

This will do the trick and VMware Player runs again.

Skype actually took me a little bit more research (read: run some Google search queries) due to an error:

$ /usr/bin/skype
(Segmentation fault)

But the solution is also very simple. Skype requires to pre-load the libGL library in order to run properly

$ LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0 skype

And to simplify your life, create launcher script as a 'transparent proxy' for Skype:

$ sudo cd /usr/bin
$ sudo mv skype skype-bin
$ sudo nano skype

Your shell script should look like so:

#!/bin/sh
export LD_PRELOAD=/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
exec skype-bin "$@"

Save your file and enable the execute bit on the script:

$ sudo chmod +x skype

That's it! Skype starts again as expected...

Optional: Decluttering

Xubuntu 13.04 comes with a couple of re-introduced software packages that you might like to get rid of. Check out the installed applications in your Ubuntu Software Centre or Synaptic Package Manager and remove them as needed.

by Jochen Kirstaetter (jochen@kirstaetter.name) at May 09, 2013 06:09 AM

www.atoutfox.org - Contributions

Changer le séparateur décimal en entrée de programme et le restituer en sortie

Comment changer le séparateur décimal et le restituer.

Il peut arriver que dans une entreprise, certains ordinateurs soient configurés avec le séparateur décimal en tant que point « . » et d'autres en tant que « , »
Le propos de ce tutorial est de montrer comment détecter le séparateur décimal en cours, au lancement de l'application, le changer pour l'application et le restituer en sortie de l'application, tant sur une sortie normale, que sur une erreur. Ce tutorial est fait en Vb. Vous pourrez aisément le transcrire en C#
Pour ce faire, nous allons nous servir d'un module en utilisant les SET et GET , afin de récupérer le séparateur (set) et de le modifier (Get)

Tout est dans le pdf joint

Voir sur http://www.strataframe.fr/forum/Topic408.aspx

by eric leissler at May 09, 2013 05:26 AM

Alex Feldstein

May 08, 2013

FoxProWiki

DragAndDrop

Editor comments: Formatting

May 08, 2013 11:21 PM

Alex Feldstein

Photo of the Day


Fairchild Tropical Gardens - Miami
Note: this is not a crop. This was what filled the frame. Yes, this close!

by Alex Feldstein (noreply@blogger.com) at May 08, 2013 10:05 AM

May 07, 2013

Alex Feldstein

FoxProWiki

UpcomingEvents

Editor comments: Philly May

May 07, 2013 08:44 PM

FoxCentral News

Philadelphia VFP User Group meets May 14

 The next meeting of the Philadelphia VFP User Group is Tuesday, May 14. We?ll supply dinner for the group starting at 6:30 PM. If you?re planning to join us for dinner, please send an email to tamar@tamargranor.com, so we buy enough food. Our speaker is Steve Bodnar of Geeks and Gurus, Inc. and his topic is HTML 5.

by Philadelphia Visual FoxPro User Group at May 07, 2013 08:09 PM

VFP Philly

Tuesday May 14--Steve Bodnar on HTML5

Our next meeting is next Tuesday, May 14 at 7 PM. We’ll supply dinner for the group starting at 6:30 PM. If you’re planning to join us for dinner, please send an email to tamar@tamargranor.com, so we buy enough food.

Our speaker is Steve Bodnar and his topic is HTML 5.

Bio: Steve Bodnar is the President of Geeks and Gurus, Inc., a software development company with offices in Detroit, MI, Kalamazoo, MI and Colorado Springs, CO.

Steve started developing FoxPro applications with FoxPro for DOS 2.0. He actively develops VFP line of business applications as well as websites using Microsoft's ASP.NET MVC and jQuery. Steve was one of the founding members of the Detroit Area FoxPro Users Group and has attended Fox conferences as often as possible since the early 1990's.

Steve has spoken at VFP conferences and user groups in Detroit, Grand Rapids, Kansas City, Toledo, Milwaukee, Sacramento and Atlanta. He's also spoken at .NET user groups, Code Camps and conferences in Grand Rapids, Raleigh, Richmond, Roanoke, Northern Virginia, Chattanooga, Philadelphia, Knoxville and The Wisconsin Dells.

Geeks and Gurus develops line of business applications and websites for small and medium sized organizations. We deliver solutions based on Microsoft technologies such as Visual FoxPro, SQL Server and .NET.

You can learn more about Steve and Geek and Gurus at http://www.geeksandgurus.com.

Abstract: There is a lot of confusion and hype surrounding HTML5. The confusion is because the HTML5 standard isn't scheduled to reach "full recommendation status" until 2022! Yet we're seeing it in all the latest browser for both desktops and mobile devices. (Of course, they don't all implement HTML5 exactly the same as the others!) The hype comes with all the new features available to us today.

In this session, we'll take a look at the timeline and discuss what it means to us - specifically why we shouldn't wait until 2022 to start using HTML5.

We'll dive into several of the new HTML5 features and look at examples of how these things are to be implemented into our websites. We'll look at the new semantic HTML (new tags such as
and
); video and audio; Canvas; geolocation; inline elements (,

by Tamar E. Granor (noreply@blogger.com) at May 07, 2013 07:42 PM

Alex Feldstein

May 06, 2013

Alex Feldstein