Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Thursday, November 16, 2017

Bare Conductive Arduino MP3 Player

I found the Bare Conductive Touch Board Starter Kit while searching for activities to do with my almost nine year old son over the school holidays. It contains a custom Arduino board with a built in microSD card reader and audio output along with twelve electrode that can be used for touch or proximity sensor input. There is also a jar and tube of black conductive paint, a brush for painting them on alligator clip wires and adhesives, stencils and cardboard cutouts for designing the sensors. A 128 MB microSD card, USB card reader and portable speaker round out the collection.

The idea is that you either paint on the sensors or clip the wires to metallic objects so that when touched it triggers the playing an MP3 track.

It turned out to be a bit too complicated for a 9 year old, but my son likes to fall asleep and wake up to music and I had the idea that I would use the kit to make an interesting MP3 player on Alex's bedhead.

The first thing was to program the Arduino board, something I was now familiar with after the ticket gate project. The code examples provided were only for the triggering of single tracks, whereas I wanted proper player navigation. This included the ability to:

  • Stop, play, pause and skip tracks
  • Shuffle tracks
  • Change the volume
  • Play collections
By default the library used by the code only plays files named in the format TRACKxxx.mp3, where each x is a number 0 to 9. I did see some code for alternative names, but couldn't get it to work so I stuck with that format.

When the shuffle mode is selected random tracks are picked. Each played track is added to a list which is scanned to ensure that it is not repeated. Skipping a track forwards or backwards only moves to the next number and doesn't use random selection.

For playing collections I made a subdirectory, in my case called sleep and placed the relevant tracks in there. I also swapped the 128 MB microSD card for an 2 GB card I'd got with an old phone. This is the largest size supported by the FAT16 library. 

The code, listed at the bottom of the post, is memory intensive and occasionally locks, but it mostly seems to work.


The need to manually copy and rename tracks made the player impractical for use by my son, who also likes current pop. Instead a I got him a portable bluetooth speaker and an old mobile phone with Google Play Music installed.

Still, after all that effort I decided to get my player working anyway and painted up a pre-primed MDF board with the stencil, affixing the Arduino board and speaker at the bottom. Each silhouette corresponds to a control. It's not intuitive, but it is artistic and I might add to the design later. I like the look of the bare white, gold and black Arduino as well, a nice reminder of what is usually hidden inside the designs.


Wednesday, October 04, 2017

Arduino ticket gate - part 1

Alex is obsessed with automatic ticket gates and desperately wants one to play with in the house. Don't ask me why.

The mechanisms in automatic paper ticket gates are extraordinarily complicated and not something I could hope or want to recreate at home. However, modern gates tend to use RFID stored value cards to trigger them.

Using parts from an Arduino education kit along with an RFID module I bought at Jaycar I was able to build a simple system that triggers a servo motor when an RFID card is tapped on the sensor. It also changes the red LED to the green and plays a sound. I put a delay in to "hold the gate open".




The cheap RFID module seems a bit dodgy and the system often requires a few reboots to work. This is the first time I've soldered and used a circuit board in years. I haven't used the Arduino much either, just following a few of the examples given in the book. Still, I'm pretty pleased with the result!


Using the Arduino is so much easier than the electronics I did at uni and as a kid.

The next step is to put it in some housing and attach a "gate" to the servo. Going to get Alex's help to do that.

Sketch


/**
 * Ticket gate model
 * Detect RFID chip and trigger a servo
 */

#include  
#include
#include

#define SS_PIN 10
#define RST_PIN 9
#define GREEN_PIN 6
#define RED_PIN 7
#define PIEZO_PIN 8
#define SERVO_PIN 5

Servo gateServo;
int openTime = 5000;

MFRC522 mfrc522(SS_PIN, RST_PIN);  // Create MFRC522 instance.

void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  gateServo.attach(SERVO_PIN);
  gateServo.write(90);
  pinMode(GREEN_PIN, OUTPUT);
  pinMode(RED_PIN, OUTPUT);
  pinMode(PIEZO_PIN, OUTPUT);
  digitalWrite(GREEN_PIN, LOW);
  digitalWrite(RED_PIN, HIGH);
  
  SPI.begin();      // Init SPI bus
  mfrc522.PCD_Init(); // Init MFRC522 card
}

void loop() {
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
    return;
  }

  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    return;
  }

  gateServo.write(180);
  digitalWrite(GREEN_PIN, HIGH);
  digitalWrite(RED_PIN, LOW);
  tone(PIEZO_PIN, 261, 100);
  delay(100);
  tone(PIEZO_PIN, 392, 200);
  delay(openTime);
  gateServo.write(90);
  digitalWrite(GREEN_PIN, LOW);
  digitalWrite(RED_PIN, HIGH);
  mfrc522.PICC_HaltA();
}

Wednesday, September 06, 2017

Sun sets, but Oracle didn't predict it

Sun microsystems
Oracle has quietly shut down the remnants of Sun's Sparc processor and Solaris operating system lines. Both Sun and Oracle have made a huge impact on my life.

