AbPK for Android updated

I spent the last few days delving back into the dark world of Eclipse/Android/Java. I don’t wish that on my worst enemy. The simplest things seem to take forever to accomplish.

This update includes the following improvements and fixes:

  • Added extrapolated peak and trough to Model view and Email consult functions.
  • Fixed tab order on patient data and serum level screens.
  • Modified CrCl Adj body weight method to use 30% of excess weight (was 20%).
  • Moved the Email function up to a button and the Clear function down to the menu.
  • Made dialog titles one line only (quick fix to the “Huge” font problem),
  • Updated the help files.

The Jellybean “Huge” font issue seems to be a common problem among developers. Because Android does not have an “Auto-size” function, there are many code hacks for re-sizing fonts to fit text on a single line. None of the methods are fool proof. So, instead of adding all that verbose java code, I just added the layout element android:lines=”1″ for the titles on each window. A K-I-S-S solution, my favorite kind. The text is truncated, but it is simply not important.

Fixing the tab order was also a trial and error affair. The serum level input would jump from dose to trough, skipping interval and number of doses. This was also a no-code layout fix with the use of the element android:nextFocusDown=”@+id/next_text”. Many blogs leave out the “+”, but this does not work without it.

Setting up the Nexus 7 for USB debugging was an adventure as Google has hidden the developer functions in Jellybean. The weirdest thing in the setup is to set your USB connection as Camera (PTP) instead of Media device (MTP) – WTF. Here is a nice step-by-step how-to blog post:
      Nexus 7 android development

I haven’t updated the free version for nearly three years. But I did this time around, thinking maybe some of you rich freeloading pharmacists will see fit to support your fellow pharmacist and hardworking small businessman. Haha, I live in a fantasy world.

Android Fragmentation

In iOS, there are just two screen sizes and three resolutions. In the Android world we have to accommodate what is essentially an unlimited number of screen sizes and resolutions.

Android fragmentation affects developers and app users alike. Every year or so fragmentation rears it ugly head in my little world. The trigger is usually a new version of Android and/or a popular new device with an usual screen size and/or resolution. This time around it’s Jellybean and the new Google Nexus line of devices.

The effect of fragmentation on small-time developers like myself is app bashing on the public review section of Google play:
app bashing

This fellow gives my app a 1 star rating with a snarky comment about wanting his twenty bucks back. Instead of simply contacting me, he pisses all over my work. And yes I take it personally, this is my life’s work.

Turns out the issue was caused by the user himself when he changed the device font size setting to “Huge”. I wish I had a crystal ball. Six months ago, when the app was last updated, such a setting was not possible. I had no idea that Google would add such a silly font size setting to their upcoming version of Android.

This is what I hate about the Google market, or Play store, or whatever they will call it next month. Anybody with a chip on their shoulder can post an anonymous comment bashing your app. And I have no way of contacting this person to help, because comments are anonymous.

Industry watchers say that Android fragmentation is probably going to get worse. Here is a nice graphic showing the current state of Android fragmentation:

Android fragmentation

Android fragmentation map

The BBVM project, part II

Everyone who doses vancomycin knows what a crap shoot it is. Of course, that is the reason why we measure levels, there is never any certainty what levels will result.

Ten years ago I had (what I thought at the time) was a great idea. You see, I have these fabulous dosing programs that save pk data. So, I will ask my fellow pharmacists to voluntarily submit their population analysis results in order to pool them together and create the “ultimate vancomycin model“.

      Build a Better Vancomycin Model project

What a bitter disappointment that turned out to be. In those ten years not one single person has bothered to lift a finger to help.

“I will”, said the little red hen. Only this time, instead of asking for help, I will gather data in stealth mode, via the web app.

The web app doesn’t collect patient identity. There is no passing of confidential information, only the following pk parameters:

  • Drug name
  • Age
  • Height
  • Weight
  • SrCr
  • CrCl
  • Kel
  • Vd

Maybe, in another ten years, there will be enough data to create the “ultimate vancomycin model“. Then the lazy dog, the sleepy cat, and the noisy yellow duck will be able to eat the bread.

Adventures in JavaScript Land

scourge 
/skərj/
Noun
A whip used as an instrument of punishment.

Of all the scourges inflicted on developers, the JavaScript/jQuery/CSS/HTML5 model has to be the worst.

What bothers me about this paradigm is the drain in productivity. So much time is wasted on the most basic task, page layout.

Coding HTML has always reminded me of hand-writing TurboPascal code back in the Eighties (which I actually enjoyed). But CSS/jQuery adds a mind-numbing and eye-straining verbosity that tests the patience of the most dogged developer.

Is there a limit to how many div tags a page can have? Does every element need an identical name and id tag? jQuery mobile grid layout actually makes me wistful for tables.

And, like so many other programming languages, books, tutorials and examples only take you about halfway there.

