Friday, June 28, 2013

Xojo Real Studio

A majority of us use the web to do research – it’s faster, easier and the information is fresh.  For years I was a frequent visitor to Ramblings, a website/blog run by Aaron Ballman.  In my opinion, it was THE definitive source for many things in REALbasic.
For those of you that are new to REALbasic, Aaron was one of the REAL Software developers that worked on REALbasic.  We was with the company for seven years which is a long time in the software industry and in many respects REALbasic bears his signature.
In his new book, Ramblings on REALbasic, Aaron took many of his old blog posts, cleaned them up with new information, rearranged the order and put them in book form.  The book is divided up into Knowledge Base, REALbasic Language, User Experience, Windows, Design Patterns, Plugins, Other Languages and Just for Fun.
The Knowledge Base is a rather large collection of changes, gotchya’s, and miscellaneous information dumps about REALbasic that Aaron wrote about for years.  REALbasic is ever evolving and Aaron wrote about the bugs or misunderstandings to give us (the REALbasic developer) a little insight into what or why it happened or how we are misusing it (which happened more often than we’d like to admit).
The REALbasic Language section goes into specific REALbasic features.  I guarantee that you’ll learn something about REALbasic in this section.  Aaron writes it not as an end-user but as someone who is writing the compiler and having to support people like you and me on a regular basis.
A good portion of REALbasic developers use RB on Mac OS X and we sometimes take a Mac-centric viewpoint of developing software for Windows.  In the User Experience and Windows sections, Aaron goes into detail on some of the finer points of the Windows experience.  If you’re not a Windows expert (and even if you thought you were), these are must read sections.
The Plugins section is an alternative to REAL Softwares woefully incomplete documentation.  Aaron does a nice job of explaining how plugins work with the IDE and then goes into details that most of us will never use (unless you want to make a plugin that is).
The Design Patterns section is particularly interesting because he creates the design patterns using REALbasic.  Design patterns are coding patterns that, if you’ve been doing software long enough, you start to see over and over again.  Bigger, more complex applications probably have some of these coding patterns in them already (even if you didn’t know it) but it’s nice to get the theory and uses of them in REALbasic, up front.
Aaron does a good job of pointing out bugs and flaws in REALbasic and which versions they occurred in.  Some of those flaws are fixed in later versions of REALbasic, and he doesn’t always note if they’ve been fixed or not.  I can understand the complexity of finding out when bugs were fixed but it makes the text incomplete in my opinion.
Another missing feature, especially for the design patterns section, is downloadable project files.  It’s one thing to list the source code and explain it, but it’s entirely different to have a working example that you can step through.
While it’s sometimes nice to have a paper book to thumb through it’s getting harder and hard to justify the cost of a book that will lose its relevance in a short period of time.  This is not new to Ramblings or any book on technology but the REAL Software Rapid Release Model guarantees that any paper book will quickly become, if not obsolete, dated quickly.
Download Link : http://rapidshare.com/files/3295947299/REALbasic%202009%20Release%204.rar

Windows 8.1 Preview Now Available

Back in May, Microsoft announced the first major update to Windows 8. While the free upgrade was once codenamed Blue, a public preview of Windows 8.1 is available starting today. Most notably, Windows 8.1 brings back the Start button, a point of sincere contention for many Windows 8 users. The full release of Windows 8.1 is still scheduled for some time later this year.
Writing on the Windows Blog, Microsoft's Brandon LeBlanc runs through some of the basic improvements included in the Windows 8.1 update. The "Metro" tiles in Windows 8 are now more customizable in terms of size, allowing users to set the tiles as "really big" or "really small." LeBlanc notes this change is most applicable to tablets, where scaling down the tiles allows for more screen real estate.
win8preview
"The best part is my Start screen customizations, apps, and files get synced across all my Windows 8.1 PCs and tablets, which is awesome," writes LeBlanc. "If I change my Start screen, install new apps, pin new apps to my Start screen on one PC – that all gets synced to my other PCs."
The Windows Store has also received a redesign, and beyond obligatory updates to some Windows 8 apps, Microsoft is planning to announce new applications sometime today. You can download the Windows 8.1 preview right now from the Windows Store, but as always, be sure to back up all your data before installing. As an additional note, the preview is not available for Windows RT users at this time

Friday, June 14, 2013

A Beginner’s Guide to Big O Notation

Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.
Anyone who’s read Programming Pearls or any other Computer Science books and doesn’t have a grounding in Mathematics will have hit a wall when they reached chapters that mention O(N log N) or other seemingly crazy syntax. Hopefully this article will help you gain an understanding of the basics of Big O and Logarithms.
As a programmer first and a mathematician second (or maybe third or fourth) I found the best way to understand Big O thoroughly was to produce some examples in code. So, below are some common orders of growth along with descriptions and examples where possible.

O(1)

O(1) describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set.
bool IsFirstElementNull(String[] strings)
{
 if(strings[0] == null)
 {
  return true;
 }
 return false;
}

O(N)

O(N) describes an algorithm whose performance will grow linearly and in direct proportion to the size of the input data set. The example below also demonstrates how Big O favours the worst-case performance scenario; a matching string could be found during any iteration of the for loop and the function would return early, but Big O notation will always assume the upper limit where the algorithm will perform the maximum number of iterations.
bool ContainsValue(String[] strings, String value)
{
 for(int i = 0; i < strings.Length; i++)
 {
  if(strings[i] == value)
  {
   return true;
  }
 }
 return false;
}

O(N2)

O(N2) represents an algorithm whose performance is directly proportional to the square of the size of the input data set. This is common with algorithms that involve nested iterations over the data set. Deeper nested iterations will result in O(N3), O(N4) etc.
bool ContainsDuplicates(String[] strings)
{
 for(int i = 0; i < strings.Length; i++)
 {
  for(int j = 0; j < strings.Length; j++)
  {
   if(i == j) // Don't compare with self
   {
    continue;
   }

   if(strings[i] == strings[j])
   {
    return true;
   }
  }
 }
 return false;
}

O(2N)

O(2N) denotes an algorithm whose growth will double with each additional element in the input data set. The execution time of an O(2N) function will quickly become very large.

Logarithms

Logarithms are slightly trickier to explain so I’ll use a common example:
Binary search is a technique used to search sorted data sets. It works by selecting the middle element of the data set, essentially the median, and compares it against a target value. If the values match it will return success. If the target value is higher than the value of the probe element it will take the upper half of the data set and perform the same operation against it. Likewise, if the target value is lower than the value of the probe element it will perform the operation against the lower half. It will continue to halve the data set with each iteration until the value has been found or until it can no longer split the data set.
This type of algorithm is described as O(log N). The iterative halving of data sets described in the binary search example produces a growth curve that peaks at the beginning and slowly flattens out as the size of the data sets increase e.g. an input data set containing 10 items takes one second to complete, a data set containing 100 items takes two seconds, and a data set containing 1000 items will take three seconds. Doubling the size of the input data set has little effect on its growth as after a single iteration of the algorithm the data set will be halved and therefore on a par with an input data set half the size. This makes algorithms like binary search extremely efficient when dealing with large data sets.
This article only covers the very basics or Big O and logarithms. For a more in-depth explanation take a look at their respective Wikipedia entries: Big O NotationLogarithms.

*Post Via "http://rob-bell.net"