Elegant Technologies

  • Meaningful Ventures
  • Simulation & VR/AR/XR
  • Education
  • Mobile Apps
  • Technology & Business
  • Blog
  • About
    • Ongoing Projects
      • Open Kitchens
      • School Twist
    • About Me
    • Contact Me

Announcing WordPress Plugin: Elegant Tweets

2011-08-26 by JJBigThoughts

I recently starting working on making my own WordPress plugins. The twitter feeds you see on this site are a result of that – I creatively call it Elegant Tweets. When I starting working on Ascendly, I wanted to make further use of plugins, so as practice, I tried to polish up my first plugin and share it with everyone. Although I want to add more features, it does work as-in, and does not have any known bugs, so enjoy.

This plugin allows you to configure the tweet stream the way you want it. Specifically, it creates a widget for use in your themes that will display zero or more tweet feeds. You can, for example, add your own Twitter username, but, more uniquely, you can also have certain Twitter feeds show based upon the categories assigned to the current page being viewed.

Motivation: I developed this plugin because I occasionally make apps for the mobile phones. Some of my apps have their own Twitter account to announce things like updates. I wanted visitors to my website see my primary feed (@jjrohrer), but to also see the feeds for the apps, but only if they were on pages related to those apps. Now, my posts that relate to a certain app are assigned to a category related to that app. So, when a user views a page, they will see several Twitter streams depending upon which categories are in view.

 

Filed Under: Elegant Tweets for Wordpress, News, Technical, Wordpress

Technical: Hacking Dashcode to Programmatically Change Deployment Directory

2011-05-26 by JJBigThoughts

I like Apple’s Dashcode more than I should.  It is a powerful Webapp creator that is a bit under-supported.  I don’t think it gets the love, or the hacker support, that it deservers.  So, I find myself trying to make it do stuff it wasn’t originally designed for.  Recently, I’ve been using it to create skins for some non-iOS mobile apps.  As part of a budding workflow, I wrote a script to copy an existing Dashcode project and have it ready for the new project, including published to the right (read – ‘new’) location instead of the old location associated with the previous project.  Well, the challenge, is that Dashcode has the concept of a “Deployment Directory” that should point to my new workspace, not my old workspace.  This article describes how to programmatically change the “Deployment Directory”

So, how can we script a solution for this?

Although Dashcode project looks like a single executable file, it is actually a Finder package with lots of stuff inside.  The trick is looking to see if the deployment path is stored in something we can mess with. It turns out the value is stored in jj.wdgtuser (my user name is jj).  Sweet!

The good news is that is stored in the .xml file – that is also the bad news.  Apple’s xml formats always sort of sucks, so getting to our variable isn’t super easy, unless you think predicate XPATH programming is super easy.

Inside a Dashcode Project

Here are the general steps I used to accomplish scripting the deployment path:

  • Ensure Dashcode is not running
  • Find the current username so you open the right .wdgtuser file.
  • Use XPATH
    • find the dict element whose previous sibling is a key element with a value of ‘DeploymentOptions‘
  • Given the above context, use XPATH to
    • find the string element whose previous sibling is a key element with a value of ‘Path’

 

The hard part here, of course, is finagling XPATH.  Here is the PHP code I used, but you’ll need to modify it for your own means:


$plistPath = baseDir($target)."/skins/{$skinName}.dcproj/jj.wdgtuser";

$xml = simplexml_load_file($plistPath);

$result = $xml->xpath("//dict/dict/string[preceding-sibling::key[1][node()='Path']]/node()");

$result[0][0] = $newDeploymentPath;

 

 

$xml->asXML($plistPath);

Here is a stab at explaining the XPATH above:

 

Hope this helps some other poor soul that wanders into the wilderness of Dashcode hacking.

Filed Under: Technical Tagged With: Dashcode, deployment directory, simple_xml, xpath

Nightlight now on the iPad – first impressions.

2010-04-03 by JJBigThoughts

Happy iPad day. I picked up my iPad at Pentagon City this morning. We made it a family outing and my six year old son was at least as excited as I was. We got in and out of the Reserved line a in about 20 minutes, so really a pretty good experience.

I like the iPad so far. Nice screen. Nice keyboard. Nice heft. Very few things to complain about.

Here are my complaints. My home button is a bit loud. A little too loud if you are typing in bed and don’t want to wake your partner. It would be too loud for a meeting, too. I seem to recall, though, that my last iphone had a loud home button, but that it quieted down with use, so take this complaint with a grain of salt.

I also resent that I can’t seem to use my old iPhone cable to charge my iPad. It’s like a big loyalty tax. What is is up with that? Correction: The problem wasn’t with the cable, it was with what it was plugged into. If I plug into my older MacBook pro, then it won’t charge, but it will charge if I lug it into the wall. What is up with that. More correction: charges sometimes on the MacBook a maybe when the iPad is turned off?

All in all, a great product, though. I’ve had a lot of fun with it so far.

I launched an upgrade to Nightlight for the iPad – check it out. Although I was stoked to have that out on opening day, I’m really bummed that I’m still having issues with getting my Powernap upgrade out the door. It’s seems to work fine for me, but apparently crashes on Apple’s test rig – arghhh. [Update: Powernap: Forty winks anywhere is doing just fine.]

