<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUUMQXkyfyp7ImA9WhRaFE4.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526</id><updated>2012-02-17T01:08:00.797+01:00</updated><category term="ruby" /><category term="linux" /><category term="hibernate" /><category term="sonyerricson" /><category term="android" /><category term="problems" /><category term="foreign key" /><category term="java" /><category term="python" /><category term="news" /><category term="g1" /><category term="os" /><category term="rails" /><category term="samba" /><category term="hash" /><category term="windows" /><category term="syslog" /><category term="p1i" /><category term="migration" /><category term="database" /><title>Canto's Web Log</title><subtitle type="html">You never know what's on the wire.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://ethernetflow.blogspot.com/" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/CantosWebLog" /><feedburner:info uri="cantosweblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DEQCQn0-cSp7ImA9WhRbEE4.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-6331774519454458854</id><published>2012-01-31T19:59:00.000+01:00</published><updated>2012-01-31T19:59:23.359+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-31T19:59:23.359+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="python" /><title>How to check if variable exists in Python.</title><content type="html">This is a pretty common problem as Python does not offer any variable checking mechanism and when we try to use non defined variable it will throw an NameError exception.&lt;br /&gt;
We can do try/expect way but it is not very useful, instead I propose to declare a Perl-style function.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;def defined(var):&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; &amp;nbsp; return var in globals()&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;br /&gt;
&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;if defined('temp'):&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; &amp;nbsp; print('defined')&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;else:&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&amp;nbsp; &amp;nbsp; print('undef!')&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We have to quote a variable but that shouldn't be a problem. This isn't very stylish or probably the best way to do it, but it works like a charm.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-6331774519454458854?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BREN8qopcd7_IuQBitMK7x0Ic8w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BREN8qopcd7_IuQBitMK7x0Ic8w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BREN8qopcd7_IuQBitMK7x0Ic8w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BREN8qopcd7_IuQBitMK7x0Ic8w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/uWglxaFgaUc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/6331774519454458854/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=6331774519454458854" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/6331774519454458854?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/6331774519454458854?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/uWglxaFgaUc/how-to-check-if-variable-exists-in.html" title="How to check if variable exists in Python." /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2012/01/how-to-check-if-variable-exists-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIGRH44eCp7ImA9WhRVGU0.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-1106880822019276839</id><published>2012-01-18T17:02:00.000+01:00</published><updated>2012-01-18T17:02:05.030+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-18T17:02:05.030+01:00</app:edited><title>SOPA and Wikipedia</title><content type="html">We all hate SOPA act but we all love Wikipedia.&lt;br /&gt;
&lt;br /&gt;
I understand that Wiki is striking but I also understand people who needs it, so if you need to access Wikipedia under blackout do this:&lt;br /&gt;
1) Open your wiki page like you would normal do but before it's fully loaded (text and pictures are visible) hit the "ESC" button on your keyboard like crazy and it should stop the blackout ;-)&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-1106880822019276839?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cSL8U2fzYzab0LUgKal5JULD8Ns/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cSL8U2fzYzab0LUgKal5JULD8Ns/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cSL8U2fzYzab0LUgKal5JULD8Ns/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cSL8U2fzYzab0LUgKal5JULD8Ns/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/5l7zLr_fIPE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/1106880822019276839/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=1106880822019276839" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/1106880822019276839?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/1106880822019276839?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/5l7zLr_fIPE/sopa-and-wikipedia.html" title="SOPA and Wikipedia" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2012/01/sopa-and-wikipedia.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MGR3g7cCp7ImA9Wx9WFkw.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-1679629379900399413</id><published>2011-01-21T14:08:00.001+01:00</published><updated>2011-01-21T14:10:26.608+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-21T14:10:26.608+01:00</app:edited><title>Ruby on Rails and encoding</title><content type="html">&lt;a href="http://rubyonrails.org/images/rails.png" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://rubyonrails.org/images/rails.png" /&gt;&lt;/a&gt; Sometimes people just don't use UTF-8. I could understand the Chinese and Japanese folks but why Polish webmasters still use ISO-8859-2 ? I wonder...&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Anyway recently my friend found a bug in my app, it's quite tricky. I have an app that takes some strings from html document and then creates an form and submit that form to the server. Everything works flawlessly until we use IE on non-utf8 encoded page.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Because IE doesn't support accept-charset form attribute data is sent in the original encoding which is ISO-8859-2 in my case. My application default encoding is utf8 so when data arrives to the app it "thinks" that it's encoded in utf8 which is obviously wrong. So I got char \xF3 which is "ó" (this letter is by the way the same as "u" but we use both to complicate our language and make it l33t onRy! ;-) in Polish and it is a "&lt;b&gt;invalid byte sequence in UTF-8&lt;/b&gt;" and my app crashes :D Soooooo great :D To crash an rails app just&amp;nbsp; send invalid utf8 char to it !&lt;br /&gt;
&lt;br /&gt;
Solution for this isn't simple. People tells about using iconv to replace/ignore/blank out the trouble making butes but I want my "ó" ! Another way is to detect the encoding and then do string.force_encoding(detected_encoding).encode!("UTF-8") which works but the problem is that in ruby 1.9 we do not have any good, working encoding detection method.&lt;br /&gt;
I've crawled the internets for hours and found only chardet gem (UniversalDetector) which fails to work under ruby 1.9 rails 3.0.3 and rchardet which also doesn't work but some awesome guy ported in to 1.9 but it still doesn't solve my problem and crashes when trying to detect encoding of my string !&lt;br /&gt;
So finally I wrote a little function, it's not perfect and it will eat letters from a string if we guess the wrong encoding, but it should work for most latin sites.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def vs(s)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if s.to_s.valid_encoding?&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; begin&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s.force_encoding('ISO-8859-2').encode!("UTF-8")&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rescue ArgumentError&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ensure&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c = Iconv.new 'UTF-8//IGNORE', 'UTF-8'&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s.replace c.iconv(s.dup + '&amp;nbsp; ')[0..-2]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Just have to remember, it's not a solution just ugly workaround&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-1679629379900399413?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8gi_FxSpxDrEyf9XWFAjoV9JkYs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8gi_FxSpxDrEyf9XWFAjoV9JkYs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8gi_FxSpxDrEyf9XWFAjoV9JkYs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8gi_FxSpxDrEyf9XWFAjoV9JkYs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/Bp_PUjhBV0s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/1679629379900399413/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=1679629379900399413" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/1679629379900399413?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/1679629379900399413?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/Bp_PUjhBV0s/ruby-on-rails-and-encoding.html" title="Ruby on Rails and encoding" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2011/01/ruby-on-rails-and-encoding.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUGQng6eyp7ImA9Wx9TF00.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-7076329529990074809</id><published>2010-11-24T10:54:00.001+01:00</published><updated>2010-11-25T18:47:03.613+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-25T18:47:03.613+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="migration" /><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><category scheme="http://www.blogger.com/atom/ns#" term="hash" /><category scheme="http://www.blogger.com/atom/ns#" term="database" /><title>Rails TypeError (can't convert String into Integer) on save</title><content type="html">&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://rubyonrails.org/images/rails.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://rubyonrails.org/images/rails.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
RoR is fun !&lt;br /&gt;
&lt;br /&gt;
Unless... you encounter some problem that google cannot explain ;)&lt;br /&gt;
&lt;br /&gt;
So recently I've got some strange &lt;i&gt;TypeError (can't convert String into Integer)&lt;/i&gt; in &lt;i&gt;.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:319&lt;/i&gt; when doing .save on my object.&lt;br /&gt;
&lt;br /&gt;
Records were successfully saved into database but this error stopped app from execution.&lt;br /&gt;
I've investigated this a little, trying to find this mysterious String which ruby wants to convert to Integer.&lt;br /&gt;
Let me tell you a little about my object I want to save.&lt;br /&gt;
&lt;blockquote&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class CreateSites &amp;lt; ActiveRecord::Migration&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def self.up&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create_table :sites do |t|&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.integer :id, :null =&amp;gt; false&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.text :title, :null =&amp;gt; false&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.column :hash, :'varchar(32)', :null =&amp;gt; false&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.text :description, :null =&amp;gt; false&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.column :user_id, 'integer references users(id)', :null =&amp;gt; false&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t.timestamps&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def self.down&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop_table :sites&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/blockquote&gt;&lt;br /&gt;
This is my migration file, clean and simple. Nothing can be wrong here, well that's a lie ;)&lt;br /&gt;
&lt;br /&gt;
Ruby was complaining about my hash field, why ? Because every object in ruby has a hash method, which is used for eg. in comparison when doing Array.uniq (which is done in rails). Then when I created this migration, rails created a Class which was overwriting hash method (which returns int) to return the db value (which is string).&lt;br /&gt;
Sooooooo not cool ! Why this isn't documented anywhere ? Shame on you rails developers ! It should be red in migration guide - &lt;span style="color: red;"&gt;DO NOT USE "HASH" AS A FIELD NAME, IT &lt;span style="font-size: x-large;"&gt;&lt;b&gt;WILL &lt;/b&gt;&lt;/span&gt;BREAK YOUR APP&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-7076329529990074809?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5UjEsIxeKffSStj4NFt4gfDGjw4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5UjEsIxeKffSStj4NFt4gfDGjw4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5UjEsIxeKffSStj4NFt4gfDGjw4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5UjEsIxeKffSStj4NFt4gfDGjw4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/cSjAZdQfp6c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/7076329529990074809/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=7076329529990074809" title="11 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/7076329529990074809?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/7076329529990074809?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/cSjAZdQfp6c/rails-typeerror-cant-convert-string.html" title="Rails TypeError (can't convert String into Integer) on save" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>11</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2010/11/rails-typeerror-cant-convert-string.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUAQ3s5eyp7ImA9Wx9TF00.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-3429198427953993994</id><published>2010-11-17T21:37:00.001+01:00</published><updated>2010-11-25T18:47:22.523+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-25T18:47:22.523+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ruby" /><category scheme="http://www.blogger.com/atom/ns#" term="foreign key" /><category scheme="http://www.blogger.com/atom/ns#" term="migration" /><category scheme="http://www.blogger.com/atom/ns#" term="rails" /><title>Rails 3 + Foreign Key</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://rubyonrails.org/images/rails.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://rubyonrails.org/images/rails.png" /&gt;&lt;/a&gt;&lt;/div&gt;Hi there !&lt;br /&gt;
&lt;br /&gt;
Recently I've been doing some railing on rails 3. They're pretty cool actually but you can read about it elsewhere ;)&lt;br /&gt;
&lt;br /&gt;
Though, there is this "foreign key" problem. Rails != Hibernate so sometimes we must work some magic.&lt;br /&gt;
We cannot do native foreign keys so we'll do it the "hard way" (which is btw very easy) &lt;br /&gt;
I'm using PostgreSQL (if you aren't - you should !) This method will  probably won't work for other databases but I don't care, so...&lt;br /&gt;
We take our migration file and put there :&lt;br /&gt;
&lt;blockquote&gt;&lt;div style="text-align: left;"&gt;&lt;i&gt;t.column :site_id, 'integer references sites(id)', :null =&amp;gt; false&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;t.column :user_id, 'integer references users(id)', :null =&amp;gt; false&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;t.column :parent, 'integer references comments(id)'&lt;/i&gt;&lt;/div&gt;&lt;/blockquote&gt;or something similar.&lt;br /&gt;
And that's it ! We don't need any plugins. Foreign keys are created.&lt;br /&gt;
&lt;blockquote&gt;&lt;i&gt;Foreign-key constraints:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "comments_parent_fkey" FOREIGN KEY (parent) REFERENCES comments(id)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "comments_site_id_fkey" FOREIGN KEY (site_id) REFERENCES sites(id)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "comments_user_id_fkey" FOREIGN KEY (user_id) REFERENCES users(id)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;Referenced by:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TABLE "comments" CONSTRAINT "comments_parent_fkey" FOREIGN KEY (parent) REFERENCES comments(id)&lt;/i&gt;&lt;/blockquote&gt;That's so awesome, isn't it ?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-3429198427953993994?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CC-urJqWKB6E9qBY671UJxnsOj4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CC-urJqWKB6E9qBY671UJxnsOj4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CC-urJqWKB6E9qBY671UJxnsOj4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CC-urJqWKB6E9qBY671UJxnsOj4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/xTk5CJJmY88" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/3429198427953993994/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=3429198427953993994" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/3429198427953993994?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/3429198427953993994?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/xTk5CJJmY88/rails-3-foreign-key.html" title="Rails 3 + Foreign Key" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2010/11/rails-3-foreign-key.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08BQng6eCp7ImA9Wx5aEU8.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-7155035987273828825</id><published>2010-11-07T12:37:00.001+01:00</published><updated>2010-11-07T12:37:33.610+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-07T12:37:33.610+01:00</app:edited><title>How to cheat in iStudent facebook competition</title><content type="html">Well on facebook, there is this iStudent competition. If you win apple will give you some gadgets so you can show off in college. Sounds fun, right ?&lt;br /&gt;
To participate you need to register and use iStudent facebook app. There you'll get some question that you need to answer. Tricky part is that there's limited time for that, each couple of seconds you loose one point. So... what can you do to stop the time ? It's easy, buy a time machine ! No, but really, just install &lt;a href="http://noscript.net/"&gt;NoScript&lt;/a&gt; for firefox and you're good. Seriously. You can always create second facebook account to get the questions and cheat, but this is just sooooo easy ! Anyway, have fun. You can get also points for inviting friends but that's just too easy. I hope I'll write here more often than once a year ;)&lt;br /&gt;
&lt;br /&gt;
Cheers !&lt;br /&gt;
&lt;br /&gt;
BTW.&lt;br /&gt;
Remember, fact that you can cheat do not allow you to do so ! ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-7155035987273828825?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Zb0GJjox25Ry40YP0jUK3kqk3iE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zb0GJjox25Ry40YP0jUK3kqk3iE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Zb0GJjox25Ry40YP0jUK3kqk3iE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zb0GJjox25Ry40YP0jUK3kqk3iE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/-TxNJ96Acms" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/7155035987273828825/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=7155035987273828825" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/7155035987273828825?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/7155035987273828825?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/-TxNJ96Acms/how-to-cheat-in-istudent-facebook.html" title="How to cheat in iStudent facebook competition" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2010/11/how-to-cheat-in-istudent-facebook.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYGQnw7eyp7ImA9WxBbGEw.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-732792668253206093</id><published>2010-03-17T09:54:00.003+01:00</published><updated>2010-03-17T09:55:23.203+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-17T09:55:23.203+01:00</app:edited><title>Telelogic Synergy problem</title><content type="html">Recently I've encountered a strange Telelogic Synergy problem.&lt;br /&gt;
When starting classic client I got couple of errors:&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;ACcent execution aborted in module vistartup, file &lt;stdin&gt;, line 123&lt;/stdin&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;ACcent execution aborted in module viproject, file &lt;stdin&gt;, line 321&lt;/stdin&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;operand of generic cast has an incompatible type&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Well that tells nothing. After further investigation it finds out that the configuration file (ccm.ini) was either corrupted or read/write access to it was denied.&lt;br /&gt;
Deleting the file helped and everything went back to normal ;) (of course the file re-created with default settings)&lt;br /&gt;
&lt;br /&gt;
This is more a remainder for me that actual note, but maybe someone will find that information usefull :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-732792668253206093?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/g9W0wuPj0hgeo4JN5UsZnhXANj8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g9W0wuPj0hgeo4JN5UsZnhXANj8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/g9W0wuPj0hgeo4JN5UsZnhXANj8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g9W0wuPj0hgeo4JN5UsZnhXANj8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/I0Xk8jJQCgc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/732792668253206093/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=732792668253206093" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/732792668253206093?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/732792668253206093?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/I0Xk8jJQCgc/cm-synergy-problem.html" title="Telelogic Synergy problem" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2010/03/cm-synergy-problem.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUARX45fip7ImA9WxBUF0Q.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-5238749790535161657</id><published>2010-03-05T12:38:00.002+01:00</published><updated>2010-03-05T13:47:24.026+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-05T13:47:24.026+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="g1" /><category scheme="http://www.blogger.com/atom/ns#" term="android" /><title>HTC G1 and SMS Service Center</title><content type="html">&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://www.purepc.pl/files/Image/news/2008/08/android.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://www.purepc.pl/files/Image/news/2008/08/android.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;Well, recently I've switched phones with my friend (just for one day) and suddenly when I got my g1 back I couldn't send any sms!&lt;br /&gt;
&lt;br /&gt;
So I called to my mobile operator and asked wth. Nice guy on line told me that he cannot help me with phone configuration because they don't know my phone model and they don't support it. What a bummer!&lt;br /&gt;
&lt;br /&gt;
So I told him to give me Service center number and I configure it myself.&lt;br /&gt;
I never done that on this phone so I jumped to settings and started searching, searching... and nothing! No SMS Service Center number to change!&lt;br /&gt;
&lt;br /&gt;
Well, that's not nice. I found two ways to do it.&lt;br /&gt;
First you have to dial *#*#4636#*#* and then g1 will take you to some super-cool-secret configuration screen where you can choose "Phone information" and change sms sc number.&lt;br /&gt;
The other way is to use app called AnyCut. It let you create shortcuts to applications and other stuff, you can create a shortcut to "Phone Info" there :)&lt;br /&gt;
Great thing is that you can create shortcuts to other fun things like "Debug intent", "Debug Tool" or "FieldTest" (you can also bring up FieldTest with code *#*#7262626#*#* ) which gives you some cool information about active gsm connection!&lt;br /&gt;
&lt;br /&gt;
Have fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-5238749790535161657?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/_n2Yqy9nrQs6Va2YrwyFQVj2nXs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_n2Yqy9nrQs6Va2YrwyFQVj2nXs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/_n2Yqy9nrQs6Va2YrwyFQVj2nXs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/_n2Yqy9nrQs6Va2YrwyFQVj2nXs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/WYIcw0AgRe8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/5238749790535161657/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=5238749790535161657" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/5238749790535161657?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/5238749790535161657?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/WYIcw0AgRe8/htc-g1-and-sms-service-centre.html" title="HTC G1 and SMS Service Center" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2010/03/htc-g1-and-sms-service-centre.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMCSXwyfip7ImA9WxRaEEo.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-6197570093731186223</id><published>2008-12-09T16:00:00.005+01:00</published><updated>2008-12-12T11:41:08.296+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-12T11:41:08.296+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="syslog" /><category scheme="http://www.blogger.com/atom/ns#" term="samba" /><title>Samba, vfs_extd_audit module and syslog</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4ulUVN-Va9Q/ST-qME_jIgI/AAAAAAAAAIU/tCeueXUcH9U/s1600-h/logo-samba.gif"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 300px; height: 155px;" src="http://1.bp.blogspot.com/_4ulUVN-Va9Q/ST-qME_jIgI/AAAAAAAAAIU/tCeueXUcH9U/s320/logo-samba.gif" alt="" id="BLOGGER_PHOTO_ID_5278124412776948226" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Did you ever wanted to monitor samba shares? To know, who's opening what and when, who's deleting what?&lt;br /&gt;That's a good thing to know. Every sysadmin should know which user deleted some public file - by accident of course ;-)&lt;br /&gt;By default SAMBA offers extended logging system, setting "log level = 5" in smb.conf allows us to see what's happening to our files. But! It logs ALOT of crap that we don't need!&lt;br /&gt;&lt;br /&gt;Samba comes with some default modules that we can use some of them are responsible for logging, ie, vfs_audit which logs opening, renaming, deleting creating, etc to syslog, vfs_extd_audit which do exacltly the same thing but to BOTH syslog, AND samba log file and third module - vfs_full_audit which is richer and more configurable version of vfs_audit. We can choose what to log and what to not (to syslog only tho :(), very nice thing. However in this case we just need to log file access. Logging should go to separate samba log files, not to syslog.&lt;br /&gt;According to SAMBA documentation, we can turn syslog off by setting "syslog = 0" variable in smb.conf file. However it &lt;span style="font-weight: bold;"&gt;doesn't work&lt;/span&gt; for vfs_extd_audit module. This module also offers us the log level, documentation says that setting "log level = 0 vfs:&lt;span style="font-weight: bold;"&gt;X&lt;/span&gt;" where &lt;span style="font-weight: bold;"&gt;X&lt;/span&gt;=vfs_extd_audit log level, we can seperate the global log level, and module log level. However it &lt;span style="font-weight: bold;"&gt;doesn't work either!&lt;/span&gt; So basicly we are stuck with logging to both syslog and samba log files which waste our disk spacem and we don't want that.&lt;br /&gt;I wrote a simple patch for latest version of Samba (3.2.5) which resolves those issues.&lt;br /&gt;It can be downloaded at &lt;a href="https://bugzilla.samba.org/show_bug.cgi?id=5956"&gt;https://bugzilla.samba.org/show_bug.cgi?id=5956&lt;/a&gt;&lt;br /&gt;To patch your Samba go to samba_src/source/modules and type patch -p0 &lt; vfs_extd_audit.c.patch&lt;br /&gt;Then recompile and enjoy! :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-6197570093731186223?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sEIgv1Qnbjh0vHtbNK59QgVHaYI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sEIgv1Qnbjh0vHtbNK59QgVHaYI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sEIgv1Qnbjh0vHtbNK59QgVHaYI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sEIgv1Qnbjh0vHtbNK59QgVHaYI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/bAsr6B6AU1s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/6197570093731186223/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=6197570093731186223" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/6197570093731186223?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/6197570093731186223?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/bAsr6B6AU1s/samba-vfsextdaudit-module-and-syslog.html" title="Samba, vfs_extd_audit module and syslog" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_4ulUVN-Va9Q/ST-qME_jIgI/AAAAAAAAAIU/tCeueXUcH9U/s72-c/logo-samba.gif" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2008/12/samba-vfsextdaudit-module-and-syslog.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8DQXk7eip7ImA9WxZUGU0.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-8438696440999315242</id><published>2008-04-11T10:55:00.005+02:00</published><updated>2008-04-11T11:07:50.702+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-11T11:07:50.702+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="java" /><category scheme="http://www.blogger.com/atom/ns#" term="hibernate" /><title>Playing with Hibernate.</title><content type="html">So recently I'm in love in JAVA (at least my girlfriend says that). I'm developing simple project for my company (because I'm bored). Swing based thing with Hibernate and mssql.&lt;br /&gt;I've used annotations to map classes to db, very cool thingy. Gotta love that. Everything in one file, class and database mapping. Some genius invented this :D But lets get to the point.&lt;br /&gt;&lt;br /&gt;Following the manual on hibernate page good thing to do is to create a HibernateUtil (or call it whatever) class to help us menage hibernate session. (&lt;a href="http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html#tutorial-firstapp"&gt;http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html#tutorial-firstapp&lt;/a&gt;) So I've created it. But I don't wanna use mapping files in xml's, I wanna use Annotations, so what I need to change is&lt;br /&gt;&lt;br /&gt;sessionFactory = new Configuration().configure().buildSessionFactory();&lt;br /&gt;to&lt;br /&gt;sessionFactory = new AnnotationConfiguration().buildSessionFactory();&lt;br /&gt;&lt;br /&gt;Hibernate has couple of configuration methods.&lt;br /&gt;- You can configure thru the code, eg.&lt;br /&gt;sessionFactory = new AnnotationConfiguration()&lt;br /&gt;          .addPackage("test.animals") //the fully qualified package name&lt;br /&gt;          .addAnnotatedClass(Flight.class)&lt;br /&gt;                 .buildSessionFactory()&lt;br /&gt;&lt;br /&gt;- Configure thru hibernate.properties file. Altrought that method (as far as i know) cannot directly add/configure annotated classes.&lt;br /&gt;&lt;br /&gt;- And the last but best method thru hibernate.cfg.xml file. It is the common way of using hibernate.cfg.xml for Hibernate configuration.&lt;br /&gt;File is very flexible, and understandable.&lt;br /&gt;&lt;br /&gt;All tutorials and manuals on hibernate.org tell that hibernate.cfg.xml is the best way of configuring hibernate.&lt;br /&gt;But, they don't tell that if you'll be using AnnotationConfiguration that file ISN'T searched in classpath!&lt;br /&gt;&lt;br /&gt;That gave me smth. to think about when i was wondering why my configuration file isn't parsed. I've tryied adding in do different folders, debugging my app and nothing.&lt;br /&gt;Then I've came up with simple idea. I simply put path to my config file in creation of sessionFactory. So it looks like this.&lt;br /&gt;&lt;br /&gt;sessionFactory =&lt;br /&gt;new AnnotationConfiguration()&lt;br /&gt;.configure("/hibernate.cfg.xml")&lt;br /&gt;.buildSessionFactory();&lt;br /&gt;&lt;br /&gt;And boom~! Everything works fine ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-8438696440999315242?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yLYpUsqqDtkLxD1pkKBIo-3JurE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yLYpUsqqDtkLxD1pkKBIo-3JurE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yLYpUsqqDtkLxD1pkKBIo-3JurE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yLYpUsqqDtkLxD1pkKBIo-3JurE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/B3swbucSDfY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/8438696440999315242/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=8438696440999315242" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/8438696440999315242?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/8438696440999315242?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/B3swbucSDfY/playing-with-hibernate_11.html" title="Playing with Hibernate." /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2008/04/playing-with-hibernate_11.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcARHkzeip7ImA9WxFTEE8.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-1051492012639899605</id><published>2008-02-13T08:57:00.005+01:00</published><updated>2010-03-31T09:54:05.782+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-31T09:54:05.782+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="os" /><category scheme="http://www.blogger.com/atom/ns#" term="news" /><category scheme="http://www.blogger.com/atom/ns#" term="windows" /><title>Windows 2008 Enterprise RTM</title><content type="html">So, yesterday I've installed win2k8 enterprise. First thing was that my DVD drive LG GMA 4082 don't read the MediaStore dvds, ouc! I went to my friend and copied it to "normal" disc.&lt;br /&gt;
Installation went smooth. It's Vista based isntall so you can partition your hdd, merge, resize etc. Very cool thingy. You have 60 days for activating the product. Enterprise full takes 10gb of hard disk space and alot of RAM! I've installed vista extensions, drivers for my ati card and nothing else (sound drivers installed automagically - WOW!) and i have 200mb ram free of my 1gb. I think i need to expand my ram, lol! I'll write more about this system when i get more into it. Hmm... how do you run aero? xD Does it even have aero? xD Looks cool, goes fast, we'll see in a year or so xD&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-1051492012639899605?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S1_U_vGa5QZZfFcOe4sU_xsuyig/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S1_U_vGa5QZZfFcOe4sU_xsuyig/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S1_U_vGa5QZZfFcOe4sU_xsuyig/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S1_U_vGa5QZZfFcOe4sU_xsuyig/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/wgegQM1G6xU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/1051492012639899605/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=1051492012639899605" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/1051492012639899605?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/1051492012639899605?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/wgegQM1G6xU/windows-2008-enterprise-rtm.html" title="Windows 2008 Enterprise RTM" /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2008/02/windows-2008-enterprise-rtm.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQAQX88cSp7ImA9WxZUGU0.&quot;"><id>tag:blogger.com,1999:blog-4796315705695217526.post-4392972524935802937</id><published>2008-02-05T13:05:00.001+01:00</published><updated>2008-04-11T10:59:00.179+02:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-04-11T10:59:00.179+02:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sonyerricson" /><category scheme="http://www.blogger.com/atom/ns#" term="problems" /><category scheme="http://www.blogger.com/atom/ns#" term="p1i" /><title>Sony Ericsson P1i and internet via PC.</title><content type="html">So I've recently bought brand new Sony Ericsson P1i. Fascinating mobile phone. I got the version w/o GPS but what the hell. I don't need it... now.&lt;br /&gt;&lt;br /&gt;   The phone is fine, allright. I don't wanna write how many functions it has.&lt;br /&gt;First thing i wanted to do was internet in my phone. So I've took USB cable and plug it in.&lt;br /&gt;I've synchronized my phone with... No wait! I did't synchronized it with Outlook 2007. It didn't worked! I did synchro it with Outlook 2003 in work but that's not that i want to do.&lt;br /&gt;Outlook is ewwwwww so i used http://mobical.net. It work with most phones, works like a charm but... You need internet to access it. This could sound stupid but is there a point in storing contacts on Your hard drive? Yea I know. Service can go down, someone can hack it, you can loose ALL of your contacts and notes but telling the truth your hard drive can break too.&lt;br /&gt;&lt;br /&gt;   So the point is P1i needs internet access to store data on mobical. As i don't have my personal USB bluetooth (why? the one in my laptop broke) I used USB cable.&lt;br /&gt;So SE PC Suite come with application called mRouter. What is it? Hard to tell... It's SUPPOSED to do NAT and give my phone internet access but... it just don't work. Ok. No, i didn't missconfigured it. I've tryied EVERYTHING and it just won't work. Blue light is on, state is connected but creating every type of connection on my P1i and configuring tons of serial ports in mRouter just don't work. If ANYONE knows a way how to connect this piece of crap with my lovely phone please let me know! And yes, i've read allmost everything on google.&lt;br /&gt; &lt;br /&gt;   I took my mom's USB bluetooth device, pluged in and installed BlueSoleil v1.5 or smth. Provied on a mini disc. I've connected my phone to it, paired and it works like a charm. OK now i want internet via bluetooth.&lt;br /&gt;In BlueSoleil i choose My Services -&gt; Properites -&gt; Personal Area networking (PAN) and what i see? That i cannot click on "Access LAN Network"!! Why? I dunno... It's just gray... So I've tried to do MS ICS (Internet connection sharing) between my network and bluetooth network.&lt;br /&gt;I've noticed that my P1i doesn't send any DHCP requests! OMG WHY!? I still don't know... but. I've configured a static IP, gateway, netmask DNS server and... it didn't worked. WTH!? When I tried to connect to internet on mobile PC asked if i agree i agreed ofcourse and... nothing. For no reason no packets where IN on PC bluetooth interface. I've fighted with it for another hour and ... lost.&lt;br /&gt;   Next thing to do was to download newer version of BlueSoleil and i got v.3.2.2.8. I installed it and.. OMG, I could click on "Access LAN Network"! YAY! So I did, restarted BS, my PC PAN adapter got IP address from my ethernet NIC. I set correct IP on P1i and IT WORKS! WOOOOOOHOOOOO! After couple minutes of internet surfing my PC got BSOD. I was like WTF!? I didn't saw BSOD for like 2 years (win xp pro). So I restarted my PC. After 2 more BSODs and couple of cigaretes I've uninstalled BlueSoleil (you cannot do this from emergency mode because the stupid windows installer won't start!). So my PC was back to normal and still no internet on P1i. I watched a movie, installed BlueSoleil 5.0.5 and there was no option "Access LAN Network" so I've unisntalled it and went to sleep.&lt;br /&gt;   At work I was goign to try again. And the chooise was BlueSoleil 3.2.2.8 witch crashes my home laptop. So at my desktop in work it works fine. Internet works fine, and everything works fine. I need to find the BSOD reason. Hmmm... Interesting.&lt;br /&gt;I've just download UIQ3 SDK. I'd rather write in MIDP2.0 beacause i want to learn more JAVA but i don't offers so many, many cool things like UIQ3. We'll see. I'll for sure write something in JME.&lt;br /&gt;BTW, Java iphonelock runs soooo slooooooow for me. gDesk isn't really that at all!&lt;br /&gt;TWUIK is a thing that require a closer look but they don't want to give it to meh! Absurd! ;)&lt;br /&gt;What i need is application like mouse gestures. Hmm... Maybe I'll write one? ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4796315705695217526-4392972524935802937?l=ethernetflow.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sgxWlhpvLOm3tbDEhsjGv8yU_ns/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sgxWlhpvLOm3tbDEhsjGv8yU_ns/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sgxWlhpvLOm3tbDEhsjGv8yU_ns/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sgxWlhpvLOm3tbDEhsjGv8yU_ns/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/CantosWebLog/~4/LFhd5KoPd4k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://ethernetflow.blogspot.com/feeds/4392972524935802937/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=4796315705695217526&amp;postID=4392972524935802937" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/4392972524935802937?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/4796315705695217526/posts/default/4392972524935802937?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CantosWebLog/~3/LFhd5KoPd4k/sony-ericsson-p1i-and-internet-via-pc.html" title="Sony Ericsson P1i and internet via PC." /><author><name>Oskar Wycislak</name><uri>http://www.blogger.com/profile/10081550851373455345</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>7</thr:total><feedburner:origLink>http://ethernetflow.blogspot.com/2008/02/sony-ericsson-p1i-and-internet-via-pc.html</feedburner:origLink></entry></feed>

