Henrik Carlsson's Blog

Allowing rewrite of permalinks on WordPress

Turns out the problem I was having with everything except the front page was due to permalink rewrites not working. It seems three things were incorrectly setup.

First, the WordPress folder wasn’t writable by the www-user.

Secondly, this needed to be done:

You have to edit the Apache conf file (in Ubuntu 14.04: /etc/apache2/apache2.conf) and change the AllowOverride setting from None to FileInfo

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride FileInfo
Require all granted

You may need to enable the Rewrite module:

sudo a2enmod rewrite

Brian Milnes on StackOverflow

Posted by Henrik on

Inga kommentarer

with permalink

Filtering wp-links-opml.php for categories

Quick note to self, since I will definitely wonder about this again. If I want to view my list of WordPress links as an OPML (i.e. wp-links-opml.php) and filter for a specific category, the way to do that is to add the ?link_cat=[category id] suffix to the URL.

Posted by Henrik on

Inga kommentarer

with permalink

Sunrise (Draft 01)


A first draft on an Eno-esque ambient thing.

A JavaScript application randomizes note order from a list of allowed notes and pipes them to the Web MIDI Api They then enter Ableton Live which routes the MIDI to an E-Mu Proteus/2 that does the actual sound generating. The sound from the Proteus is then treated with delay, reverb and Valhalla Shimmer in Live.

This is very much inspired by the article JavaScript Systems Music and by Eno’s Airports 2/1.

Posted by Henrik on

with permalink

Jag är väldigt kluven inför läget inom politiken nu

Å ena sidan är jag glad över att Centern och Liberalerna är tydliga med att de inte tänker stödja sig på Sverigedemokraterna för att regera. SD är inte som många andra högerpopulister i Europa, de är rasister och har inget i en regering eller som stöd till en regering att göra.

Nej visst, just du SDare som läser det här är självklart bara en ”konservativ sanningssägare” eller liknande och om du envisas med det så kan jag inte göra annat än att ta dig på orden. Partiet som du företräder och/eller röstar på är dock inte ett konservativt parti, det är ett rasistiskt parti vars höga företrädare inte respekterar grundläggande demokratiska principer.

Så Alliansen i regeringsposition med SD som stöd i riksdagen är inte bra. Inte bra alls.

Alternativet å andra sidan är regeringen som vi dras med idag. En regering som är ytterst ansvariga för transportstyreleskandalen, som ger pengar till de som redan har och som tar från de som något spar. En regering som kör över företagsamma människor som gör nåt bra för andra, eftersom det rimmar illa med den ideologiskt färgade världsbilden. En regering vars största parti aktivt profiterar på människor för att finansiera sig själva.

Men visst, det är en regering utan inflytande från SD och det är viktigt. Fast å andra sidan, till skillnad från SD som gapar om hårdare invandringspolitik och utvisningar så har ju S/MP-regeringen omsatt det i praktiken genom att stänga gränsen och det är väl egentligen inte så mycket bättre.

Så frågan om hur jag tycker att det parti jag kommer rösta på i nästa val, sannolikt C, ska agera i regeringsfrågan är mycket komplex. Jag har inga bra svar idag.

Posted by Henrik on

Inga kommentarer

with permalink

Regarding the Accidental Tech Podcasts discussion on surround sound

On the most recent episode of the Accidental Tech Podcast John tried to convince Marco to get a surround sound system for his living room. Since audio is my thing1, I felt like a needed to add some things to the discussion.

The case for a >=3.1 surround sound system

Personally I think surround sound is cool and the more speakers/channels the cooler. That being said, I’d argue that the most important part isn’t to have 5.1 or 7.1 or whatever high number.1. It is to have at least 3.1. The three, as opposed to the two, means that you’ll have a center speaker in addition to the regular left and right speaker. This is super important for clarity reasons. Here’s why:

Imagine you are panning sound from left to right in a regular 2-channel stereo system. At the far ends the sound comes from just one speaker, left or right depending on whether your panner is at the far left or far right. As you leave the far extreme and head for the other side, the sound will start to come from both speaker but with differences in volume between the two. This will create the illusion that the sound is being emitted from somewhere in-between them.

When you are putting the sound dead center in this system both speakers generate identical sound waves at identical volume at the same time. If you are and the speakers are positioned at the exakt corners of an equilateral and the acoustics of the room doesn’t interfere too much, your brain will believe that the sound comes from the actual center. This positions the sound at what’s called the phantom center.

Now, move your head/yourself slowly toward one side and your perception of where the sound is coming from will change. As you move, one speaker will be positioned closer to you than the other which will mean that the sound from it will arrive at your ear earlier that the sound from the other speaker and you will perceive the sound as coming from a source closer to the closest speaker. (There will also be a difference in volume at your ears. The one that’s closest will also be louder.) 2

Compare this to panning the same sound to the center speaker of a >=3.1 surround sound system. This way the sound is only coming from one speaker which means that wherever in the room you are, you’ll alway perceive the sound as coming from this speakers position.

TV shows and movies tend to have their dialog mixed in the center of the sound field. If the mix is a surround sound mix that’s being down-mixed for your 2-channel stereo system it will position the sound ”in the middle” using the phantom center. Same goes for a dedicated 2-channel mix. This means that unless you and the speakers are perfectly positioned, you will not experience this as the sound coming from the actual center.

That being said, the exact position from which the sound is being emitted is not that big of a deal. It’s probably along the same lines of importance as whether you rinse your aeropress filters before use or not. However, there is something more that happens.

Since the sound is coming from multiple sources, the sound waves from them will super position with each other and you will get interference. If you are in the perfect position, as described above, that will be 100% constructive interference and only result in a louder sound. If however you are a bit off from the optimal listening position – which you will be, trust me – the sound waves will actually be slightly out of phase with each other when they arrive at your ears. That means some frequencies will be louder that intended while others will be softer. Please note that this is different frequencies of ”the same sound”. This will mess with the clarity of the sound.

Generally this problem will be most audible in the upper mid-range where good clarity is very important for perception of human speech. This results in less speech-intelligibility in a 2-channel stereo sound field compared to a >=3-channel sound field with a dedicated center channel.

So that is why I think that a >=3.13 sound system is always superior to a 2-channel system for tv and movie watching.

I hope this makes some sense. I realized while writing this that it’s quite hard to express these technical thing in a language that’s not your own while also making it accessible to someone who isn’t deep in the audio field, and also being interesting to someone who knows the basics.

The number of audio channels on vinyl

Yes Marco, there are plenty of vinyl albums with stereo mixes. There are even surround sound on vinyl.

Regarding speaker shapes

One of the reasons why some speakers are shaped ”weirdly” is because the shape of the speaker effects the sound of it, because of diffraction.

In summary

Marco should definitely get a surround sound system, even if he doesn’t connect the actual surround/rear speakers.4

