As I’ve always strived to automate my home, as much as I can. Although I can’t still turn the lights on and off, I’m capable of controlling my TV, my set-top-box and my multimedia PC with my iPhone. And the problem with the lights is not so much of “impossible” but rather I don’t feel like tearing down my laws to run cables. I actually managed to write an app for a friend to turn his garden lights on and off with his iPhone.

For that purpose, having my TV remote is essential! Unfortunately, after I upgraded my iPhone 3Gs to 4s, the Samsung Remote app started crashing on each launch. Here’s how I managed to get it working:

  1. Turn off Wi-Fi and cellular data
  2. Start Samsung TV
  3. Go into Demo Play
  4. Turn back on your Wi-Fi
  5. Hit refresh
  6. Select a TV from the list
This seemed to work for me, even after I restarted the App.

 

Since WordPress updated their iOS app to include location for posts, it came to my attention that it is fairly easy to add location to your posts – and it works nicely with the “Quick Photo” feature of the iOS WordPress app.

Unfortunately after I installed the WordPress GeoLocation plugin OnSwipe’s iPad theme stopped working for me. After some digging it turned out it is because Geolocation is overwriting the default alias of $ of jQuery which was breaking OnSwipe.

Here is how to fix that:

  1. Go to your admin panel
  2. Go to Plugins -> Editor
  3. In the drop-down Select plugin to edit choose “Geolocation”
  4. From the file list Plugin Files (just underneath the drop-down) select geolocation/geolocation.php
  5. Find in the code the function add_google_maps (use your browser’s search function and look for “function add_google_maps”)
  6. Find the line that reads: var $j = jQuery.noConflict(); either comment it out by prepending two slashes in front of it or delete it
  7. In its place add the following: $j = jQuery;
  8. Click Update File

This should fix OnSwipe and at the same time allow your visitor to view the location tag of your posts!

Ubuntu 11.10 is out! So the package manager prompted me to upgrade from Ubuntu 11.04 and so I did. The upgrade process took several hours, but mainly because I wasn’t paying attention and I didn’t take immediate action of different prompts regarding the upgrade process.

I decided to keep all of my config file modifications hoping that would give me less headache at the end. Nevertheless, I got several problems after I booted in my new shiny Oneric Ocelot (Ubuntu 11.10’s codename).

  1. I couldn’t go past the login screen – the solution was simple – for some reason my ~/.Xauthority file was owned by root:root – I simply deleted the file and that fixed it
  2. I didn’t get any sound in Unity, but only in Unity as it turns out, as aplay was playing sound just fine. The sound preferences’ Hardware tab was also completely empty. I deleted the ~/.pulse folder and re-logged and I could re-configure my sound. Sound was back on!
I’ll keep this post updated if I come across more problems, and hopefully their solutions.

When I upgraded to Lion suddenly my colorful SSH prompts on remote linux machines became dull and black and white. It took me some time to figure out what was going out, so at first I edited my Ubuntu .bashrc file and uncommented force_color_prompt=yes. But this didn’t seem right. So after some digging I found the problem – in Snow Leopard Terminal.app by default was identifying itself as xterm-color, but now in Lion it is xterm-256color, which the remote Ubuntu did not recognize. So to fix it without changing anything on the remote machines, do the following:

  1. Open Terminal.app Preferences
  2. Go to the Settings tab
  3. In your default theme go to the Advanced tab
  4. On the first line Declare terminal as: select xterm-color, instead of the default xterm-256color
  5. Reopen Terminal.app and voilà – the colored SSH command prompt is back!

I’ve read lots of forum posts on getting audio through the HDMI interface on an NVidia ION and the solution turned out to be extremely simple: The HDMI output device (labeled as S/PDIF 1) was muted but not visible in Ubuntu’s GUI!

A note about my hardware:
I have a ZOTAC ZBOX HD-ND22, which has NVidia ION chipset and I’m running the proprietary NVidia driver version 270.41.06.

