Skip to main content

Posts

Embeded Flash in Java Desktop App

Most of examples about playing Flash animation on desktop application I found on the internet to are done by VB. But today I found java version. Flash SWT Plugin[ many thanks to Don Park ], it work very well on my latest project :). To use Flash SWT Plugin, download com.docuverse.swt.flash-0.4.zip and extract it somewhere on local disk. Now our eclipse flash project need to add atleast two external jars e.g. flash.jar[from where we just extract the zip] and swt.jar and now we are ready to code. THE SOURCE To play swf file, all we need is FlashPlayer object and activate it that all. it'll look like this. import com.docuverse.swt.flash.FlashPlayer; public class SWTPlayer { .... private void run() { // TODO Auto-generated method stub Display display = new Display(); Shell shell = new Shell(display); FlashPlayer player = new FlashPlayer(shell); player.loadMovie(0, " yourflashfile.swf "); player.setSize(550, 400); player.activate(); shell.setSize(550, 400); ...

Install TinyMCE module on Drupal

I'm just choose Drupal to be CMS for my new site. Nothing more than google tell me that it win 2007 Open Source CMS Award :) so just try it. Creating content with drupal is easy but if you want to add image, WYSIWYG editor, you need to install third party module. This post is about how i get this feature for my site. 1. Download TinyMCE WYSIWYG Editor [this will enable the TinyMCE editor to be used with Drupal] you will get file name tinymce-5.x-1.9.tar.gz. Extract it into Drupal modules folder you will get modules/tinymce. 2. Download TinyMCE engine and you will get tinymce_3_0_1.zip. Again extract into tinymce folder from step one. Now you have modules/tinymce/tinymce. 3. Enable TinyMCE module by go to Administer->Site building->Modules TinyMCE should be at the bottom of the page. Enable it. 4. Grant permission to user role by go to Administer->User management->Access control[I'm check only authenticated user] 5. Create new profile by goto Administer->Site Con...

Make your eclipse look better on ubuntu

When using eclipse on ubuntu, extra space between items and fonts size make it look awkward. I try to adjust fonts by go to [Window->Preferences->General->Appearance->Colors and Fonts]. This will not much help, reduce fonts size does not change space between item. Here is Eclipse Europa before tweak. Anyway, at last I found the way to make eclipse look more compact from googling. Thank for Wesley and Vladimir Buell for this trick . Create ".gtkrc-2.0" in your home directory enable you to customize gtk object style[more about gtkrc-2.0]. Here is my ".gtkrc-2.0". pnix@pnix-a7n:~$ cat .gtkrc-2.0 style "gtkcompact" { font_name="Sans 8" GtkButton::default_border={0,0,0,0} GtkButton::default_outside_border={0,0,0,0} GtkButtonBox::child_min_width=0 GtkButtonBox::child_min_heigth=0 GtkButtonBox::child_internal_pad_x=0 GtkButtonBox::child_internal_pad_y=0 GtkMenu::vertical-padding=1 GtkMenuBar::internal_padding=0 GtkMenuItem::horizontal_paddin...

cvs server on ubuntu gutsy

Note for my first time setting up cvs server on ubuntu gutsy. CVS, a version control system, allow you to work on sourcecode with your team. To install it on ubuntu, we need two packages from repos, cvs and the wrapper. pnix@pnix-a7n:~$ sudo aptitude install cvs cvsd [sudo] password for pnix: Reading package lists... Done Building dependency tree Reading state information... Done Reading extended state information Initializing package states... Done Building tag database... Done The following NEW packages will be installed: cvs cvsd 0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 1756kB of archives. After unpacking 3973kB will be used. Writing extended state information... Done Get:1 http://th.archive.ubuntu.com gutsy/main cvs 1:1.12.13-8 [1669kB] Get:2 http://th.archive.ubuntu.com gutsy/universe cvsd 1.0.13 [87.4kB] ... Building tag database... Done pnix@pnix-a7n:~$ ...

include external jar into your own exported jar

One problem that almost java guys have is create jar with external jar include. In eclipse it has export function to export project but there's no way to add external jar with this method. Today I found one solution, the project Fat Jar Eclipse Plug-In can take care this problem. Installation is just unzip it to eclipse folder then restart eclipse in shell or command line with this command "eclipse -clean". Now your eclipse already have fatjar plugin. To use it export the project, from your package explorer, right click on your project and select "Export...". You will get "Export Dialog"[see pic], choose Other->Fat Jar Exporter. From here you will know what to do next.:)

gusty firefox + google toolbar = hang

I love google toolbar and it's my number one online bookmark for a long time. After upgrade to gusty I feel that my firefox is not stable as it use to be. My firefox is freeze on some site that try to open second window. I'm not sure what's wrong firefox or toolbar but I know that after uninstall toolbar the problem gone. [to uninstall go to "Settings" > "Help" > "Uninstall" option on toolbar] Now I need something to replace google toobar jobs. Not too hard to find this. "Firefox Google Bookmark" for bookmarks. After install this extensions your firefox will has new menu "GBookmarks". below is screenshot Another thing i need is gmail notifyer, there are many firefox extension and linux apps can do this job. For me i choose checkgmail. pnix@pnix-a7n:~$ sudo aptitude install checkgmail Reading package lists... Done Building dependency tree ... Building tag database... Done pnix@pnix-a7n:~$ note: for now look...

using cron to execute sqlscript in oracle

Using cron to run sql script is a good idea to apply with a periodic database job. When running any scripts, cron doesn't know any environment variable. So, in the script, we always -use full path with execute command. -define all environment variable. ex. to see data in customer table in oracle database and log in customer_rpt.log, I create sql script[testsc1.sql] like this [oracle@oracle1 ~]$ cat testsc1.sql spool /home/oracle/customer_rpt.log select * from customer; quit; [oracle@oracle1 ~]$ next create shell script file to run sql script file. [oracle@oracle1 ~]$ cat mydbshell.cron #!/bin/bash ORACLE_HOME=/u01/app/oracle/product/10.1.0/db_1; export ORACLE_HOME; ORACLE_SID= my_sid ; export ORACLE_SID; /u01/app/oracle/product/10.1.0/db_1/bin/sqlplus user/password @/home/oracle/testsc1.sql [oracle@oracle1 ~]$ note that oracle_home, oracle_sid variable must be defined and sqlplus command called with full path. Now, we define new cron job by 'crontab -e' in console and make...