Back in 1992 I had my first encounter with Unix in a numerical mathematics course at the ANU. A number of our lessons were held in the university's computer labs housing Sun Sparc terminals. I marvelled at the huge high resolution greyscale CRT screens, opening terminals and text editors to edit and run Matlab scripts on the Solaris server. They looked so much nicer than the PCs and Macs we used elsewhere. Long before they were readily available for PCs these terminals used laser mice, though they required a special mouse mat to operate.

A year later, when I bought my first modem, I would connect into a Solaris Unix server via the terminal and access my email and play IRC. I met my wife over Solaris.

As a result of my Internet obsession I drifted into the role of web developer, eventually gaining employment at CSIRO's Australia Telescope National Facility managing their website. The site ran on a Solaris 2.6 server and for a time I even had a Sparc terminal to access it.

It was here that Oracle came into the picture. I built some web applications utilising the Oracle database, the only one available to me.

By this stage I was not a fan of either Solaris or Oracle (or 'Orrible as called by some). Much of the open internet ran on open source solutions like Linux and MySQL and, as expensive commercial products, the Oracle database and Solaris operating system often required custom compilations of libraries and custom rewrites of code. Our version of Solaris only supported 256 colours, meaning that images supplied by our users were often of too poor quality to use on the web.

A lot of time that could have been spent developing practical applications was instead wasted just wrangling the systems to work in the first place.

Eventually that job finished and I ended up writing PHP scripts on a Windows IIS box, which was a whole new set of pain.

Today I am still writing PHP, but running it on a Ubuntu Linux server, which is an extremely popular and well supported combination meaning that it's easy to find answers to problems online. But I haven't escaped Oracle, which acquired Sun in 2009, entirely. We use the very popular MySQL as our database and that was purchased by Oracle as well.

By all accounts the marriage between Sun and Oracle was not a happy one (it certainly wasn't on our servers) and I'm sad to see the disappearance of the former. Farewell!

Friday, January 06, 2017

Out of gas


The Summer school holidays are traditionally a quiet time at work when, with so many on leave, one can focus on those small personal projects that you never have a chance to do during the rest of the year. You take things a little slower and wind down after the usually hectic period leading up to Christmas.

I am fortunate enough to be able to work from home over the Summer holidays, allowing me to keep an eye on Alex whilst still doing work. The lack of a four hour daily transit to work and the need to worry about school lunches and homework means there are more hours in the day to both work and play.

That's the theory. So why am I so bloody knackered?

After dithering for most of the year a certain fracking (and I use that as an epithet) group demanded that we make their website for them by the end of January. And I am off on holidays for most of January.

I never wanted to do this site. We should be decarbonising, making this research redundant. Plus it's industry funded so they can pay for an external site and developer. It's not like energy companies pay their fair share of taxes.

The only consolation is that at least much of the research is focused on mitigation and preventing damage to the environment from the operations.

But they didn't listen to me. Nor did they employ people with web experience to manage the project. So not only do I have to develop the site, but I also have to handhold the authors. And I and the rest of the team already have a lot of work on my plate.

We have a new graphic designer replacing the one I worked with on last year's fantastic Utopia project. This new guy is perfect for the organisation as he has a tendency to overcomplicate everything. I try to use WordPress' inbuilt functionality and structure as much as possible, allowing users flexibility at the expense of centralised control. Simplicity and flexibility are my mottoes.

It's one reason why our WordPress sites are far more popular for authors than our Sitecore websites.

User flexibility and control is an anathema to corporate operations.

So I'm presented with the need for a large number of templates, custom post types and fields (using Advanced Custom Fields). And there's no time to argue because they've been approved and the graphic designer is off on leave. And our front end developer has only a short time available too.

Naturally a lot of the elements and styles don't fit into WordPress' default generated HTML. So that means things like custom menu walkers and archive pages.

I find I have to do almost no training to get users up to speed with vanilla WordPress but customisation means additional training and the people responsible are on leave.

There's no way I can do everything in time, no time to train a contractor up and get them permissions, so I tell them they'll only have a subset of pages available for the initial launch lose the fancy searches for now.

And I begin working flat out before and after Christmas. I give them some custom page types so the authors can start entering content while I work on listing pages. I solve problems and churn code out. What I did was petty awesome, even if I do say so myself. Not just reusing other people's themes and plugins like some commercial developers do (because my clients are "special needs" so virtually nothing works out of the box).

I'd like to work on this on the evenings and spend time during the day looking after Alex. But no, in come the phone calls. Sometimes every ten minutes or so. Help entering content, changes to be made to templates, the odd bug discovered. One day I counted to ten and was about to open the door on a hiding Alex playing a game of hide and seek when the phone rang. Again.

You see, when a manager or communicator signs off on something it means very little. They want changes. Limitations are unacceptable.

But I want to spend some time with my kid. The year is too busy and he grows up so fast that any time together is precious.

I finally made the site live today. More bugs/changes. Eventually, at 4 pm (and if you think that's skiing off early I'd had 10 minutes off for lunch), when I was supposed to go and pick up Alex from a friend's place another change request came in and I lost it. Privately. My head was so exhausted that I couldn’t cope with any more changes. I told them no. That any further changes ran the risk of further bugs. They apologised, said thank you, and I fixed the last known bug.

Then I found this floating in our swimming pool and fished him out...


Another giant bug fixed!


Monday, July 18, 2016

Alex's awesome holidays

The last day of school holidays for the middle of 2016 and I think it's worth jotting down all the activities over the past two weeks. Left to his own devices, Alex would spend far too much time with his devices, so the idea was to get him out and about in a way to stimulate his body and mind with the kind of experiences he doesn't normally get while still having time to "chillax" as he so likes to say. Meanwhile, when he wasn't in vacation care I worked from home.

Thursday June 30

Second last day of school, but we had some expiring movie tickets so went to watch Steven Spielberg's version of The BFG at Miranda. We all enjoyed it, well acted and visually spectacular.

Friday July 1

Alex wrote his first Android apps using MIT App Inventor 2 and following their video tutorials. It''s very simple, much like Scratch, and you can do cool stuff using a device's built in sensors. He worked out how to customise the examples and we put one of the apps on my phone.

Later I had a play with an Arduino set I had recently purchased. Wish that mucking around with digital hardware was that simple when I was at university!

Saturday July 2


Bike riding at Centennial Park, B and I on hired bikes, Alex furiously pedalling his too-small kid's bike.

Sunday July 3

After the previous day's experience we decided to get Alex a new bike. Purchased an adult one so that we can ride with him.

Monday July 4

Vacation care with clowns for Alex after the 4-D cinema cancelled on them. 

Tuesday July 5

Bikes arrived! While I worked from home, Alex relaxed and did his own thing.

Wednesday July 6

Second day of vacation care. Alex went to indoor rock climbing and laser tag.

Thursday July 7

A full day Thinkspace workshop on Scratch programming at Sydney Observatory for Alex. He really enjoyed writing the three games and was very proud to show them off to me. A long way from writing text games in BASIC when I was his age!


Friday July 8

Took Alex for his first ride on the new bike - needed more practice!

Saturday July 9

Riding his new bike in the park, Alex saw his school principal.
  

Sunday July 10

Alex left us alone to go go karting at a friends birthday. Apparently he was a bit nervous at the speed of them.

Monday July 11

Sadly the holidays were not without some homework and Alex had to write a persuasive speech. Persuading him to write it was the real test. 

Tuesday July 12

I had a day off, or tried (forgot to undivert my phone). We built some of the plastic houses and shops for Alex's Japanese N-scale model railway layout. Wish the bath house was real!



We both went for a ride around the suburb on our bikes, but Alex found the hills a bit tricky. 

Wednesday July 13

While Kita was at the vet having his teeth cleaned I took Alex down to the ANSTO nuclear reactor at Lucas Heights for an hour and a half session of Atomic Kids. This fantastic session introduced kids to the periodic table, atoms and chemical bonds. Alex really enjoyed it.

Thursday July 14

Another full day workshop, this time learning about the circulatory and respiratory system at the Junior Science Academy at Macquarie University while I was over at work at North Ryde. They looked at dissected sheep hearts and lungs and made blood from Cheerios, marshmallows and food dye. He was pretty exhausted by the end of it but eager to tell me everything he'd learned.

Friday July 15

A chance for B to spend some time with Alex before going over to his best friend's house.

Saturday July 16

Alex came into our bedroom at 4 AM bawling his eyes out, having just fallen out of his bed. We then discovered a gash to the side of his head. Who knew sleep could be that dangerous? So off to the emergency department we drove. A couple of hours later, no stitches or glue, just plasters holding the skin together. Barely any rest then off to the first karate of the term.

As the head sensei is off recovering from an operation we had Sensei Leighton, the exercise fanatic.

Went off to eat Chinese at Hurstville and had an afternoon tea of chocolate pudding at Brighton. I could feel a headache building and by the time we were driving back home it was ferocious.

Chocolate flavoured vomit.

I was a write off for the rest of the night.

Sunday July 17

Another birthday party for Alex, this one at 10 pin bowling. I came second last amongst the adults. I would have been last but one of them let his toddler bowl. At least I got one strike! Alex won, thereby cementing what was a pretty awesome holidays for him.

A balance between exercise, education and relaxation. Hopefully he's starting next term in a good frame of mind. I think I need another holiday!

Friday, July 15, 2016

WordPress shortcodes and line breaks.

WordPress automatically adds break tags to new lines. Normally this is useful behaviour but it can prove a major annoyance when combined with shortcodes.

Following user requests I had added a set of column shortcodes to my Utopia theme. The shortcodes are currently just a way of adding a Bootstrap grid to the content, but as we will be replace Bootstrap with an alternative grid system in future this is a way of future proofing the content.

I found a couple of really useful tutorials for adding a columns menu to the TinyMCE visual editor in WordPress:

All well and good, but when I published the content WordPress added break tags between the div
tags and the columns did not display.

My first solution was to change the order of WordPress' shortcode_unautop and wpautop filters, as per these instructions.


//move wpautop filter to AFTER shortcode is processed
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 99);
add_filter( 'the_content', 'shortcode_unautop',100 );

Bad move! Suddenly my other shortcode output was messed up. So I had to remove those lines.

The solution? Write a custom filter using regular expressions to remove line breaks between the shortcode tags and run it before the normal WordPress line break filters kick in. A regex tester proved very useful here!

function utopia_cols_strip_breaks( $content ) {
$content = preg_replace('/(\[utopia_col_row\])([\s]*)(\[utopia_col)/i','$1$3',$content);
$content = preg_replace('/(\[\/utopia_col_)([\_\d]+)(\])([\s]*)(\[utopia_col)/i', '$1$2$3$5', $content);
$content = preg_replace('/(\[\/utopia_col_)([\_\d]+)(\])([\s]*)(\[\/utopia_col_row)/i', '$1$2$3$5', $content);
    return $content;
}
add_filter( 'the_content', 'utopia_cols_strip_breaks', 0 );

I had to use three expressions as there are shortcodes for rows and columns of different widths. Whilst WordPress is supposed to handle breaks between individual shortcodes, the issue here is that we are mixing different shortcodes together and the content between them should have paragraph and line break tags added. The code above only applies to the added shortcodes and seems to work well, so problem solved!

Monday, February 15, 2016

Reaching Utopia

After many months of work I finally released my first complete WordPress theme Utopia today and I'm pretty proud of it.

Unlike some of my previous attempts which were based on the Underscores starter theme, Utopia was pretty much built from scratch. The theme, which will be used on CSIRO Research websites, is designed to address many of the feature requests and deficiencies of the previous themes we've used on the site and elsewhere.

My colleague Taranii, with some help from Kate, another member of the team, did the design and CSS markup while I was responsible for the PHP coding. It was a remote collaboration due to the distributed nature of our team, but I thought it worked really well, thanks to some of the fantastic tools on offer.

We used Atlassian's Bitbucket, Sourcetree and git for source code management, which made it really easy to deploy on both our Windows development machines and Linux servers. Atlassian's Jira was used for bug tracking, along with Jira Capture for test sessions. Finally, most of our contact was via Cisco Jabber.


The Utopia theme, along with the post grid plugin we developed alongside it, has a number of very cool (to me) features. These include different colour schemes, the ability to use page, post and category feature images in the individual page headers, social media buttons, a local contextual menu, support for different page and post templates and a page and post listing grid with lots of options and the ability to be included as a widget or shortcode.

Another group in our organisation went to an outside specialist WordPress development house to build a theme for their WordPress blog. The result, which took quite a while to complete, was a theme that relied mainly on a somewhat expensive base theme and set of commercial plugins whose licenses are still causing us grief, especially as the users want more features.

So I'm proud that we built our feature rich theme ourselves! We do use some third party plugins, but after I looked at following a similar development path to the blog I realised that it would never satisfy the myriad of little issues and needs that our users always seem to have. At least this way we really understand our code a lot better.

I was up until the early hours finishing off some basic usage documentation and building the new top level site for the release. Exhausting, but very satisfying to finally get it out there to the users.

So, does the name Utopia mean that theme is perfect? Nope, there's plenty left to build in future! In fact it's all about building. Or trying to.

Thursday, December 24, 2015

One hour until Christmas

Better go to bed, don't want Santa to skip our house.

Going to bed before midnight would be nice. So would waking up to a quiet Christmas day spent with just the three of us (and dog). Sadly not. Instead it's a drive up to the Insular Peninsula for a party with one side and back south by the evening for a dinner with the other.

I'm exhausted. I've been pushing to get this super awesome WordPress theme ready for testing before my co-developer, the designer goes on holiday. Finally set up the test sites last night and then wrote up the authoring and admin instructions from about 7 am and sent them out an hour before work closes for the Christmas break.

Then there were all the other support requests.

Alex has been on holiday for a week now so I had to look after him at the same time, meaning a lot of the recent work was done late at night after he slept. Then there was Christmas shopping and preparing dishes for tomorrow.

I'm knackered!

Oh darn, I just remember I have to make another layer of jelly and let it cool before pouring.

Merry Christmas.

Tuesday, December 15, 2015

Why you think I hate Microsoft

Every popular, or once popular, operating system has its fans. Who doesn't know an Apple fanboy (or fangirl), with their fervent agreement with every utterance from Steve Jobs and now Tim Cook? Or the Linux freedom fighter, for whom a command line equals "desktop ready"? There are even those that can't let go of their Amiga.

But there is another group who are surprisingly not as well recognised. Surprising, because theirs is the most popular opeating system of all, at least as far as personal computers are concerned.

I'm talking about Microsoft.

Let’s be clear about something. I use Microsoft products and have done so for decades. My desktop computers all run Windows, including my work laptop. I used to program in Microsoft BASIC and more recently (though somewhat reluctantly) in C# and .Net. I've maintained Web servers running IIS and even used FrontPage. At work we use Outlook.

Microsoft do make some good and useful products. But in geekdom Microsoft has traditionally been seen as the Evil Empire, to be distrusted and opposed at every opportunity.

So it has come as a shock to find people jumping out of the woodwork to vigorously and publicly defend Microsoft products from criticism.

Fair enough, you say. If they make good products then they should be supported. However, a closer analysis of the defenders' arguments actually illustrates the flaws in Microsoft's traditional strategy and why it has been losing market share.
Yes it is cloud-based allrite, but the fact that you can use it simultaneously across multiple devices with proper version control, op-locking, etc. puts it miles ahead of iOS. Google's services are okay, but as 90+% of the corporate desktop uses Microsoft Office I don't bother with it.

And yes, SharePoint is an incredibly helpful suite if used appropriately. Poor user practices and system implementation does not make it an inferior product. But hey, you could always use TRIM or some other form of EDMS if you're prepared to put up with the pain and lack of mobile support.
SKay, December 11, 2015 
Microsoft Lumia 950 XL phone review: different, but not in a good way
The above comment illustrates very well the issues.

  1. The comment author assumes that the only corporate environments matter and that only Microsoft is suitable for enterprise environments.
  2. They blame the user for not using the product properly rather than the usability of the product.

SharePoint is my tool of choice for revealing the true corporate Microsoft fan. We once did a competitive evaluation between intranet content management systems and invited representatives from Microsoft to pitch SharePoint. They arrived terribly cocky, assuming their product was the best and couldn't be bothered to answer the questions we'd sent them, dismissing them away as "You would need to program it"rather than providing them out of the box like the eventual winner did.

I've used SharePoint at work. It's had gaping usability, standards compliance and systems maintenance issues, yet the Microsoft fans insist that it's suitable for something other than a document sharing platform. Even then it's a version dependent pain compared with, say, Google Docs. Even Microsoft themselves don't seem to love it so much any more.
Now that Internet Explorer has won the browser wars.
That was a quote from a course I attended around three years ago about building websites using .Net. It wasn't true then and it certainly isn't true today (even Microsoft are dumping IE for Edge), especially with so much browsing done on non-Microsoft phones.

But the true Microsoft fan can't see that anyone would seriously use a non-Microsoft product. Their world is the corporate world of centrally managed systems where everything is Microsoft. They seem to struggle to acknowledge that there other enterprise players. After all, in their minds, who would use an Oracle database when SQLServer exists? There is a blindness to alternatives.

This course was funny in that it taught web application development from the perspective of a desktop application developer. They thought web pages should look like and act like Windows desktop applications.

Ha ha. Why would you make something that ugly?

Microsoft has a long history of making stuff ups with regards to the Internet and the Web. Rather than stick to agreed third party standards they subverted them with products that produced ugly and bloated code that only worked properly in Microsoft products. I have had enough of trying to fix Microsoft Office and FrontPage generated HTML to last me a lifetime.

You see, Microsoft has traditionally been the enemy of interoperability. You want to use something outside of their environment? You always run into some barrier they've erected, some proprietary extension that is required to do what other products can handle almost seamlessly.

To be fair I think Microsoft has been changing under Satya Nadella and embracing a lot more openness and standards, but many of their supporters still seem to be stuck in the old ways. To a Microsoft fan it's your fault if you want something different. It's the Microsoft Way or the Highway.

Me, I like the highway. It's more scenic, usually cheaper and full of interesting things to explore and learn from. And if the diehard Microsoft fan gets in the way? There's always an alternative route, they just can't see it for themselves.

Sunday, June 14, 2015

Alex and computers

Scratch
I was rather pleased to see Alex playing with Scratch this morning. It's a free Flash web tool designed for kids that enables them to write programs by connecting a variety of elements together. I think it's quite good for teaching kids about loops and logic.

I have also installed Microsoft Small Basic on his machine, though it might be a bit advanced for a six year old. Not for long, though.

Alex is rather obsessed with computers and is very comfortable using them. Right now he's very proud of his ability to change the desktop background in Windows 8. He also made his own slideshow movie with Movie Maker and another with YouTube.

The obsession can be rather funny though. He may be the only person who like Ctrl-Alt-Del and typing in passwords, getting rather upset that you don't have to do it this way for home machines, unlike enterprise systems at school and work.

He also wanted Word and PowerPoint. Unwilling to shell out further money for both until he actually needs them, I installed LibreOffice instead and told him that it was the latest version, newer than at school (him being used to this with Windows 8.1 instead of the school's Windows 7) and that's why the icons are different.

I must get him on to Linux as well. He prefers the iPad to his Windows 8 convertible laptop/tablet, but the reason I chose the latter is that it runs Adobe Flash, which a lot of educational websites, including Scratch, still require.

Unfortunately, the Microsoft Parental Controls are an annoying pain to use, though still beneficial when it comes to learning what not to click on.

What I really need to get working on is controls on YouTube to prevent certain useless topics from being displayed (e.g. EvanTubeHD, adult reviews of toys and endless computer game commentary). There's so much else that's educational or creative that could be watched instead.

I think back to reading my parents' 1950s medical textbooks, full of grotesque diseases largely unknown due to vaccines and antibiotics. Now Alex watches the highly educational Operation Ouch on ABC iView and can tell us the most remarkable medical facts. I'm quite envious actually!

Wednesday, August 06, 2014

Mod_speling gotcha

I recently had to migrate a large chunk of content from a Windows server to Linux. Linux's file system is case sensitive, Windows is not, so I ended up with a lot of broken links. A solution is to use Apache's mod_speling. I only wanted to use the capitalisation capabilities of mod_speling, not the spelling variations. I enabled the module, which is off by default, and entered the configuration in the virtual host conf, the site conf, the .htaccess file, but nothing seemed to work.

The trick was that you need both options to be on, not just CheckCaseOnly. So for capitalisation only you would put the following in your .htaccess file.

<ifmodule mod_speling.c>
    CheckCaseOnly on
    CheckSpelling on
</ifmodule>

Thursday, August 08, 2013

This is why Microsoft are uncool

Robert Scoble argues that Microsoft has lost its cool on today's Sydney Morning Herald website. I actually found Joseph S' pro-Microsoft comments below the article to be a better illustration than Scoble's.
This discussion is ludicrous. Microsoft is not solely a one dimensional consumer app or gadget company. It remains the world leader in business applications and platform support. The Office suite is still used every day in most businesses around the world. SQL Server has made major inroads into industrial strength datbase markets. Azure is a major leap forward in cloud service delivery and in the developer space tools like MVC Entity Framework and Silverlight are far more comprehensive and feature rich than competitor products. Sharepoint has become the leading business content repository. The world still uses Microsoft as the core business delivery platform. It seems the readers of this article are unaware of that. 
Firstly let me say I am not a Microsoft employee or acolyte but I have to disagree with some of your comments. I am a developer and I recently evaluated Java FX and .NET MVC for a complex multi layered browser based UML diagram modelling system. .NET MVC was selected so I don't agree that Java is taking over. Corporate and Government Azure uptake is slow because of concerns about data sovereignty. Microsoft has introduced a network utility to incorporate inhouse database servers. They are also building an Australian data centre. I dont understand the comment about SQL Server being stagnant. SQL Azure has hundreds of new instances a day. Windows 8 will take a while for Corporates to appreciate the benefits. With BYOD growing exponentially Win 8 offers a uniform OS across the desktop and the device. When you get into the service delivery area in Microsoft's development suites there are countless quite brilliant innovations happening all the time. These are largely unobservable to the public, but to claim that Microsoft do not innovate is simply nonsense.
Joseph is right that Microsoft is still heavily used in business and indeed it does have some good products (but not necessarily all those listed above). But I've found that those developers who have grown up within the Microsoft ecosystem struggle to understand that users may want to do things outside the Microsoft way. Maybe they don't want to build an enterprise app or invest in a year of Microsoft Certified training to write a simple program or website. Or maybe they want their application to interact with non-Microsoft products and data. Take his mention of Sharepoint - we use it, but it's a usability nightmare and traditionally doesn't play nice with non-Microsoft browsers and files.

Microsoft is not cool because Microsoft doesn't support diversity and choice. It's not agile or interested in letting users drive it's developments. Instead Microsoft wants to make those decisions for you and it doesn't understand any other way.

Thursday, May 02, 2013

More notes on setting up Sitecore locally

More joys getting Sitecore to run on my machine. For some reason the App Pool of the Sitecore instance was set to .Net 2 rather than .Net 4. This required going into IIS Manager and changing the App Pool setting.

Sitecore had also managed to set the database connection string to my local user rather than a builtin account. I had to edit the username and password in AppConfig/ConnectionStrings.config in Visual Studio and rebuild the solution in order to make it work.

I wish Sitecore would use HTML documentation rather than PDF - it makes jumping to the right spot in Google searches very difficult.

Wednesday, May 01, 2013

Notes on setting up Sitecore locally

I'm in the process of preparing for formal training in Sitecore development. Sitecore is a enterprise content management system written in .Net. I find Sitecore's development documentation quite poor in contrast to many open source projects. Too much is in PDF format.

In order to practise, I've had to setup a local version of Sitecore on my desktop machine. Sitecore provide an installation file, but I had issues attempting to connect to my instance of SQLExpress as it appears to need an SQL Server user rather than using the default Windows authentication. To resolve this I first had to download and install Microsoft SQL Server Management Studio Express. I then changed the server authentication mode to permit SQL Server and Windows Authentication.

After entering the credentials of the sa user I was then able to install Sitecore.

I then needed to create a Sitecore Web Application Project in Visual Studio 2010. Note that the Sitecore webroot can be found in the Website subdirectory of the directory setup by the Sitecore install. With replicated folder names in Sitecore directories the instructions can be a little confusing.

Tuesday, February 26, 2013

Inquire into enquire (Templatic)

WordPress madness yesterday. One of my colleagues purchased a Templatic WordPress theme and discovered that all the strings which should read enquiry were instead inquiry (similarly enquire was inquire). Templatic's support forums are available only to those who have purchased a theme - and Google's cache. To make the changes (and I recommend changing capitalisations as well) you need to edit the language.php file of the theme.

Do not do a simple blanket search and replace, because the constant names need to remain as INQUIRY. Only change the values.

define('SEND_INQUIRY',__('Send enquiry','templatic'));

I'm not sure if these changes will be overwritten if you update the theme.

Saturday, January 26, 2013

What's happened to the WWW?

<html>
I can't help but feel a sense of irony that on the very day I was preparing a web page for an upcoming talk by Sir Tim Berners-Lee, the creator of the World Wide Web, so was I also dismantling one of our few websites designed to let our researchers communicate with their peers.

The WWW was developed at CERN, the European Organisation for Nuclear Research and home of the Large Hadron Collider for the purpose of allowing CERN researchers to share information about their experiments, facilities and the organisation itself, partly as a way of mitigating the loss of institutional knowledge due to staff turnover. The original proposal is fascinating for its outline of the problems and proposed solution and as Berners-Lee wrote:
"Perhaps a linked information system will allow us to see the real structure of the organisation in which we work."
When the WWW expanded out of CERN it was into other research organisations and the universities and the content was primarily scholarly in nature.

Today the WWW is a very different beast. While there is a massive amount of well researched information available resources online about an almost inconceivable range of subjects (take Wikipedia for example), the real driver appears to be advertising. Not just advertising driven giants like Google, Facebook and media outlets, but all sorts of organisations and individuals attempting to sell a product, service or even an opinion to readers online.

My organisation is not alone in forcing researchers to pass information to "communicators" who rewrite it for general consumption before it is allowed to go on the main organisational websites, even internally. The intended audience is almost never fellow researchers, but stakeholders with money (even if only the public's taxes). The content ceases to become a real information resource and instead becomes advertising.

Thankfully, there are initiatives for sharing organisational scientific information online through publications and data repositories. But for many the WWW is no longer a tool for opening up information for discovery and instead it is for controlling what information is available out in the open.

The whole point of the WWW was the ability to turn text into hyperlinks to more information about a term or resource. If that link pointed to an entirely different website then great, you had expanded the network of accessibility of that information. It's amazing what random paths you could be lead upon and what you could learn from such links. Now authors are often discouraged (apart from Wikipedia) from creating inline links, with what links that exist in a page usually designed to guide the reader along a specified path within the site.

Perhaps some of the responsibility for this change lies with web standards themselves. When it started the formatting options for web pages were very limited - the main point of a page was the content and the hyperlinks elsewhere. Now web development is all about format over content. No longer can anyone simply write up a HTML document for the web, now HTML standards are mindbogglingly complex and websites require the input of graphic designers, accessibility and search engine optimisation experts.

I love great design and the amazing tools now available online from banking and booking to satellite photo maps with incredible overlay options and video editing online. But I do wonder if the need to be visually stunning often prevents us from really communicating. It's like "Keeping up with the Kardashians" replacing a Sir David Attenborough docummentary. I think we've lost something precious in the transition.
Updated on 2013-01-26 with comments about hyperlinks.

Friday, April 27, 2012

All a twitter on Apps Day

I posted over 100 tweets today under the username @AppsDay on behalf of the Australian Centre for Broadband Innovation's Broadband Apps Day 2012 at the Australian Technology Park. The day featured a speakers from organisations ranging from Google and Microsoft to Woolworths and Ausgrid discussing potential applications for the National Broadband Network (NBN) and the issues associated with them.

Topics included home automation, health applications (including Dance Dance Revolution for seniors), application development and e-commerce.

There was a disappointing lack of discussion on the security and privacy issues associated with these applications. For instance, a Samsung rep was spruiking the control of household whitegoods from their televisions, phones and tablets. Yet there was a recent report of vulnerabilities in Samsung electronics, one of which could cause endless restarts in their televisions. Who might be watching you on those televisions as well?

The point about who owns your household data was also raised. Some of your devices like smart electricity and water meters may report directly back to suppliers via the NBN without the household owner being able to directly access that data. What about other devices sending usage information out to marketers. One speaker thought that users might want Harvey Norman to contact them to offer more energy saving devices based upon usage. That's actually quite scary.

There is a lot to think about with the potential for a ubiquitous broadband network with similarly ubiquitous connected devices.

A few speakers commented that the way people consumed entertainment has changed and that their children expected on demand video rather than traditional television and to interact with devices via touch, voice or gesture rather than the normal remote control. It's certainly been our experience with Alex.

I don't think that Twitter is the best medium for conference commentary. I quite miss IRC's live chatting and channels, though I think we could do even better today. I have some ideas for the ideal online conference tool...

Rather than use the big work laptop I brought in my trusty Sony VAIO P to do the tweeting. The keyboard is great for fast typing and quiet. Even better it's light and cool - important if you don't have a desk.

What I derived the most pleasure from was developing a web display of the conference tweets, which we put up on a big screen outside the lecture theatre. I wasn't happy with the lack of customisation options with other tools like Twitterfall, so I decided to write my own.

It took me around a day to combine the Twitter Search API with Javascript and PHP, along the way reminding myself how to use jQuery, AJAX and parse JSON formatted data, plus do some cool CSS3 effects. The actual programming is surprisingly simple, it's the eye-candy that took the time. Screenshots of the results below:

Opening logo screen

Twitter feed, updated every minute



Sunday, March 04, 2012

Me vs ASP.Net Part 2

Post delayed by bugs - of the viral nature...

My ASP.Net course (ASP.Net Using C# 2010 - Part 1) wrapped up on Thursday and I have quite mixed feelings about it. I believe that the course was aimed at C# developers who are transitioning on to ASP.Net and it shows. I myself had no C# experience, but its very name displays its C heritage and I have used a number of other derivative languages in that family, so I could follow the general concepts.

The way that the course was presented and many of the language libraries used were too much like developing a Windows application for my liking. When developing a Windows application you generally aim for consistency - the same menu structures, the same look and feel, the same data entry and presentation widgets. The web is much freer. Plus, most websites are not about entering and presenting sales data. Intranet applications, maybe, but even then plenty are designed for other activities.

Datagrids, preconfigured navigation and site map structures, themes other than pure CSS or HTML-like templates. It all felt very old fashioned web. In fact it felt like a programmatic evolution of Microsoft FrontPage. It's what a Microsoft Windows Application Developer might want and I think that's the problem.

Microsoft have, over the years, struggled to accept that the World Wide Web should not be tied to their products.

Take Microsoft Word for instance. It is the bane of most webmasters's existence. Why? Because when you export to HTML it generates a whole lot of code in order to retain it's original appearance when placed online. Even if you use filtered HTML. But most of the time you don't want it to look like that, especially if putting it into a content management system. Some non-HTML author writes up their content in Word, then you need to spend ages cleaning up the code. My favourite feature of Adobe Dreamweaver isn't the (not-really) WYSIWYG editor (I usually use the code window), nor the integrated file management. It's the fantastic Word HTML cleaning when I paste content across.

This misunderstanding of the web's nature sometimes manifests itself as outright hostility by their supporters towards open source and other alternative technologies, often decried as "not up to enterprise standards", despite being used by some of the world's largest online companies. If many Microsoft technology courses were structured like mine then I can see how these misconceptions are transmitted to new Microsoft developers.

In itself I can't see anything wrong with using C# and I can certainly see why many developers love Visual Studio. Apart from the serious debugging and data visualisation capabilities, which I didn't really get into, Visual Studio does a lot of convenient handholding with properties windows and Intellisense making lots of suggestions and autocompletions. Maybe too much handholding and easy shortcuts to completing tasks, which I think gets in the way of intimate understanding of a technology and can slow you down. I wonder how many experienced developers switch that handholding off.

Anyway, at least I know have a feel for the language and Visual Studio. It will be interesting to see how useful the course was when I start developing with ASP.Net over the next few weeks.

Monday, February 27, 2012

Me vs ASP.Net Part 1

"Now that Internet Explorer has won the browser wars..." says the ASP.Net video tutor on my PC.

What?!?!?!

It may currently have the largest market share, but it sure as hell hasn't "defeated" the opposition. It's like claiming that because the United States is (okay, was for a short time) the only superpower that one can just ignore any cultural differences elsewhere in the world.

Proof that Microsoft really is an American company?

I'm on day one of my ASP.Net training. I'm trying to approach the language with an open mind, same as I would for any other language. However, so far I'm still struggling to get past that same "bulldog enthusiasm" I discussed in No fun Microsoft.

More to come over the next week...

Wednesday, December 07, 2011

No fun Microsoft

I had a lot of fun creating allrite@. There is something about learning and experimenting with a new programming language (Python) in Linux. As I trawled the web for instructions and tips there was a sense of participating in an enthusiastic group who took pleasure in contributing their knowledge to the greater community.

I never feel the same way about the Microsoft programming community. There is still a lot of enthusiasm, but it's a kind of bulldog enthusiasm, charging in and saying Microsoft is the way, the only way and get the f!@# out of my way. You want standards and interoperability? We've got our standards and interoperability between our own products: you don't need anything else.

Want some extra functionality? Somebody has a product/plugin for that. Now hand over your credit card details...

Microsoft's programming languages and tools may have a lot going for them and I certainly use their products on a daily basis. But it's not fun.

Popular Posts