@IBOutlet weak var ratingControl: RatingControl! – Use of undeclared type ‘RatingControl’

These two errors may occour when taking the ”Start Developing iOS Apps (Swift)” from apple.com:

” ‘weak’ may only be applied to class and class-bound protocol types, not ‘<<error type>>'”

”Use of undeclared type ‘RatingControl'”


This happens when your UITableViewCell, in this case ”MealTableViewCell”, has at target Membership to ”FoodTrackerTests” but RatingControl has not.



Select ”RatingControl.swift”, then in the right navigation, select the file icon at the top (next to the questionmark). Then check ”FoodTrackerTests”. Now your error will go away.


How to instal Lucence 5.1.0 / solr + tomcat7 on Ubuntu 15.04

There is a solr-tomcat package, but to install it you need to install tomcat7 first. If you already have tomcat7, skip step 1.

  1. sudo apt-get install tomcat7 tomcat7-admin tomcat7-common libtomcat7-java
  2. sudo apt-get install solr-tomcat
  3. Check http://localhost:8080 to confirm tomcat
  4. Check http://localhost:8080/solr to confirm solr
  5. Done!

Skrollr – image not in sync

When using Skrollr I recently noticed that if you’re using ”$(document).ready(function(){ skrollr.init(); }) ” when calling the script, all the images might not have been loaded. This can lead to images beeing unsynced when scrolling. By changing to ”$(window).load(function() {skrollr.init();})” the problem is solved. This is beacuse window.load is not true until all images and content is loaded =)

Bootstrap modal popup

If you are using WordPress with a Bootstrap based theme and you are looking for a popup solution to promote offers to your customers, then I have the right plugin for you =)

I just releaste this plugin: http://wordpress.org/plugins/bootstrap-modal-popup

It uses Bootstraps modal component to display a popup with content. The popup can be triggerd on scroll or timeout.


Oh! And here are some screenshots =)




WordPress tribe events registration

I was using Tribe Events and need a simple event registration solution (no login, just registration). So I came up with a simpel solution using ”WordPress form manger”. Follow these steps if you want a registration form in singel view for Tribe Events:

  1. Install ”WordPress form manager” https://wordpress.org/plugins/wordpress-form-manager/
  2. Create a form called ”registration-form”
  3. Add the fields you need (name, company, phone etc).
  4. Add a field called ”Event name”
  5. Save your form
  6. Go to the tab ”Form extra”
  7. Give the field ”Event name” the following nickname ”eventname”
  8. Save your form
  9. Open your themes ”style.css” add this rule: .fm-item-eventname { display: none; }
  10. Save
  11. Open your themes ”function.php”
  12. Add the code below, save and you are god to go =)

