Blog Posts

Sencha touch 2 apps and scrolling issue in Chrome/Android

I was revisiting a conference app I developed in Sencha Touch 2.3 (ST from this point onwards), and realised that the scroll for a couple of lists have suddenly stopped working. This was really weird as the scroll used to work fine and nothing has changed on the code side. This made me think whether the issue persists in how Chrome is rendering the list. I checked the same thing in Safari and it was working fine, which made me realise that the issue has to do with Chrome and the way the WebView renders the app on Android. A bit more digging made me realise that Chrome 43+ has caused this issue. There are two solutions to the problem. 1. Upgrade to ST 2.4.2 which resolves the problem. 2. Use a couple of overrides which are available here: I have personally taken option 2, as I want to retain my app on ST 2.3.1. The solution has worked simply out of the box and a big thanks go to Josh Morony.

Repository Fringe 2015

At #rfringe15 – Repository Fringe 2015. Fantastic conference. Also had a chance to speak to DMPOnline team for API development as well as other members of DCC team. Hardy also presented the DMAOnline poster successfully getting the runner up prize.

Hydra as a Digital Asset Management System

We are currently looking for a solution to store the different forms of digital objects/assets that are generated by various researchers/academics/departments/faculties at Lancaster University. The traditional repository model does not feel like it is best suited to accommodate the ever expanding range of digital assets. We are talking about Research Data, Digitised objects, Open Educational Resources, Video and Audio files, Software packages, etc. So we started looking into other appropriate solutions. From my previous experience, I remember Fedora was designed for this very purpose. The hint is in the name, Flexible Extensible Digital Object Repository Architecture. We are really keen on the flexible and extensible aspects. However, experience has also taught me that Fedora can become very complex to manage very quickly. Something, we at Lancaster, can’t afford at this time with our limited resources. At the same time, we are also looking into two wrappers/solutions on top of Fedora, aptly named as Hydra and Islandora. Hydra is based on Rails (Ruby) whereas Islandora is based on Drupal (Php). Considering we have expertise in neither (we are primarily a Django/Python shop), we are open to both solutions, or something else completely. Between Hydra and Islandora, however, it seems like Hydra

Continue Reading

Sencha Touch 2.3, hasMany association, and duplication of store entries

