Github Blog
Have now improved workflow: I write in (aqua)emacs using orgmode, do orgmode-export-project and git commit the changes that updates the site directly. Also have full control over the site html, so i can make it in whatever layout i feel like(even if is ugly :P ).
source code is here: http://github.com/al3xandr3/al3xandr3.github.com
Note: I'm still keeping the http://alexandrenotebook.blogspot.com/ for re-posting, re-linking, and other shorter content.
jQuery Twitter 'mini' plugin
Here's a little jQuery plugin for displaying a twitter feed into a web page. The goal was to put my latest 'tweets' on my blog, and also learn jQuery. Ended up making a 'mini' jQuery plugin that can easily be added into any web page.
Demo:
For the code:
$(function() { $('#tw').click(function() { $('#tw').twitter({'user':'al3xandr3','count':2}); }); });
The plugin is running on the sidebar of this blog under the 'ON TWITTER' title.
How It Works
It makes an Ajax request to twitter that returns json data of the feed. That data is then read and injected into the selected html element(s).
See in:
$.ajax({ url: "http://twitter.com/status/user_timeline/" + settings.user + ".json?count="+ (settings.count+1) +"&callback=?", dataType: 'json', success: function (data) { $.each(data, function (i, item) { //text $this.hide().append("<p id=" + item.id + ">" + replaceURLWithHTMLLinks(item.text) + "  </p>").fadeIn('slow'); //date if (typeof prettyDate(item.created_at) !== "undefined") { $("<br>").appendTo("#" + item.id); //line break $("<a>" + prettyDate(item.created_at) + "</a>").attr( { 'href': ('http://twitter.com/' + settings.user + '/status/' + item.id), 'target': '_blank' }).css("font-size", "75%").appendTo("#" + item.id); } });} });
jQuery is a very nice designed lib, simple and powerfull. Some say its just like a functional programming Monad.
Full source code is available in github: http://github.com/al3xandr3/jquery-twitter-plugin
I'm now a ...
UI Optimization(AB testing) Tools, the Future?
How it works:
- You plugin the AB testing tool to your application and say: optimize page A, on the measurable goal X (for example downloads).
- The Tool by itself: creates new UI variation -> tests it -> analyses results -> picks best one -> creates new UI variation -> tests it -> etc… This goes ad eternum… Much like natural evolution, keeps experimenting/mutating, until it finds the best combinations.
Details:
- New UI variations do not need(shouldn't even) be 100% random, they should use smarter techniques like: genetic(and other search/optimization) algorithms + tried out design heuristics + branding guidelines(avoid color A, use font B, etc..) + (sampled)user filtering + some amount of randomness + etc..
- Knowledge Base: Build a Database with the test results, that collects knowledge of what worked and what didn't (for a given context). Just as Pandora collects user input for building its recomendation system, this accumulated knowledge would serve as input for the task of generating the new UI variations. Note: The amount of data is key; the bigger the amount of test results, the closer to all possible variations thus the closer to all the best optimizations. With a large amount of test and tried out results quicky we would get the perfect UI rules.
- Page Flow: Tool should optimize not only the page itself, but also navigation along pages, customizing content depending on the flow For example, forward the user to a different page, depending on the keyword used in a search engine when arriving at the website.
- Personalized UI: What works for user A might not work for B. A 16 years old likes different things than a 50 years old. Even for a unique user, his tastes changes over over time: winter vs summer, week vs weekend, working hours vs non-working hours etc… So the perfect interface might need to be changing over time(?) Don't assume, experiment and see if it works…
Automating todo tasks lists reports
Here's the geek automation of the week, its for helping creating reports from my TODO tasks list when using the amazing emacs org-mode(see here whats org-mode all about).
(simplified) Work Flow
- I get a request, add it into my todo list queue, marking it as a TODO item.
- Work, work, work, guided by the todo listed tasks, balancing priority and effort and (..add your own reason here..).
- When finished, mark an item DONE.
- Generate a report every week with the done tasks.
Generating the Report
(I use this setup on Mac, with some adaptations should also on Linux and Windows)
Every week i then generate a report of the DONE Tasks, by running:
# file: get-work-done.sh
# run: sh get-work-done.sh
# Uses emacs to extract the DONE items from work.org, generating a work-done.csv
/Applications/Aquamacs.app/Contents/MacOS/Aquamacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv "+TODO=\"DONE\"" org-agenda-files (quote ("/.../work.org")))' > work-done.csv
# Applies desired report formatting to the exported work-done.csv, generating work.csv
ruby format-report.rb work-done.csv
# Clean up the originally exported file
rm work-done.csv
# Opens the final file in the default .csv handler, typically Excel.
open work.csv
(see the comments "#" to understand what it does in each step)
Then I use the format-report.rb bellow to apply formatting to the report, for example: add my own header, add/remove columns, Dates, change names, calculate values, etc, etc... see example:
# file: format-report.rb
flines = File.open(ARGV[0]).readlines
column_map = {
"friendly_name_i_use1" => "required_final_report_name1",
"friendly_name_i_use2" => "required_final_report_name2",
"friendly_name_i_use3" => "required_final_report_name3"
}
File.open( "work.csv","w+") do |fl|
fl.puts "header1,header2,header3,header4"
flines.each do |l|
a = l.split(",")
# Time, mapping-defined-in-column_map, original-column-2, original-column-3
fl.puts Time.now.strftime("%m/%d/%Y") + "," + (column_map[a[1]] || a[1]) + "," + a[2] "," + a[3]
end
end
And voila, i run this and an excel sheet opens up with the report of the week.
Guardian Data Blog
- All the deadliest and strongest earthquakes since 1900, including coordinates
- The one penny supermarket price cuts
- Unicef's state of the world's children report 2009: Where is the worst place in the world to grow up?