Category Archives: Null

Taking back your control after Windows reinstall

We all do it. I mean, it’s not really a choice is it? It’s just something that has to be done more frequently than changing socks.

I’m of course talking about reinstalling Windows. Because, man, is this a totally non-hardened OS or what? You can go to one ad-powered website and get a whole slew of issues that will sit on you system partition for as long as you don’t do that reinstall. So you do it. You do the reinstall. And everything feels so much better; Things are snappier, all of a sudden you have your system drive storage space back, and still all the rest of the files on a separate drive since 2006, because you remember that time when you reinstalled and you naively put everything on one single huge drive… Everything got erased.

And now you’re trying to install Cygwin and get some projects going. Maybe try to clone a git project from your home controlled server. And then…. Permission denied, said Bill. Access Denied, said Bull. Oh yeah… Windows don’t know who the hell you are anymore. I mean, sure for the system drive it knows you are its benevolent master. But that separate drive. Ooooh, it’s more inpentetrable than Fort Knox.

Well, there are a thousand different vague answers ranging from so called MS Support and MVP’s to helpful forum users who tells you to install Norton to see if you have a virus, so you at same time can get a thousand new toolbars in IE installed.

There’s _one_ solution that’s worked. Only one. And it’s the command line. Because no OS creator in their right minds would make a command line that cannot rectify the errors all shitty 3rd party applications or window managers can make. Behold, the command:

icacls [The folder you want to get back control over] /reset /t /q

That’s it. Everything you need on one line. Don’t thank me, thank Reddit.

Just a small note on add_filter in WordPress

add_filters seem to have its use in a WordPress context. However, debugging them is shit. And there are not a whole lot of good examples around to explain how to work with them.

I was trying to figure out a way to modify the colour defaults for the quotes component in AESOP Story Engine, and that took me a couple of hours to figure out (I’m just not that used to mucking around with plugins, filters and hooks); mainly because there are absolutely zero actual examples on how you can override them defaults.

So, here it is

add_filter() – The bare minimum

add_filter([a filter associated to the component you want to affect], [a method name reference that you come up with]). E.g:

add_filter(‘aesop_quote_defaults’, ‘modify_defaults’)

modify_defaults() – A couple things

You actually get an incoming argument that contains stuff in it, that you can review with… let’s say… var_dump()?