If you are working with Sencha Touch 2.3 (ST from this point onwards), then you may have developed a love/hate relationship with the platform like myself. Some aspects of the framework are great, whereas some others are sadly atrocious. The lack of coherent document, and the wide variety of conflicting information also does not help. In a recent incident, I am using a hasMany association in the model and found a peculiar issue happening. To give you background of the issue, I have a model called Session which has a hasMany relationship with another model called Participant. Both models below: The Session model: Ext.define('MyApp.model.Session', { extend: '', requires: ['MyApp.model.Participant'], config: { idProperty: 'id', fields: [ { name: 'id', type: 'int' }, { name: 'number', type: 'string' }, { name: 'time', type: 'string' }, { name: 'date', type: 'string' }, { name: 'day', type: 'string' }, { name: 'title', type: 'string' }, { name: 'abstract', type: 'string' }, { name: 'track', type: 'string' }, { name: 'room', type: 'string' }, { name: 'building', type: 'string' } ], hasMany: { model: 'MyApp.model.Participant', name: 'participants', primaryKey: 'id', foreignKey: 'session_id', associationKey: 'participants' } } }); The Participant model: Ext.define('MyApp.model.Participant', { extend: '', config: {

Continue Reading

DNS configuration – Ubuntu Server with Static IP

I was trying to install Ubuntu Server 12.10 on my shiny new HP ProLiant Microserver. The installation went smoothly with¬†a couple of hiccups that are as follows: First of all, beware of the tiny grey rectangle that shows at the bottom left of your screen when you boot from a USB disk. I was looking at it wondering why this is happening, is it a hardware issue, a disk issue? I created the Ubuntu Server 12.10¬†image on multiple disks, tested it on multiple machines, then did the same with Ubuntu Server 12.04 LTE. However, every¬†time I boot from the USB disk, all I see is the small grey rectangle at the bottom left of the screen. A bit of Googling¬†helped and I realised that all you need to do is to leave the grey rectangle on the screen for a couple of minutes, then¬†press ‚ÄúEnter‚ÄĚ, then leave the next screen for a couple of minutes, and press ‚ÄúEnter‚ÄĚ again, and magically the Ubuntu server¬†installation screen would be in front of you. Ubuntu installation used to be easier than this, and to be fair, the rest of¬†the installation was a breeze. Secondly, as with most server installations, I wanted to assign

Continue Reading

IGeLU 2012 – A brief perspective

The 2012 International Group of Ex Libris Users Conference (IGeLU 2012) was hosted by the Swiss Federal Institute of Technology, Zurich (ETH, Zurich) from the 11th to the 13th of September 2012. I had the pleasure of attending the conference, the pre-conference meetings, and the post-conference PWG meeting. During the hectic schedule of these meetings, I also had two talks to give, for details, see the Talks page. The conference itself was very useful, both from a personal and professional growth point of view. It clarified to us Ex Libris’s vision, the direction they are heading towards as a company, and how Oxford systems fit in their vision. It also gave us the opportunity to see Alma in action, speak to people who are moving towards Alma, and understand what we need to work on to have a smooth transition to Alma when the time comes for it. The other great thing about the conference was that I finally got to meet a lot of people in person that I knew virtually before. Another great component of IGeLU 2012 were the excellent talks given by numerous people. This included the excellent keynote speeches and the individual presentations on different topics. One of the things

Continue Reading

Parsing XML with lxml in Django ‚Äď Multiple Namespaces and XPath

A few days ago, I was trying to figure out how to parse XML with multiple namespaces and get information using XPath in Django. I came across lxml which I think is really good. You don’t have to csrf_exempt this procedure as it is GET based and thus safe. I am doing it for consistency with the rest of my code. I am using Primo Webservices basic search here as an example, but you may not be able to open this URL as it is a protected URL. Also, this may not be the best way to do this, so if you can think of improvements, please let me know. from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import simplejson as json import urllib from lxml import etree   @csrf_exempt def brief_search(request):     errors = []     if request.method == 'GET':         searchTerms = request.GET.get('query')         bulkSize = request.GET.get('pageSize')         indx = request.GET.get('start')         if indx:             indx = int(indx) + 1             DEFAULT_NS = ''             query = 'any,contains,' + searchTerms             url = '' + query + '&indx=' + str(indx) + '&bulkSize=' + bulkSize             content = urllib.urlopen(url)             xml = etree.parse(content)             docset = xml.getroot().xpath('//sear:SEGMENTS/sear:JAGROOT/sear:RESULT/sear:DOCSET', namespaces={'sear': '', 'def': DEFAULT_NS})             totalhits = docset[0].get("TOTALHITS");             docs = xml.getroot().xpath('//sear:SEGMENTS/sear:JAGROOT/sear:RESULT/sear:DOCSET/sear:DOC/def:PrimoNMBib/def:record', namespaces={'sear': '', 'def': DEFAULT_NS})  

Continue Reading

Configuring AWStats for Response Time Parameters

Recently I was looking at various web log analysers that I can use with Apache to generate standard and custom statistics. The package that seemed most promising was AWStats. AWStats does a great job, especially with standard statistics. It is also very easy to install. However, if you want to see performance related attributes in AWStats, you need to use the ‚ÄúExtra Sections‚ÄĚ in AWStats. I was interested in the response time parameter for a query in Apache. As a result, my Apache LogFormat looks something like: >LogFormat ‚Äú%h %u %l %t ‚ÄĚ%r‚ÄĚ %>s %b ‚ÄĚ%{Referer}i‚ÄĚ ‚ÄĚ%{User-Agent}i‚ÄĚ %T %D‚ÄĚ 443_combined Where %T represents the response time in seconds (useless as most requests are performed in under a second) and %D represents the response time in microseconds. The 443_combined is the nickname you can give to your LogFormat string, and then use this nick name to format when defining log files. You can call it anything. Equivalent AWStats log format is: >LogFormat=‚ÄĚ%host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot %other %extra1‚Ä≥ And to show the %extra1 parameter in the graphical page, you use the EXTRA SECTIONS. ExtraSectionName1="Response Time (in microseconds)" ExtraSectionCodeFilter1="200 304" ExtraSectionCondition1="URL,/" ExtraSectionFirstColumnTitle1="Response Time" ExtraSectionFirstColumnValues1="extra1,([0-9]*)$" ExtraSectionFirstColumnFormat1="%s" ExtraSectionStatTypes1=P ExtraSectionAddAverageRow1=0 ExtraSectionAddSumRow1=0

Continue Reading

Site Footer

Sliding Sidebar

About Me

About Me

Strategy, Leadership, Innovation and Code Monkeyism

Social Profiles

Latest Tweets