Steps that I took to get HDMI audio:

  1. Open Sound Preferences
  2. Open the Hardware tab
  3. From the Profile dropbox select Digita Stereo(HDMI) Output
  4. Open up a Terminal
  5. type alsamixer
  6. Using the Left/Right arrow keys navigate to the item labeled S/PDIF 1
  7. Press M and the OO symbol on top should light up in green to denote the channel was unmuted
  8. Test the audio output via Sound PreferencesTest Speakers

In my case the setup worked between reboots.

I’m also having a problem running Ubuntu Unity via HDMI, the screen does not update and the mouse clicks seem to be off by tens of pixels. If you have an idea how to fix that – drop me a line in the comments.

UPDATE: A simple:

unity --reset

will fix unity’s display weirdness I mentioned above

Честит празник (на патерица) на всички, които могат да прочетат това.

От няколко години насам, по случай 24 май, много се чепка темата за кирилицата, шльокавицата и произвдните им азбуки, които средностатистическия българин употребява.

“Младите”, които използват компютри са упреквани, че си развалят езика и нямат правопис. Често се набедяват популярните програми – фейсбук, скайп (я вижте как хубаво изглеждат тия търговски марки написани на кирилица) и т.н.. Но дали те са причината?

Определено не!

И двата софтуера имат “меню на български”. А именно “менюто на български” е причината да пишем на латиница. Разгледайте обявите за телефони от преди няколко години – като част от “екстрите” на телефоните неотменно присъства “меню на български”. В 2011 почти всички телефони имат въпросното меню и способ да се пише на кирилица, но до преди няколко години това определено не беше така.
Същото се отнася и за компютрите – голяма част от софтуерните програми нямат “меню на български”, а до преди излизането на Уиндоус Виста, дори и сносна кирилица нямаше! Тази по БДС не се брои! Защо? Ами защото за някой, който тепърва започва да работи с компютър не може да намери БДС еквивалента на клавиатурата, защо такъв няма, защото държавата е допуснала да се продава в рамките на държавата продукт, който не отговаря на националните изисквания, а именно – не поддържа националния стандарт за клавиатурна подредба с обозначение на клавишите на кирилица. От тук всеки започва да ползва подредбата ЯВЕРТЪ – тук поне буквите ги има, а тази подредба я има поне от края на 80-те години! Т.е. проблема с БДС подредбата на клавиатурата не е от вчера. И така хем няма клавиатура с БДС, хем няма фонетична подредба в най-масовата операционна система! От там, започва да се ползва и латинската азбука за писане на български.

От скоро имаме и фонетична подредба, заложена системно в по-новите версии на уиндоус, но това не означава, че навика отмира трудно – даже напротив. В един момент започва да става дразнещо да превключваш от кирилица на латиница и обратно. А това се налага често, понеже всички интернет адреси са на латиница!

Заключенията, кой е виновен за слабата грамотност оставям на вас.

Извинете ме за правописните грешки, но за мен езика е средство, а не самоцел.

It took me two days to figure out how to initialize a new child record from within the parent model, I hope this helps someone:

I’m using devise for authentication and authorization and using devise built-in controllers. My User model has a child Contact model (Contact belongs_to :User) which contains the user’s names and contact information. I preferred not to initialize the content model on new registration in the view (what’s the point of MVC philosophy if you don’t follow it?).

The solution (in Ruby on Rails 2.3.11) is the after_initialize callback


class User < ActiveRecord::Base
  has_one :contact, :dependent => :destroy
  accepts_nested_attributes_for :contact, :allow_destroy => true

  # Devise modules will go here

  attr_accessible :contact_attributes

  def after_initialize
    self.build_contact if self.contact.nil?
  end
end

and voilà! Your Contact model will be initialized and thus shown in the view when you use f.fields_for :contact

As you can probably figure out, I’m a huge of of Hoegaarden! I believe it is THE BEST beer in the world! Served with a slice of lemon it has an unmistakable and unbeatable taste!