Also, in my opinion Marco is right in that a full range system sound more ”natural” and ”cohesive” than a speaker with less bass response combined with a subwoofer.

  1. I have a bachelor degree in Sound and Music Production and I teach it for a living at Dalarna University. My education is not an engineering education so I don’t have the deepest, geekiest knowledge on some things but I do know a few things. 
  2. This thought-experiment is quite simple to try out in real life. Just play something in mono, panned to the middle of a 2-channel stereo sound system och move around with your eyes closed and point to where you think the sound is coming from. 
  3. Technically a >=3.0 system is enough for this. The subwoofer/LFE-channel doesn’t do anything for this but to avoid unnecessary confusion is chose to write .1 for this whole article. 
  4. Please note that all of this is written by someone who’s only tv is an LCD tv and who only uses the built in speakers in it… 

Posted by Henrik on

Inga kommentarer

with permalink

En uppmaning

Therese Bohman har skrivit en bra text i Expressen idag om att det ”Visst finns det en medieelit”. Du bör läsa hela texten.

Dock är det inte texten som helhet som jag tänkte skriva ett inlägg om här.

Man kan ha invändningar mot orden (samtidens favoritsysselsättning), men innebörden satte fingret på något viktigt: Att det fanns – och finns, ännu tydligare i dag – en klyfta i Sverige: mellan stad och land, medelklass och arbetarklass, de som har makt över orden och de som inte har det.

(min kursivering)

Therese sammanfattar perfekt vad jag tycker är det absolut största problemet med det offentliga samtalet idag, framförallt i sociala medier. Vi märker ord och vi tolkar alltid in värsta möjliga i andras ord. Istället för att ge människor vi inte håller med ”the benefit of a doubt” och försöka förstå vad de menar så läser vi deras texter som djävulen läser bibeln.

Så här är en uppmaning till oss alla, även mig själv. Låt oss försöka förstå vad motparten i en diskussion menar. Om vi är osäkra på vad som åsyftas med ett ord eller en fras, låt oss tolka det som bästa möjliga istället för värsta möjliga. Eller fråga skribenten istället för att anta det värsta.

Det är möjligt att människor kan ha andra åsikter än oss själva och ändå inte vara nazister, fascister, diktaturkramande stalinister, etc. etc.

Posted by Henrik on

Inga kommentarer

with permalink

Slight update to my Blu-ray workflow

Posted by Henrik on

Inga kommentarer

with permalink

My current workflow for ripping blu-rays into an iTunes-friendly format

This post is just for my own sake. I’ll probably write this up better once I’ve reached a final conclusion.

The workflow is as follows:

It’s not perfect and it needs some tweaking. Right now I’m contemplating whether to use detect crop or from Melton’s utilities.

Posted by Henrik on

En kommentar

with permalink

More Zelda – Twilight Princess

I’m still playing Twilight Princess even though I haven’t blogged about it for almost a month. I’ve intended to but haven’t gotten around to it and rather then spend time blogging about playing, up until now I’ve chosen to play it instead.

Once more, this is a game that I think is better the less you know about it so if you haven’t played it and think that you sometime, maybe, possibly, will, stop reading.

So I’ve kept playing and I’ve finished the first two dungeons and I’m getting ready to head for the third one. As far as I can tell I’ve expelled all twilight from Hyrule, so I don’t think I’ll play as a wolf anymore. So far the game is really great. It’s one of my favorite Zelda game, maybe my absolute favorite. I like the darkness and despair about it. It’s gotten me a lot more emotionally invested in the game than I usually are in a Zelda game. The only other time that I’ve actually cared this much about the characters in the game has been Majora’s Mask, hence my idea for the perfect three days, inspired by Groundhog Day.

I like that I know so little, that everything that happens catches me by surprise and that I have very little idea of how far I’ve actually made it into the game. From what the game tells me, this third dungeon will be the last one but based on previous games I might just as well be less than half-way through at this point.

The combats are really intense, both as a wolf and as a human/hylian. Most of the combats feel very intense and the wiimote control scheme makes them feel a bit more real than in other games. You could argue, as some do, that modern Zelda game has lost some of the free world exploration that was such a big part of the first game and if you look at it that way, Twilight Princess is very low on free exploration. There are obstacles spread out all over that makes your path through both the overworld and various underworlds vary linear. However, this does not take away anything from my excitement of playing it. Sure it would be nice to be more free to explore, but I still feel like I’m making the decisions, so I’m happy.

The game also keeps me on the edge of my seat because I feel like I really, really don’t want to die in it and it feels very possible that I might in encounters every now and then. I don’t know if I missed something or if it’s by design, but so far I haven’t manage to find any fairy to keep in a bottle, so I don’t have the usual ”insurance” that I tend to have in Zelda games.

And one more thing, the Shadow Beasts are really creepy! Really, really creepy.

