I’ve been studying in Trinity College Dublin (TCD) for about two months. The master course is very intensive here, which reminds me of the the third undergraduate year in China.
To be honest, I did’t like mathematics at all, especialy those partial equations. What a headache! And how brave I am to study master in the School of Mathematics! Well, that misery was in the past. I mean the math is still difficult for me, it just somehow makes me interested. After all, it doesn’t count as a bad thing.
It’s true that some assignments are very easy. Meanwhile, there is always at least one problem that consumes a lot of time and efforts to figure it out. And that’s good for learning from my point of view. If it’s too easy, then it’s wasting time. While it’s pointless if it’s too hard. Thus, so far so good.
However, being a foreigner is not easy for me. House renting, bins collection service, GNIB card, re-entry visa, water charges application, etc. I even assembled my bed frame and the dining table along with four chairs! Those things will never happen if I stay in China. But that definitely enriches my life, in a way. :D Feels more independent now.
I purchased an ODROID-U3 (Community Edition) from HardKernel a couple of days ago. It runs much faster than what I expected. Anyway, I’d love to share my experience related to this board. So, here we go. The first chapter: Resize partitions in the microSD card.
A functional Linux* device (ODROID-U3 itself doesn’t count)
A microSD card reader
*: Other UNIX-like OS may do the work as well, but I didn’t test it.
Let me write the procedures in advance.
Back up the data from microSD card partitions.
Using fdisk to modify the disk partition table.
Make new partitions
Restore the data
Why don’t we just use resize2fs? Because I need to enlarge the first partition whose format is vfat. So I have to move the second partition right, which means changing the second partition’s header. I don’t know how to manage that, so let us just go the old-fashioned way.
Actually I’ve uploaded this plasmoid to kde-apps since about two months ago. The applet does support English and Simplified Chinese. However, the api returns only Chinese strings, which makes this applet looks like Chinese-only.
Thanks for PM25.in’s free API. Now you can check the city’s air quality index (AQI) in mainland China, just in your favourite desktop environment.
The applet is totally open-source and free for everyone. You can check the source code on Git@OSC.
After nearly a week silent, I’m back with a new QML plasmoid for your KDE 4.x. Though I regarded it not as very helpful… :)
I think you probably know that AMD open-source Radeon driver has already supported dynamic power management (DPM) since kernel 3.11. Like the old lousy power-profile management, it’s controlled by things like echo high > /sys/class/drm/card0/device/power_dpm_force_performance_level. Not a big deal, but inconvenient if you got a laptop and need to control it frequently. Yeah, it won’t automatically switch to performance from battery when your laptop’s ac plugged, or vice versa.
Thus, here is the plasmoid applet I cooked today, it’s premature but capable. Although a few things I should mention here.
Display may be incorrect after switching forced performance level.
Buttons won’t adjust their height, hence it’s ugly if you resize the widget to a taller one.
QML doesn’t support access to external files directly, so the method is dirty and you might not like it.
Well, if you want to know, I’ll talk about the implemention of write and read in QML.
Thankfully, /sys/class/drm/card0/device/power_dpm_force_performance_level is a plain text file, at least it can be treated as one. So I use XMLHttpRequest to read this file. @_@ I told you that you won’t like it.
We tend to use echo to write into DPM files, so just go on, use plasmoid.runCommand to execute echo.
Before use runCommand, one should add LaunchApp as a required extension in metadata.desktop file.
Basically, plasmoid.runCommand(exec, [,argsList]) equals exec args1 args2 args3 etc.
I was busy making a KDE plasmoid named kdictionary recently. And I found myself actually learnt a lot through this process.
Of course. I never programme in QML before but now I am a big fan of it. It’s very easy to get start and cook couples of small applications. Although I used QtQuick 1.1 from Qt 4.8, I recommend you use QtQuick 2.0 from Qt 5 for the sake of convience and new Qt magic.
Haha.. Qt is another thing. I start another project kdictionary-lingoes to port LingoesLD2Reader.java to C++ realm. Well, Qt provides tons of useful and powerful libraries which you definitely need outside of standard C++.
Hmm.. I have to mention that function QString::toStdString() actually implements toascii(), which result in losses of some unicode character. To fix that, you need to use std::string() to wrap the data of QString. i.e. std::string(getDef(input).toUtf8().data())
Out of question. I made plasmoid of course I knew something new from it.
The configuration dialog UI file is config.ui, use QtDesigner to finish design work. Make sure that the name of checkbox or some control stuffs like that has a prefix kcfg_ (Just check what I done in kdictionary). Because that will let Plasmoid and QML do a magic work to integrate the UI file and the configuration data file main.xml.
Oh, use plasmate to cook your plasma-stuffs. But remember that tool has a lot of bugs and TODOs. :–)
REALLY looking forward to taste KDE 5 and Plasma 2. (some annoying problems are only fixed in Qt5, along with many long-waited functions.)