August 26, 2013

Coding Session #18: Metagaming code, Powerful Stuff Comments (0)

Brute force and ignorance baby, that's how most of us get started in the coding game. You go from point A to point B and so on following all the rules along the way. As your skills progress your code becomes less iterative, better organized and reusable, a bit faster, more maintainable, and generally more elegant. Good for us.

LM_original

But what does it take to reduce your code by 10x's? Make it significantly faster? Changing the rules of course!

LM_rewritten

A simple example: you need to show and hide a bunch of elements. The brute force approach is to show/hide each element individually. If you change the rules and group the elements, you can hide/show the group.

Changing the rules typically means defining or redefining how the target of your code is described. If you describe something well, you can reduce your code significantly. It can also impact the speed of your code. For example, the same query run on a non-indexed and an indexed table. The index was added to change the rules in such a way that the same query runs significantly faster.

In this coding session, we take some 3,100+ lines of code with 200+ms performance and reduce to ~300 lines of code and ~20ms performance. All in about five hours. If you look through the original code, there has to be days of coding effort in there.

We did this by defining the rules in our favor, not just accepting what was there. Specific to Servoy, there are a number of ways to accomplish this.

Continue reading "Coding Session #18: Metagaming code, Powerful Stuff"

| Posted by David Workman on August 26, 2013 at 11:49 AM | Permalink | Comments (0)

August 21, 2013

Coding Session #17: Coding is !@#$ Messy Comments (0)

Layout work, value lists, adding data points, navigating eclipse, keeping track of todo items, digging through old code, getting lost, getting timely help, writing new code, assigning tasks to other people, speccing stuff out, reviewing other's code, passing params, JSDocs, general debugging, form in dialogs, debugging form in dialogs, naming conventions, smart client, web client, SVN, foundsets, filtering lists, tab panels, anchoring, old school UI runtime manipulation....

All with rambling train-of-thought commentary.

Seriously, this is what coding is really like. Which probably means that being good programmer is really all about how much chaos can you handle at one time while still moving forward. Hint: don't go it alone....

| Posted by David Workman on August 21, 2013 at 10:41 PM in Articles, Video | Permalink | Comments (0)

August 18, 2013

Multiple Instances of Forms Comments (0)

by Adrian McGilly
http://www.mcgilly.com/

Note: Guest post! If multiple window workflows seem like more work than they are worth—then this is the article for you. - David

Let's say you want to open multiple instances of the same form, the way Outlook lets you open as many Contacts or Appointments or Emails as you want. By default, Servoy can only display one runtime instance of a form at a time, but you can clone a form as often as you want and display the clones simultaneously in as many windows or tabpanels as you want. But what if your form has tabpanels? If all you do is make a clone of the main (top-level) form, but not the forms in its tabpanels (which I will call subforms) then when you try to display your original form and your clone at the same time, you'll find the tabpanels won't work in both forms, only in the most recently opened form. To get both forms to work, you would need to clone the subforms (and sub-subforms, etc.) and programmatically "place" the cloned subforms in the correct tabpanels of the clone. And even then you will still run into problems with any code that references any of the cloned subforms by name, because the cloned subforms will all have new names.

So how can you make your solution support multiple instances of forms that include tabpanels? This article shows you one technique for achieving this.

Terminology

For the purposes of this article we will call a form in a tabpanel a 'subform'. We will call the form that contains the tabpanel the 'parent', and we will call any top-level form and all of its subforms (including sub-subforms, etc.) a 'formset'.

3-windows

Continue reading "Multiple Instances of Forms"

| Posted by David Workman on August 18, 2013 at 09:53 PM in Articles | Permalink | Comments (0)

July 28, 2013

I Love You Wakanda…but I'm Breaking Up Comments (3)

The secret is out. I'm admitting my love affair for "Wakanda" in Servoy-land for the first time. Surprised? I suspect not given that Servoy developers are on the prowl and Wakanda is the hottest chic in the room. So shapely, so mesmerizing, sooo…oooohhh baby, your throaty voice….

(*Snap*) Huh, what was I talking about?

Breakup

Continue reading "I Love You Wakanda…but I'm Breaking Up"

| Posted by David Workman on July 28, 2013 at 10:17 PM in Commentary | Permalink | Comments (3) | TrackBack (0)

June 24, 2013

Phone calls from web client with Asterisk Comments (0)

by Lachlan Dunlop
http://www.lach.net/