If there’s anything negative to say about the game it’s the fact that some puzzles are hard in a way that doesn’t feel fair. Today I needed to google something for the first time in it. I had no idea about how to taw the Zora’s. (Here’s what I found online. It felt like a failure but I had tried and tried and pondered the puzzle over and over again and when I read the solution I was glad that I did google it. There’s no way I could have figured that out on my own, unless I’ve replayed the game from start and kept playing at a more regular pace. As things are now I’m playing once a week, tops. That means I forget things like a burning lava rock next to a warp portal.

And I’m also very confused by where I’m allowed to start if I’m saving and quitting, so that means I tend to not play if I don’t know that I can put at least two hours into the game.

Posted by Henrik on

Inga kommentarer

with permalink

Some more information on the WordPress bug that I think that I’ve found #wordpress

Yesterday I wrote about a problem that I’m having with a WordPress plugin that I’m working on, and I said that I think it’s a bug in WordPress. Here are some more information about it.

What the plugin is supposed to do

The plugin should cross-post/syndicate any new post to Twitter. There are a lot of plugins already that does this, but I wanted a few special features.

So far so good. This all works as intended. There is however one more thing that it’s supposed to do:

The technical part

The plugin hooks into the publish_post action and early on in its code it checks if ( get_post_format( $ID ) == 'link' ). If it returns true an XPath query retrieves the href of the first <a> element and uses this instead of the permalink in the Twitter post.

The XPath part works just fine in all my tests.

The problem

As long as I post from the WordPress Admin interface, everything works as intended. The problem occurs when I post using the Press This bookmarklet. When I post this way, if ( get_post_format( $ID ) == 'link' ) never returns true, regardless of the post format.

If I create the post using Press This but instead of publishing I save it as a draft and then publish from the Admin panel, it works as intended.

Do you have a solution?

If so, please let me know.

The code is available on GitHub but I’ve kept the repository private since I’m a little bit embraced by the code, but let me know if you’d like to check it out and I’ll add you to the repo.

Posted by Henrik on

7 kommentarer

with permalink

Is this a bug in WordPress?

I’m working on a WordPress plugin to syndicate my posts to Twitter. I know, there are lots of plugins that does that already but none of the ones I’ve found does it the way I want, so I decided to roll my own. I’ve got the basics working and have been using it on my site for quite some time now. However, I’ve encountered a problem. Here’s how I want it to work:

When I publish a link post, instead of posting a link back to my site to Twitter, it should post the link to the site that I’m linking to. The plugin ”knows” whether it’s a link post or not based on

At first glance this works fine and it worked in development. However, ones I started using it on my site I realized that it only worked some of the times and other times it wouldn’t recognize a link post.

Tonight I’ve managed to narrow it down. It seems like the problem occurs when I post with the ”Press this” bookmarklet. If I do that, even a post that clearly has been givet the ”link” post format still returns false for if ( get_post_format( $ID ) == 'link' ). If I post the exact same content using the WordPress dashboard the post is recognized as a link post and everything else works as intended.

Is this a bug in WordPress? I should investigate this further but right now I need to go to bed, so I’m throwing the question out to you, smart people on the internet, instead.

Posted by Henrik on

2 kommentarer

with permalink


Yesterday when Iris was asleep in her bed, Linn and I sat down on the couch to watch some TV. We’ve just finished the latest season on Modern Family that’s available on Netflix in Sweden1, so we needed to find something new. While browsing for a while, not managing to agree on something, Linns sleepiness got the best of her and she decided to fall asleep on the couch instead.

Even though I was really tired I decided to watch something. Initially I was going to start watching Luke Cage but while browsing a list Zodiac by David Fincher showed up. I tend to really like Fincher’s movies and since I hadn’t watched this one, and since it was still reasonably early in the evening, I went with it. At first I thought I might watch half of it or something and then continue another day but the movie drew me in.

It’s a mystery-thriller based on the actual case of a serial killer who called himself ”The Zodiac”. It features a great cast, including Jake Gyllenhaal, Mark Ruffalo, Robert Downey Jr. and Chloë Sevigny, and I loved it.

I knew very little about it when going into it. I wasn’t even sure if the text at the beginning that proclaimed it to be based on actual events were true or not2 but it totally got me hooked in just a few minutes.

The thing that I really like about David Fincher’s movies is that he thinks, or at least the movies gives the impression that he thinks, that I the viewer is an intelligent and observant person. He loves exposition but not in a bad way.

Also this movie, unlike Fight Club and Gone Girl – which are the two most Fincher movies that I saw most recently3 – is free of irony. It’s an honest thriller that has me invested in solving the crime and that, in a few instances, makes me genuinely scared.

Oh, and in case you don’t obsessive click all the links that I put in this post, you should absolutely check out this one, David Fincher – And the Other Way is Wrong, from Every Frame a Painting. It’s a great analysis of Fincher’s style and as far as I can tell it doesn’t really spoil any of his movies, so you can watch it even if you haven’t watched all his films yet.

  1. I think it’s season 7. 
  2. It is. 
  3. I saw Gone Girl for the first time, Fight Club was a rewatching. 

Posted by Henrik on

Inga kommentarer

with permalink

USB-C everywhere is a good thing, an iPhone without a headphone jack is not

Followers of this blog, or people who have been having coffee and nerd talk with me for the past weeks, know that I don’t like the absence of a headphone jack on the iPhone 7. I don’t think Apple removed it to mess with us or to squeeze us for some extra bucks for adapters1. I think they2 did it because it makes the iPhone a simpler product for them, one less thing to think about in manufacturing, one less potential source of failure, and they made the bet that most iPhone owners won’t miss it, as long as the included headphones use a connecter that is present.

I think that they are mostly correct in their analysis but this kinds of simplification always leaves one or more people behind. I, and most of the pro audio world at large, am most certainly left behind by this. I often use my iPhone with ”studio” headphones, I often connect it to recording consoles and PA desks and so on, so I would need to make sure that I always carry the lightning to mini-jack dongle and that’s a hassle. As more and more of these simplifications are done more and more people are left behind because it’s not the same people that keeps being left out in the cold. On top of that, I as a consumer/user don’t get any benefit from this exclusion. Apple’s executives may call it ”courage” as much as they want, whatever the reason for the removal, consumers see zero benefit from it.

And in those last two sentences lies the reason for why I’m not upset by the new MacBook Pros lack of any ports besides USB-C/Thunderbolt 3. Sure this will be a painful transition in some ways. Yes, we will be forced to buy more dongles, adapters and docks and lugg them around, but there is a very real benefit to it in the long run. A truly Universal Serial Bus. One connector to rule them all. And it’s a good connector!

Also computers generally lasts longer than phones, so if you – yes you dear reader – don’t want the hassle of dongles, then wait an extra year or more to buy a new MacBook Pro and in that time the world will start to catch up to the idea of One Connector.

Sure, it would have been great to have a new MacBook Pro that had every port that the old ones did in addition to ten USB-C port, four times longer battery life, a CPU powerful enough to do anything imaginable in the blink of an eye, a screen that can’t be cracked and that would weight an once. Okay, I’m being silly here. I know that fantasy beast is not what you, the people who don’t like the new Macs, have been asking for. I’m merely saying that these new computers have a clear benefit that the old ones didn’t have, partly as a result of removing things from the old ones and when it comes to these kinds of ports I do think that Apple can heard the industry infront of it and force a more timely transition away from the old and toward the new. It has happened before, it will happen again. However I do not think that Apple is that strong in the pro audio world.

  1. In that case they wouldn’t have included one in the package and it would have been more expensive than $9 to buy an extra one. 
  2. Yes, I will refer to Apple as they, not it. I know it is the correct grammar but I think ascribing it to a faceless massive corporation i asinine. 

Posted by Henrik on

En kommentar

with permalink

A video of me playing Zooropa, using a Mooger Fooger Low Pass Filter, Line6 Echo Park delay and a Boss ME50

So I’ve made a YouTube video. I’ve been pondering the idea of making a video for a while now, mostly because I like to try out various ways of expressing myself online. (Which is the reason why I also occasionally do a microcast.) I’ve made a few videos for work that I’ve put up on YouTube but I wanted to make something that wasn’t for work, something where I speak into the camera vlog style for at least a part of the video.

So the thought of making a video has been spinning around in my head and little over a week ago I finally stumbled upon something to make it about. Here’s what I wrote in the description on YouTube:

An attempt to make a sound similar to what the Edge has on Zooropa, using a Fender Telecaster, Mooger Fooger MF-101 Low Pass Filter, Line6 Echo Park, Boss ME50 and a ZVex Nano Head amp.

A few weeks back I watched a video from Pro Guitar Shop where Andy played Zooropa using a ZVex Super Seek Wah and two delays and I got really fascinated by it. It made me realize how simple the actual playing in this song is and made me think about making my own version. Then the other day I recalled that we have a bunch of Mooger Fooger pedals at work and I started to wonder whether the Low Pass Filter with an envelope could be used as the auto-wah effect.

The answer, in my opinon, is yes and this is the video I made using the Mooger Fooger and two delay pedals from my ”collection”.

Maybe this is the only video I’ll make, maybe it’s the first of many. Right now I don’t know but I do know it felt good to hit publish on this, even though I have a lot of complaints to myself about the technical quality of the video, but I’ll save that for another day.

Posted by Henrik on

with permalink

Zelda – Twilight Princess

Last week I started playing Zelda – Twilight Princess. I’ve had the game for quite a while, over two years I think, but haven’t really felt like I had the time to get deep into it until now. When I started playing last week I saw that the only save file I’ve used was last modified on New Year’s Eve 2014, so it’s been a while. 🙂

I really didn’t have much idea about what the game would be, other than that it was a Zelda game. The playing I had done two years ago had taught me how to move around using the Wii controller and given me a taste of the look of the game but nothing more. When I got further and further into it during the weekend I got really hooked. It was a much darker game then I expected, more like Majora’s Mask then any other Zelda game I’ve played.

There’s a lingering feeling of despair all over the world and the ”twilight realm” that’s spreading across the world is really scary.

That being said, if you haven’t played this game and think that you might do it one day, then do it! Stop reading right now. The less you know about the game the better.

Now that the ”spoiler horn” have been officially fired, let’s talk som specifics. As the game started I really thought that it would be similar to the beginnings of Ocarina of Time. I was told that I was going to go to Hyrule Castle and possible see the princess. The sun was shining and things seemed fine. Yes, a kid got missing and I had to rescue it but the monsters I had to fight to do that were not that bad and I felt like I had things under control. The I got pulled into the Twilight Realm and man is it creepy.

I had heard before that Link could morph into a wolf in this game, so I wasn’t that surprised when I first transformed but I had not expected the alternate world of twilight that I was supposed to navigate. Nor had I known that I didn’t control the metamorphose myself.

And the monsters… The monsters of the twilight actually freaked me out. Not just in a ”they are hard to beat” kind of way but in a, holy shit this is nightmare inducing kind of way. Some of them reminded me of the demogorgon from Stranger Things.

Thing is/was a bit rambly but I just wanted to jot down how much I love this game now, as I’m about eight hours into it. I feel an urge to keep playing, even more so than usual with Zelda games. Right now I’m more fueled by the need to save the children of my village then to save the world of something similar.

Last night, right before I stopped playing, I found the wooden sword that one of the kids had used. It was stuck in the ground in a twilight covered part of Hyrule and at that point I really didn’t want to stop. I wanted to keep playing all night long but that just isn’t feasible right now.

Posted by Henrik on

Inga kommentarer

with permalink

Regarding Apple’s suspension of Kapeli/Dash and the discussions of the matter on ATP and Core Intuition

On this weeks Accidental Tech Podcast (191: The Failure Mode of a Train), Casey, John and Marco talked about the controversy around Apple closing the App Store account of developer Kapeli. (I’ve mostly been out of the loop on this thing so most of my knowledge of it comes from said ATP episode.)

The discussion was informative but part of it left me feeling uneasy. My problem was that it seamed like all three hosts thought it was perfectly reasonable for Apple to be able to dictate what the developer expressed in public, if he wanted a chance to get his account back.

This seems so wrong to me. Either the developer broke the rules is such a way that it way right to close his account and that’s that, or he did not break the rules in such a way and therefore his account should be reinstated regardless of what he says or does in public.

Having an eight-hundred pound gorilla like Apple dictate what its developers should write on their blogs if they are ever in a controversy with them seems so wrong, regardless of whether what Apple wanted this particular developer was 100% true, 100% false or anything in-between. The App Store rules system is already iffy enough, should we also accept that Apple can dictate our complaints in public?

I was glad to hear the Manton Reece seems to agree with me as he argues similarly on this weeks Core Intuition (Episode 254: It Blew Up In This Case). (Overcast link with timestamp.

Posted by Henrik on

Inga kommentarer

with permalink

The endless frustrations of using Siri

There’s a dearth in my podcast cue at the moment, so I’ve been relistening to some old podcasts. Currently I’m listening to Hypercritical #38: ”Virtually Spotless” and early on (Overcast link with timestamp) John and Dan talks about Siri which I assume had just been released when this episode was recorded.

Anyway, it’s interesting to listen to John’s concerns with a few years hindsight and realize that so many of his concerns are still valid. Siri can frustrate to no end. Even when ”she” correctly translates what I say into text the parsing fails me time and time again.

Here’s a recent example. My fiancé and me recently switched our grocery shopping list to a shared iCloud Reminders list. One of the supposed perks was that it would enable us to use Siri to add stuff to the list. The list in question is called ”Shopping list”.1

Me: ”Add bread to the shopping list.”
Siri: ”There doesn’t seem to be a list called the shopping list.”
Me: Frustratedly inputs the item manually instead.

After a few days or maybe a week or something, I had an idea:

Me: ”Add bread to shopping list.”
Siri: ”I’ve added it.”

Tried it a few more times and could confirm that shopping list is a known list and therefore work, however the shopping list does not work. How is such a basic thing not working?

And don’t get me started on how bad the iPhone is at picking up voice from any kind of distance other than right next to it.

My point is this, how can Siri still be this dumb and often so useless when it seems like Amazon’s Alexa is much more reliable to use? Apple has had years to fix this now but progress is so slow.

  1. Well, technically it’s called ”Handlingslista” which is the Swedish translation of Shopping list, and yes Siri ”works” in Swedish as well. 

Posted by Henrik on

Inga kommentarer

with permalink

kUTTypeImage is defined in MobileCoreServices.framework

This gets me every time I try to create a sharing extension for iOS. I follow along with the WWDC session ”Creating Extensions for iOS and OS X, Part 1” from 2014 and when I encounter this line, I get an error:

The problem is that kUTTypeImage is unknown to Xcode. The solution is to import MobileCoreServices.framework.

(For more on this, check out this StackOverflow thread.

Posted by Henrik on

Inga kommentarer

with permalink


Idag är första dagen som jag lämnade av Iris på förskolan. Vi har varit där under några dagar i förra veckan också men även när hon var själv med de andra barnen och pedagogerna så var jag kvar i huset, så det här var något nytt.

Iris verkade inte tycka att det var någon stor grej. Hon kunde nog inte bli av med mig fort nog. 🙂

Jag har så smått börjat se fram emot att hon ska börja förskola eftersom jag vet att hon älskar att ha många barn och vuxna runt sig, så jag tror att hon kommer trivas bra, och för att det faktiskt vore skönt att låta någon annan få trilskas med henne ibland. Trots det så hade jag en stor klump i magen när jag gick ut genom dörren utan att ha henne i släptåg. Klumpen sitter delvis i nu när jag skriver, så det är väldigt dubbla känslor.

Men jag ska hämta henne redan klockan elva idag, så det går nog bra.

”Schoolbag in hand, she leaves home in the early morning…”

Posted by Henrik on

Inga kommentarer

with permalink

Liking stuff via the blog

I watch, read and consume a lot of stuff on the web. Recently I’ve taken a particular interest in YouTube, and I see a lot of cool, watch-worthy stuff there.

Sometimes when I see something awesome I click the thumbs up in YouTube, sometimes I don’t. Regardless, I also want to post some of the stuff that I like to the blog.

So far I’ve lacked a good way to do that. Part of what I lack is a good workflow to do it, one that makes it as low friction as possible but the main part is that I don’t know how to best display it on the blog. It would probably make sense to create a custom post type for ”likes” or ”interactions” or something similar, but I can’t help feeling like that is yak-shaving.

Therefor I think I should just get on with it. I’ll publish microblog posts with the text ”I liked (♥️) this:” and then a link (complete with u-like-of-microformat) to the video. I’ll also tag the posts with the like tag.

Posted by Henrik on

Inga kommentarer

with permalink

Do you know of a good way to rip Blu-rays with subtitles intact?

I’m trying to rip the video (and audio) from Blu-rays1 into an iTunes and AppleTV friendly format, while preserving subtitles and, this is key, not burning them in. I’ll write a detailed post on my needs, findings and workflow soon but right now I just want to throw the ball out to you.

I’m currently using a mixture of MakeMKV, Don Melton’s video transcode scripts, Subler and iDentify 2. The workflow I’m currently using requires me to add external .srt-files for subtitles, since I don’t want to burn them into the video.

Do you, dear reader, have any experience with this? Any suggestions for me? Please get in touch! (E-mail: henrik [@] henrikcarlsson [dot] se, @synvila on twitter or just send a webmention to this post.)

  1. Off course I’m only talking about Blu-ray discs that I’ve gotten written consent from all the rights-holders to do this. 

Posted by Henrik on

En kommentar

with permalink

Quick thoughts on the Nintendo NX

A handheld console that can be connected to a TV seems like the right way to go, at least in my opinion. As previously discussion on this blog I love my 3DS but there are countless times that I’ve wished that it supported AirPlay or something similar that allowed me to put the video up on my TV.

Nintendo has been playing the game its own way, totally detached from the other console manufacturers spec race, for a long time. Maybe this is the way for them to go.

Posted by Henrik on

Inga kommentarer

with permalink

How I manage what goes into my news rivers

Almost a year ago I wrote about WordPress’ Link Manager. It’s an old feature of WP that seems to get very little use these days. But it is a way to collect links to websites and, this is the important part, their corresponding RSS/Atom feeds, and get an OPML file os the websites in question.

Collected links can be put in categories and every category has its own OPML. You can find the OPML for all my links here.

OPML is one of the file formats that can feed a river in River 5. As far as I know the OPML that River 5 reads needs to be in the lists folder in your River 5 installation, so at first glance that seems to rule out using WordPress’ OPML feature.

The not so secret sauce that makes it work is the ”include” node in OPML. In my lists folder I have and OPML file for each and every river I want River 5 to generate. Each of those files contain a single <outline> node that links to the corresponding category among my WP links.

For example, my ”Everything feed”:

This tells River 5 to include everything it finds at the URL http://blog.henrikcarlsson.se/wp-links-opml.php which, as I just mentioned, is the full list of links that I collect in my sites link manager.

So whenever I want to add or remove a link (site/blog/etc) I just use WordPress’ link manager. That makes it very simple to add and remove stuff and therefore I’m more likely to try to add new sites to the mix and see if they add to my satisfaction or not.

Posted by Henrik on

Inga kommentarer

with permalink

Keeping up with the news using River 5

River 5 has been running on one of my servers now for about twenty-four hours and so far things seem to work perfectly. Order is restored and I feel connected with the news again.

River 5 is a feed reader that generate rivers of news. A river of news is a way of displaying items of feeds that presents the items in one or more feeds as a reverse-chronological list with a headline (if present), short text and a link to the original post. It’s very similar to the Twitter timeline. The main difference is that news rivers uses RSS and Atom feeds for their content, not a proprietary plattform, hence they are part of the open web.

You can see and use my rivers in the native views that’s included with River 5 here, or you can checkout my own simplified version of the viewer, that’s more optimized for my smartphone.1

As I’ve mentioned before, I’m currently not using Twitter. I stopped mostly because I don’t like the debate-climate there. The limitations of Twitter that once made it interesting has turned it into a great megaphone for anti-intellectualism and it effects all of us when we’re using it. However, I did started to feel disconnected from the news of the world when my old, River 4-based, rivers stopped working right around the time i quit Twitter.

So I rebooted using River 5 and now I feel connected again. The river is basically my timeline. I decide what goes into it, the same way I did on Twitter. The difference is that the articles on news sites and the posts on people’s blogs are more thought-through than the quips we throw around Twitter. The same goes for the microblogs I include in the rivers. Even though they are basically the same as tweets, I don’t think they are as hamstrung by the format.

  1. This is very much a work in progress, but it’s the way I’m currently getting most news. 

Posted by Henrik on

Inga kommentarer

with permalink

The basic building blocks of Twitter

At its core, Twitter is just three fairly simple things.

  1. A simple way to post short status updates.
  2. A list of people who’s post you follow.
  3. A timeline that mashes the posts from those people together into one stream.

Every piece of the puzzle was there long before Twitter. For posting we had, and still have, blogs. For following we have things logs blogrolls, remember those? And the timeline is just a river style feed reader.

The indie web movement are trying to recreate this, but I think what they/we lack is a turn-key solution for new users to get all this. The pieces are there, but they need to be combined.

Today I learned more about an upcoming service that I’ve been keeping my eye on for some time, that will bring these pieces together in what looks like a great way. Exciting times!

Posted by Henrik on

Inga kommentarer

with permalink

Roland TR-707

Today I got a Roland TR-707 ”Rhytm Composer” from my dad. (In exchange, he got my SE Electronics Reflexion Filter. Each of us think we made the better part of the deal.)

A quick phone snap of the Roland TR-707

A quick phone snap of the Roland TR-707

Unfortunately the first attempt at turning the device on failed. Dad did not have an external PSU for it, so I had to look through my own boxes of PSUs.

The 707 has a battery compartment that holds two AA batteries, but from what I’ve been able to gather from the user manual of the device as well as from the internet in general, these are only to power the machines memory when disconnected from a regular power source. It’s main power comes from the DC input that expects 12 V DC, center negative. I found an adapter among my spares that matched the specs but it didn’t connect properly. It seems like something i stuck inside the DC In jack.

When checking it out and while searching for information on the PSU (the center negative thing was not evident from the machine itself) I realized that my particular unit has an extra jack next to the power switch. The jack seems to be a 3.5 mm mono jack and from the labeling on a piece of tape on top of the machine, this is an alternative power jack.

To confirm this I decided to open up the 707. Doing so is very straight forward. Just turn it so the bottom faces up and unscrew seven philips screws. Once it poped open I could see wiring from the 3.5 mm jack to the circuit board connection of the regular power jack, so it seems like this indeed is an alternative power jack. Unfortunately, when I opened it I managed to sever the red wire that connects the battery pack to the circuit board, so I’ve busted the memory for now. I don’t have a soldering iron at home so I can’t fix it right now, but I don’t see how fixing it can be a problem.

(Left to right) 1. The regular DC in. 2. Power switch. 3. The tacked-on, alternate DC input.

(Left to right) 1. The regular DC in. 2. Power switch. 3. The tacked-on, alternate DC input.

I put the machine back together and started searching for a 12 V DC power supply with a 3.5 mm plug and realized that my guitar pedal PSU (the T-Rex Fuel Tank) actually have that feature. So I plugged it in and tried to power on the device, but sadly no luck.

At this time I’m not sure what the problem is and since I don’t have neither a soldering iron nor a multimeter available at home, I’ll have to put this off to another day. I’ll keep blogging about my way to make it functional again.

Posted by Henrik on

Inga kommentarer

with permalink

An iPhone without a headphone jack

There are strong rumors flying around the internet saying that the next iPhone will lack a traditional 3.5 mm headphone jack. If that is the case I will be sad. If Apple does this and keeps it up in the future, my next phone will likely be an iPhone SE (that has a headphone jack) and thereafter I’ll switch away from Apple. I don’t want to do that and since so far this is only a rumor, I don’t need to worry about it today.

Among the articles I’ve read on the topic, I think Jason Snell’s ”Searching for a good reason to remove the headphone jack” on Six Colors is the best.

I’d like to add extra emphasize to the way a (so far hypothetical) removal of the 3.5 mm jack would impact the audio and music business in a bad way. In recording studios all over the world, there are people connecting their phones to big, expensive mixing consoles. We do this for instance to be able to listen to reference material when making a recording. Same is true in the live sound world. In PAs everywhere there are phones connected to the Front-of-House mixers being used to play music that the engineer needs to calibrate the PA properly. So far this has been pretty straight forward, since every phone, every tablet and every laptop that I know of has a 3.5 mm jack.

So regardless of what (brand of) device people might use in your studio/PA, you can count on the 3.5 mm tele plug to be the simplest solution.

If Apple removes the headphone jack we will have a more stressful work-environment, with more crap to keep track of and more adapters to loose.

So please, say it isn’t so.

Posted by Henrik on

Inga kommentarer

with permalink

I’m taking a break from Twitter

I’ve felt for a while now that it is time for me to step away from Twitter, maybe not forever but at least for a few months.

I don’t like what Twitter does to me. I obsessively check it at every available moment. That might in it self not be a problem, but the stuff that I read there doesn’t make me happy, doesn’t stimulate me and doesn’t in any way make my life better. It just makes me angry. I get angry about the things that I read and then I feel a need to make angry or sarcastic remarks about it and thereby feeding back into the toxic hell-stew.

I seem like a really grumpy guy on Twitter, and that is a role I’m not that comfortable to play at the moment. Therefore I deleted all Twitter apps on my phone last Thursday (June 30th).

The fact that I’ve been off Twitter for a few days might seem strange, particularly since you most likely are reading this because you followed a link on Twitter, posted days after June 30th. That’s because I have a cross-posting plugin on my blog. That plugin will continue to cross-post everything I blog to Twitter as well. Through the magic of Bridy, your replies to my posts will also keep being backfed to the blog. But I will not read my Twitter timeline at all during this break.

Instead, I will read more stuff via RSS and I will try to blog more and about more diverse things. I also want to post more microcasts. If I can get a reliable cross-posting mechanism working I’ll probably also get back into Anchor. You can also still find me on Instagram, at least for now.

Posted by Henrik on

Inga kommentarer

with permalink

Ett svar till Christoffer (@c_vilander)

Three hours later, trying to figure out how (if even possible) to add a ‘Action Segue: Show’ from a cell to a View Controller …

Christoffer Vilander (@c_vilander) on Twitter

Om jag förstår det du försöker göra rätt, och om jag minns rätt vilket inte är någon garanti, så ska du skapa en segue i dina storyboards från din UITableView till vyn som du vill visa. (Ctrl-dra från TableView till målet.) Sen ger din segue en ”identifier”.

Sen har jag inte koll på hur det ska se ut i Swift men i Objective-C så hade jag gjort så här i TableViewController.m:

Hoppas att det var svar på din fråga och att det hjälper.

Posted by Henrik on

2 kommentarer

with permalink

Jessica Jones

Ikväll började jag titta på Jessica Jones på Netflix. Har inte vetat nåt om vad det är eller vad jag ska förvänta mig men eftersom det sagts så mycket positivt om det så blev jag nyfiken.
Efter ett avsnitt tycker jag att det verkar vara riktigt bra. Spännande, coolt och till och med gripande.

Posted by Henrik on

Inga kommentarer

with permalink

My frustration with Twitter, succinctly summarized by Dave Winer (and than commented way too rambly by me)

Yesterday Dave Winer made a harsh comment regarding twitter.

Everyone: When you ask ”Isn’t that what Twitter already does?” the answer is no. Twitter does nothing well because of the 140-char limit.

You might even say Twitter does nothing. The Seinfeld of social networks.The province of snorts and gusts. Miscreant sarcasm and trollery.

– Dave Winer on Twitter, 2016-05-13. (first paragraph, second paragraph)

At first this might sound like an oversimplification but it resonated with me. Twitter is making me increasingly frustrated these days. The 140 character limit might, might, have been a good thing to differentiate it at first but today I think that it’s one of the core problems of the service.

A hundred-and-forty character limit is actively harming nuanced discussions. Once you start tweeting directly to one person it gets even worse since precious characters are eaten up by the username of that person. So instead of discussion we get people screaming simplified messages into the void, we get Trump, we get people calling someone who tries to argue for something a racist, or a sexist, or a social justice warrior, a communist, a fascist, etc. Whatever name you find is properly insulting you use to smear the those who seems to not agree with you. When there’s not enough room to question or to debate you get name-calling.

I’m guilty of this as well. I’m also guilty of not speaking up and not questioning in a lot of cases. There have been so many times that I thought of something that I wanted to express, so many times that I wanted to ask follow-up questions to someone who wrote something that I didn’t agree with and so many of those times I chose not to. Because I couldn’t fit it within the limits of twitter without botching the message completely. So instead I kept shut.

So why do I keep using twitter? Probably because so many of my friends and people whose opinions I care about are there, and so much of the news that I read comes to me this way.

Fortunately the latter obstacle is not that much of a problem. I’m still an avid RSS user and I could replace a lot of my news sources on Twitter with various RSS feeds and readers. In part I am doing that already since I’ve more or less unfollowed every single account tweeting about Swedish politics or Swedish news. Instead I keep the RSS feed of some Swedish newspapers in my river of news.

Same thing goes for a lot of tech news as well.

The first problem, that so many of my friends and people who’s voices I care about is on Twitter is a bigger issue. I am actually after all these years contemplating joining Facebook. Maybe that would help me to keep up with my friends. In a way, I think it would be better for this than Twitter is.

As for the people who I’m not a real-life friend, who might not even follow and/or be interested in me, with but whose opinions matter to me, I think all of us – everyone who’s expressing strong opinions on the internet – should be better at expressing us on our own publishing space as well. More blogs, more of the indieweb.

This post got a lot more rambly than I planned. I’d actually only planned to quote Dave and to leave a sentence or two as a comment but things doesn’t always turn out the way we’ve planned.

So I have no great way of ending the post. No call to action for you, the reader or for myself. I guess I’ll get back on this topic.

Posted by Henrik on

Inga kommentarer

with permalink

Using and AirPort Express as a wired extension to an AirPort Extreme

Part of moving into the new house off course involves setting up the wired and wireless network for the home. Since I have both an Apple AirPort Extreme and an Airport Express, and since the house is too big for the wireless network from one to cover all of it, I wanted to use the latter to extend the formers wifi. I’ve struggled with this previously and failed.

This time I decided not to quit until it worked. There’s just no way this can’t be done, right?

After some googling I found a webpage that helped me on the way, Airport Express as an extender. (Apple.com).

The way to do it is to connect a Cat5e/Cat6 wire between one of the ports of the Extreme and the port1 of the Express. So far, so good.

Then, and here’s the catch, you setup the Extreme as a wifi access point. Once it’s up and running you setup the Express and the important thing is to not set it up as an extension of an existing network. Instead you should set it up as a new network, give it a unique device name and then use the same network name and password as you did on the Extreme. Finally you set the Express to work in bridge mode.2

Is you do these steps it should work. Yay!

  1. I have the older Express that only has one Ethernet port. 
  2. Apple calls this ”roaming” and you can read more about it in the manual

Posted by Henrik on

En kommentar

with permalink

DC exhausting all possibilities

This is an old Los Angeles Times article about Batman Begins and with hindsight, this is an amazing quote from David S. Goyer, who wrote the screenplay:

”Batman Vs. Superman” is where you go when you admit to yourself that you’ve exhausted all possibilities,” says Goyer

Guess who wrote the screenplay for Batman v Superman: Dawn of Justice.

Posted by Henrik on

with permalink

Ett svar till Emils svar till mitt svar

Min ursprungliga post – En kommentar till ”Refactoring Loops and Conditionals”

Emil svarade genom ett par tweets, som jag här satt samman till ett sammanhängande citat för tydlighetens skull.

Jag tycker han gör det rätt fram tills han blandar in collection. Även om collection är helt guld så blir det i det där fallet inte lättare att förstå. Men bort med switchen och in med en array istället. Helt klart.

och tredjepartslibraries är ju väldigt vanligt sedan Composer slog igenom. Om man inte utnyttjar det är man korkad. 🙂

Jag håller med om att det i det här fallet inte är något fel att byta ut ett Switch-statement mot en Array, så jag tror att vi är mer eller mindre överens.

Sen kan jag absolut se värdet av tredjepartsramverk. Dock medför de en högre tröskel för förståelse för den som läser koden i efterhand eftersom den förutsätter en förtrogenhet med det aktuella ramverket. Och visst, idag använder ”alla” Laravel men om två år är det något annat som ”alla” använder. Huvudproblemet här skulle jag säga är att PHP har så dåliga interna typer att man som utvecklare så lätt frestas att förlita sig på en tredjepart för något så grundläggande som en ”Collection”-klass.

Posted by Henrik on

En kommentar

with permalink

En kommentar till ”Refactoring Loops and Conditionals”

Min vän Emil twittrade nyss följande:

Dagens lunchfilm för dig som programmerar PHP.
Diskutera i grupp.

Emil Österlund, 2016-04-27

Jag fick en stor lust att, precis som Emil uppmanar till, diskutera det som visades i videon, och eftersom 140 tecken inte är en särskilt bra grogrund för nyanserad diskussion så tänkte jag blogga om det istället. (Just nu skriver jag på svenska för att i första hand diskutera med Emil. Eventuellt översätter jag det hela till engelska vid ett senare tillfälle om det visar sig vara intressant.)

Låt mig börja med att säga att jag är helt övertygad om att Adam Wathan som har gjort videon är en mycket mera kunnig PHP-utvecklare, och säkert programmerare i största allmänhet, än vad jag är. Jag är bara en glad amatör. Så jag vill inte påstå att han är okunnig, att hans lösning är idiotisk. Det är säkert jag som missförstått nåt men tills jag förstår mer så har jag några invändningar. Dessa kan sammanfattas under rubriken:


Varför denna refaktorisering1? Vad vinner vi på den? Blir koden mycket snabbare att exekvera? Blir den lättare att uppdatera?

Jag skulle påstå att den definitivt blir svårare att förstå. Kanske inte för den som redan programmerar på avancerad nivå, och visst ”det är lätt om en kan”, men omstruktureringen fick koden att gå från något som var fullt läsbart för den som är en nybörjare inom programmering till totalt obegripligt för den inte redan invigde.

”Switch”-statements och loopar kanske inte är så snygga att titta på men det är glasklart vad de gör. Jag skulle kunna visa den ursprungliga koden för de 12-åringar som vi (Emil, jag och andra) på fritiden undervisar i grundläggande programmering och annat och barnen skulle ha förstått allt redan under första lektionen. De refaktoriserade resultatet skulle kräva många lektioner för att förstå, inklusive en lektion i ett tredjepartsramverk eftersom den vanliga array-datatypen i PHP inte anses vara bra nog.2

Vi har bytt bort lättförståelig kod, så vad fick vi istället?3 Adam Wathan påstår att han gör koden mera ”simple” och ”clean” men jag förstår inte på vilket sätt det är sant. Det blev mindre kod men är det verkligen samma sak som ”simple” och ”clean”. Det är säkert Objective C-programmeraren i mig som talar men jag är ett fan av kod som är tydlig och lättförståelig, även om det innebär att den är längre och mera mångordig än vad som vore nödvändigt för samma funktion.

(Also linked from Twitter.)

  1. ”Internet” påstår att det här är rätt översättning. 
  2. Jag kan i och för sig hålla med om att ”Array” inom PHP är ett stort jävla mörker, vilket jag insåg när jag började med Objective C och såg hur vackert NSArray och NSDictionary fungerade där. Men PHP-kverulansen sparar jag till en annan dag. 
  3. Det är alltså en ärlig fråga, inte ett sarkastiskt uttalande. Jag vet inte vad vi vinner på den nya koden. 

Posted by Henrik on

En kommentar

with permalink

Första kvällen i huset

Nu är vi på plats i huset. ”Vi” är jag, Linn, Iris och min bror som är här och hjälper oss med flytten. Vi har kört ett rejält lass hit till huset idag så vi har allt vi behöver men just nu är det lite svårt att veta var någonting är. Fyrtio kartonger betyder att det finns gott om ställen att leta på. 🙂

Vi har även byggt ihop ett gäng möbler och har massor kvar och i morgon ska vi hämta ännu mer prylar och förhoppningsvis ska jag även få fart på det trådlösa nätverket i huset.

Det kan även vara så att vi så småningom får roa oss med att klättra på taket och sätta upp en tv-antenn. En av de många tjusningarna med ett helt nytt hus är ju att det inte finns några antenner eller nåt på det. Fiber finns draget in i huset och det är den vägen vi kommer konsumera merparten av den tv vi tittar på. Jag vill inte skaffa någon box och/eller något abonnemang från någon kabeltv-leverantör men jag vill att vi om möjligt ska kunna titta på sändningar från SVT och TV4, även om internetuppkopplingen av någon anledning slutar fungera. Så därav en vanlig tv-antenn för marksänd digital-tv. Stay tuned för mer av det äventyret. (I’ll see myself out.)

Hursomhelst så känns det väldigt, väldigt bra att sitta vid köksbordet, visserligen ett väldigt rörigt köksbord men ändå, i sitt eget hus och njuta av en öl och av tystnaden. Ingen vältrafikerad bilväg som stör, inga grannar som låter genom väggarna som vi delar. Ingen vändplan där raggarbilarna står och brötar ut bas. Bara värmepannan som surrar i bakgrunden. (Det kan vara så att jag behöver köpa en tjockare dörr till tvättstugan där pannan sitter, annars kanske jag så småningom blir sinnessjuk.)

Det är mycket kvar att göra innan allt är klart inne i huset och trädgården är en enda ler- och stenhög just nu men det känns att det kommer bli väldigt bra och jag trivs redan.

Posted by Henrik on

Inga kommentarer

with permalink

Scrolling a UIView to keep the keyboard from obstructing the view of the current UITextField

Wow, that’s an unwieldy title!

Anyway, during some spare time today I’ve struggled with something in Objective C and Cocoa Touch that I’ve been struggling with before. When a UITextField in an iOS app becomes ”active”, allowing the user to enter text, almost half of the screen gets covered by the software keyboard. That’s all well and good, but that keyboard is likely to obstruct the view of something, maybe even of the UITextField in question and that’s not good.

To avoid this problem, I the developer am supposed to move or resize (or something) the view. There are multiple questions about this on StackOverflow and multiple answers. After some digging and a lot of trial and error I came up with a solution that differed at least somewhat from all other solutions that I could find. As far as I can tell my solution works and it’s pretty short in terms of code, which I like.

I don’t know, maybe it’s a bad solution. If so, please let me know.

The solution

First, embed all the views that need to move inside a UIScrollView.

In my case I have multiple UITextFields that needs to move so I placed them all inside a UIScrollView. I then added the following property to my ViewController:

This property is updated on textFieldShouldBeginEditing like so:

Then , in my viewDidLoad I added the following two observers:

These will trigger the methods keyboardDidShow and keyboardDidHide when the keyboard appears and disappears respectively. It is in those methods that ”the magic” happens:


As I said, this works but it’s very possible that it’s a bad solution. If you like the solution, feel free to use it. If you think it’s bad, please tell me so and why so that I can learn and become a better programmer.

Posted by Henrik on

Inga kommentarer

with permalink

Det gör mig så ledsen

Jag mår så dåligt varje gång jag ser ett reportage om flyktingarna som förtvivlat försöker ta sig till Europa och jag hatar våra politiker som fokuserar på att göra det svårare för dem, istället för att fokusera på asylrätten och på att rädda liv.
Förhoppningsvis så kommer åtminstone historiens dom över dagens europeiska ledare bli stenhård.

Posted by Henrik on

En kommentar

with permalink

Apple vs The US Government, or I stand with Tim

As most of you probably know by now the FBI has demanded that Apple build a new version of iOS with a backdoor in place. This iOS version is ostensibly only meant to be used on an iPhone 5C owned by one of the San Bernardino terrorists.

Tim Cook, Apples CEO, has publicly refused this.

First off, let me say that I agree with and fully support Cook in this. Good work Tim!

Second, if it wasn’t so serious it would be quite funny that suddenly private corporations go all in on defending civil liberties from the government. Should the government be the ones doing the defending of liberties?

This is a really important line in the sand than Cook is drawing. I’m not sure that Apple can uphold their stance in the long-run, but I hope I’m wrong and that they can.

As other people have said, the FBI has chosen this case wise to get the legal precedent they want. Nobody sympathizes with the San Bernardino terrorists so it’s easy to make a straw man argument about Apple being evil for being more interested in protecting terrorists than ”the American people”. But we need to realize that this is not about the San Bernardino case. This is about US federal agencies wanting the technical help and legal precedent to do whatever they want with the private data of whoever they want.

Where are the other tech giants? Why aren’t Microsoft, Facebook and Google lining up next to Apple? So far the only CEO that I’ve seen taking a firm stance on this is Jan Koum, CEO of WhatsApp

I have always admired Tim Cook for his stance on privacy and Apple’s efforts to protect user data and couldn’t agree more with everything said in their Customer Letter today. We must not allow this dangerous precedent to be set. Today our freedom and our liberty is at stake.

Some links

Here are some good articles on the topic:

Or just look at ”the front page” of Daring Fireball. John has collected a lot of good links and quotes.

Posted by Henrik on

En kommentar

with permalink

Please Anchor, be a good citizen of the open web

I’ve tried Anchor today. It’s a service that let’s its users post short audio posts, like Twitter but for audio. Or put more accurately, it allows its users to make short-form podcasts. I thought it was really fun to use, and discussing a topic on it with a friend seemed much more fruitful that doing the same thing on Twitter.

The setup procedure in the app was simple and as far as I know there are no easier way of recording a piece of audio and broadcasting it ”to the people”. (Note the quotes.)

However, there are quite enough silos around already and I really don’t like to lock myself into yet another one. I want to own the data – or content if you prefer – that I create. Therefore I’d like the following:

I also want to mix and match sources. I want to be able to consume similar content in one app, not having to constantly switch from one app to the other just because people lock their content in various silos.

As I said in the beginning, what Anchor does is provide a way to easily record short-form podcasts and publishing them to the people following you. There is nothing about this that is new from a podcasting perspective. What is new, is how easy they’ve made it. I love that! But since they are podcasts I want to treat them as such. I want people to be able to listen to the things I publish even if they don’t have, never have had, nor ever will get, an account on Anchor.

So I would like Anchor to provide a way for its users to use the content they – the users that is – create outside of the Anchor. The simplest way to do this, that almost certainly would require very little effort on Anchor’s part, is to have some sort of feed for each user of the service. Making those feeds RSS feeds with <enclosure> elements would make them compatible with pretty much all podcatchers that are currently in use.

That would make the service so much less of a silo. It would mean that other people could listen to my stuff outside of Anchor and I could interleave the ”Waves”1 of people on Anchor with other short- or long-form podcasts that I listen to. It would also mean that I could set up automation to cross-post my waves to my own site.

And it wouldn’t even have to be RSS/XML. Any kind of easily parseable feed available without authentication would do for me. Once upon a time even Twitter provided this function for its users tweets and it was great.

Sure, it would be nice to have a posting API for Anchor and it would be equally nice to have a way of using their app to post directly to another service, or to my own blog, but the simple act of adding feeds would take them so far along the way of becoming good citizens of the open web. And I want them to be that since I thought the app and service was great, but I don’t want to lock up my content.

One good thing about it is that there are more or less easily accessible URLs for each Wave. Unfortunately, those URLs are not easily crawlable for the media they are meant to display.

I’ve asked Anchor, both on Anchor and on Twitter, whether they are going to add feeds or not. So far I’ve not gotten a respons. If you who read this also finds this important, please ask them about it you too. (They are @anchor on Twitter.)

So please Anchor, please, be a part of the open web. In your Medium posts you claim to be ”the world’s first true public radio”. Make this real by actually making the content created by your users public. Embrace feeds, embrace the open web.

  1. A post on Anchor is called a wave

Posted by Henrik on

2 kommentarer

with permalink