Wikipedia Mobile #1
Veröffentlicht am 8.4.2012, 02:00 Uhr
This morning I accidentally installed Wikipedia’s mobile app on my iPad. It felt sluggish, strange and not at all what I expected. As bitching doesn’t help and I wanted to use my professional knowledge in my free time, I started poking around. This is the result.
Starting position
The iOS Wikipedia app has really bad ratings. Users complain about bad performance, bad usability and about the feeling that this is more an Android app but an iOS app. In sum, this creates you a rating of only 2 stars for the current version. Ouch.
- http://itunes.apple.com/de/app/wikipedia-mobile/id324715238?mt=8
- https://play.google.com/store/apps/details?id=org.wikipedia
Android users seem to be happier with their 4.5 star rating. The problems only exists with the iOS version of the (similar) app. Strange. Let’s start with the basics and look into the feature set:
- Read Wikipedia articles
- Fulltext search
- Save and read articles offline
- Share articles
- Articles nearby (articles on topic near my geolocation)
- Supports reading articles in different languages
Doesn’t sound too bad. It’s not only stuff a mobile web site could do, so an app makes sense. So lets start to investigate.
What’s the background of all that?
The AppStore description of the app also links to a Twitter account and the source code of the app on Github:
- https://twitter.com/#!/wikimediamobile
- https://github.com/wikimedia/WikipediaMobile
From these two links I basically spent hours reading, clicking, reading again – typical procrastination stuff (Procrastinators beware if you are even near Wikipedia articles…). But I learned a lot ;) Back to topic: The following links all are relevant to the mobile efforts of Wikipedia:
- http://bit.ly/wikiappbugs (Bugs in Bugzilla instead of Issues of Github)
- http://www.mediawiki.org/wiki/Category:Mobile
- http://www.mediawiki.org/wiki/Wikimedia_Mobile_and_Special_Projects_engineering
- http://www.mediawiki.org/wiki/Mobile_design
- http://www.mediawiki.org/wiki/Wikimedia_Apps
- http://meta.wikimedia.org/wiki/Mobile_Projects/Contribute#Apps
- http://blog.wikimedia.org/c/technology/mobile/
- http://meta.wikimedia.org/wiki/Mobile_Projects/roadmap
- http://meta.wikimedia.org/wiki/Mobile_Projects
- http://meta.wikimedia.org/wiki/Mobile_Projects/Platforms_Support_Status
While reading these pages, I noticed information about two different iOS apps: One is based on Rhodes, one on Phonegap. It turns out the Phonegap version for iOS is quite new and the old one is to be retired and phased out:
So we have several projects and initiatives in the mobile space of Wikipedia:
- Mobile design
- Mobile website
- MobileFrontend: Extension that produces the mobile website http://www.mediawiki.org/wiki/MobileFrontend
- Zero (text-only) mobile website for Global South (developing countries)
- Mobile apps
Not too bad. Of course the articles in the wiki are quite… organically grown and sometimes hard to differentiate and classify. But I think that’s the case most of the time when volunteers and professionals work together.
The funny stuff: code
Now I have an overview, so let’s get back to the funny stuff: code.
As I have never used git before, I spend some time installing all the tools and learning how to use them. After that I can finally checkout the repository on Github. While I do this, I notice that the README.md isn’t as pretty as all the readmes of the other Github projects I know. So that’s the first thing I decide to fix. 1 hours, lots of reading and 3 minutes of ‘coding’ and a pull request later, it is done. My commit gets integrated by reedy a few minutes later. I’m in.
But now to the real code. The folder structure of the repository isn’t very clear. There are lot’s of confusing files in the root that don’t really belong there in a multi platform project, several folders that also don’t make sense to me or I can’t identify. Again, this seems to have grown over time. This is definitely something that could and should be fixed.
In /assets/www I find something that looks like the html application. Loooots of Javascript, jQuery and Zepto *confused. Anyway, using –disable-web-security I can open the Phonegap app in Chrome and even get it working! Still, several ‘file not found’ as non-existant files are requested. But here it becomes quite clear, that the app itself is no bad in itself. It works, the code is more or less structured, you can see what the developer was thinking. Normally that’s a good thing. So as to not fish around without all information, I conclude my little poking session for today.
Conclusion
After getting this short glimpse into Wikipedia Mobile I think that the code isn’t the first problem to fix. First it needs some love in the Documentation and Organization of the code. So that’s where I will start. Let’s see what I can do.
PS: Well, I installed the app on my old iPod 3 (iOS 4.2.1) and tried to use it – completely unuseable. Maybe we should start with the code after all.
Performance-Optimierung am Beispiel: betamode.de
Veröffentlicht am 22.3.2012, 20:07 Uhr
Ich habe mich ein wenig mit Performance Optimierung von Webseiten beschäftigt. In den nächsten Tagen und Wochen werde ich einige Beiträge dazu veröffentlichen. Den Anfang macht diese Beschreibung des Optimierungsvorgangs von betamode.de:
Beispielseiten für Optimierung
Ausgangssituation
- http://www.webpagetest.org/result/120318_NC_3MJ57/
- http://www.webpagetest.org/result/120318_GB_3MJ59/
Erste Beobachtungen und Auswertung
- urchin.js – uralter Google Analytics Code?
- Mehrere kleine GIFs, sollten sich einfach spriten lassen
- First Byte Time ist sehr hoch
- Kein Caching der statischen Ressourcen
- Kein CDN
Optimierung
Anwendbare Regeln aus High Performance Website Sites:
Rule 1 – Make Fewer HTTP Requests
Folgende Bilder können zusammengefasst werden:
- http://betamode.de/wp-content/themes/betamode/images/suche.gif
- http://betamode.de/wp-content/themes/betamode/images/clock.gif
- http://betamode.de/wp-content/themes/betamode/images/comments.gif
- http://betamode.de/wp-content/themes/betamode/images/xml.gif
Schritte:
- Bilder von <img> auf background-images umbauen
- Bilder als Sprite zusammenfassen: http://betamode.de/wp-content/themes/betamode/images/sprite.gif
- Sprite als background-image einbauen
- Da sich bg.gif nicht mitspriten lässt wird es als data-base64 direkt ins CSS eingebunden
Ergebnis
- http://www.webpagetest.org/result/120318_NM_3MJST/
- http://www.webpagetest.org/result/120318_C2_3MJSV/
Rule 3 – Add an Expires Header
Mit W3 Total Cache lässt sich sich das wunderbar erschlagen.
Ergebnis
- http://www.webpagetest.org/result/120318_0K_3MJY7/
- http://www.webpagetest.org/result/120318_4C_3MJZ0/
Rule 6 – Put Scripts at the Bottom
Das Analytics-Script ist zwar schon ganz unten, aber noch das alte synchrone. Also mal das neue besorgen und einbauen.
Ergebnis
- http://www.webpagetest.org/result/120318_B3_3MJZY/
- http://www.webpagetest.org/result/120318_TS_3MJZZ/
Rule 10 – Minify JavaScript (+ HTML + CSS)
Javascript gibt es keines, aber für Minify von HTML und CSS kann einfach W3 Total Cache konfiguriert werden, fertig.
Ergebnis
- http://www.webpagetest.org/result/120318_C4_3MK1C/
- http://www.webpagetest.org/result/120318_6G_3MK1D/
Dann zum Abschluss noch ein bisschen serverseitiges Caching um DB-Anfragen und so weiter zu minimieren mit W3 Total Cache.
End-Ergebnis
- http://www.webpagetest.org/result/120318_57_3MK1Z/
- http://www.webpagetest.org/result/120318_XM_3MK22/
Tadaa, schnell.
Anwendungen und Tools zum Monitoring und Graphing von Serverdaten (Load, Memory, Traffic)
Veröffentlicht am 31.7.2011, 18:19 Uhr
SAAS:
Self-hosted:
- http://munin-monitoring.org/
- http://www.cacti.net/
- http://www.eluna.org/eluna_graph_system.html
- http://www.monitorix.org/
- http://www.prbproject.org/
- http://serverstats.berlios.de/
Ergänzungen willkommen.
MySQL: temporäre Tabellen
Veröffentlicht am 23.6.2009, 23:57 Uhr
Große Queries, die sowieso per ‘Using temporary’ anzeigen, dass im Hintergrund eine temporäre Tabelle erstellt wird, lassen sich oft wunderbar zwei- oder dreiteilen indem man erst eine temporäre Tabelle erstellt und dort nun dann die Abfragen ausführt. Besonders effektiv ist das, wenn Teil 1 des Queries die Anzahl der zu betrachtenden Zeilen stark einschränkt, Teil 2 dann jedoch nochmal heftig sortieren muss.
MySQL: Delete a subset in a table quickly
Veröffentlicht am 21.6.2009, 14:04 Uhr
Heute mal wieder über einen netten MySQL-Hack gestolpert:
The trick is, that INNER JOIN will ‘shrink’ the LargeTable down to the size of the TemporarySmallTable and the delete will operate on that smaller set only, since USING will reference to the joined table.
http://blog.mkoebele.de/2008/07/mysql-delete-subset-in-table-quickly.html
http://dev.mysql.com/doc/refman/5.0/en/delete.html#c9536
Mehr davon bitte…
File-Encoding erkennen
Veröffentlicht am 7.9.2008, 20:00 Uhr
Mein Held für heute: Mindprod mit seinem Encoding Recogniser. Applet kurz laden lassen, Datei auswählen und einfach Encodings durchprobieren. Funktioniert wunderbar.
MySQL: The table ‘foo’ is full
Veröffentlicht am 31.3.2008, 14:14 Uhr
Ich muss zugeben, ich war erstmal ziemlich platt. Aber, es gibt ja zum Glück Erklärungen und (mutmaßliche) Lösungen:
http://dev.mysql.com/doc/refman/5.0/en/full-table.html
http://dev.mysql.com/doc/refman/5.1/de/full-table.html
http://jeremy.zawodny.com/blog/archives/000796.html
Das von Jeremy Zawodny vorgeschlagene
alter table foo max_rows = 200000000000 avg_row_length = 50;
funktioniert auch wunderbar. Nun passen nochmal ein paar Gigabyte rein.
IE7 em + float Bug
Veröffentlicht am 4.3.2008, 00:47 Uhr
Immer wieder schön was einem bei der täglichen Arbeit so über den Weg läuft. Stark vereinfacht:
<div style="float:left"><img src=...></div>
<div id="text">Erste Zeile Text. <em>Zweite Zeile Text</em></div>
Das führte im konkreten Fall im IE7 dazu, daß ab der zweiten Zeile der Hintergrund des text-Div vor das floatende Div links gelegt wurde. Natürlich war der verursachende Code lange nicht so einfach, und so habe ich dann doch locker 30 Minuten gesucht und probiert bis ich auf die Idee kam, dass das em der Auslöser sein könnte.
Glücklicherweise hatte schon 2006 jemand dieses Problem:
The other (are you ready for this?) is to remove the <em> element.
I am perplexed. Does anyone have a clue as to what is going on?
Und ein weiterer Leidensgenosse konnte eine passende Lösung liefern:
Yeah. It’s an em bug :-) IE6 has em bugs, too. Try this:
em {zoom: 100%; overflow: hidden;}
http://archivist.incutio.com/viewlist/css-discuss/81647
Web Inspector für Safari 3.0.4 auf Windows
Veröffentlicht am 24.11.2007, 15:20 Uhr
1) Download the nightly build from http://nightly.webkit.org/.
2) Extract the contents from the zip file.
3) If you are running Vista then you will have to add the following to the end of the Preferences.plist file (under C:\Users\<UserName>\AppData\Roaming\Apple Computer\Safari\), just before </dict></plist>:
<key>WebKitUserStyleSheetLocationPreferenceKey</key> <true/>
4) Execute the run-nightly-webkit.cmd file. This will launch Safari from the command prompt.
Quelle: http://weblogs.asp.net/davidbarkol/archive/2007/06/22/web-inspector-for-safari-on-windows.aspx
Zusätzlich die WebKitPreferences.plist im Safari-Einstellungsordner öffnen und folgendes hinzufügen:
<key>WebKitDeveloperExtras</key>
<true/>
MySQL: INSERT … ON DUPLICATE KEY UPDATE
Veröffentlicht am 23.8.2007, 13:38 Uhr
Ich kann gar nicht oft genug darauf hinweisen:
INSERT INTO table (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=c+1;
Sinn der Sache:
Wenn ein INSERT einen doppelten Wert für ein UNIQUE- oder PRIMARY KEY-Feld erzeugen würde wird das UPDATE ausgeführt.
http://dev.mysql.com/doc/refman/4.1/en/insert-on-duplicate.html
http://www.mysqlperformanceblog.com/2006/05/29/insert-on-duplicate-key-update-and-summary-counters/
Vielleicht wird man dann irgendwann diese umständlichen if(mysql_insert_id() == 0) oder mysql_affected_rows-Konstruktionen los.