modify_defaults($whatsThis) {



and stuff comes out that you can actually work with! Yeah, it’s going to print all over your wordpress page whenever this is being called, but it sure beats not knowing _anything_ about the contents!

So, what a total add_filter code snippet could look at in the context of changing the background colour for the quote module, that could go into a functions.php file in a child theme:

add_filter(aesop_quote_defaults‘, ‘modify_quote_defaults);

function modify_quote_defaults($defaults) {

        $defaults[background] =white‘;

        return $defaults;


So, now the background will by default be white, in terms of the quote module.


I’m not (quite yet) a super savvy WordPress developer, and I shouldn’t have to resort to make a lot of Google searches (as an extra to reading your documentation), that proved to be several rabbit holes, and still I have to go through the core source code(!) to figure this out.

And not only that AESOP HORROR STORY ENGINE; It is your RESPONSIBILITY to document these things CLEARLY, but you seem to actually expect your userbase to go trawl your Github to find the fields that are applicable for these things. SHAME!

Anyways, apart from that, there’s a thing that I am a bit uncertain of how to do or handle appropriately;

  • How to modify the defaults used in the admin area of WordPress when adding each component?

Adding _your_ fonts to TinyMCE (WordPress)

This took me a while to figure out, mainly because I:

  • Went the quick and dirty route
  • Found a TON of tips on how to add Google Web and other web fonts, which I didn’t want because I
  • Wanted to load custom (TTF) fonts

I was about to use a WordPress plugin called Fonts, because it was minimal and had exactly what I needed:

  • The buttons to choose Font family and size
  • Enabled the possibility to add custom fonts

But, alas, there was a snag that I wasn’t particularly interested in pursuing. When reading the instructions on how to add custom fonts to the fonts list, you get linked to the WP SITES page where it, when coming to the actual solution part of the answer, states:

You have reached content available exclusively for members.

To enjoy unlimited access & support, register using this form, or login.

Clicking the register button and what do you know; registering sets you back $49.99 a month!

So instead I went the “Spend hours, days, even weeks” route (it took me longer than I suspected, I’ll give it that) and figured out something that seems to work!

Step 1 – Fonts

Now, I’m no expert in this field so I took the trusted “Throw it on the wall and see what sticks” approach and converted the fonts I needed to a number of other font formats, other than the one I had (otf). In the end, what I use is:

  • EOT
  • WOFF
  • TTF

The tools I used for this is FontForge and ttf2eot, both for Windows.

Step 2 – Development

You need:

  • 1 piece of Theme
  • 1 set of Plugins


If it’s one of your own themes or one that you made a child theme out of or you’re just messing in another one’s, doesn’t really matter. I will not go into any detail on how to make themes or edit the files for a specific theme, as that is abundantly well described pretty much everywhere on the InterWeb.

What really matters is what you put in the style.css (or corresponding style file) which is this:


Important to note here is that I reference a path to a plugin. If I can, I try to consolidate things. You could potentially place these wherever you’d like, but having a shared space is nice.

Now, this means that the wordpress pages will load the fonts (read on and you’ll see the contents of my-font.css as well) so they become available to the browser for viewing, should they not be available on the viewer’s computer already.

Onwards to the plugin!


This is the gritty part to make TinyMCE actually show you the Font family dropdown box and load up the fonts you want. This took a b unch of hours to navigate, as I’m not used to mucking around in TinyMCE and the border between what WordPress can do and what TinyMCE expects is certainly not clear cut!

Anyways, what I ended up with is this folder structure

  • wp-content
    • plugins
      • add-fonts
        • add-fonts.php
        •  fonts
          • My-Font.eot
          • My-Font.woff
          • My-Font.ttf
          • my-font.css

I’m not claiming this to be the best structure, it’s just one that seem to work ok.


The meat of the plugin. This makes sure to

  • Add the Font family button to TinyMCE
  • Add the fonts you want to the Font family dropdown
  • Reflect your changes when you select a font

Quite simply, this is what it looks like:

 * @package Add_Fonts
 * @version 1.0
Plugin Name: Add Fonts
Plugin URI:
Description: This simply adds "back" the Font Family button in TinyMCE and enables a custom (local) font
Author: Jonas Hellström (shellström)
Version: 1.0
Author URI: 

 * Adds the Font Family button
add_filter( 'mce_buttons_3', 'my_mce_buttons_3' );
function my_mce_buttons_3( $buttons ) {
 $buttons[] = 'fontselect';
 return $buttons;

 * Adds new font items to the Font Family dropdown
add_filter( 'tiny_mce_before_init', 'wpex_mce_google_fonts_array' );
function wpex_mce_google_fonts_array( $initArray ) {
 // The format is [Font name in dropdown=Font name in font-family of CSS]
 $theme_advanced_fonts = 'My font=My font;';
 $initArray['font_formats'] = $theme_advanced_fonts;
 return $initArray;

 * Loads the font-faces so the editor can reflect the selected font in the editor
add_action( 'admin_init', 'wpex_mce_google_fonts_styles' );
function wpex_mce_google_fonts_styles() {
 $font1 = '';
 add_editor_style( str_replace( ',', '%2C', $font1 ) );

 * Imports the font-face styles for some reason
add_action('admin_head-post.php', function() {
 @import url('');

It’s somewhat self explanatory. Except for the my-fonts.css reference in there. Well, how about we take a look at that as well, shall we?:

@font-face {
 font-family : 'My font';
 font-style  : normal;
 font-weight : normal;
 src         : url('');
 src         : url('') format('embedded-opentype'),
 url('') format('woff'),
 url('') format('truetype');

Well, as you can see these are mostly a ton of references to places where the font files are. The @import rule in the theme style.css at the beginning of this article uses these font definitions, so when you change something in this file, the theme will naturally just follow along.

Adding more fonts later on should be as simple as:

  • Generating the font files
  • Adding a new @font-face definition in my-font.css and making sure the paths are set correctly
  • Adding new $theme_advanced_fonts = ‘My font=My font;’; rows


I didn’t come up with this on my own, here’s a link to where I finally got stuff up and running for real:


Final words

Since you’ve now created this as a plugin, you will also have to enable it in the Plugin tool of WordPress.

Compatibility? Well, I tested this out on WordPress 4.4.2 and I have absolutely _no_ idea whether it will work on older or newer versions. But the original StackOverflow answer was written in June of 2014, so it should be alright.

Package, where the hell are you??!

Simple solution to a simple problem;


I can’t figure out where in the wholey hell of Linux-operating-system-paths-and-specifications, a package is spread out.


dpkg -L [package]

Gerrit commands and other bits

Gerrit is a really interesting code review tool. When I worked for one of my former employers I got to test it out and I was both intrigued and daunted by it.

The learning curve is sky-high with this one, but there’s a lot of things done right, when it comes to running huge code bases.

So, naturally, I want to use this at home as well, for my own pet projects. If nothing else, to keep myself updated on the technology.

Here are a few things that become important when you have got your Gerrit-site up and running. You know, the day-to-day and next-project kinda things that aren’t super obvious.

Cloning a repo

git clone ssh://[username]@[server]:29418/[project]

Getting the commit-hook

 scp -p -P 29418 [username]@[server]:hooks/commit-msg .git/hooks

Pushing to origin

git push origin HEAD:refs/for/master

Alternative way of pushing to origin

vim .git/config

[remote "gerrit"]
 url = http://[server]:29418/[git-repo]
 fetch = +refs/heads/master:refs/remotes/origin/master
 push = refs/heads/master:refs/for/master

git push gerrit

My impressions on two not-that-old mobile OSes (Ubuntu Touch et. Firefox OS)

I had the good fortune of getting a “Firefox OS Developer Preview” device called “peak” delivered to me the other day. It took nearly a month from purchase to delivery and the overall information sharing by Geeksphone (the creators of peak) was not what I would expect. But I digress. We’re here to talk about the devices, or rather the OS on the devices. There already is an insane amount of videos and specs and whatnot on the interweb but I’d like to do my own writeup of these things, if you don’t mind.

Mix it

Alongside peak I decided to take a swing at Ubuntu Touch. Considering I already have a plethora of Nexus devices I wanted to choose one of them that wasn’t being used as my daily driver, which made the choice fall on the Samsung Galaxy Nexus. There was no real other reasoning behind this other than that I needed my N7 and N4 to stay in the shape they’re currently at but down the line I’ll test Touch out on those as well to see what kind of difference that makes.

To the summit

So, starting off with peak. This device gave me mixed feelings from the first get go when I took it out of its packaging (which is a pretty nice and interesting piece made out of recycled cardboard (I imagine)): It is plasticy, it has a weird “neck” at the top where the camera housing is located (sort of an inverse “neck” that the Galaxy Nexus has) and it has a somewhat iPhone’y look (bottom-middle-placed-home-button-and-nothing-more).

Booting the thing was a blast from the past when I saw the boot logo appear in all it’s 256 colour splendour. Everything after that has at least some 64K colours (probably even 16M but I haven’t verified). Booting was fairly quick, I didn’t have time to think any of it.

Lock/App screens
Having used a build of Firefox OS on a Samsung Galaxy S, I at least knew how to work with the lock screen. Being so used to swiping left or right or basically any direction from other devices (all the Nexi), double tapping the unlock symbol feels a bit awkward.

The homescreen layout and feel is, too me, more reminiscent of iPhone, apart from the one big clock “widget” (which I’m guessing can’t be switched out by something else in this version) at the top on the first screen.
Swiping to the left brings up two new screens. The first screen being a small set of tools such as camera, fm radio, settings, etc. Another swipe to the left brings up another small set of tools such as calendar, clock, e-mail, etc.
Swiping to the right from the homescreen brings up another iPhone-similar screen, which consists of a search field at the top and a collection of grouped circular app icons divided in categories such as social, weather, sports, etc. Tapping the search field and typing in letters quickfilters a result of apps that you have installed. This, which was a bit disappointing, didn’t search on the Marketplace (which is an app where you can go look for more apps!). That would’ve been a nice to have.
Moving about the screens works fine, however one thing that ticks me off: When I tap an app icon, sometimes the device registers this as a swipe. The first thought that came to my mind was “Oh, ok. So I nudged my finger a bit sideways, I’ll try it aga… hmmm, it happened again. And I swear I didn’t nudge my finger in any direction this time.”. This becomes a bit annoying after a while. I’ll take a look at the code at some point to see if I can Fix-It[tm].

Home lock screen

Home lock screen (found no way of hiding the toast...)

Home screen

Home screen

App screen 1

App screen 1

Finder screen

Finder screen

Looking at the apps, I took a dive into the Settings. It looks rather nice with clear icons (I haven’t figured out what the “Internet sharing” icon should look like, though… Some kind of chain links..?) and toggles (which are non-swipable). Tapping a setting, opens up the setting page for that setting…. and with that an almost impossible-to-hit-back-button in the upper left corner! I don’t know why this decision was made, but that’s what you get. I’ll see if I can Fix-That-As-Well[tm] later. I changed a few settings such as volumes and enabled lockscreen unlock sounds. One thing I noticed. THE UNLOCK SOUND IS REALLY LOUD! AND THE PHONE DIALLER SOUND AS WELL! And there’s no way to adjust the volumes for those. One thing that I found to be pleasing in all this cacophony of noise is that the external speaker really packs quite a punch.
Taking a look at the Browser, to me one of the integral parts of Firefox OS, it feels ok. Address bar at the top, alongside a sidebar-opener-button on the right hand side. At the bottom there appears a number of context sensitive navigation buttons. The browsing experience is ok, pages load fairly quick (running traffic over 3G) but, and this I don’t know why: More or less half of the times I would get greeted with a “Problem loading page” message. When this occured, each time I tried accessing a page, I could see the data traffic notifier icon animate a couple of times and then disappear as if nothing worked. I had to reboot the device whenever this happened. The Marketplace app was giving me a tough time. Half of the times nothing happened when I tapped the app buttons on the front page (featured apps I guess) after it had loaded, the other half of the times when I could tap (for instance) a category, nothing happened when I tapped an app button within the category, and lastly the third half of the times the data connection actually broke when navigating in the Marketplace so I had to reboot. All in all, a pretty horrible experience and I didn’t get to install any apps! Testing the HERE Maps app was interesting. It worked quite well, tiles loaded as they should, it found my GPS based location, I couldn’t figure out how to turn GPS off (or at least I couldn’t make the notification icon disappear. It changed color from white to gray, but never disappeared no matter what I did to settings or running apps). Also, the HERE Maps UI is really created for another screen density. Even tinier buttons than the back button in the settings mentioned earlier.

Settings page

Settings page with an infinitely small back button!

Broken Marketplace

Most of the times the Marketplace looked like this...

HERE maps

tiiiny buttons (HERE maps)

Ok, the experience so far has been rough. I do however understand that there is a reason it says “Developer Preview” all over this thing (well, it’s only stated at the back actually. But it’s clearly visible. No beating around the bush.). Over time when the software gets more mature, the device will follow along with it (here’s hoping that intermittent data connection drops requiring reboots will be a thing of the past (I’ll-See-If-I-Can-Get-Around-To-Fix-That-As-Well[tm])).
What I do sincerely like is the fact that this is supposed to be a truly Internet-centered OS and I absolutely believe that. What will be interesting is to see whether the populace of smartphone users and all the devs are ready, willing and mature to embrace it in order to make it _really_ usable. I’ll certainly try and be all of those and keep monitoring the situation while I spend my time adapting my web services to it.

[Adjective] [Animal]

Well, not really. Ubuntu Touch doesn’t really have that familiar naming that is connected to Ubuntu releases. I’m sure it will in the future though.

Getting a hold of a build and flashing this was a whole lot easier than I thought. One light pound of Galaxy Nexus, one ounce of Lubuntu, three pinches of apt-get and a hint of command lining and the thing was baked and ready to eat! No manual flashing of binaries in the correct order and right versions, it just worked[tm].

Booting up Ubuntu caught my interest in the fact that the only thing telling you that you are actually booting anything is the usual short vibration when pressing the power button and the Google logo… then everything goes black… and then you’re in Ubuntu Touch! For those of you who are used to later versions of Ubuntu, you will recognize the orange-purple colour scheme. Which I totally dig.

Lock/App screens
It’s really nice to rest your eyes on and the homelockscreen (in lack of a better word) is nice to look at. It displays a status bar with a bunch of icons, a digital clock at the top, a circular clock like widget with the text “14 tweets received” printed in it and a small marker working as a visual queue for the 14 tweets that “I” have received. Ok, that’s all nice but the question is though, how do I “unlock” this so I can start poking around? Tapping the “14 tweets received widget”? Pulling down the status bar? Swiping the “14 tweets received” widget?…. Apparently not. Ok, so let’s swipe and tap pretty much everywh… AHA! Swiping left from the rightmost edge was the trick! Nothing like a small moment of frustration on the first trial of a new OS.

So, now I’m at the Home screen (which is aptly named just that). It consists of a few Frequent apps such as Camera (that works), Phone (which doesn’t work), Browser, etc. Further down there is an area called Favourite People with a few happy people displayed on “cards”. Scrolling down we find People Recently in Touch, which I guess is who “I” contacted lately. Even further down we find Recent Music. Going down, here is Videos Popular Online. Scrolling a bit fu… No, wait. It stops there.
Naturally, as a smartphone user, I start swiping to the right and left and find a few more screens. The first swipe to the left reveals Apps (and also a bottom bar which pans in from the bottom of the screen, displaying which screen I’m at, represented by an icon), which displays a collection of Running apps. Below that is the previously mentioned Frequently used collection of apps and below that we find Installed and at last a collection called Available for Download. Swiping left yet again here is a Videos screen. At the top: Featured, below that: Recent, further down: New Releases, scrolling more: Popular Online. This is the end of the screens in this direction. Swiping right from Home reveals a People screen. This is in all essentiality “my” address book on a scrollable screen. Yet another swipe to the right displays Music. The content is laid out in much the same way as Videos so I won’t go through it once more. (After all, you have read 1774 words so far, and that’s not a small amount).



Running apps

Running apps

Navigator indicator

Navigator indicator

Status bar
Swiping the status bar was really awkward. I of course, being that naive, expected an Android kind of information curtain display. And it actually is pretty Android’y, but with the big difference that it’s aware of what status icon you swiped over and displays contents based on that. So swiping the finger down over the blue letter, I get the messages that I’ve been missing out. Swiping over the speaker icon displays audio settings. Nice touch (pun intended?)!

Messages pulldown

Messages pulldown

*Swipe* *swipe* *swipe*
So a bit of swiping later I’ve realised two things: 1: It’s really hard to do repeatable swipes and access what you would expect. 2: See 1. The reason for this is that more or less everything is swipeable and yields different results. More often than not I would actually start to swipe a bit too far to the right or left of the screen which would not switch between the home screens (or any other paged view) but instead either 1: bring up the quicklaunch sidebar for a brief half a second and then bring me back to one of the home screens or 2: switch between already running apps. These are neat features but they’re in the current state of things more a nuisance than of assistance.
Oh, another thing. I found a sort of Google Now equivalent. When in an app, you can swipe upwards which reveals a semi-transparent icon with a looking glass. Releasing the finger over it brings up a field (and a few buttons) that says “Type or say a command”. I tried to type “message” but it didn’t do anything.

Quicklaunch sidebar

Quicklaunch sidebar

Find it

"Ubuntu Now" spyglass icon

While poking around the different apps I found another hidden gem, so to speak. Opening the Phone app gives you pretty much what you would expect: somewhere to tap in a number and then a button to place the call. However, looking at the top of the app there is something that tells the tale of more under the surface. The title of the app is “Call >” and I just tested out tapping the text and what do you know, there are more options revealed! So in the Phone app you will now have the different scrollable “tabs” Call, Conversations and Contacts. When you have selected a tab, the other options will fade into the background and reappear if you swipe or tap the title again. Neat! There are a couple of more apps bundled in this software, however, either they require signing in or they aren’t functional and just work as placeholders.

Displaying scrollable tabs

Displaying scrollable tabs

Remember when I mentioned the first trial of a new OS. When I say that this is an OS, you may believe that this is something that can be used, perhaps not as a daily driver but at least to some extent for mail and some basic messaging, maybe some music entertainment. But you know what, I wouldn’t recommend it. This is, in my opinion, something that you are going to use as a way of trying to understand what the Ubuntu creators are up to in the mobile scene. One of the very telling tales of this is that there is a pre-installed, pre-populated account. There are a whole bunch of fake friends, fake messages, fake videos, fake music, and so on. I have found no way of switching users. I was able to create a user (with a bit of adb and ssh keyboarding) but nowhere did I find a Log out or Switch account-button.
Also, the screen won’t turn off automatically. Ok, so this isn’t really a usability thing but it’s still one of those things that are pretty vital if you don’t want a dead weight in your pocket because you accidently hit the power button.

The end

Ok, so where does this leave us? Well, these OSes don’t really have a lot in common other than being run on mobile devices and having Android as their common denominator. Firefox OS is focusing in on a lightweight system which primarily make use of different kinds of web technologies to make itself usable. And seeing the explosive nature of Internet services and availability, I’m pretty confident that this will find its place. Especially considering that adaptation of an already existing web service should prove not to be too high of an effort.
Ubuntu Touch is instead going in the direction of becoming your ubiquitous-carry-around-mini-format-computer OS. This in itself opens up another set of possibilities (I would love to see the day when I can have a docking station at home and at work that are hooked up to a screen, keyboard and mouse and the UI  seamlessly switches between desktop and mobile depending on whether the device is in the dock or not) but also challenges in the shape of app making.

Ok, so this was my take on Firefox OS and Ubuntu Touch at this point in time. For those of you interested in more developie or tekkie reading material, you’ll have to wait a while longer until I’ve started to get around to keyboarding out a few samples. These thing take time, mind you. Why not do a little bit of searching on the Interwebs while you wait?

Eclipse, Android, installation och “must override a superclass method”

Det här är ett mycket irriterande och rätt svårlöst problem eftersom kompileringsfelmeddelandet man får är ohyggligt otydligt när man väl kommer fram till varför det uppstår.

Du har
* Windows XP (32 bitar)

och vill installera
* Java
* Eclipse
* Android SDK

Så, du laddar hem det som krävs och kör installationerna av det hela. Du sätter igång ett nytt Android-projekt och implementerar ett interface. Du vet att det krävs ett par obligatoriska metoder pga din implementation och gör @Override-implementationer av metoder. Här lägger du nu märke till ett problem. Kompilatorn säger

The method createNdefMessage(NfcEvent) of type MainActivity must override a superclass method

Du undrar vad i hela friden det här innebär, flänger runt i lite olika API:er för att se om det verkligen är rätt stavat och har rätt antal argument men hittar inget direkt uppenbart fel. Så då börjar googlandet och till slut kommer du fram till att

Eclipse väljer ut en lägre kompileringsversion än den som krävs. Ofta väljs 1.5 ut som standard och för att det ska bli någorlunda ordning och reda behöver man 1.6.

Så, även om jag med största sannolikhet kommer att glömma bort att jag skrivit om detta (för det är inte alltför ofta det här problemet uppstår) så tänker jag att både jag själv och någon annan skulle kunna ha nytta av det förr eller senare.


Jag har länge avskytt hårdvarutillverkares taffliga försök att skaka fram mjukvara för datorer (främst Windows) där de vill att man som användare ska ha en “svit” för att göra de vanligaste sakerna man brukar göra med sin enhet kopplad till datorn. Ofta blir det att den här mjukvaran antingen är för funktionsfattig, för stor (60MB+ är ju inga ovanligheter), icke-fungerande eller rätt och slätt ful (högst subjektivt).

Det som stör mig allra mest är när de också har mage att tvinga en att installera den här sviten för att tillåta något så enkelt och basalt som en drivrutinsinstallation för enheten. Jag har som tur är aldrig än så länge tvingats installera en sådan svit, utan har efter mycket sökmotorande och forumläsande, lyckats få tag på drivrutiner när jag behövt. Om jag någon dag tvingas använda en svit för en kommande enhet kommer jag förmodligen inte att behålla enheten utan se mig om efter en annan.

Jag har med hjälp av Ascii på Swedroid lyckats få tag på ett drivrutinspaket för Android-enheter som är rätt komplett och förhållandevis enkelt att hantera, om man bara är ute efter att bara installera just drivrutiner i Windows. Jag är en Android-utvecklare och har inget behov av några extra krussiduller förutom just drivrutiner och jag tror det finns fler som har samma behov.

Därför beskriver jag här vad paketet innehåller (i mer och mer detalj allteftersom jag har tid att uppdatera detta inlägg) och en länk till var man kan ladda ner det. Det ligger på min Google Drive, fritt tillgängligt att ladda ner för den som behöver.


Android-drivrutiner (Google Drive)


Jag har inte gjort det här paketet själv, till att börja med, men jag använder det själv när jag behöver. Paketet är baserat på ett bibliotek från Microsoft som heter Driver Package Installer (DPInst). Det huvudsakliga syftet med DPInst är att förenkla proceduren att låta en användare installera drivrutiner och minimerar det manuella jobbet genom att göra det hela mer automatiserat.

I rooten av paketet finns det två mappar och en fil

  • Mapp: amd64 (64-bitsversioner av drivrutinerna)
  • Mapp: x86 (32-bitsversioner av drivrutinerna)
  • Fil: install-drivers.cmd (Start-fil som, baserat på om man har 32- eller 64-bits OS kör filen dpinst.exe i antingen x86- eller amd64-mappen)
(Tidsbrist gör att jag inte kommer längre pecis just nu, men ett tips på vägen)

Google Nexus-enheter

Jag rekommenderar att du, om du har en Nexus-enhet, installerar drivrutinerna på egen hand och inte förlitar dig på automatiseringen i detta paket. Detta för att du har full kontroll på händelseförloppet och att du dessutom kan förklara i vilket steg det gick snett om det gick snett, så att andra kan hjälpa dig. Det finns en guide för hur man installerar dessa drivrutiner för iaf Galaxy Nexus på den här sidan av bloggen. Den kommer fungera även för andra Nexus-enheter (sånär som på Nexus 7, som jag inte har drivrutinerna till än), plus följande “vanliga” Android-enheter (+ betyder att jag själv testat dessa, – att jag själv inte testat dessa, ¤ att de ingår i basutbudet eller testats av andra):

  • ¤ HTC Dream
  • + HTC Magic
  • + HTC Desire S
  • + HTC Hero
  • + HTC Legend
  • + HTC Sensation
  • + HTC Desire
  • ¤ HTC Incredible
  • ¤ HTC Supersonic
  • + Google HTC Nexus One
  • + Google Samsung Nexus S
  • + Google Samsung Galaxy Nexus
  • ¤ Moto Sholes
  • + Huawei IDEOS
  • ¤ LGE GW620
  • ¤ Kindle Fire
  • ¤ SciPhone N19
  • ¤ NVIDIA Tegra
  • ¤ Nook E-Ink
  • ¤ B & N Nook Color

MySQL triggers #1

Om man vill att en kolumn ska uppdateras med en tidsstämpel för tidpunkten vid en UPDATE kan man göra ett av följande om en kolumn för tiddsstämpel redan finns:

1: Kör ALTER TABLE för att anpassa kolumnens DEFAULT-värde:


2: Skapa en TRIGGER för att hantera uppdateringen:

CREATE TRIGGER [namn_på_trigger] BEFORE UPDATE on `[tabell]` FOR EACH ROW SET NEW.[kolumn] = NOW();

Om man vill att en kolumn ska uppdateras med en tidsstämpel för tidpunkten vid en INSERT kan man göra ett av följande om en kolumn för tidsstämpel redan finns:

1: Använd samma metod som förra punktlistan, alternativ 1.

2: Skapa en TRIGGER för att hantera inläggen:

CREATE TRIGGER [namn_på_trigger] BEFORE INSERT ON `[tabell]` FOR EACH ROW SET NEW.[kolumn] = NOW();


Idag fick jag lära mig om


(som rätt och slätt kan förkortas till)


Vill man inte råka ut för en tragiskt tråkig utskriftsdialog, så kan man rätt och slätt skriva


och få ut sakerna på standardskrivaren.

Nu vill jaga bara veta hur man använder detta för att skriva ut en specifik fil utan att behöva öppna den.