function add_registration_form () {
echo '<h2>Registration for '. strtolower(get_the_title()) .'</h2>';
echo '<input type="hidden" id="name-of-event" value="'.get_the_title().'" />';
echo do_shortcode('[form registration-form]');
echo '<script>
$ = jQuery;
$(function() {
//-- Read name from hidden field that has been printed before form
$(".fm-item-eventname input").val($("#name-of-event").val());


Create a google sitemap with typoscript

Create a google sitemap with typoscript for pages and extensions

Use typoscript to create a sitemap with pages and custom urls from extensions, in this exemple I will include one of my one extensions:
xmlSitemap = PAGE
xmlSitemap {
typeNum = 200
config {
no_cache = 1
disableAllHeaderCode = 1
additionalHeaders = Content-Type: text/xml; charset=utf-8
simulateStaticDocuments = 0
absRefPrefix = http://www.YOUR-URL.com
tx_realurl_enable = 1

wrap (
<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.google.com/schemas/sitemap/0.84&#8243;
xsi:schemaLocation=”http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd&#8221;

10 = HMENU
10 {
special = directory
special.value = 1

1 {
expAll = 1
NO {
doNotLinkIt = 1

stdWrap {

cObject = COA
cObject {

wrap = <url>|</url>

10 = TEXT
10 {
typolink {
parameter.field = uid
returnLast = url
wrap = <loc>|</loc>

20 = TEXT
20 {
strftime = %Y-%m-%dT%H:%M:%SZ
wrap = <lastmod>|</lastmod>

30 = TEXT
30.value = <priority>1.0</priority>

if.isFalse.field = shortcut



2 < .1
2.NO.stdWrap.cObject.30.value = <priority>0.9</priority>
3 < .1
3.NO.stdWrap.cObject.30.value = <priority>0.8</priority>
4 < .1
4.NO.stdWrap.cObject.30.value = <priority>0.7</priority>
5 < .1
5.NO.stdWrap.cObject.30.value = <priority>0.6</priority>
6 < .1
6.NO.stdWrap.cObject.30.value = <priority>0.5</priority>
7 < .6
8 < .6
9 < .6
10 < .6

* Render extension
20 {
table =  tx_txpremises_premises
select {
pidInList = 8 //– Page/folder ID
renderObj = COA
renderObj {
stdWrap.wrap = <url>|</url>
5 = TEXT
5 {
typolink.parameter = 9 //– Singel view page for your extension posts
typolink.additionalParams = &objectId={field:uid} //– Custom links to your extensions pages
typolink.additionalParams.insertData = 1
typolink.returnLast = url
wrap = <loc><![CDATA[|]]></loc> //– wrap URL with CDATA
10 = TEXT
10 {
field = tstamp
strftime = %Y-%m-%dT%H:%M:%SZ
wrap = <lastmod>|</lastmod>
20 = TEXT
20.value = <priority>0.7</priority><changefreq>weekly</changefreq>


This post is an extensions of http://www.adick.at/2010/06/01/typoscript-xml-sitemap/

WordPress form manager set visitors email as sender

If you are using the plugin form-manager and you want to use the visitors email as sender in the header just follow these steps:

  1. Open up the wordpress admin panel
  2. Go to ”Forms”
  3. Click on your form
  4. Click on the tab ”Form extra”
  5. Type in the nickname ”email” nexto the field that holds the e-mail adress
  6. Save
  7. Go to the tab ”Edit”
  8. To the right under ”E-mail notification” change the field with the header ”from” to: [item email]
  9. Save
  10. Test

If you need any help, just leave a comment on this post and I will tell you how to fix it.

For more shortcodes, checkout the plugin-page: http://www.campbellhoffman.com/question/advanced-e-mail-settings/

Yii model default DB values

Great tip if your working with the PHP-framework Yii, if you create a new model and want to set some default values, like ”order by”, you can just add the following function (defaultScope) to your CActiveRecord extended class:

public function defaultScope(){
return array(
‘order’=>’my_order_field DESC’

Read more here: http://www.yiiframework.com/doc/guide/1.1/en/database.ar

Raspberry PI – disable screen saver for X

I just got my hands on a raspberry PI, and the first problem I ran into was that the screen is going black after a couple of minuts. It does not seems to be a simple way to solve this, but I found three solutions online and I will summon them up here. Just follow the steps in each:

X-Server setting:

  1. Run this to install utilities (if not installed): apt-get install x11-xserver-utils
  2. Create (if not exists) this file in your home directory: ~/.xinitrc
  3. Open thie file: sudo nano ~/.xinitrc
  4. Add the following four lines:
    xset s off
    xset -dpms
    xset s noblank
    exec /etc/alternatives/x-session-manager
  5. Save and exit

Lightdm setting:

  1. sudo nano /etc/lightdm/lightdm.conf
  2. In that file, look for: [SeatDefault]
  3. Insert this: xserver-command=X -s 0 dpms

KDB settings:

  1. Run: sudo nano /etc/kbd/config
  2. Change the value ”BLANK_TIME=30” to ”BLANK_TIME=0”
  3. Change the value ”POWERDOWN_TIME=30” to ”POWERDOWN_TIME=0”
  4. Save exit nano
  5. Run: sudo /etc/init.d/kbd restart


Completing all these steps solved the problem for me =)

WordPress (WP) wp_list_pages returns null

I recently had a problem with wordpress 3.6 and the function wp_list_pages within my template. I know my page had subpages, but when I executed the code the function returned NULL. After doing some digging I found that when wp_list_pages runs, it applys a ”exlcude”-filter, and somewhere on the way this filter added all my pages to it. I tried deactivating all plugins, search all code for the exclude filter funtion and tried another theme but it did not work.

So for now I just added comment marks infront of line 842 in fil ”wp-includes/post-template.php” which temporarly solved the problem.

I know this is the forbidden way so solve it =) so if someone has a better solution, please put it in the comment section.