Note: Guest post! On one of my daily perusals of SVN commits I saw some code that perked my "whoa...too cool" radar. Crazy creative stuff. - David

Moving a Servoy smart client solution to the web brought with it a number of challenges. Our original solution was based on Data Sutra which is a robust smart client (and now web client) application platform for Servoy solutions. To keep our headaches to a manageable level during the transition process, we worked closely with the Data Mosaic folks as they developed the web client version of the Data Sutra framework.

Our solution is a CRM application that interfaces with an Open Systems OSAS Accounting system. In the original smart client phone app, dialers were interfaced through modems connected to the client computers' serial ports and linked into the main phone system. It was a wiring mess and the sales reps had to be in the office where the phone system was located.

In migrating to web client, we changed the phone system to the very successful open source system Asterisk. Sales reps now have "soft phones" on their computers (sip device) for phone calls. This allows them to have phone and application access wherever they open their laptops.

Call-reporting

Green rows = incoming calls, red rows = calls over 5 minutes

Continue reading "Phone calls from web client with Asterisk"

| Posted by David Workman on June 24, 2013 at 03:27 PM in Articles | Permalink | Comments (0)

May 26, 2013

Divide and conquer with Servoy headless client plugin Comments (2)

Who do you call when you write a method that turns out will take over 33+ days to complete on a 12 core server? As business programmers, efficient and speedy code usually takes a back seat to getting the job done. But 33 days is a few days above the limit where what you are (or not) doing is sure to get you noticed by someone up the food chain.

Wouldn't it be nice to speed this up dramatically without having to do a major code overhaul?

12-core army-1

12 cores maxed out

Scenario
Recently a job came through where we needed to convert a bunch of tables from integer primary keys to UUID primary keys. The other major component was splitting one table up into four related tables while keeping links to other tables in place. Exception logic included things like setting delete flags to orphaned data.

Issue
This is the kind of brute force coding task that can get you into trouble in a hurry. "Trouble" defined in this case as over a million rows in the table that we needed to split up across four tables.

Hitting the start button on the first pass version of our routines and watching things progress (…NOT…) and we knew we were in for it.

Continue reading "Divide and conquer with Servoy headless client plugin"

| Posted by David Workman on May 26, 2013 at 11:48 AM in Articles | Permalink | Comments (2)

January 29, 2013

Data Sutra 4.0 Released Comments (2)

Ready to move to the web and mobile in a big way?

Screen-date-combo

After eight months of development and rigorous testing with Servoy 6.1.x, today we are releasing Data Sutra version 4.0. The marque features of this release are:

Continue reading "Data Sutra 4.0 Released"

| Posted by David Workman on January 29, 2013 at 11:20 AM in Module, News | Permalink | Comments (2)

January 03, 2013

Hacking Servoy's Calendar Picker Comments (4)

Servoy's web client calendar picker is an easy target to make fun of—the last time it looked even somewhat passable was probably 15 years ago. A picture is worth a 1,000 words:

Servoy_calendar_picker

Additionally, Servoy doesn't have any hooks or abstractions to modify the look and feel of this component. And all the markup and css is generated at runtime so not so easy as just going in and adjusting a bit of CSS.

The rest of this post explains how to arrive at this:

Calendar_picker_after

Continue reading "Hacking Servoy's Calendar Picker"

| Posted by David Workman on January 3, 2013 at 03:17 PM in Tips | Permalink | Comments (4)

November 19, 2012

Fractions for Servoy Comments (0)

We just released an open source project that adds fractional data entry and display and decimal/fraction conversion to Servoy.

You can find it here: https://www.servoyforge.net/projects/fractions

 

| Posted by David Workman on November 19, 2012 at 05:36 PM in Module, News | Permalink | Comments (0)

August 09, 2012

Coding Session #15: Testing Comments (0)

We're in the midst of converting over our entire engineering processes for large (sprawling) GUI-driven (target audience…monkeys) enterprise (mythical beasts that grudgingly poop money) applications (the current evolutionary-defining tool that makes us all wish for the stone age again) from Java thin client deployment (*shiver*) to this html5/javascript/css3 thingee conceived when a million annoying people tasked with making a rainbow were put into a room for an epoch with all-you-can-eat pizza and coke.

(Should have put a million monkeys in that room. Would have at least gotten Macbeth out of the deal.)

Where was I? Oh yea…testing.

Continue reading "Coding Session #15: Testing"

| Posted by David Workman on August 9, 2012 at 04:15 PM in Articles, Video | Permalink | Comments (0)