Archive for category I am half a robot
Įspūdžiai iš LOGIN 2010
Posted by Artūras Šlajus in I am half a robot on March 18th, 2010
Žodžiu pranešimai buvo cool (kai kurie nebuvo), konferencija smagi, viskas oki, ties tuo per daug nesiplėsiu. Tačiau apibendrinus – likau maloniai nustebintas
O aš tiesiog noriu paminėt porą projektų iš barcamp:
Awesome projektas, kurio pagrindinė esmė – kontekstinė reklama tavo puslapyje.
Turi blogą? Jėga! Užsiregistruoji pas juos, įdedi widgetą pas save ir lauki.
Kažkas užsuka pas tave į blogą ir sumąsto, kad būtų šaunu turėti savo reklamą čia. Spaudžia “Add advertisment”, įkelia bannerį, susimoka, tu patvirtini reklamą, pinigai įkrenta į tavo sąskaitą, užsakovo reklama sukasi.
Labai šaunus ir lengvas būdas reklamai. Plojimai kolegoms iš Lenkijos. Eikit ir bandykit!
Nekilnojamo turto skelbimų portalas su paprasta ir genialia mintimi. Skelbimus pateikti ne sąrašuose, o ant žemėlapio.
Turi gražią vartotojo sąsają ir įvairius žemėlapinius pokštus. Cool!
Tai va tiek šiam kartui
Fujitsu Amilo Pi 1505 squeaking, crackling, scratchy sound
Posted by Artūras Šlajus in Ubuntu on February 10th, 2010
I installed Ubuntu 9.10 into my Fujitsu-Siemens Amilo Pi 1505. It has Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller. I had this horrible squeaking, crackling sound which would get worse when CD was accessed.
It would even play when I muted the PCM input.
The solution was to install gnome-alsamixer and mute the CD channel.
- sudo apt-get install gnome-alsamixer
- Applications -> Sound & Video -> GNOME Alsa mixed
- Mute the CD channel
Here you go! No more crackling sound!
Hope this helps someone.
Getting Hash keys exchanged with values (PHP’s array_flip)
Posted by Artūras Šlajus in Ruby on December 12th, 2009
In PHP there is a nifty function that exchanges Hash keys with values: array_flip.
You can have it in Ruby easily too:
hash = {:a => 1, :b => 2, :c => 3}
> pp hash.to_a
[[:c, 3], [:a, 1], [:b, 2]]
> pp Hash[*hash.to_a.flatten.reverse]
{1=>:a, 2=>:b, 3=>:c}
You can define it as a method of Hash:
class Hash
def flip
self.class[*self.to_a.flatten.reverse]
end
end
> pp {:a => 1, :b => 2, :c => 3}.flip
{1=>:a, 2=>:b, 3=>:c}
Beware this only works on simple scalar hashes. Check out this proposal for better way.
Laiko sukiojimai
Posted by Artūras Šlajus in I am half a robot on November 22nd, 2009
Hm, čia tik man vienam taip, ar ir kitiems Omnitel vartotojams? Po laiko pasukimo SMS’ai iki šiol ateina 1 valanda iš ateities. Nice?
PHP5 vs Ruby
Posted by Artūras Šlajus in I am half a robot, Ruby on October 7th, 2009
<?php
class Base {
static function create() {
return new self;
}
}
class Child extends Base {}
var_dump(Child::create());
?>
vs
class Base
def self.create
new
end
end
class Child < Base
end
puts Child.create
What do we get?
In PHP (PHP 5.2.9-2 (cli) (built: Apr 9 2009 08:23:19)): object(Base)#1 (0) {}
In Ruby (ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]): #<Child:0x2880610>
Hopes that PHP6 fixes this.
Funny Ruby
Posted by Artūras Šlajus in Ruby on October 1st, 2009
a = a
You would imagine it would raise NameError if a was not defined, right? Not! It would just set a to nil
Evil…
Internet Explorer (IE) doesn’t show JPEG images with CMYK profile
Posted by Artūras Šlajus in Webas on September 19th, 2009
Fun fact: IE doesn’t show CMYK jpeg images. So if you’re wondering some day why your image doesn’t show in IE, but works fine eveywhere else – checks it’s color profile (IrfanView might do the trick)
Man patinka Ruby dokumentacija :))
Posted by Artūras Šlajus in Ruby on July 13th, 2009
------------------------------------------- Object#instance_variable_set
obj.instance_variable_set(symbol, obj) => obj
------------------------------------------------------------------------
Sets the instance variable names by _symbol_ to _object_, thereby
frustrating the efforts of the class's author to attempt to provide
proper encapsulation. The variable did not have to exist prior to
this call.
Featureful ieškok.lt
Posted by Artūras Šlajus in Webas on May 25th, 2009
Šiaip visai patogiai padaryta, bet vieno dalyko nepadarė. Nėra kaip pažiūrėti ar tu žiūrėjai anketa, ar ne. Na ką gi, dėka Firefox ir Greasemonkey – dabar jau yra
RubyConf 2009.2 video medžiaga
Posted by Artūras Šlajus in Ruby on April 22nd, 2009
http://distance.ktu.lt/vips/join.php?sr=547
Matoma tik su IE ir WMP

