<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1672873697087215452</id><updated>2012-01-21T00:13:26.846-08:00</updated><category term='ruby'/><category term='oracle 10g'/><category term='foreign key'/><category term='path'/><category term='IE6'/><category term='mysql'/><category term='auth_user'/><category term='sqlite'/><category term='tomcat'/><category term='web2py'/><category term='join'/><category term='Blogger'/><category term='Syntax Highlighting'/><category term='right join'/><category term='oracle'/><category term='open flash chart'/><category term='base64'/><category term='sqlserver'/><category term='xml layout'/><category term='android'/><category term='asynchrone'/><category term='ror'/><category term='windows7'/><category term='Ajax request'/><category term='yii'/><category term='requires'/><category term='shared host'/><category term='db'/><title type='text'>Software Development Problems</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-6537236852293435487</id><published>2012-01-21T00:12:00.000-08:00</published><updated>2012-01-21T00:13:26.855-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web2py'/><category scheme='http://www.blogger.com/atom/ns#' term='requires'/><title type='text'>Web2py - remove the "delete" check box</title><content type='html'>In web2py, the form displayed&amp;nbsp; to update form containing an input file is like this :&lt;br /&gt;name + input text + "browse" button + [file + delete check box]&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;Problem &lt;/span&gt;: how can I remove this "delete" check box ? Because the image is required. If I check the value is not null, it returns false, because the value is empty.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;Solution &lt;/span&gt;: it's really easy. In your file db.py just add: &lt;span style="color: #38761d;"&gt;requires=IS_NOT_EMPTY&lt;/span&gt;&lt;br /&gt;&lt;pre class="python" name="code"&gt;&lt;br /&gt;Field('data', 'upload',requires=IS_NOT_EMPTY())&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And that's it ! &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-6537236852293435487?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/6537236852293435487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=6537236852293435487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6537236852293435487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6537236852293435487'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2012/01/web2py-remove-delete-check-box.html' title='Web2py - remove the &quot;delete&quot; check box'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-4533955268356022814</id><published>2011-11-08T16:46:00.000-08:00</published><updated>2011-11-08T16:50:51.191-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='foreign key'/><category scheme='http://www.blogger.com/atom/ns#' term='web2py'/><category scheme='http://www.blogger.com/atom/ns#' term='auth_user'/><title type='text'>web2py - add a foreign key to aut_user</title><content type='html'>I'm still doing my project in web2py, and I wanted to add a foreign key in my auth_user table.&lt;br /&gt;&lt;br /&gt;Problem: in the file models/db.py, you first declare the tables auth_* and then the other tables. So if you add your foreign key you'll get an error because the "foreign table" doesn't exist yet.&lt;br /&gt;Example :&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;&lt;br /&gt;auth = Auth(db)&lt;br /&gt;auth.settings.extra_fields['auth_user'] = [Field('myFK', db.foreignTable)]&lt;br /&gt;auth.define_tables() &lt;br /&gt;&lt;br /&gt;db.define_table('foreignTable',Field('name', length=45) )&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;So I tried to define my foreignTable before settings.extra_fields, but it didn't work either...&lt;br /&gt;&lt;br /&gt;Solution :&lt;br /&gt;The only solution I could find was the following :&lt;br /&gt;&lt;pre name="code" class="python"&gt;&lt;br /&gt;auth = Auth(db)&lt;br /&gt;auth.settings.extra_fields['auth_user'] = [Field('myFK', integer)]&lt;br /&gt;auth.define_tables() &lt;br /&gt;&lt;br /&gt;db.define_table('foreignTable', Field('name', length=45) )&lt;br /&gt;&lt;br /&gt;db.auth_user.myFK.requires = IS_IN_DB(db, 'foreignTable.id', '%(name)s', zero=T('choose one')) &lt;br /&gt;&lt;/pre&gt;At first I declare my column as an integer, and after I define my foreignTable. Then I link myFK to my foreignTable.&lt;br /&gt;&lt;br /&gt;And that's it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-4533955268356022814?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/4533955268356022814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=4533955268356022814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/4533955268356022814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/4533955268356022814'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/11/web2py-add-foreign-key-to-autuser.html' title='web2py - add a foreign key to aut_user'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-2391718476741879455</id><published>2011-10-13T20:13:00.000-07:00</published><updated>2011-11-08T16:51:06.641-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web2py'/><category scheme='http://www.blogger.com/atom/ns#' term='shared host'/><title type='text'>How to install web2py on a shared host</title><content type='html'>I'm working on a project with a friend using &lt;span style="color: #38761d;"&gt;web2py&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;i&gt;Free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applications. Written and programmable in Python.&lt;/i&gt;&lt;/blockquote&gt;&lt;a href="http://web2py.com/"&gt;Official website&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now that we are ready to upload our website, we were looking for good shared host. It was not easy to find a good one. Finally we choose Site5 because it supports Python and the server is in Montreal.&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #990000;"&gt;Problem: &lt;/div&gt;how to install web2py on a shared host ?&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #38761d;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;I could find this website : &lt;a href="http://www.web2pyslices.com/slices/take_slice/76"&gt;web2py on shared hosting&lt;/a&gt;.&lt;br /&gt;I followed the instructions from  "Installing web2py".&lt;br /&gt;&lt;br /&gt;When you do this, here is the url to see your app : &lt;br /&gt;&lt;i&gt;http://www.mydomain.com/web2py/mySuperApp/default/index&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;But what we wanted was something like that :&lt;br /&gt; &lt;i&gt;http://www.mydomain.com&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;So here are the modifications :&lt;br /&gt;- move all the web2py files directly to "public_html".&lt;br /&gt;Before : $HOME/public_html/web2py/web2py.py&lt;br /&gt;After : $HOME/public_html/web2py.py&lt;br /&gt;(it's just an example with web2py.py file, but you should move all the files!)&lt;br /&gt;&lt;br /&gt;- edit $HOME/public_html/routes.py, your file should just contains :&lt;br /&gt;&lt;pre class="python" name="code"&gt;routers = dict(&lt;br /&gt;    BASE = dict(&lt;br /&gt;  default_application='mySuperApp',&lt;br /&gt;  domains={'mydomain.com' : 'mySuperApp'},&lt;br /&gt;    ),&lt;br /&gt;)&amp;nbsp;&lt;/pre&gt;*routers is a new feature of web2py. &lt;a href="http://www.web2py.com/book/default/chapter/04#Parameter-Based-System"&gt;This parameter-based system first appeared in web2py version 1.92.1&lt;/a&gt;.&lt;br&gt;If you want to know which version of web2py you're using, just open the file $HOME/public_html/VERSION&lt;pre class="python" name="code"&gt;&amp;nbsp;&lt;/pre&gt;And that's it ! Now you can access your application simply by using : www.mydomain.com !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-2391718476741879455?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/2391718476741879455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=2391718476741879455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2391718476741879455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2391718476741879455'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/10/how-to-install-web2py-on-shared-host.html' title='How to install web2py on a shared host'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-2502312970151317862</id><published>2011-07-28T19:33:00.000-07:00</published><updated>2011-11-08T16:51:32.988-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='Syntax Highlighting'/><title type='text'>Adding Syntax Highlighting to Blogger</title><content type='html'>&lt;span style="color: rgb(255, 0, 0);"&gt;Problem&lt;/span&gt;&lt;br /&gt;How to add syntax highlighting to Blogger ?&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Solution&lt;/span&gt;&lt;br /&gt;I couldn't find a better way than this website :&lt;br /&gt;&lt;a href="http://heisencoder.net/2009/01/adding-syntax-highlighting-to-blogger.html"&gt;http://heisencoder.net/2009/01/adding-syntax-highlighting-to-blogger.html&lt;/a&gt;&lt;br /&gt;That helped me a lot !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-2502312970151317862?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/2502312970151317862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=2502312970151317862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2502312970151317862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2502312970151317862'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/07/adding-syntax-highlighting-to-blogger.html' title='Adding Syntax Highlighting to Blogger'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-8170599919465231487</id><published>2011-07-28T18:56:00.000-07:00</published><updated>2011-08-08T22:13:09.214-07:00</updated><title type='text'>Android Mini Collectibles</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;*2011-08-09 The figures that I'm talking about are fake! Please read the comments&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Today I'm not going to talk about software problem.&lt;br /&gt;I want to talk about the Android Mini figures. I bought some and I'm not totally satisfied by the finishing.&lt;br /&gt;Of course if you look at the official website (&lt;a href="http://www.deadzebra.com/dyzplastic/project-android-mini.php"&gt;Dyzplastic&lt;/a&gt;) it looks very nice. And I think 80% of the time it is nice.&lt;br /&gt;But here are some "bugs" that I could see.&lt;br /&gt;&lt;br /&gt;1) Head&lt;br /&gt;As you can see on the picture, there are 2 Reactor, but the one on the left has some strange stain on his head.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-yWYoG6o5idQ/TjIUEqEQQDI/AAAAAAAAEr0/AMoPdSghI4w/s1600/IMG_1968.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/-yWYoG6o5idQ/TjIUEqEQQDI/AAAAAAAAEr0/AMoPdSghI4w/s320/IMG_1968.JPG" alt="" id="BLOGGER_PHOTO_ID_5634588154038075442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;2) Paint&lt;br /&gt;This looks like the painting was not done correctly&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-B_GDZ17dAcA/TjIUESnS30I/AAAAAAAAErs/uKG37HaanS0/s1600/IMG_1967.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/-B_GDZ17dAcA/TjIUESnS30I/AAAAAAAAErs/uKG37HaanS0/s320/IMG_1967.JPG" alt="" id="BLOGGER_PHOTO_ID_5634588147742596930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;3) Dirty&lt;br /&gt;This other Albino looks dirty (not as white as the other one)&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-6o9FJI00HuI/TjIUETDuTXI/AAAAAAAAErk/eGNaJ36jJb4/s1600/IMG_1966.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://4.bp.blogspot.com/-6o9FJI00HuI/TjIUETDuTXI/AAAAAAAAErk/eGNaJ36jJb4/s320/IMG_1966.JPG" alt="" id="BLOGGER_PHOTO_ID_5634588147861835122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;4) Glue&lt;br /&gt;The box opened by itself from the bottom. Cheap quality glue...&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-lw9E-pYF9BY/TjIUEJJJZSI/AAAAAAAAErc/CJSMXc8il_Y/s1600/IMG_1965.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/-lw9E-pYF9BY/TjIUEJJJZSI/AAAAAAAAErc/CJSMXc8il_Y/s320/IMG_1965.JPG" alt="" id="BLOGGER_PHOTO_ID_5634588145200227618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, the price of these figures is cheap but I was expecting something better from Google.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-Szg4qxrhyiU/TjIU3t26iZI/AAAAAAAAEr8/ow1PmaHvloc/s1600/IMG_1878.jpg"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 240px;" src="http://1.bp.blogspot.com/-Szg4qxrhyiU/TjIU3t26iZI/AAAAAAAAEr8/ow1PmaHvloc/s320/IMG_1878.jpg" alt="" id="BLOGGER_PHOTO_ID_5634589031229196690" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-8170599919465231487?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/8170599919465231487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=8170599919465231487' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/8170599919465231487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/8170599919465231487'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/07/android-mini-collectibles.html' title='Android Mini Collectibles'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-yWYoG6o5idQ/TjIUEqEQQDI/AAAAAAAAEr0/AMoPdSghI4w/s72-c/IMG_1968.JPG' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-480944271097077991</id><published>2011-06-11T07:20:00.000-07:00</published><updated>2011-11-08T16:51:51.423-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='yii'/><category scheme='http://www.blogger.com/atom/ns#' term='right join'/><category scheme='http://www.blogger.com/atom/ns#' term='db'/><title type='text'>Yii - Right join</title><content type='html'>I wanted to learn something new so I decided to create a website using the framework Yii (&lt;a href="http://www.yiiframework.com/"&gt;more info&lt;/a&gt;). It's written in PHP and I think it's pretty cool.&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Yii comes with rich features: MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, etc. It can reduce your development time significantly.&lt;/blockquote&gt;&lt;br /&gt;But I'm having a problem that I can't solve right now.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Problem&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I have 2 tables :&lt;br /&gt;- &lt;strong class="bbc"&gt;tbl_prono&lt;/strong&gt; (id, game_id, ...) : there are &lt;span class="bbc_underline"&gt;2 rows&lt;/span&gt; of data&lt;br /&gt;- &lt;strong class="bbc"&gt;tbl_game&lt;/strong&gt; (id, date, team_id,...) : there are &lt;span style="font-weight: bold; color: rgb(51, 204, 0);" class="bbc_underline"&gt;3 rows&lt;/span&gt; of data&lt;br /&gt;&lt;br /&gt;In my model Prono I did the following relation:&lt;br /&gt;&lt;pre name="code" class="php"&gt;return array(&lt;br /&gt;'game'=&amp;gt;array(self::BELONGS_TO, 'Game', 'game_id'),&lt;br /&gt;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I created the following dataprovider in an action (PronoController):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="php"&gt;$dataProvider=new CActiveDataProvider('Prono', array(&lt;br /&gt;'criteria'=&amp;gt;array(&lt;br /&gt;    'with'=&amp;gt;array('game'=&amp;gt;array('joinType'=&amp;gt;'RIGHT JOIN')),  &lt;br /&gt;    // please note the RIGHT JOIN&lt;br /&gt;)));&lt;br /&gt;&lt;br /&gt;$this-&amp;gt;render('pronos',array('dataProvider'=&amp;gt;$dataProvider,));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;It generates a correct sql querry. But it returns&lt;span style="color: rgb(255, 0, 0);"&gt; 2 rows&lt;/span&gt; instead of 3 !&lt;br /&gt;It should return &lt;span style="color: rgb(51, 204, 0);"&gt;3 rows&lt;/span&gt; because I'm doing a "right join" and tbl_game has 3 rows.&lt;br /&gt;&lt;br /&gt;So, in my CgridView, I can see only 2 rows...&lt;br /&gt;&lt;br /&gt;I couldn't find a solution to display 3 rows....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-480944271097077991?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/480944271097077991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=480944271097077991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/480944271097077991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/480944271097077991'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/06/yii-right-join.html' title='Yii - Right join'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-1227797986212652543</id><published>2011-04-13T12:43:00.000-07:00</published><updated>2011-07-28T19:43:03.565-07:00</updated><title type='text'>ORA-01940 cannot drop user</title><content type='html'>&lt;span style="color: rgb(255, 0, 0);"&gt;Problem&lt;/span&gt;:&lt;br /&gt;Oracle 10g, I want to drop a user using this command :&lt;br /&gt;drop user alex cascade;&lt;br /&gt;&lt;br /&gt;But I have this error:&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;ORA-01940: cannot drop a user that is currently logged   in &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Solution&lt;/span&gt; :&lt;br /&gt;I checked on google and find this excellent Website : &lt;a href="http://www.dba-oracle.com/t_ora_01940_cannot_drop_user.htm"&gt;http://www.dba-oracle.com/t_ora_01940_cannot_drop_user.htm&lt;/a&gt;&lt;br /&gt;It said that you should do this :&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="sql"&gt;select s.sid, s.serial#, s.status, p.spid&lt;br /&gt;from v$session s, v$process p&lt;br /&gt;where s.username = 'myuser'&lt;br /&gt;and p.addr (+) = s.paddr;&lt;br /&gt;&lt;br /&gt;alter system kill session 'sid,serial#'; &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's correct but your username should be in &lt;span style="font-weight: bold; color: rgb(51, 204, 0);"&gt;uppercase&lt;/span&gt;!&lt;br /&gt;For example :&lt;br /&gt;&lt;pre name="code" class="sql"&gt;...&lt;br /&gt;where s.username = 'ALEX'&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;And that's it !&lt;br /&gt;&lt;br /&gt;You can do a quick test :&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;select username from v$session;&lt;br /&gt;select * from v$session where username = 'alex';&lt;br /&gt;select * from v$session where username = 'ALEX';&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-1227797986212652543?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/1227797986212652543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=1227797986212652543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/1227797986212652543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/1227797986212652543'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/04/ora-01940-cannot-drop-user.html' title='ORA-01940 cannot drop user'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-6676203040977535044</id><published>2011-04-13T06:27:00.000-07:00</published><updated>2011-04-13T06:33:34.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='path'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle 10g'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle'/><title type='text'>path oracle 10g</title><content type='html'>&lt;span style="color: rgb(255, 0, 0);"&gt;Problem&lt;/span&gt;:&lt;br /&gt;You can't execute commands such as "imp", "exp", "impdp" or "expdp" even though the path is setted in the environment variable.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Solution&lt;/span&gt;:&lt;br /&gt;In my case, there was a mistake. When I installed Oracle 10g, the path was automatically set to :&lt;br /&gt;PATH=C:\oraclexe\app\oracle\product\10.2.0\server\&lt;span style="color: rgb(255, 0, 0);"&gt;bin&lt;/span&gt;;C:\Windows\system32...&lt;br /&gt;&lt;br /&gt;But in reality it should be "BIN" (uppercase)!&lt;br /&gt;PATH=C:\oraclexe\app\oracle\product\10.2.0\server\&lt;span style="color: rgb(51, 204, 0);"&gt;BIN&lt;/span&gt;;C:\Windows\system32...&lt;br /&gt;&lt;br /&gt;After modifying the path, I could execute the command "impdp" anywhere from the command line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-6676203040977535044?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/6676203040977535044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=6676203040977535044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6676203040977535044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6676203040977535044'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/04/path-oracle-10g.html' title='path oracle 10g'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-6130419852447154699</id><published>2011-02-19T12:13:00.000-08:00</published><updated>2011-02-19T12:25:54.836-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sqlite'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>SQLiteDatabase created and never closed</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Problem&lt;/span&gt;&lt;br /&gt;When I'm using my application and I can see this error in the LogCat tab :&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;02-17 17:20:38.556: ERROR/Database(434): Leak found&lt;br /&gt;02-17 17:20:38.556: ERROR/Database(434): java.lang.IllegalStateException: /data/data/databases/xx.db SQLiteDatabase created and never closed&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 255, 51);"&gt;Solution&lt;/span&gt;&lt;br /&gt;Well, at first I thought it was because of my cursors. So I decided to check every cursor and close them all after having done with them.&lt;br /&gt;But I still got the same problem.&lt;br /&gt;&lt;br /&gt;So in fact, it's just that for every activity (onCreate) I was opening a connection to the database, but I never closed it.&lt;br /&gt;So the solution was to close the connection in each activity:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;@Override&lt;br /&gt;protected void onStop() {&lt;br /&gt; dbService.closeConnection();&lt;br /&gt; super.onStop();&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And that's it !&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-6130419852447154699?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/6130419852447154699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=6130419852447154699' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6130419852447154699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6130419852447154699'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/02/sqlitedatabase-created-and-never-closed.html' title='SQLiteDatabase created and never closed'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-4273719299672524370</id><published>2011-02-12T16:24:00.001-08:00</published><updated>2011-02-13T07:22:54.098-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android Insufficient storage</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Problem&lt;/span&gt;&lt;br /&gt;I was debugging my application using an android virtual device in Eclipse.&lt;br /&gt;When I run the application I could see this error in the console:&lt;br /&gt;&lt;br /&gt;[2011-02-12 19:22:25 - shiro] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE&lt;br /&gt;[2011-02-12 19:22:25 - shiro] Please check logcat output for more details.&lt;br /&gt;[2011-02-12 19:22:25 - shiro] Launch canceled!&lt;br /&gt;&lt;br /&gt;The size of my app is around 22Mo (there are a lot of pictures).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 204, 0);"&gt;Solution&lt;/span&gt;&lt;br /&gt;The first time I configured the android virtual device, I put only 2 or 3Mo for "&lt;span style="font-style: italic;"&gt;SD Card size&lt;/span&gt;".&lt;br /&gt;So I had no choice to create a new virtual device and put something like 30Mo.&lt;br /&gt;I ran my app for the first time. No problem. Then I wanted to run it again, and I got the same problem. I guess I could set the size of SD card to 100Mo, or in the virtual device, you can go to the &lt;span style="font-style: italic;"&gt;menu &gt; settings &gt; manage applications&lt;/span&gt;. Then choose the application and uninstall it. Then you can run your app again in debug mode from Eclipse.&lt;br /&gt;&lt;br /&gt;And that's it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-4273719299672524370?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/4273719299672524370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=4273719299672524370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/4273719299672524370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/4273719299672524370'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2011/02/android-insufficient-storage.html' title='Android Insufficient storage'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-1687524601205979102</id><published>2010-09-06T09:01:00.000-07:00</published><updated>2011-02-20T07:59:42.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: 2 view elements side by side</title><content type='html'>In my Android application, I wanted to display 2 spinners, side by side (50% of the width each).&lt;br /&gt;I didn't want to use width = "100px" for example. I wanted to be relative as much as possible.&lt;br /&gt;So here is what I did:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt; &lt;TableLayout android:layout_height="wrap_content" android:id="@+id/TableBtn" &lt;br /&gt;     android:layout_alignParentBottom="true" android:layout_width="fill_parent"&gt;&lt;br /&gt;  &lt;TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" &lt;br /&gt;      android:layout_height="wrap_content" android:weightSum="100"&gt;  &lt;br /&gt;   &lt;br /&gt;   &lt;Button&lt;br /&gt;   android:id="@+id/btnBack"&lt;br /&gt;   android:layout_height="wrap_content"&lt;br /&gt;   android:text="@string/back"&lt;br /&gt;   style="?button"&lt;br /&gt;   android:layout_weight="50"&gt;&lt;br /&gt;   &lt;/Button&gt; &lt;br /&gt;   &lt;br /&gt;   &lt;Button&lt;br /&gt;   android:id="@+id/btnMap"&lt;br /&gt;   android:layout_height="wrap_content"&lt;br /&gt;   android:text="@string/map"&lt;br /&gt;   style="?button"&lt;br /&gt;   android:layout_weight="50"&gt;&lt;br /&gt;   &lt;/Button&gt;&lt;br /&gt;   &lt;br /&gt;  &lt;/TableRow&gt;&lt;br /&gt; &lt;/TableLayout&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;***WARNING***&lt;/span&gt; XML tags are case sensitive. In my example above, I don't know why it's display in lower case... Please use &lt;span style="color: rgb(51, 255, 51);"&gt;TableLayout&lt;/span&gt;, &lt;span style="color: rgb(51, 255, 51);"&gt;TableRow&lt;/span&gt; and &lt;span style="color: rgb(51, 255, 51);"&gt;Button&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;I created a &lt;span style="font-weight: bold;"&gt;tableLayout&lt;/span&gt; with 1 &lt;span style="font-weight: bold;"&gt;tablerow&lt;/span&gt;. In each &lt;span style="font-weight: bold;"&gt;tablerow&lt;/span&gt; I added 2 &lt;span style="font-weight: bold;"&gt;buttons&lt;/span&gt;.&lt;br /&gt;I set the attribute &lt;span style="font-style: italic;"&gt;weightsum="100"&lt;/span&gt; to the row. And for each element of the row,I set &lt;span style="font-style: italic;"&gt;layout_weight="50"&lt;/span&gt;.&lt;br /&gt;And that's it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-1687524601205979102?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/1687524601205979102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=1687524601205979102' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/1687524601205979102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/1687524601205979102'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2010/09/android-2-view-elements-side-by-side.html' title='Android: 2 view elements side by side'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-6965626557858036349</id><published>2010-06-10T10:08:00.000-07:00</published><updated>2010-06-10T10:45:16.493-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='ror'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>ruby - windows7 - mysql</title><content type='html'>So I tried to install Ruby on Rails on my windows 7, but it was strange...&lt;br /&gt;First, I followed this tutorial -­&gt; &lt;a href="http://rubyonrails.org/download"&gt;http://rubyonrails.org/download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1) I installed Ruby on my C:\&lt;br /&gt;2) I installed Gem on my C:\&lt;br /&gt;3) I did &lt;span style="font-weight: bold;"&gt;gem install rails&lt;/span&gt;, but it says it needed other gem (activesupport, rack....)&lt;br /&gt;Strange... So I downloaded each missing gem and did &lt;span style="font-weight: bold;"&gt;gem install rack-1.0.0.gem &lt;/span&gt;&lt;br /&gt;Then I could install rails!&lt;br /&gt;4) I installed mySQL and NetBeans.&lt;br /&gt;&lt;br /&gt;but impossible to create table (db:migrate), and suddenly I have a blue screen...&lt;br /&gt;&lt;br /&gt;In fact there was 2 problems.&lt;br /&gt;1) The drive C:\ is kind of protected for writing (Vista &amp;amp; 7). I uninstalled Ruby and installed it on D:\.&lt;br /&gt;After that, when I did &lt;span style="font-weight: bold;"&gt;gem install rails&lt;/span&gt;, it worked like a charm.&lt;br /&gt;&lt;br /&gt;2) I couldn't create tables because mySQL5.1 doesn't like Ruby very well. So you should download a latest library. For more information, please see -­&gt; &lt;a href="http://forums.aptana.com/viewtopic.php?f=20&amp;amp;t=7563&amp;amp;p=27407&amp;amp;hilit=libmysql.dll#p27407"&gt;http://forums.aptana.com/viewtopic.php?f=20&amp;amp;t=7563&amp;amp;p=27407&amp;amp;hilit=libmysql.dll#p27407&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And that's it!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-6965626557858036349?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/6965626557858036349/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=6965626557858036349' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6965626557858036349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6965626557858036349'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2010/06/ruby-windows7-mysql.html' title='ruby - windows7 - mysql'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-2768330527992791087</id><published>2010-04-16T09:18:00.000-07:00</published><updated>2010-04-22T14:24:02.619-07:00</updated><title type='text'>VB .net avec win7 x64</title><content type='html'>So here is one thing that may help other people.&lt;br /&gt;I have &lt;span style="font-weight: bold;"&gt;Win7 x64&lt;/span&gt; and a VB application using Microsoft Access DB. My version of Office is 2007 32 bits.&lt;br /&gt;The VB application is old, and I have to make it works on VS2008. Before it used OLEDB4.0. When I started the program I had this error: &lt;span style="font-style: italic; color: rgb(255, 0, 0);"&gt;provider is not registered on locale machine&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;After searching on the Web, I found out that I needed to install new driver (or provider) from Microsoft Website: &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=C06B8369-60DD-4B64-A44B-84B371EDE16D&amp;amp;displaylang=en"&gt;2010 Office System Driver Beta: Data Connectivity Components&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And here is what I understood:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;download&lt;span style="color: rgb(51, 204, 0);"&gt; 14.0.4536.1000_AccessDatabaseEngine_none_ship_&lt;span style="color: rgb(255, 0, 0);"&gt;x86&lt;/span&gt;_en-us_exe\AccessDatabaseEngine.exe&lt;/span&gt; if your Office is 32bits.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;in the properties of your VB application, go to &lt;span style="font-weight: bold;"&gt;advanced compile options&lt;/span&gt;  and choose &lt;span style="font-weight: bold;"&gt;CPU target&lt;/span&gt;: &lt;span style="color: rgb(255, 0, 0);"&gt;x86&lt;/span&gt;&lt;/li&gt;&lt;li&gt;in the string connection, use: &lt;span style="font-style: italic;"&gt;gDB.ConnectionString = "Provider=Microsoft.ACE.OLEDB.&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-style: italic;"&gt;12.0&lt;/span&gt;&lt;span style="font-style: italic;"&gt;;Data Source=""MDITMain.mdb"";Persist Security Info=False"&lt;/span&gt;. Do not use "14.0". This is a bug, you can find more information on google&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you want to test your DB connection, check here: &lt;a href="http://blogs.msdn.com/farukcelik/archive/2007/12/31/udl-test-on-a-64-bit-machine.aspx"&gt;"UDL Test" on a 64 bit machine&lt;/a&gt;&lt;br /&gt;Here is what was inside my UDL file:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;[oledb]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;; Everything after this line is an OLE DB initstring&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\xxx\Documents\Visual Studio 2008\Projects\WindowsApplication1\WindowsApplication1\DBMain.mdb;Persist Security Info=False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's it for now&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-2768330527992791087?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/2768330527992791087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=2768330527992791087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2768330527992791087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2768330527992791087'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2010/04/vb-net-avec-win7-x64.html' title='VB .net avec win7 x64'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-4186377300546591878</id><published>2010-03-25T19:44:00.000-07:00</published><updated>2010-03-25T20:27:36.934-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='join'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android join tables</title><content type='html'>In my application, I have many tables and for a reason, I had to do a query using "&lt;span style="color: rgb(255, 0, 0);"&gt;join&lt;/span&gt;".&lt;br /&gt;I'll not explain how to access a database, but just so you know, check on Google for&lt;br /&gt;object &lt;a href="http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html"&gt;SQLiteDatabase&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So I was checking at the method &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;query &lt;/span&gt;, here is the information:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public Cursor   query  (String  table, String[]  columns, String  selection, String[]  selectionArgs, String  groupBy, String  having, String  orderBy)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Parameters&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(0, 153, 0);"&gt;table &lt;/span&gt;:&lt;span style="font-style: italic;"&gt;The table name to compile the query against.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Cursor cursor = myDataBase.query(&lt;br /&gt;    "myTableA" ,&lt;br /&gt;    new String[] { "_id", "name"},&lt;br /&gt;    null,null, null, null, null);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That's nice, but what if I want to a "join" ? I need more than 1 table in my query.&lt;br /&gt;Well, at beginning I found &lt;a href="http://developer.android.com/reference/android/database/CursorJoiner.html"&gt;CursorJoiner&lt;/a&gt;. Nice, I can join 2 cursors. But what if I have 3 or more joins to do ??&lt;br /&gt;&lt;br /&gt;In fact, the parameter "&lt;span style="font-style: italic; color: rgb(0, 153, 0);"&gt;table &lt;/span&gt;" (function query) can contains many tables (not just one).&lt;br /&gt;For example:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;Cursor cursor = myDataBase.query(&lt;br /&gt;    "myTableA a, myTableB b",&lt;br /&gt;    new String[] { "a._id", "a.name", "b._id", "b.name"},&lt;br /&gt;    "a.foreignKey = b._id",&lt;br /&gt;    null, null, null, null);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That was not difficult, but the definition of the parameter "&lt;span style="font-style: italic; color: rgb(0, 153, 0);"&gt;table &lt;/span&gt;" was not so good.&lt;br /&gt;&lt;br /&gt;Another solution would be to use &lt;a href="http://developer.android.com/reference/android/database/sqlite/SQLiteQueryBuilder.html"&gt;SQLiteQueryBuilder&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;SQLiteQueryBuilder myQuery = new SQLiteQueryBuilder();&lt;br /&gt;myQuery.setTables("myTableA, myTableB");&lt;br /&gt;myQuery.appendWhere("a.FK = b._id");&lt;br /&gt;Cursor cursor = myQuery.query(myDataBase, null, null, null, null, null, null);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-4186377300546591878?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/4186377300546591878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=4186377300546591878' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/4186377300546591878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/4186377300546591878'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2010/03/android-join-tables.html' title='Android join tables'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-8429137968324301530</id><published>2010-03-15T08:58:00.000-07:00</published><updated>2010-03-25T19:38:51.309-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xml layout'/><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: add xml layout dynamically</title><content type='html'>For the application I'm creating, the user can use "search" function. This function will return &lt;span style="font-weight:bold;"&gt;a list&lt;/span&gt; of castles.&lt;br /&gt;Here is the XML to display one result (/res/layout/element_result.xml). There is 1 button, 2 text fields and 1 image : &lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&lt;RelativeLayout&lt;br /&gt;android:id="@+id/layoutElement"&lt;br /&gt;android:layout_width="fill_parent"&lt;br /&gt;android:layout_height="fill_parent"&lt;br /&gt;xmlns:android="http://schemas.android.com/apk/res/android"&lt;br /&gt;&gt;&lt;br /&gt;      &lt;Button&lt;br /&gt;       android:id="@+id/btnGo"&lt;br /&gt;       android:layout_width="wrap_content"&lt;br /&gt;       android:layout_height="wrap_content"&lt;br /&gt;       android:text="@string/go"&lt;br /&gt;       android:layout_alignParentTop="true"&lt;br /&gt;       android:layout_alignParentRight="true"&lt;br /&gt;      &gt;&lt;br /&gt;      &lt;/Button&gt;&lt;br /&gt;      &lt;TextView&lt;br /&gt;       android:id="@+id/description"&lt;br /&gt;       android:layout_width="wrap_content"&lt;br /&gt;       android:layout_height="wrap_content"&lt;br /&gt;       android:layout_below="@+id/presentation"&lt;br /&gt;       android:layout_alignLeft="@+id/presentation"&lt;br /&gt;      &gt;&lt;br /&gt;      &lt;/TextView&gt;&lt;br /&gt;      &lt;TextView&lt;br /&gt;       android:id="@+id/presentation"&lt;br /&gt;       android:layout_width="wrap_content"&lt;br /&gt;       android:layout_height="wrap_content"&lt;br /&gt;       android:layout_alignParentTop="true"&lt;br /&gt;       android:layout_toRightOf="@+id/image"&lt;br /&gt;      &gt;&lt;br /&gt;      &lt;/TextView&gt;&lt;br /&gt;      &lt;ImageView&lt;br /&gt;       android:id="@+id/image"&lt;br /&gt;       android:layout_width="wrap_content"&lt;br /&gt;       android:layout_height="wrap_content"&lt;br /&gt;       android:layout_alignParentTop="true"&lt;br /&gt;       android:layout_alignParentLeft="true"&lt;br /&gt;      &gt;&lt;br /&gt;      &lt;/ImageView&gt;&lt;br /&gt;&lt;/RelativeLayout&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Then, I created a XML layout (/res/layout/results.xml) who will contain the list of results. That means, there will be&lt;span style="font-weight:bold;"&gt; many times&lt;/span&gt; element_result.xml inside results.xml. There is a scrollView and a table layout.&lt;br /&gt;&lt;pre name="code" class="xml"&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;br /&gt;&lt;RelativeLayout&lt;br /&gt;android:id="@+id/widget28"&lt;br /&gt;android:layout_width="fill_parent"&lt;br /&gt;android:layout_height="fill_parent"&lt;br /&gt;xmlns:android="http://schemas.android.com/apk/res/android"&lt;br /&gt;&gt;&lt;br /&gt; &lt;ScrollView&lt;br /&gt; android:id="@+id/scrollResult"&lt;br /&gt; android:layout_width="fill_parent"&lt;br /&gt; android:layout_height="wrap_content"&lt;br /&gt; android:scrollbars="horizontal"&lt;br /&gt; android:layout_above="@+id/btnBack"&lt;br /&gt; android:layout_alignParentLeft="true"&lt;br /&gt; &gt;&lt;br /&gt;  &lt;TableLayout xmlns:android="http://schemas.android.com/apk/res/android"&lt;br /&gt;      android:id="@+id/myTableLayout"&lt;br /&gt;      android:layout_width="fill_parent"&lt;br /&gt;      android:layout_height="fill_parent"&lt;br /&gt;      &gt;  &lt;br /&gt;  &lt;/TableLayout&gt;&lt;br /&gt; &lt;/ScrollView&gt;&lt;br /&gt; &lt;br /&gt; &lt;Button&lt;br /&gt; android:id="@+id/btnBack"&lt;br /&gt; android:layout_width="fill_parent"&lt;br /&gt; android:layout_height="wrap_content"&lt;br /&gt; android:text="@string/back"&lt;br /&gt; android:layout_alignParentBottom="true"&lt;br /&gt; android:layout_alignParentLeft="true"&lt;br /&gt; &gt;&lt;br /&gt; &lt;/Button&gt;&lt;br /&gt;&lt;/RelativeLayout&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Ok, our views are ready. Now how to use them in Java. I read this blog, and that helps me a lot : &lt;a href="http://stackoverflow.com/questions/2259647/android-layoutwidth-being-disregarded-by-cascaded-use-of-layoutinflater"&gt;Android LayoutWidth being disregarded by cascaded use of LayoutInflater&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here is my activity file:&lt;br /&gt;&lt;pre name="code" class="java"&gt;&lt;br /&gt;public class ResultActivity extends Activity{&lt;br /&gt;&lt;br /&gt; public void onCreate(Bundle savedInstanceState) { &lt;br /&gt;        super.onCreate(savedInstanceState);&lt;br /&gt;        // "results" is for the xml file "results.xml"&lt;br /&gt;        setContentView(R.layout.results);&lt;br /&gt;  &lt;br /&gt;        addElementResult();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void addElementResult() {&lt;br /&gt;        // "myTableLayout" is the id of the element in results.xml&lt;br /&gt;        TableLayout tl = (TableLayout)findViewById(R.id.myTableLayout);&lt;br /&gt;        // we will use service from inflater &lt;br /&gt;        LayoutInflater inflater = (LayoutInflater)getSystemService(LAYOUT_INFLATER_SERVICE);&lt;br /&gt;  &lt;br /&gt;        //doing a loop to add many times the same xml&lt;br /&gt;        for(int i = 0; i &lt; 17; i++) {&lt;br /&gt;                 // "element_result" is the name of the xml file "element_result.xml". &lt;br /&gt;                 // Create the itemView who will be added.&lt;br /&gt;                 // itemView = element_result.xml&lt;br /&gt;                 View itemView = inflater.inflate(R.layout.element_result, null);&lt;br /&gt;                 // get the textView, and set the text to something&lt;br /&gt;                 TextView t1 = (TextView) itemView.findViewById(R.id.presentation); &lt;br /&gt;                 t1.setText("something" + i);&lt;br /&gt;   &lt;br /&gt;                 TextView t2 = (TextView) itemView.findViewById(R.id.description); &lt;br /&gt;                 t2.setText("oh oh oh" + i);&lt;br /&gt;&lt;br /&gt;                 //add the itemView&lt;br /&gt;                 tl.addView(itemView, new TableLayout.LayoutParams(&lt;br /&gt;                   LayoutParams.FILL_PARENT, &lt;br /&gt;                   LayoutParams.WRAP_CONTENT));&lt;br /&gt;        }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So the result will look like that :&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_EOmWGX15WGU/S55f3sMBD0I/AAAAAAAAEbU/uxCtzpuHnng/s1600-h/hello_world_5.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 246px;" src="http://4.bp.blogspot.com/_EOmWGX15WGU/S55f3sMBD0I/AAAAAAAAEbU/uxCtzpuHnng/s400/hello_world_5.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5448898009523883842" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note: in results.xml, I created a scrollView because if there is 20 results, the user should be able to scroll down to see all the results.&lt;br /&gt;Note: I used "tableLayout" to be able to add results one under another one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-8429137968324301530?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/8429137968324301530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=8429137968324301530' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/8429137968324301530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/8429137968324301530'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2010/03/android-add-xml-layout-dynamically.html' title='Android: add xml layout dynamically'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_EOmWGX15WGU/S55f3sMBD0I/AAAAAAAAEbU/uxCtzpuHnng/s72-c/hello_world_5.png' height='72' width='72'/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-1875011849713275311</id><published>2010-03-09T08:27:00.000-08:00</published><updated>2010-03-25T19:39:04.937-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='android'/><title type='text'>Android: main.out.xml error</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.ghacks.net/wp-content/uploads/2009/06/android.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 180px; height: 180px;" src="http://www.ghacks.net/wp-content/uploads/2009/06/android.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;So it's been long time, I'm not doing Ruby anymore.&lt;br /&gt;Now, for myself, I decided to create an &lt;span style="color: rgb(51, 204, 0);"&gt;Android application&lt;/span&gt;. At first, I wanted to create an Iphone application, but only people having a Mac can use the SDK... So let's use the Android SDK!&lt;br /&gt;After doing the tutorial &lt;span style="font-style: italic;"&gt;Hello World&lt;/span&gt; (see &lt;a href="http://developer.android.com/guide/tutorials/hello-world.html"&gt;here&lt;/a&gt;), I started doing my application. And after a few minutes I had an error...&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;&lt;br /&gt;[2010-03-09 11:32:04 - shiro]Error in an XML file: aborting build.&lt;br /&gt;[2010-03-09 11:32:05 - shiro]res\layout\main.xml:0: error: Resource entry main is already defined.&lt;br /&gt;[2010-03-09 11:32:05 - shiro]res\layout\main.out.xml:0: Originally defined here.&lt;br /&gt;[2010-03-09 11:32:05 - shiro]D:\workspace\shiro\res\layout\main.out.xml:1: error: Error parsing XML: no element found&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For information, I'm using Eclipse. Why when I click on "run" I have this error ? Why Eclipse is creating a new file "main.out.xml" and then complain about it ? My application is really small, I didn't write any line of code in my main activity...&lt;br /&gt;&lt;br /&gt;Well the error is simple, and it's not related to the application directly. It's a problem with Eclipse. To run the application, I must select the project (root folder) in the left column and then I can click on "run".&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOmWGX15WGU/S5Z8BDhszzI/AAAAAAAAEag/JHVgV7tX4tA/s1600-h/out.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 164px;" src="http://1.bp.blogspot.com/_EOmWGX15WGU/S5Z8BDhszzI/AAAAAAAAEag/JHVgV7tX4tA/s320/out.png" alt="" id="BLOGGER_PHOTO_ID_5446677156919562034" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I had this error, because I was running the "main.xml". So Eclipse could not do anything with that.&lt;br /&gt;Here is a noobie error, but it was difficult to find the solution...&lt;br /&gt;I guess the next post will also concern Android application. It's always fun to discover new things :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-1875011849713275311?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/1875011849713275311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=1875011849713275311' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/1875011849713275311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/1875011849713275311'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2010/03/android-mainoutxml-error.html' title='Android: main.out.xml error'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_EOmWGX15WGU/S5Z8BDhszzI/AAAAAAAAEag/JHVgV7tX4tA/s72-c/out.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-7652159673638855032</id><published>2009-11-03T12:20:00.001-08:00</published><updated>2010-03-25T19:39:24.298-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windows7'/><category scheme='http://www.blogger.com/atom/ns#' term='tomcat'/><title type='text'>Install Tomcat on Windows 7</title><content type='html'>I decided to install Tomcat (6.0) on Windows 7 for a project.&lt;br /&gt;&lt;br /&gt;I downloaded "apache-tomcat-6.0.20.exe" directly from Tomcat website.&lt;br /&gt;&lt;br /&gt;I installed it on "d:\".&lt;br /&gt;&lt;br /&gt;Then I started it, but nothing happen, it was always at "stopped".&lt;br /&gt;I check the log file, and I could see "[error] Failed creating java C:\Program Files\Java\jre6\bin\client\jvm.dll"&lt;br /&gt;&lt;br /&gt;Copy the file msvcr71.dll (C:\Program Files\Java\jre6\bin\msvcr71.dll) to D:\Tomcat 6.0\bin&lt;br /&gt;&lt;br /&gt;This website help me to find this solution:&lt;a href="http://mandown.co.nz/development/getting-tomcat-apache-to-run-on-microsoft-windows-7/"&gt; http://mandown.co.nz/development/getting-tomcat-apache-to-run-on-microsoft-windows-7/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If this didn't help you, you can have a look here: &lt;a href="http://www.mkyong.com/tomcat/tomcat-error-prunsrvc-failed-creating-java-jvmdll/"&gt;http://www.mkyong.com/tomcat/tomcat-error-prunsrvc-failed-creating-java-jvmdll/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-7652159673638855032?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/7652159673638855032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=7652159673638855032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/7652159673638855032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/7652159673638855032'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2009/11/install-tomcat-on-windows-7.html' title='Install Tomcat on Windows 7'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-6067253612209429439</id><published>2009-07-29T22:38:00.000-07:00</published><updated>2009-07-29T23:19:40.158-07:00</updated><title type='text'>update rubygems</title><content type='html'>I tried to update rubygems on CentOs but could not.&lt;br /&gt;First, I asked help to my friend Google and found this site: &lt;a href="http://rubygems.org/read/chapter/3"&gt;http://rubygems.org/read/chapter/3&lt;/a&gt;&lt;br /&gt;It worked well on one computer but on another one I had this error:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:&lt;br /&gt;in 'report_activate_error': could not find RubyGem session (&gt;= 0) (Gem::LoadError)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I tried many things until I realized that "session" is actually a gem!&lt;br /&gt;So let's do:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;gem install session&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Another error "could not find RubyGem hoe-seattlerb..."&lt;br /&gt;So let's do:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;gem install hoe-seattlerb&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Same error with "hoe". But this one is tricky, because hoe need rubygems &gt; 1.3.1, but to install rubygems 1.3.5 we need hoe!&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;update_rubygems&lt;br /&gt;/usr/lib/ruby/site_ruby/1.8/rubygems.rb:578:&lt;br /&gt;in `report_activate_error’: Could not find RubyGem hoe (&gt;= 2.3.0) (Gem::LoadError)&lt;br /&gt;&lt;br /&gt;gem install hoe&lt;br /&gt;ERROR:  Error installing hoe:&lt;br /&gt;      hoe requires RubyGems version &gt;= 1.3.1&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I tried to do (wihout success):&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;gem install rubygems-update #by default, it installs the latest version which is 1.3.5 now&lt;br /&gt;update_rubygems&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The problem is in version 1.3.5! First remove all rubygems:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;gem uninstall rubygems-update&lt;br /&gt;&lt;br /&gt;#Then&lt;br /&gt;gem install rubygems-update -v 1.3.4&lt;br /&gt;update_rubygems&lt;br /&gt;&lt;br /&gt;#Then you can install hoe&lt;br /&gt;gem install hoe&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I lost so many hours for this stupid mistake...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-6067253612209429439?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/6067253612209429439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=6067253612209429439' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6067253612209429439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/6067253612209429439'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2009/07/update-rubygems.html' title='update rubygems'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-2481204358199070599</id><published>2009-06-25T00:31:00.000-07:00</published><updated>2009-06-25T00:47:30.580-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='sqlserver'/><title type='text'>insert date in sqlserver</title><content type='html'>Recently I saw a strange behavior, and I don't know why. When I create a new object model and set its attributes, if I set the date, then in the DB it shows me the day before.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;&lt;br /&gt;abc = ABC.find(:first, :conditions =&gt; "id = 1")&lt;br /&gt;puts abc["date"] # 2009-06-25&lt;br /&gt;&lt;br /&gt;#let's create a new object 'model' and set the same date as ABC&lt;br /&gt;model = Model.new&lt;br /&gt;model.date = abc["date"]&lt;br /&gt;model.name = "a name"&lt;br /&gt;model.save!&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After, in Sqlserver management studio:&lt;br /&gt;&lt;pre name="code" class="sql"&gt;&lt;br /&gt;select * from model;&lt;br /&gt;&lt;br /&gt;--date = 2009-06-24 15:00:00:000&lt;br /&gt;--name = "a name"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So why it's not the 25th?? Is there a bad configuration somewhere? Well, I don't know. When I have more time, I'll try to understand why, but for now, to avoid this problem, I'm doing the following:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;&lt;br /&gt;model.date = "#{abc["date"] }"&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-2481204358199070599?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/2481204358199070599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=2481204358199070599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2481204358199070599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2481204358199070599'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2009/06/insert-date-in-sqlserver.html' title='insert date in sqlserver'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-7985189125863344483</id><published>2009-06-17T22:45:00.000-07:00</published><updated>2009-06-18T00:05:17.161-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax request'/><category scheme='http://www.blogger.com/atom/ns#' term='asynchrone'/><title type='text'>asynchrone Ajax query problem</title><content type='html'>Can you find what's wrong in this code:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function example(event){&lt;br /&gt;   for(i = 1; i &lt; array.length; i++){&lt;br /&gt;      new Ajax.Request(url, {&lt;br /&gt;         method: 'put',&lt;br /&gt;         postBody: someParam,&lt;br /&gt;         onSuccess: function(transport){&lt;br /&gt;            $(array[i]).innerHTML = "updated!";&lt;br /&gt;         },&lt;br /&gt;         onFailure: function(transport){&lt;br /&gt;            //do something&lt;br /&gt;         }&lt;br /&gt;      });&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Description: let's say the array elements are all IDs of some tags "div". There is a loop, for each element an ajax request is send.&lt;br /&gt;Hint: The "a" of Ajax stands for "asynchronous".&lt;br /&gt;So where is the problem?&lt;br /&gt;&lt;br /&gt;The problem is here:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;$(array[i]).innerHTML = "updated!";&lt;/pre&gt;&lt;br /&gt;Why? Because we use "i"! Let's say the array has 10 elements. First (asynchronous) request is send  (i=1), so our controller is working, and at the same time the loop continue, so now i=2, another Ajax request is send and so on. Now i=4 and... oh! the controller just finished is work for the first request, so the function onSucces is called, and then $(array[i]).innerHTML = "updated!". But "i" is 4 now! It's not 1 ! So we write "updated!" in the wrong div.&lt;br /&gt;&lt;br /&gt;Here is my solution (maybe not the best one), I send "i" as a parameter to the controller and the controller return it.&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function example(event){&lt;br /&gt;   for(i = 1; i &lt; array.length; i++){&lt;br /&gt;      new Ajax.Request(url, {&lt;br /&gt;         method: 'put',&lt;br /&gt;         postBody: i, //send "i"&lt;br /&gt;         onSuccess: function(transport){&lt;br /&gt;            //get the response&lt;br /&gt;            original_i = transport.responseJSON;&lt;br /&gt;&lt;br /&gt;            $(array[original_i]).innerHTML = "updated!";&lt;br /&gt;         },&lt;br /&gt;         onFailure: function(transport){&lt;br /&gt;            //do something&lt;br /&gt;         }&lt;br /&gt;     });&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Insuide the controller:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;&lt;br /&gt;def my_controller&lt;br /&gt;   post_data = request.raw_post #here we received "i"&lt;br /&gt;   ....&lt;br /&gt;   ....&lt;br /&gt;   ....&lt;br /&gt;   render :text =&gt; post_data #and we return it&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-7985189125863344483?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/7985189125863344483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=7985189125863344483' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/7985189125863344483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/7985189125863344483'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2009/06/asynchrone-ajax-query-problem.html' title='asynchrone Ajax query problem'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-7237525637024838637</id><published>2009-06-16T01:33:00.000-07:00</published><updated>2009-06-18T00:09:46.808-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='base64'/><category scheme='http://www.blogger.com/atom/ns#' term='open flash chart'/><category scheme='http://www.blogger.com/atom/ns#' term='IE6'/><title type='text'>Open flash chart save image (ruby+IE6)</title><content type='html'>Presentation: one of my tasks was to implement a feature to print a flash chart. To generate the chart, I'm using &lt;a href="http://teethgrinder.co.uk/open-flash-chart-2/"&gt;Open Flash chart 2&lt;/a&gt;, great open source, free, library to draw chart dynamically. I downloaded it from &lt;a href="http://pullmonkey.com/projects/open_flash_chart"&gt;PullMonkey website&lt;/a&gt; (because I'm working on Ruby).&lt;br /&gt;&lt;br /&gt;Now let's try to print the chart. After the chart is generated (can't print if no render), we can get the image as binary:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;document.getElementById('divfMyChart').get_img_binary()&lt;br /&gt;//return a base 64 image, something like this: R0lGODlhFGHGGHRGH..... (very long string)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;More info about &lt;a href="http://en.wikipedia.org/wiki/Base64"&gt;base64&lt;/a&gt;. And here is an example of a base64 image:&lt;br /&gt;&lt;pre name="code" class="html"&gt;&lt;br /&gt;&lt;img src="data:image/png;base64,R0lGODlhFGH2.." /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;If your web site support only FireFox and IE8 (and higher) that's perfect, because there is no problem! Here is the code, it will create a new window with the image:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;img_src = document.getElementById('divOfMyChart').get_img_binary();&lt;br /&gt;img_tag = "&lt;img src="http://www.blogger.com/%22+image_src+%22" /&gt;";&lt;br /&gt;var img_win = window.open("", null);&lt;br /&gt;with(img_win.document) {&lt;br /&gt;write("&lt;t-itle&gt;my image&lt;/t-itle&gt;" + img_tag + ""); } //change "t-itle" for "title"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You can see a more complete examples &lt;a href="http://teethgrinder.co.uk/open-flash-chart-2/save-as-image-menu.php"&gt;here&lt;/a&gt;.&lt;br /&gt;Now if you open your web page with IE6 or IE7 &lt;span style="color: rgb(255, 0, 0);"&gt;it won't work!&lt;/span&gt; Why? Now begin the most interesting part of this post.&lt;br /&gt;Well, it's not working because IE6 and IE7 don't support base64 format. It's not even a problem of your server, so you can not do anything except to change your source code.&lt;br /&gt;I could see there is a library in PHP who can create an image from base64 image  (base64_encode($string);).&lt;br /&gt;So is there a similar library in Ruby? Yes there is! It's &lt;a href="http://rmagick.rubyforge.org/"&gt;RMagick&lt;/a&gt;. &lt;span style="font-style: italic;"&gt;An interface to the ImageMagick and GraphicsMagick image processing libraries. Supports over 100 image formats, including GIF, JPEG, PNG.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Download &lt;span style="font-weight: bold;"&gt;RMagick &lt;/span&gt;(current version 2.9.2): &lt;a href="http://rubyforge.org/projects/rmagick/"&gt;http://rubyforge.org/projects/rmagick/&lt;/a&gt;&lt;br /&gt;If you're using Windows, download "rmagick-win32"!&lt;br /&gt;Extract the files from the archive, and read &lt;span style="font-weight: bold;"&gt;README.html&lt;/span&gt;. Please follow the "Installation instructions". It's easy to install. RMagick requires &lt;span style="font-weight: bold;"&gt;ImageMagick &lt;/span&gt;or &lt;span style="font-weight: bold;"&gt;GraphicsMagick&lt;/span&gt;, so installed one (only one!). You can find the installation files in RMagick website.&lt;br /&gt;&lt;br /&gt;And we need something else, the &lt;span style="font-weight: bold;"&gt;PNG library&lt;/span&gt;: &lt;a href="http://www.libpng.org/pub/png/pngcode.html"&gt;http://www.libpng.org/pub/png/pngcode.html&lt;/a&gt;&lt;br /&gt;PNG library is divided into 2 libraries : &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;zlib&lt;/span&gt;:&lt;span style="font-style: italic;"&gt;Zlib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system.&lt;/span&gt;&lt;br /&gt;Download "zlib compiled DLL, version 1.2.3": &lt;a href="http://www.zlib.net/"&gt;http://www.zlib.net/&lt;/a&gt; Extract the files and read &lt;span style="font-weight: bold;"&gt;USAGE.txt&lt;/span&gt;. It's easy to install: &lt;span style="font-style: italic;"&gt;copy ZLIB1.DLL to the SYSTEM or the SYSTEM32 directory&lt;/span&gt;.&lt;span style="font-style: italic;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;libpng:&lt;/span&gt;&lt;span style="font-style: italic;"&gt;This is an open source project to develop and maintain the reference library for use in applications that read, create, and manipulate PNG (Portable Network Graphics) raster image files. &lt;/span&gt;&lt;br /&gt;download "libpng-1.2.37-setup.exe": &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=23617&amp;amp;package_id=16183"&gt;http://sourceforge.net/project/showfiles.php?group_id=23617&amp;amp;package_id=16183&lt;/a&gt; and install it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So now you have everything!&lt;br /&gt;We create a JS function who will send an ajax request (with the binary image) to the controller. The controller will create an image (jpg) on the server and return the path to this image. Then the JS function will create a popup to show the image.&lt;br /&gt;In my view:&lt;br /&gt;&lt;pre name="code" class="javascript"&gt;&lt;br /&gt;function printChart(event){&lt;br /&gt;new Ajax.Request(urlForPrintImage, {&lt;br /&gt;        method: 'put',&lt;br /&gt;        postBody: document.getElementById('divOfMyChart').get_img_binary(),&lt;br /&gt;        onSuccess: function(transport){&lt;br /&gt;            image_path = transport.responseText;&lt;br /&gt;&lt;br /&gt;            img = "&lt;img src="http://www.blogger.com/+image_path+" /&gt;";&lt;br /&gt;            var img_win = window.open("", null);&lt;br /&gt;            with(img_win.document) {&lt;br /&gt;                write("&lt;t-itle&gt;My image&lt;/t-itle&gt;" + img + ""); } //change "t-itle" for "title"&lt;br /&gt;        },&lt;br /&gt;        onFailure: function(transport){}&lt;br /&gt;    });&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In my controller:&lt;br /&gt;&lt;pre name="code" class="ruby"&gt;&lt;br /&gt;require 'base64'&lt;br /&gt;require 'rubygems'&lt;br /&gt;require 'RMagick'&lt;br /&gt;&lt;br /&gt;def print_image&lt;br /&gt;        #get the parameter sent by ajax query&lt;br /&gt;        png_data = request.raw_post&lt;br /&gt;&lt;br /&gt;        #file name and path for the image file&lt;br /&gt;        #(you have to change this depending of your routes)&lt;br /&gt;        file_name = "myPath/chart.jpg"&lt;br /&gt;&lt;br /&gt;        #decode the binary image with Base64&lt;br /&gt;        blob = Base64.decode64(png_data)&lt;br /&gt;&lt;br /&gt;        #use RMagick to create an image from the blob&lt;br /&gt;        image = Magick::Image.from_blob(blob).first&lt;br /&gt;        #save the file on the server&lt;br /&gt;        image.write(file_name){  self.quality = 100    }&lt;br /&gt;&lt;br /&gt;        #return the file path&lt;br /&gt;        render :text =&gt; file_name&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-7237525637024838637?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/7237525637024838637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=7237525637024838637' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/7237525637024838637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/7237525637024838637'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2009/06/open-flash-chart-save-image-rubyie6.html' title='Open flash chart save image (ruby+IE6)'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1672873697087215452.post-2430637217082420803</id><published>2008-10-29T06:18:00.000-07:00</published><updated>2008-10-29T06:24:51.301-07:00</updated><title type='text'>Why?</title><content type='html'>In this blog I'll talk about the problems I had to face during my work.&lt;br /&gt;I'm working for the industry of software development since 2005 as same time as I'm studying software engineering in Canada. I worked for 4 different companies.&lt;br /&gt;First one was as an intern, only for 4 months. It's a small company, around 10 employees, I did some JSP, Java and Javascript.&lt;br /&gt;My second experience was in a department of a university,  we were a group of 12 peoples. I did mainly Java for 2 years as intern, part time and full time.&lt;br /&gt;My third experience was in a consulting company, around 43 employees. I did some C++, C# and Biztalk.&lt;br /&gt;Finally, my current work (as intern) is in Tokyo. We are 9 full time workers plus some part time students. I'm coding in Ruby (and use the framework Rails).&lt;br /&gt;&lt;br /&gt;The purpose of this blog is to expose all the problems I faced during my work and the solution.&lt;br /&gt;I'm doing this blog because many time I looked for a solution on other blogs, and that was useful! So maybe, who knows, my blog could be useful to someone.&lt;br /&gt;&lt;br /&gt;So currently, all the post will concern Ruby and Rails.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_EOmWGX15WGU/SQhjhASi6XI/AAAAAAAAAxI/SpH2VPYnSLg/s1600-h/ruby_on_rails_logo.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 168px; height: 200px;" src="http://1.bp.blogspot.com/_EOmWGX15WGU/SQhjhASi6XI/AAAAAAAAAxI/SpH2VPYnSLg/s200/ruby_on_rails_logo.jpg" alt="" id="BLOGGER_PHOTO_ID_5262565583247042930" border="0" /&gt;&lt;/a&gt;Link for Ruby : &lt;a href="http://www.ruby-lang.org/en/"&gt;http://www.ruby-lang.org/en/&lt;/a&gt;&lt;br /&gt;Link for RoR : &lt;a href="www.rubyonrails.org/"&gt;&lt;cite&gt;http:&lt;/cite&gt;&lt;/a&gt;&lt;a href="http://www.ruby-lang.org/en/"&gt;//&lt;/a&gt;&lt;a href="www.rubyonrails.org/"&gt;&lt;cite&gt;www.rubyonrails.org/&lt;/cite&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="www.rubyonrails.org/"&gt;&lt;cite&gt;&lt;/cite&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1672873697087215452-2430637217082420803?l=soft-dev-pro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://soft-dev-pro.blogspot.com/feeds/2430637217082420803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1672873697087215452&amp;postID=2430637217082420803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2430637217082420803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1672873697087215452/posts/default/2430637217082420803'/><link rel='alternate' type='text/html' href='http://soft-dev-pro.blogspot.com/2008/10/why.html' title='Why?'/><author><name>Dalf</name><uri>http://www.blogger.com/profile/06013390533870550906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_EOmWGX15WGU/SikqyIHr6MI/AAAAAAAACSg/A1QtC-DbOnk/S220/IMG_7285.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_EOmWGX15WGU/SQhjhASi6XI/AAAAAAAAAxI/SpH2VPYnSLg/s72-c/ruby_on_rails_logo.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
