Markdown with Poster
Update May 13th:
Having tried Blogsy I am not really a fan of their Markdown Support. Blogsy gives a blank editor and I later converts everything into HTML which is what I don’t want because I upload and store my blog entries as plain Markdown text. This way I can keep editing it on any Markdown editor I want on any system (iPhone, iPad and Mac). As far as I can tell there is no support for images, files etc.
In my quest to use Markdown with my WordPress Blog I am now using Poster on the iPad to write a post. As with MarsEdit images are again the big thing. So I uploaded this Image but Poster is adding this a plain HTML. I could remove the HTML and place it into a Markdown format but I would have expected that when it does support Markdown that uploading an image would add the image in Markdown.
Let’s see if I Blogsy does a better job.
CQ Workflow Presentation
On Wednesday, April 17th I gave a Presentation about Workflows to the OC CQ User Group which ran for about 2 hours.
So here are the Slides as PDF file, 16MB. Before you look at them I want to point a few things out:
As a Developer I need to figure out how to make things work and so most of my time is spent on figuring out how to deal with problems, bugs or other shortcomings of a Framework. Therefore problems are more important and I focus on way more that on the things that work without a problem. On the other hand I want to give my audience as much help as I can to deal with problems they might have or they might run into in the future. So don’t take my long list of bugs, traps and pitfalls as an indication that CQ Workflow is too buggy and unreliable.
In addition keep in mind that Workflows has two major parts. The coding which I covered a lot but also the business component which defines what to do in the Workflow, by whom and in what order. Because this is an iterative process it makes developing Workflows more difficult because changes might require a redesign of the Workflow.
All in all CQ Workflows need a strong commitment by the developers as well as by the stakeholders because they will take time to get it right and to make it acceptable for the enduser. That said I think CQ Workflows can do amazing things and be a big time saver (especially in crunch time) if setup right.
Have fun – Andy Schaefer
BTW: The session was tapped and so I think it will be posted on the User Group page soon.
CQ Workflow Tutorial: Export Workflow Models Quickly
Update (5/17/2013):
There is a bug in the script when there are more than 10 files. This part will fix it:
# Do not change any of these INDEX=1 FILES=$TARGET_DIR/$PACKAGE_NAME-*.zip for f in $FILES do echo File Name: $f FILE=$f NTEMP=`echo ${FILE##*-}|cut -d . -f1` echo NTEMP: $NTEMP if [ "$NTEMP" -gt "$INDEX" ]; then INDEX=$NTEMP fi done;
So far I did not discuss how to manage the project even though if you look at the final project files I posted at the end of the Post you will see that it contains the Workflow Models as well.
In General I always keep the Workflow Models in my VCS (often my personal GIT as well as the Client’s VCS) just to make sure I have a track record of all the changes and can see how it evolves over time but also to have a way to easily undo a problematic current version. Because Workflow Models can only be edited inside the CQ Workflow Model Editor we need to find a way to export them quickly, easily and fast otherwise we might loose changes. That said I never to export the workflows directly into the VCS but rather export them into a temporary folder and then use a DIFF tool like Delta Walker for the Mac to move them over even if I just copy them without ever merging. Read more
Markdown, Syntax-Colored Source Code
In this post I want to see if I can use Markdown and Blog Text in order to have syntax colored source code.
Source Code
This is an inner Java Class:
private static class LogLevelConfig { private LogLevel mLogLevel; private Pattern mModelIdGlobPattern; private Pattern mModelTitleGlobPattern; public LogLevelConfig( String pModelIdGlob, String pModelTitleGlob, String pLogLevel ) { if( pLogLevel == null || pLogLevel.trim().length() == 0 ) { mLogLevel = LogLevel.debug; } else { try { mLogLevel = LogLevel.valueOf( pLogLevel ); LOG.info( "activate(), given log level found: {}", mLogLevel ); } catch( Exception e ) { throw new IllegalArgumentException( "no log level found for: '" + pLogLevel + "'" ); } } if( pModelIdGlob != null && pModelIdGlob.trim().length() > 0 ) { mModelIdGlobPattern = Pattern.compile( pModelIdGlob ); } if( pModelTitleGlob != null && pModelTitleGlob.trim().length() > 0 ) { mModelTitleGlobPattern = Pattern.compile( pModelTitleGlob ); } } public LogLevel getLogLevel() { return mLogLevel; } public boolean matchWorkflowModel( WorkflowModel pWorkflowModel ) { boolean lReturn = true; if( mModelIdGlobPattern != null ) { lReturn = mModelIdGlobPattern.matcher( pWorkflowModel.getId() ).matches(); } if( mModelTitleGlobPattern != null ) { lReturn &= mModelTitleGlobPattern.matcher( pWorkflowModel.getTitle() ).matches(); } return lReturn; } }
This is now the same code in Markdown:
private static class LogLevelConfig {
private LogLevel mLogLevel;
private Pattern mModelIdGlobPattern;
private Pattern mModelTitleGlobPattern;
public LogLevelConfig( String pModelIdGlob, String pModelTitleGlob, String pLogLevel ) {
if( pLogLevel == null || pLogLevel.trim().length() == 0 ) {
mLogLevel = LogLevel.debug;
} else {
try {
mLogLevel = LogLevel.valueOf( pLogLevel );
LOG.info( "activate(), given log level found: {}", mLogLevel );
} catch( Exception e ) {
throw new IllegalArgumentException( "no log level found for: '" + pLogLevel + "'" );
}
}
if( pModelIdGlob != null && pModelIdGlob.trim().length() > 0 ) {
mModelIdGlobPattern = Pattern.compile( pModelIdGlob );
}
if( pModelTitleGlob != null && pModelTitleGlob.trim().length() > 0 ) {
mModelTitleGlobPattern = Pattern.compile( pModelTitleGlob );
}
}
public LogLevel getLogLevel() {
return mLogLevel;
}
public boolean matchWorkflowModel( WorkflowModel pWorkflowModel ) {
boolean lReturn = true;
if( mModelIdGlobPattern != null ) {
lReturn = mModelIdGlobPattern.matcher( pWorkflowModel.getId() ).matches();
}
if( mModelTitleGlobPattern != null ) {
lReturn &= mModelTitleGlobPattern.matcher( pWorkflowModel.getTitle() ).matches();
}
return lReturn;
}
}
How I did it
First I must make sure that Markdown is ignoring my Blog Text Code snippet by enclosing the entire Code into a <div> block and then use the Blog Text syntax to define the code block which is are 3 cutely brackets together with the attribute lang defining the source code language for the Syntax Coloring. When I wanted to display the Markdown version of the Source Code I had to use the Blog Text No-Parse tags (two curly brackets followed by two exclamation marks). But if I use Blog Text then I will use only Blog Text for source code and not both.
The only downside of that all is that Markdown preview displays just a blob of text. Still the code is not infused with HTML making it impossible to read and without the additional work to convert the code every time to HTML.
— Andy
Pebble: Review and Outlook
A few weeks back I received the highly anticipated Pebble Watch which I backed through Kickstarter. Since then I am using it all the time even though Pebble is not yet living up to its own promises. On the other hand I have a lot of respect for the Pebble team and what they accomplished so far. To have so much success and then deliver is not easy and requires a lot of work as well as business skills to just survive the onslaught.
Later I heard Dan Bejamin from 5By5 giving a review of the Pebble on Amplified #51 and I was a little disappointed by Dan’s comments because they sounded more like a spoiled brat rather than an adult even though being a spoiled brat seems to be much of the mantra lately in the tech press. For me a comment like I want more is treating the Pebble team like Apple, Google or Samsung but the reality is that Pebble does not have a multi-million R&D budget where it can just hire a bunch of developers to push the development. This is the bleeding-edge of technology and so we need to ask ourselves if we could do it better.
The Good
That said I think the watch should be reviewed and should voice our expectations so that we can push the technology forward. So this is what I liked about the Pebble Watch:
- Many different Watchfaces which can be easily exchanged.
- Vibrating on incoming Call or SMS. This way I will never miss a call.
- Easy to manage music. This is nice when I have my Bluetooth Headset on and I can pause the music right away.
- Waterproof
- Magnet-Connected USB Charging Cable. Easily to Connect.
The Bad
Many of the bad items are things that I think will be solved soon and otherwise might need creative thinking due to limitation with iOS.
- No Battery Indicator except the Battery is Low or when it is fully charged
- Magnet-Connected USB Cable does easily disconnect and this is hard to discover
- Battery Charge lasts less than 7 days.
- No Apps so far (Golf, Biking etc).
- Email Notification is not working for me.
Improvements
For example the battery indicator does not have to be on watch per se but I could be placed on the Pebble App instead. I also would like to receive a Notification on my iPhone when the Pebble watch disconnects from the Charging Cable and also when the Pebble is fully charged. Another thing I would like is to be able to call one of my favorite phone numbers. I know you can do this with Siri but my English accent does not go well with Siri and most of the time I cam better off taking my phone out and select the number manually. Another think I would like it to use my Pebble together with a Gym Log App where I can use the Pebble to see what is the next exercise / machine, the weight and let me know when to start the next repetition and tell the App when it is over.
Conclusion
Yes, the marketing of Pebble was and still is way ahead of the gadget. On the other hand this is a gadget by a small team and until there is another gadget like this is out we cannot compare it. Pebble is released early, maybe too early, but this has more to do with the funding through Kickstarter, its overwhelming success and the ensuing balancing act between initial success, demand after release and how to mange the business. The Pebble team could have hired a lot of additional people but that would have drained their reserve making it difficult to react to competitors. So I think that the Pebble team decided to focus on the SDK to advance the Watch rather than to create a few Apps even if that meant the Watch looks now limited.
— Andy
Moving Home of this Site
Since a while I am contemplating to move away from Bluehosst.com because of various issues but mostly because I am having issues with connecting to the Mail Server from time to time and this is plain annoying. A little bit of an effort on their site would made have stayed but I got more or less no help.
A New Web Site Host
Since I started looking I never found a good host. Next week my hosting at Bluehost.com was up for renewal and so I was finally forced to act. Initially I tried out Squarespace.com but their support of handling Source Code was not really good and neither Markdown nor BlogText was really supported and I was not inclined to use a special text component to display source code.
So last Week I got a notice from my registrar Register4Less that they offer Web Hosting that would fit my need. Because time was of the essence I ordered their hosting for a year. Then I wrote down what had to be done to move:
- Backup WordPress using the Dropbox backup
- Upgrade WordPress to the latest version
- Download the WordPress files from Bluehost
- Export the DB using phpAdmin
- Uploading the WordPress files to Register4Less
- Create the MySQL DB
- MySQL Admin and WordPress User and give them the right permissions
- Import the WordPress Export
- Change my local /etc/hosts to test
- Test the WordPress Site
- Undo the /etc/hosts changes
- Create the Email Accounts
- Transfer the Emails using imapsync using MacPorts
- Testing the Emails on the new Server
- Create / Adjust the DNS Settings at Register4Less
- Change the DNS Name Servers at Register4Less for my Domain
- Test the Life WordPress Site and Email Server
I expected that this would take the entire weekend to accomplish. But because the setup at Bluehost and Register4Less are so similar (both use Linux, cPanel, FTP etc) I was done within about 9 hours which is lightning fast.
Pitfalls
The first problem I caused myself was when I through that I had to change the Domain Name inside the WordPress DB records until I realized that using /etc/hosts was much easier. Then I had some issues with imapsync and because I did not want to pollute my Mac Box I used a VMware Fusion virtual machine to install MacPort and imapsync. It was slower but if anything went wrong because of the MacPorts etc I could just ditch the virtual machine. At the end everything ran smoothly and straight forward. Finally the change of the DNS entries took some time because of an initial misconfiguration and then I had to wait until the previous settings finally expired (3h TTL).
Result
Best result is if nobody would notice and so far I looks good based on my initial smoke screen tests. I am still expecting some issues but so far I was impressed how easy and fast it was. WordPress, MySQL / phpAdmin and cPanel are really easy to do a move like that. Let’s cross our fingers that the Mail Server problems are a thing of the past to make the effort worthwhile.
At the end I want to thank Dough from the Register4Less Support team for his help otherwise this would have been a way longer story.
— Andy Schaefer