Too many ‘helpful’ CSS web sites consist of stupid pet tricks – how to code some silly visual effect, with little practical coding examples.

My problem is, I’ve yet to find a decent editor to improve productivity. Dreamweaver came close, but its’ Mac-like quirks keep putting me off.

Every time I work in JavaScript, this song plays in my head.

Whipping Post

Hour after hour of ass-numbing coding this week produced but this one web page, which has very limited functionality:

abpk_web

Recent updates

Since the RSS to Facebook feed appears to be hopelessly broken, here is a recap of recent software updates:

APK© for Windows v 3.5.14

  • Added setup dialog.
  • Added obesity weight adjustment factor for CrCl.
  • Added check for update on startup.
  • Added check for presence of classic WinHelp.
  • Improved update checker.
  • Updated help file.

Antibiotic Kinetics© for Windows Desktop v 2.3.18

  • Added automatic update availability check.
  • Added BMI to consult form.
  • Fixed yes/no dialog default button.
  • Changed AdjBW for CrCl to 20%.

Kinetics© for Windows v 2.3.7

  • Added automatic check for update on startup
  • Changed CrCl adjusted BW to key off of BMI
  • Fixed model editor issue: “CL” and “Kel” selectors sometimes don’t change.
  • Added technical support dialog.
  • Added check if winhelp32.exe present.
  • Added MRU list save/load after main form closes-opens.
  • Changed BSA to BMI on consult and monitor forms.

DripCharts© for Windows v 2.1.10

  • Added check for classic winhelp.
  • Added WinHelpViewer unit.

RxInterventions© for Windows v 1.7

  • Added splash screen. 
  • Added support for multiple entries per patient.
  • Added check for proper MD name format.
  • Updated JvDialog (fixed default button selection).

Puzzling RSS graffiti problem

I don’t understand why the last two “What’s New” rss feeds for APK are not showing up on FB. Google reads them just fine, and news items before and between these two came through fine. I ran my xml through the W3C feed validation service and it flagged a couple of minor errors, but nothing to explain this.


APK for Windows 3.5.14 http://www.rxkinetics.com/autoupdate.html
Added check for presence of classic WinHelp.
Added check for update on startup.
Added setup dialog.
Added obesity weight adjustment factor for CrCl.
Improved update checker.
Updated help file.
Sat, 12 Jan 2013 08:00:00 GMT


APK for Windows 3.5.13 http://www.rxkinetics.com/autoupdate.html
Improved population analysis report.
Fixed comments not printing on consult.
Tue, 25 Dec 2012 08:00:00 GMT

Anyway, a new version of APK for windows was posted January 12, 2013.

KinPlot

A single page web application:

KinPlot web app

This is a rewrite of a PC app which I wrote for Windows many years ago.

KinPlot for Windows

The purpose of this app is to visualize basic pk concepts of 1-compartment models. To use: enter the model parameters and dosage regimen. Click the graph button to display a serum level plot. You may compare multiple dosing regimens on one graph.

The web version of KinPlot runs in any modern browser that supports HTML5 (Chrome, Firefox, IE 10, Safari). To access the app, point your browser here:
rxkinetics.com/kinplot

KinPlot was written using HTML5, CSS3, and JavaScript/jQuery. There are several tools that purport to combine all these elements into one IDE. I tried Apana studio, Blue Griffon, DreamWeaver, Kompozer, JetBrains Webstorm, and NetBeans. But each was lacking in one way or another.

Eventually I ended up using the best tool to write each portion of the app: Notepad++ for the HTML, TopStyle for the CSS, and Sublime editor for the JavaScript. Coding each portion separately may have helped. Since each of these languages are so different, I was able to concentrate on one task at a time. It took two days to write… not bad.

I plan to submit it to the Chrome marketplace.

Web apps are the wave of the future and single page web apps are the current rage. Downloading and installing a program on your PC/Phone/Device is so ten years ago.

When learning something new, it’s best to start with something simple. It feels good to learn a new programming paradigm and create a working app. I hope to eventually convert more of my tools over to web apps.

Time for a beer.

Addendum
I just stumbled upon Google Chrome Frame after seeing “IE with GCF” in the web site analytics. GCF is a plugin for Internet Explorer 6, 7, 8, and 9 that supports all the HTML5 features that are found in modern browsers. Now if the KinPlot web app is accessed from IE, the web site will prompt for installation of Google Chrome Frame.

iPhone app, so what

RxKinetics now has an iPhone app on the iTunes store.

So what, this is nothing new. The RxKinetics WebApp has been available for years.

This is only news because most iPhone people never explore outside their exclusive private app store. If an iApp doesn’t come from iTunes, then it apparently doesn’t exist. Why? Part of the reason may be that sense of belonging to a privileged and exclusive club which is an essential ingredient of the Apple mystique. Belonging is as much a human need as is shelter or love, and Apple’s marketing has masterfully manipulated that basic human need which exists within us all.

