<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tov's Blog &#187; Uncategorized</title>
	<atom:link href="http://blog.nobody-is-like.me/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nobody-is-like.me</link>
	<description>Just another (geeky) WordPress weblog</description>
	<lastBuildDate>Sat, 16 Jul 2011 14:57:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Rails Own Logger</title>
		<link>http://blog.nobody-is-like.me/2011/07/rails-own-logger/</link>
		<comments>http://blog.nobody-is-like.me/2011/07/rails-own-logger/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 14:53:39 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=93</guid>
		<description><![CDATA[I was in need of a logging mechanism that prints all log messages with a &#8220;severity&#8221; that equals or is higher of &#8220;INFO&#8221; to STDOUT (I&#8217;m using multilog for actual logging stuff). As I wasn&#8217;t able to google a solution I came up with the following (not quite elaborated) code: &#160; class OwnLogger &#60; Logger [...]]]></description>
			<content:encoded><![CDATA[<p>I was in need of a logging mechanism that prints all log messages with a &#8220;severity&#8221; that equals or is higher of &#8220;INFO&#8221; to STDOUT (I&#8217;m using <a title="multilog" href="http://cr.yp.to/daemontools/multilog.html">multilog</a> for actual logging stuff).</p>
<p>As I wasn&#8217;t able to google a solution I came up with the following (not quite elaborated) code:</p>
<p>&nbsp;</p>
<pre class="brush:ruby">class OwnLogger &lt; Logger

    include Severity
    SEV_LABEL = %w(DEBUG INFO WARN ERROR FATAL ANY)

    def add(severity, message = nil, progname = nil, &amp;block)
      time = Time.now
      if ENV['LOG_FROM_INFO_TO_STDOUT']
        if severity &gt;= INFO
          msg = "#{$$}:#{SEV_LABEL[severity]}:" + time.strftime("%Y-%m-%dT%H:%M:%S.") &lt;&lt; "%06d " % time.usec + ":"
          if message.nil?
            if block_given?
              message = yield
            else
              message = progname
              progname = @progname

            end
            msg += message.to_s
            puts msg
          end
        end
        super
      end

    end</pre>
<p>So if you put the following lines in your /config/application.rb you&#8217;ll get what I got <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<pre class="brush:ruby">config.logger = OwnLogger.new(File.dirname(__FILE__) + "/../log/#{ENV['PROCNAME']}#{Rails.env}.log")
</pre>
<p>AND (most important) you&#8217;ll still have the &#8220;normal&#8221; logfile containing all messages</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2011/07/rails-own-logger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the ID value of a serial column after insertation</title>
		<link>http://blog.nobody-is-like.me/2011/04/get-the-id-value-of-a-serial-column-after-insertation/</link>
		<comments>http://blog.nobody-is-like.me/2011/04/get-the-id-value-of-a-serial-column-after-insertation/#comments</comments>
		<pubDate>Fri, 15 Apr 2011 15:18:08 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Informix Serial Ruby]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2011/04/get-the-id-value-of-a-serial-column-after-insertation/</guid>
		<description><![CDATA[Just took me 2 hours of Googling&#8230; I found: http://stackoverflow.com/questions/246983/informix-how-to-get-an-id-of-the-last-inserted-record [...]The value of the last SERIAL insert is stored in the SQLCA record, as the second entry in the sqlerrd array. Brian’s answer is correct for ESQL/C, but you haven’t mentioned what language you’re using. If you’re writing a stored procedure, the value can be [...]]]></description>
			<content:encoded><![CDATA[<p>Just took me 2 hours of Googling&#8230;</p>
<p>I found:<br />
<a href="http://stackoverflow.com/questions/246983/informix-how-to-get-an-id-of-the-last-inserted-record">http://stackoverflow.com/questions/246983/informix-how-to-get-an-id-of-the-last-inserted-record</a></p>
<p>[...]The value of the last SERIAL insert is stored in the SQLCA record, as the second entry in the sqlerrd array. Brian’s answer is correct for ESQL/C, but you haven’t mentioned what language you’re using.<br />
If you’re writing a stored procedure, the value can be found thus:<br />
LET new_id = DBINFO(‚sqlca.sqlerrd1‘);<br />
It can also be found in $sth-&gt;{ix_sqlerrd}[1] if using DBI<br />
There are variants for other languages/interfaces, but I’m sure you’ll get the idea.<br />
[...]</p>
<p>I got the idea and have created the following procedure</p>
<p>CREATE PROCEDURE lastid ()<br />
         RETURNING integer;<br />
            DEFINE lastid integer;<br />
LET lastid = DBINFO(&#8216;sqlca.sqlerrd1&#8242;);<br />
RETURN lastid;<br />
END PROCEDURE</p>
<p>So to get the latest column you just use </p>
<p>select lastid() from table(set{1})</p>
<p>btw.: If you want to make use of this in Rails, I’d some success with:</p>
<p>class InformixConnect &lt; ActiveRecord::Base<br />
  self.abstract_class = true<br />
  establish_connection :development_informix</p>
<p>  def save<br />
    super<br />
    self.id = self.connection.select_value(&#8220;select lastid() from table(set{1})&#8221;)<br />
  end</p>
<p>end</p>
<p>so a model like</p>
<p>class Customer &lt; InformixConnect<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
end</p>
<p>would be able to connect to Informix and to get correct values from the DB without the<br />
usage of sequences!</p>
<p><strong>ERROR<br />
</strong>Unfortunately the stuff above (overwriting the save method) does not work for some reasons.</p>
<p>I have patched</p>
<p>  class InformixAdapter &lt; AbstractAdapter</p>
<p>     def prefetch_primary_key?(table_name = nil)<br />
        false<br />
      end<br />
&#8230;.</p>
<p>     def insert(sql, name= nil, pk= nil, id_value= nil, sequence_name = nil)<br />
        execute(sql)<br />
        select_value(&#8220;select lastid() from table(set{1})&#8221;)<br />
      end<br />
&#8230;..</p>
<p>This works!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2011/04/get-the-id-value-of-a-serial-column-after-insertation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix broken application icons in Mac OS X Snow Leopard</title>
		<link>http://blog.nobody-is-like.me/2010/12/fix-broken-application-icons-in-mac-os-x-snow-leopard/</link>
		<comments>http://blog.nobody-is-like.me/2010/12/fix-broken-application-icons-in-mac-os-x-snow-leopard/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 08:35:30 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Mac OS X]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2010/12/fix-broken-application-icons/</guid>
		<description><![CDATA[So it happened again: Most of my application icons were broken, i.e. only visible in a very low resolution. After googling a bit I found the following discussion: http://discussions.apple.com/thread.jspa?threadID=2142401 mdi’s suggestion did the trick for me: http://discussions.apple.com/message.jspa?messageID=10296267#10296267 What I did: open Terminal.app (If you never did&#8230; : Try „spotlight-search“ &#8211;&#62; Terminal) enter cd /private/var/folders enter [...]]]></description>
			<content:encoded><![CDATA[<p>So it happened again:</p>
<p>Most of my application icons were broken, i.e. only visible in a very low resolution.</p>
<p>After googling a bit I found the following discussion:<br />
<a href="http://discussions.apple.com/thread.jspa?threadID=2142401">http://discussions.apple.com/thread.jspa?threadID=2142401</a></p>
<p>mdi’s suggestion did the trick for me: <a href="http://discussions.apple.com/message.jspa?messageID=10296267#10296267">http://discussions.apple.com/message.jspa?messageID=10296267#10296267</a></p>
<p>What I did:</p>
<ul style="list-style-type: disc">
<li>open Terminal.app (If you never did&#8230; : Try „spotlight-search“ &#8211;&gt; Terminal)</li>
<li>enter cd /private/var/folders</li>
<li>enter sudo find . -name &#8220;com.apple.QuickLook.thumbnailcache&#8221;|xargs sudo rm -rf</li>
</ul>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;(you will have to enter your password)</p>
<ul style="list-style-type: disc">
<li>Restart Finder.app using „Apple-Menu&#8211;&gt; „quit immediately (It’s „Sofort Beenden“ in German. Dunno the english term) or press </li>
<li><span style="font-size: 13pt;">command+option+escape</span>“. Chose „Finder restart“.</li>
<li>Be happy <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>OK, to be honest I had to restart to be really happy <img src='http://blog.nobody-is-like.me/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2010/12/fix-broken-application-icons-in-mac-os-x-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NoMethodError: undefined method `empty?&#8217; for 8:Fixnum</title>
		<link>http://blog.nobody-is-like.me/2010/11/nomethoderror-undefined-method-empty-for-8fixnum/</link>
		<comments>http://blog.nobody-is-like.me/2010/11/nomethoderror-undefined-method-empty-for-8fixnum/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 16:28:46 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2010/11/nomethoderror-undefined-method-empty-for-8fixnum/</guid>
		<description><![CDATA[Argh&#8230; This f&#8230;ine error message above has been thrown during a records = Model.find(:first). Guess why: I made use of a legacy table that contained the attribute „type“. I just had to add a self.inheritance_column=&#8217;itype&#8217; into my model and now everything’s OK. Rails: Do you consider this as friendly error messages?]]></description>
			<content:encoded><![CDATA[<p>Argh&#8230;<br />
This f&#8230;ine error message above has been thrown during a</p>
<p>records = Model.find(:first).</p>
<p>Guess why:</p>
<p>I made use of a legacy table that contained the attribute „type“. I just had to add a</p>
<p>  self.inheritance_column=&#8217;itype&#8217;  </p>
<p>into my model and now everything’s OK.</p>
<p>Rails: Do you consider this as friendly error messages?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2010/11/nomethoderror-undefined-method-empty-for-8fixnum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>F..k suexec</title>
		<link>http://blog.nobody-is-like.me/2009/10/f-k-suexec/</link>
		<comments>http://blog.nobody-is-like.me/2009/10/f-k-suexec/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 13:08:40 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/?p=39</guid>
		<description><![CDATA[Musste mal gesagt werden!]]></description>
			<content:encoded><![CDATA[<p>Musste mal gesagt werden!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/10/f-k-suexec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kinderhilfe.de defaced</title>
		<link>http://blog.nobody-is-like.me/2009/05/kinderhilfede-defaced/</link>
		<comments>http://blog.nobody-is-like.me/2009/05/kinderhilfede-defaced/#comments</comments>
		<pubDate>Sat, 16 May 2009 11:48:57 +0000</pubDate>
		<dc:creator>tov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.nobody-is-like.me/2009/05/16/kinderhilfede-defaced/</guid>
		<description><![CDATA[Oh Mann. Jetzt haben tatsächlich irgendwelche Schwachköpfe die Seite der Kinderhilfe.de &#8220;verändert&#8221;. Auch wenn der Verein Kritik in der Presse einstecken musste, ist das noch lange kein Grund rechtswidrig deren Webseite umzugestalten. Mal abgesehen davon, dass das für die Petitionsgegner nur Wasser auf die Mühlen ist. Wirklich blöde Aktion, die noch Nachwirkungen haben wird. Nur [...]]]></description>
			<content:encoded><![CDATA[<p>Oh Mann. Jetzt haben tatsächlich irgendwelche Schwachköpfe die Seite<br />
der Kinderhilfe.de &#8220;verändert&#8221;. Auch wenn der Verein Kritik in der<br />
Presse einstecken musste, ist das noch lange kein Grund rechtswidrig<br />
deren Webseite umzugestalten. Mal abgesehen davon, dass das für die<br />
Petitionsgegner nur Wasser auf die Mühlen ist.<br />
Wirklich blöde Aktion, die noch Nachwirkungen haben wird.<br />
Nur kurz wg. unterwegs</p>
<p>Tobias</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nobody-is-like.me/2009/05/kinderhilfede-defaced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