I also launched a simple, but useful upgrade to Elegant Quadratic and launch a Pythagorean equation solver and generic math expression solver called Lil Math. These three are using a new technology that I’m developing to streamline app development – especially cross platform stuff. More about that later.

Filed Under: iPad, News, Products & Apps, Technical Tagged With: iPad, nightlight

Technical: Scroll Home after Input Completion in Mobile Safari

2009-04-21 by JJBigThoughts

I’ve been experimenting with PhoneGap, a nice UIWebview wrapper for iPhone, Android, and ~Blackberry.  Since the development happens in javascript, you spend more time working around the limitation of UIWebView.

I ran into the following problem.  I have several input fields on a page.  As the user moves to each input field on the iPhone, the screen rightly scrolls to the next input field.  When the user has finished entering their data, the screen only partially scrolls back home.  I got around this with the following – I hope it helps someone…



//****************************  jKeyboardGotDismissed() & jKeyboardGotShown() -BEGIN- ******************************
// This snippet give you a reasonable way to detect that the user is not currently input data.
// Motivation:  On the iphone, when inputing data, the soft keyboard pops up.  When the keyboard is dismissed, it doesn't
// usually scoll back to the original position.
//
// I know this is kludgy.  There is probably some slick way to detect that a input box lost focus, but that it had
// moved on to onother input box, or not - but I couldn't find any examples.  This uses a timer, and seems to fall
// into the good-enough category.
//
// Insturctions:
//  Copy this block of code into your script
//  Modify jKeyboardGotDismissed() & jKeyboardGotShown() as desired.
//
// Use Cases:
//      Make sure the screen has scolled to 0,0 after the user finishes inputing data on the iphone
//          add something like " window.scrollTo(0, 0) " to jKeyboardGotDismissed()
var bStoppedInputtingUnlessSomeoneTellsMeOtherwise = true;
var enumKeyboardStateThereGone = "Gone";//There, means the keyboard must be visible, "Gone" means it must be hidden
function _jFocusTypeHelper() {
if (bStoppedInputtingUnlessSomeoneTellsMeOtherwise == true) {
if (enumKeyboardStateThereGone == "There") {
enumKeyboardStateThereGone = "Gone";
jKeyboardGotDismissed();
} else {
enumKeyboardStateThereGone = "Gone";// why twice? Just so enumKeyboardStateThereGone will be set before the function call.
}

} else {
if (enumKeyboardStateThereGone == "Gone" ) {
enumKeyboardStateThereGone = "There";
jKeyboardGotShown();
} else {
enumKeyboardStateThereGone = "There"; // why twice? Just so enumKeyboardStateThereGone will be set before the function call.
}

}
}

// This function gets called whenever the keyboard is  dismissed.  feel free to modify it
// Motivation: I wanted to make sure the screen scolled back to the right spot after the last input
// Known Limitations: 1/4 second delay before jKeyboardGotDismissed is notified.
function jKeyboardGotDismissed() {
//alert("The soft Keyboard just got dismissed (if, in fact, this device has a softkeyboard)");
window.scrollTo(0, 0);//Scroll home after the keyboard is dismissed.  Delete this line if you don't want that to happen.  @TODO: Add smooth scrooling
}

function jKeyboardGotShown() {
//alert("The soft Keyboard must have just popped up (if, in fact, this device has a softkeyboard)");
}

document.addEventListener("blur",function() {bStoppedInputtingUnlessSomeoneTellsMeOtherwise=true;setTimeout(_jFocusTypeHelper,250);},true);
document.addEventListener("focus",function() {bStoppedInputtingUnlessSomeoneTellsMeOtherwise=false;_jFocusTypeHelper();},true);

//****************************  jKeyboardGotDismissed() & jKeyboardGotShown() -END- ******************************

So, how would you use this? If you put this code in your page, it should just magically work.

Filed Under: Technical Tagged With: iPhone, javascript, mobilesafari, scroll

Recent Posts

  • Unnamed Strengthen-Democracy Project
  • PowerNap (not) on the Oculus Go
  • Porting PowerNap to Oculus Go
  • So many missing images…
  • I rode a VR bike today

Categories

  • Business of Software (12)
  • Client Projects (1)
  • Content (1)
  • Elegant Labs (4)
  • Mobile (26)
    • Android (5)
    • Blackberry (3)
    • Elegant Torch (1)
    • iOS (23)
      • iPad (14)
      • iPhone & iPod touch (16)
    • Nokia (1)
    • Palm (1)
  • News (6)
  • Personal Technology (1)
  • Platforms (14)
  • Products & Apps (19)
    • Different Proportions (1)
    • Elegant Pythagorean (1)
    • Elegant Quadratic (1)
    • Elegant Word of the Day (1)
    • Elegant Words (2)
    • Lil' Math (1)
    • Meeting Timer (1)
    • Nightlight (1)
    • PowerNap (4)
    • Survey Size (1)
    • Time to Eat (1)
    • Time to Read (1)
    • Wallet Zero (2)
  • Technical (4)
  • Technology Trends & Looming Opportunities (14)
  • Uncategorized (6)
  • VR (3)
  • Wordpress (1)
    • Elegant Tweets for Wordpress (1)

Archives

Copyright © 2026 Elegant Technologies ::

Copyright © 2026 · Start on