“Apple’s gizmos aren’t just cleverly designed computers: as the lines last week indicated, they are socioeconomic and cultural signifiers. Even when it turns out that some of these very same products are produced in sweatshop conditions redolent of nineteenth-century Manchester, many smart, affluent, and educated people want to be seen sporting them. Sorry, that is an understatement. They absolutely have to have them.” How Long will the Cult of Apple Endure? The New Yorker

Here’s the link… so what:
AbPK available on iTunes

“It is nothing but a rewrite”

The other night while watching the Mars landing I mentioned to Brad that I know someone who works at JPL. Will Duquette, the author of the desktop wiki we had used for years, is a programmer at JPL. Trying to find his bio I did a quick google search for “will duquette desktop wiki”. Instead I discovered this “review” of RikiTikiWiki as the third result: Taking note: August 2011.

I took exception to some of the reviewer’s “points” (especially the ones he decided to print in bold). So, I filled out a comment from the link on his blog page. He didn’t publish one word of my comment. What kind of dick does a hatchet job of a review and then doesn’t publish comments from the software author? Anyway, for the record, here is what I said:

  • Thanks for the kind words about my little program. I would like to clarify a couple of points in your post.
  • Will Duquette is my friend, and I have used his Notebook application for years. When he stopped developing it, I asked for and received his permission to use his basic idea as the basis of my software. Both within the software documentation and on my web site I credit Will with the original software idea. Will’s desktop wiki has been extremely useful to our practice. I have presented and published a paper describing how helpful the wiki is in our hospital pharmacy. In both the presentation and the publication I credited Will’s software with helping to structure our practice.
  • I had asked Will multiple times if he was working on a new version. His answer was yes, but it was a low priority and he simply did not have the time. So, I bit the bullet and wrote this little program, which is an incremental improvement over Notebook.
  • So, your remark “It is nothing but a rewrite in Delphi of Will Duquette’s Notebook application”, is partially true. But, by leaving out my acknowledgement of Will’s software and his permission, you make it sound like I stole his idea.
  • Although I kept Will’s basic interface, I did add some features which make the wiki more useful for us.
  • The main reason I had to rewrite Will’s Notebook was that his was not multi-user enabled. We had a few instances of one user deleting another user’s work. A related problem was Notebook did not keep a history of edits. Another essential wiki feature missing from Notebook is a log of who had made the edits.
  • Regarding your comment about my installation instructions: the purpose of the software is to maintain a shared knowledge base on the hospital intranet. Thus the instruction which states “install the wiki into “a shared folder on the network” and to give all staff read/write privileges”.
  • Another point I’d like to clarify is the donation request. The software is fully operational and 100% free to use, there are no restrictions. I do ask for a donation, this is not required. I ask for donations from my fellow pharmacists to help defray the cost of developing and maintaining the software. This is an example of the software licensing model called Donationware. I also state that the source code is available on request.
  • RikiTikiWiki was written for a specific audience, hospital pharmacists, and (as far as I know) is only available from my web site. I am curious how you came into possession of it?

Regarding my last point, I have since discovered that RikiTikiWiki has been uploaded to a bazillion different download sites and torrents (softpedia.com, softango.com, softsea.com, brothersoft.com, famouslywhy.com, fileguru.com, etc, etc). None of these sites have my permission to distribute my software! WTF?

RikiTikiWiki for Windows

RikiTikiWiki screen shot

Don’t put all your eggs in one basket

Since I have failed spectacularly at adding ajax to my asp.net 2.0 web apps, I’ve been looking for alternatives. NS Basic/App Studio is a newer web application builder that is approaching maturity. NS Basic/Palm has been in my toolbox for 12+ years, it’s what I used to write PalmOS programs. Their latest product, App Studio, takes an easy to comprehend, integrated approach to building javascript enabled web apps.

I’ve been trying it out for a couple of days, to get a feel for what it can do and how the code functions. Below is a screenshot of the patient data entry screen of AbPK on an iPod touch. Aesthetically, it’s much more pleasing to the eye than the current asp.net version.

Abpk_NSbasic_iOSIt doesn’t do much yet, other than calculating CrCl, but feel free to try it out here: AbPK web app

The main advantage of App studio is, I can deploy it on my Linux server and drop the expensive Microsoft server, leaving that hard to manage asp.net crud as a bad memory.

The only problem is, NS Basic/App studio is targeted for handheld devices. On the desktop it will run under the Chrome and Safari browsers on Windows and OSX, but fails to run under Firefox or Internet Explorer.  The average corporate Joe, working under the thumb of an oppressive IT dept, won’t be able to run this app on his locked down desktop at work.  Then again, maybe that’s not such a bad thing.