Problem
How to add syntax highlighting to Blogger ?
Solution
I couldn't find a better way than this website :
http://heisencoder.net/2009/01/adding-syntax-highlighting-to-blogger.html
That helped me a lot !
Friday, July 29, 2011
Android Mini Collectibles
*2011-08-09 The figures that I'm talking about are fake! Please read the comments
Today I'm not going to talk about software problem.
I want to talk about the Android Mini figures. I bought some and I'm not totally satisfied by the finishing.
Of course if you look at the official website (Dyzplastic) it looks very nice. And I think 80% of the time it is nice.
But here are some "bugs" that I could see.
1) Head
As you can see on the picture, there are 2 Reactor, but the one on the left has some strange stain on his head.
2) Paint
This looks like the painting was not done correctly
3) Dirty
This other Albino looks dirty (not as white as the other one)
4) Glue
The box opened by itself from the bottom. Cheap quality glue...
Well, the price of these figures is cheap but I was expecting something better from Google.
Today I'm not going to talk about software problem.
I want to talk about the Android Mini figures. I bought some and I'm not totally satisfied by the finishing.
Of course if you look at the official website (Dyzplastic) it looks very nice. And I think 80% of the time it is nice.
But here are some "bugs" that I could see.
1) Head
As you can see on the picture, there are 2 Reactor, but the one on the left has some strange stain on his head.
2) Paint
This looks like the painting was not done correctly
3) Dirty
This other Albino looks dirty (not as white as the other one)
4) Glue
The box opened by itself from the bottom. Cheap quality glue...
Well, the price of these figures is cheap but I was expecting something better from Google.

Saturday, June 11, 2011
Yii - Right join
I wanted to learn something new so I decided to create a website using the framework Yii (more info). It's written in PHP and I think it's pretty cool.
But I'm having a problem that I can't solve right now.
Problem
I have 2 tables :
- tbl_prono (id, game_id, ...) : there are 2 rows of data
- tbl_game (id, date, team_id,...) : there are 3 rows of data
In my model Prono I did the following relation:
I created the following dataprovider in an action (PronoController):
It generates a correct sql querry. But it returns 2 rows instead of 3 !
It should return 3 rows because I'm doing a "right join" and tbl_game has 3 rows.
So, in my CgridView, I can see only 2 rows...
I couldn't find a solution to display 3 rows....
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.
But I'm having a problem that I can't solve right now.
Problem
I have 2 tables :
- tbl_prono (id, game_id, ...) : there are 2 rows of data
- tbl_game (id, date, team_id,...) : there are 3 rows of data
In my model Prono I did the following relation:
return array(
'game'=>array(self::BELONGS_TO, 'Game', 'game_id'),
);
I created the following dataprovider in an action (PronoController):
$dataProvider=new CActiveDataProvider('Prono', array(
'criteria'=>array(
'with'=>array('game'=>array('joinType'=>'RIGHT JOIN')),
// please note the RIGHT JOIN
)));
$this->render('pronos',array('dataProvider'=>$dataProvider,));
It generates a correct sql querry. But it returns 2 rows instead of 3 !
It should return 3 rows because I'm doing a "right join" and tbl_game has 3 rows.
So, in my CgridView, I can see only 2 rows...
I couldn't find a solution to display 3 rows....
Thursday, April 14, 2011
ORA-01940 cannot drop user
Problem:
Oracle 10g, I want to drop a user using this command :
drop user alex cascade;
But I have this error:
ORA-01940: cannot drop a user that is currently logged in
Solution :
I checked on google and find this excellent Website : http://www.dba-oracle.com/t_ora_01940_cannot_drop_user.htm
It said that you should do this :
That's correct but your username should be in uppercase!
For example :
And that's it !
You can do a quick test :
Oracle 10g, I want to drop a user using this command :
drop user alex cascade;
But I have this error:
ORA-01940: cannot drop a user that is currently logged in
Solution :
I checked on google and find this excellent Website : http://www.dba-oracle.com/t_ora_01940_cannot_drop_user.htm
It said that you should do this :
select s.sid, s.serial#, s.status, p.spid
from v$session s, v$process p
where s.username = 'myuser'
and p.addr (+) = s.paddr;
alter system kill session 'sid,serial#';
That's correct but your username should be in uppercase!
For example :
...
where s.username = 'ALEX'
...
And that's it !
You can do a quick test :
select username from v$session;
select * from v$session where username = 'alex';
select * from v$session where username = 'ALEX';
Wednesday, April 13, 2011
path oracle 10g
Problem:
You can't execute commands such as "imp", "exp", "impdp" or "expdp" even though the path is setted in the environment variable.
Solution:
In my case, there was a mistake. When I installed Oracle 10g, the path was automatically set to :
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32...
But in reality it should be "BIN" (uppercase)!
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\BIN;C:\Windows\system32...
After modifying the path, I could execute the command "impdp" anywhere from the command line.
You can't execute commands such as "imp", "exp", "impdp" or "expdp" even though the path is setted in the environment variable.
Solution:
In my case, there was a mistake. When I installed Oracle 10g, the path was automatically set to :
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Windows\system32...
But in reality it should be "BIN" (uppercase)!
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\BIN;C:\Windows\system32...
After modifying the path, I could execute the command "impdp" anywhere from the command line.
Sunday, February 20, 2011
SQLiteDatabase created and never closed
Problem
When I'm using my application and I can see this error in the LogCat tab :
Solution
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.
But I still got the same problem.
So in fact, it's just that for every activity (onCreate) I was opening a connection to the database, but I never closed it.
So the solution was to close the connection in each activity:
And that's it !
When I'm using my application and I can see this error in the LogCat tab :
02-17 17:20:38.556: ERROR/Database(434): Leak found
02-17 17:20:38.556: ERROR/Database(434): java.lang.IllegalStateException: /data/data/databases/xx.db SQLiteDatabase created and never closed
Solution
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.
But I still got the same problem.
So in fact, it's just that for every activity (onCreate) I was opening a connection to the database, but I never closed it.
So the solution was to close the connection in each activity:
@Override
protected void onStop() {
dbService.closeConnection();
super.onStop();
}
And that's it !
Sunday, February 13, 2011
Android Insufficient storage
Problem
I was debugging my application using an android virtual device in Eclipse.
When I run the application I could see this error in the console:
[2011-02-12 19:22:25 - shiro] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
[2011-02-12 19:22:25 - shiro] Please check logcat output for more details.
[2011-02-12 19:22:25 - shiro] Launch canceled!
The size of my app is around 22Mo (there are a lot of pictures).
Solution
The first time I configured the android virtual device, I put only 2 or 3Mo for "SD Card size".
So I had no choice to create a new virtual device and put something like 30Mo.
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 menu > settings > manage applications. Then choose the application and uninstall it. Then you can run your app again in debug mode from Eclipse.
And that's it!
I was debugging my application using an android virtual device in Eclipse.
When I run the application I could see this error in the console:
[2011-02-12 19:22:25 - shiro] Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
[2011-02-12 19:22:25 - shiro] Please check logcat output for more details.
[2011-02-12 19:22:25 - shiro] Launch canceled!
The size of my app is around 22Mo (there are a lot of pictures).
Solution
The first time I configured the android virtual device, I put only 2 or 3Mo for "SD Card size".
So I had no choice to create a new virtual device and put something like 30Mo.
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 menu > settings > manage applications. Then choose the application and uninstall it. Then you can run your app again in debug mode from Eclipse.
And that's it!
Subscribe to:
Posts (Atom)