Sunday 12 August 2012

android install in eclipse


android install in eclipse


Android Install in Eclipse

Step1: download the eclipse from the following link
                                eclipse download
Step2: unZip the elipse and install the following plugin in the eclipse
            ADT- https://dl-ssl.google.com/andr
oid/eclipse/(required)
            

Step3:  download the android sdk from following link
             android sdk download
             
Step4: unzip the sdk folder and configure that in the eclipse

           4.1: In eclipse open window--->preferences--->android--->SDKLocation  to configure the                 unziped folder. and --->ok.

Step5: update the sdk tools. 

            5.1:In eclipse open window--->Android SDK Manager-->
            5.2: check the tools and click the install.

Step6: Install the which version you want select that version Sdk platform  and install.

Step7: Configure the emulator.

           7.1:n eclipse open window--->AVD Manager -->

           7.2:  Select new button to open new window
           
           7.3: give name,select the Target version.
           example:
           
           7.4:  click Create AVD button.
            then select the created AVD and click Start button.
            7.5: click Launch button.

How do I delete from multiple tables using INNER JOIN IN SQL


How do I delete from multiple tables using INNER JOIN IN SQL


DELETE t1,t2,t3 
FROM Filedata AS t1 
INNER JOIN Filepath as t2 
INNER JOIN Fileversions as t3 where t3.file_id='0.9067535276368446'

Changing the engine in the all tables of the database progrmetically for mysql


database and java


Changing the engine in the all tables of the database progrmetically for mysql



                     Connection connection = null;
    try{
                     //for getting the connecion
     Class.forName("com.mysql.jdbc.Driver");
     connection =                                                       DriverManager.getConnection("jdbc:mysql://localhost:3306/hydhouse","root","password");
          try{        
            // Create statement object 
            Statement stmt = connection.createStatement();

                            //for getting the tables from that database
            DatabaseMetaData dbm = connection.getMetaData();
  String[] types = {"TABLE"};
  ResultSet rs = dbm.getTables(null,null,"%",types);
  while (rs.next()){
  String table = rs.getString("TABLE_NAME");

//for change the engine in mysql
  String sql="ALTER TABLE "+table+" ENGINE = innodb ";
  int i=stmt.executeUpdate(sql);
  System.out.println(i);
  }
        }
        catch (SQLException s){
         connection.close();
          System.out.println("SQL Exception " + s);
        }

permissions and process killing in Ubuntu


Ubuntu


for giving permisions

>chmod -R 777 filename/foldername

for know the processes of any application

>ps aux|grep eclipse             for eclipse

for kill the processes

>kill -9 processnumber

For see the tomcat log changes in console

>tail -f catalina.out

Running multiple tomcat servers


Running multiple tomcat servers


Running multiple tomcat servers


Download tomcat, and unpack it twice, into two separate directories. Edit the conf/server.xml file in one of the copies in the following way: Change the port on the root Server element to a different number (e.g. 8006) Change the port attributes on the Connector elements to a different number (e.g. 8010 instead of 8009, 8081 instead of 8080 and 8444 instead of 8443) You should now be able to run the bin/startup.sh scripts in both installations to get two running tomcats. Connect using port 8080 and install the basic application services, and then connect using port 8081 to install the service provider management services. Source link. Some other useful links are given linkslinks.

Configuring Tomcat 6 with eclipse in ubuntu


Configuring Tomcat 6 with eclipse in ubuntu


Configuring Tomcat 6 with eclipse in ubuntu

open terminal and type this
sudo apt-get install tomcat6(not required if already installed)
cd /usr/share/tomcat6
sudo ln -s /var/lib/tomcat6/conf conf
sudo ln -s /etc/tomcat6/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat6 log
sudo chmod -R 777 /usr/share/tomcat6/conf
restart server
then configure the server

Sorting an ArrayList that contains pojo class


sorting the arraylist contains pojo classes

Sorting an ArrayList that contains pojo class

Sorting of ArrayList containing our own Class/Objects in java, Sorting ArrayList that contains customizes java class/objects in java . How to sort Arraylist that contains our own class in java?
Here is the example of sorting  a list that contains java pojo class.
In below example, we have Employee class with attribute id, first name & last name.
We have another class that actually use the sort() method of Collections which has to implement Comparator() to sort pojo with its field.

Here is the Employee Class

  1. public class Employee   
  2. {  
  3.     int id;  
  4.     String firstName;  
  5.     String lastName;  
  6.       
  7.     public Employee(int id,String firstName,String lastName)  
  8.     {  
  9.         this.id=id;  
  10.         this.firstName=firstName;  
  11.         this.lastName=lastName;  
  12.     }  
  13.     public int getId() {  
  14.         return id;  
  15.     }  
  16.     public void setId(int id) {  
  17.         this.id = id;  
  18.     }  
  19.     public String getFirstName() {  
  20.         return firstName;  
  21.     }  
  22.     public void setFirstName(String firstName) {  
  23.         this.firstName = firstName;  
  24.     }  
  25.     public String getLastName() {  
  26.         return lastName;  
  27.     }  
  28.     public void setLastName(String lastName) {  
  29.         this.lastName = lastName;  
  30.     }  
  31. }  

Here is actual class that sort the list which contains Employee objects

  1. import java.util.ArrayList;  
  2. import java.util.Collections;  
  3. import java.util.Comparator;  
  4. import java.util.List;  
  5.   
  6.   
  7. public class SortEmployeeList  
  8. {  
  9.     public static void main(String[] args)   
  10.     {  
  11.         Employee emp1 = new Employee(1,"Dipen","Khadka");  
  12.         Employee emp2 = new Employee(2,"John","Rotela");  
  13.         Employee emp3 = new Employee(3,"Shark","Anderson");  
  14.         Employee emp4 = new Employee(4,"Suman","Bhatt");  
  15.           
  16.         List<Employee> employeeList = new ArrayList<Employee>();  
  17.         employeeList.add(emp1);  
  18.         employeeList.add(emp2);  
  19.         employeeList.add(emp3);  
  20.         employeeList.add(emp4);  
  21.           
  22.         //sort by First name  
  23.         Collections.sort(employeeList, new Comparator() {  
  24.             @Override  
  25.             public int compare(Object obj1, Object obj2) {  
  26.                 Employee emp1 = (Employee)obj1;  
  27.                 Employee emp2 = (Employee)obj2;  
  28.                 return emp1.getFirstName().compareToIgnoreCase(emp2.getFirstName());  
  29.             }  
  30.         });  
  31.         //Now the employeeList is sorted based on first name  
  32.           
  33.           
  34.         //sort by Last name  
  35.         Collections.sort(employeeList, new Comparator() {  
  36.             @Override  
  37.             public int compare(Object obj1, Object obj2) {  
  38.                 Employee emp1 = (Employee)obj1;  
  39.                 Employee emp2 = (Employee)obj2;  
  40.                 return emp1.getLastName().compareToIgnoreCase(emp2.getLastName());  
  41.             }  
  42.         });  
  43.         //Now the employeeList is sorted based on last name  
  44.     }  
  45. }  

GWT plugins adding in eclipse


GWT plugins adding in eclipse

GWT plugins adding in eclipse

1.download the eclipse from eclipse link
2.open help--->install new softwares..

ADT- https://dl-ssl.google.com/andr
oid/eclipse/(required)

indigo update- http://download.eclipse.org/
releases/indigo(required)

gwt- http://dl.google.com/eclipse/p
lugin/3.7(required)

GWT Designer Update Site - http://dl.google.com/eclipse/inst/d2gwt/latest/3.7 (required)

svn- http://subclipse.tigris.org/up
date(for svn)

How to fix GC overhead limit exceeded in Eclipse


How to fix GC overhead limit exceeded in Eclipse

Especially true if you're using Eclipse in 64 bit machine, Eclipse will throw GCoverhead limit exceeded when it runs out of memory when performing memory-consuming operations such as building workspace on big projects.

An internal error occurred during: "Building workspace".
GC overhead limit exceeded
While such problem won't come up when you're coding using text editors, the operation is required to enable some extra functionality to the IDE. To fix this problem, go to your Eclipse installation directory and find the eclipse.ini file. Here's how it looks in some installations.
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.php.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx384m
What you need to do is to increase the memory allocation for the IDE. Increase the value of the following lines that you think is reasonable with your system and projects.
-Xms512m
-Xmx1024m
You can optionally increase the value of XX:MaxPermSize Restart Eclipse for the changes to take effect.

How to install plugin in eclipse follow this link


How to install plugin in eclipse follow this link

How to install plugin in eclipse follow this link

Step1: In eclipse open Help-->Install New Software

Step2: add plugin link in workwith 
ex:  ADT - https://dl-ssl.google.com/android/eclipse/

Step3: check what u want install and select next> button.

Step4: select next> button  Accept and Install.

Different Ways To Embed A Free MP3 Player On Your Website


Different Ways To Embed A Free MP3 Player On Your Website


Different Ways To Embed A Free MP3 Player On Your Website.

links 

HTML Audio





GOOGLE READER PODCAST PLAYER FOR SINGLE MP3S


The Digital Inspiration blog has the details on embedding MP3 files with the Google Player, but to summarize the article, you just have to insert this code, replacing “MP3URL” with the correct URL of the MP3 file hosted on the web that you want to embed in your index.html file that hosts the main page:

<embed type=”application/x-shockwave-flash” src=”http://www.google.com/reader/ui/3523697345-audio-player.swf” flashvars=”audioUrl=MP3URL” width=”400″ height=”27″ quality=”best”></embed>

While this player is very simple in appearance, it doesn’t carry the Google logo, it even has volume controls and is probably one of the easiest ways to embed an MP3 player working fast.


YAHOO MEDIA PLAYER FOR ANY MP3 URL ON A PAGE

So let’s say you already have a bunch of MP3 files listed on your webpage and you just need a player. Instead of inserting the Google player code for each and every one of those MP3s, you could just use the handy Yahoo Media Player.
As long as you have linked to those MP3 files in your webpage, you can use the following code to include the Yahoo Media Player, which will detect the MP3 files and display the playbuttons next to each MP3 file.
<script src=”http://mediaplayer.yahoo.com/js” type=”text/javascript”></script>
With that one line of HTML, you get a floating media player that can play all the MP3 files in one webpage.

JW FLV PLAYER FOR PLAYLISTS

The JW Player is an open-source player for non-commercial use. You can download the player, which comes with a few more files, namely swfobject.js and player.swf, all of which you’ll upload to the same location where your website is. Having the JW Player for playlists means you’ll need to insert code in your index.html page and also have a separate XML file with the track list, which really isn’t that hard to put together.
First, you’ll need to insert the following code on your index.html page:
<script type=’text/javascript’ src=’URLofSWFOBJECT.JS’></script>
<div id=’mediaspace’>This text will be replaced</div>
<script type=’text/javascript’>
var so = new SWFObject(‘URLofPLAYER.SWF’,’mpl’,’470′,’320′,’9′);
so.addParam(‘allowfullscreen’,'true’);
so.addParam(‘allowscriptaccess’,'always’);
so.addParam(‘wmode’,'opaque’);
so.addVariable(‘playlistfile’,’URLofPLAYLISTFILE.XML‘);
so.addVariable(‘playlist’,'left’);
so.write(‘mediaspace’);
</script>
The items in bold are the ones you need to replace with the correct URLs of the object, player, and XML file (URLofSWFOBJECT.JS, URLofPLAYER.SWF, URLofPLAYLISTFILE.XML). If this code doesn’t show anything on your page, try this code that’s meant to embed MP3 players in blogs and sites like MySpace:
<object classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ width=’470′ height=’300′ id=’single1′ name=’single1′>
<param name=’movie’ value=’URLofPLAYER.SWF‘>
<param name=’allowfullscreen’ value=’true’>
<param name=’allowscriptaccess’ value=’always’>
<param name=’wmode’ value=’transparent’>
<param name=’flashvars’ value=’playlistfile=URLofPLAYLISTFILE.XML&playlist=left&dock=false’>
<embed
type=’application/x-shockwave-flash’
id=’single2′
name=’single2′
src=’URLofPLAYER.SWF
width=’470′
height=’300′
bgcolor=’undefined’
allowscriptaccess=’always’
allowfullscreen=’true’
wmode=’transparent’
flashvars=’playlistfile=URLofPLAYLISTFILE.XML&playlist=left&dock=false’
/>
</object>
As for the XML file, all you need to do is to save a file with the XML file extension using Notepad in Windows or any text editor. If you’re using Notepad, make sure in the Save type as field has “All Files (*.*)”. Inside the XML file, paste this and replace bold items with the appropriate entries:
<?xml version=”1.0″ encoding=”UTF-8″?>
<playlist version=”1″ xmlns=”http://xspf.org/ns/0/”>
<title>Your MP3 Playlist</title>
<info>http://YourWebpageHere/</info>
<trackList>
<track>
<title>NAMEofMP3file1</title>
<location>URLofMP3file1.MP3</location>
</track>
<track>
<title>NAMEofMP3file2</title>
<location>URLofMP3file2.MP3</location>
</track>
<track>
<title>NAMEofMP3file3</title>
<location>URLofMP3file2.MP3</location>
</track>
</trackList>
</playlist>
You can add more tracks if you want with the
<track>
tag, just make sure you adjust the height of the player accordingly. This is what the player looks like with the playlist on the left.
To customize the color of the player, head over to the setup page from the official JW Player website. This setup page will also let you input your desired player parameters (e.g. whether to autoplay or not) and preview the results, while you don’t even have to figure out the code as it painlessly spits out the code for you to just copy.
Not only does this awesome, free player take care of an entire playlist, it also can play single MP3 files. You’d only need to insert this code in your index.html file:
<script type=’text/javascript’ src=’PATHtoSWFOBJECT.JS‘></script>
<div id=’mediaspace’>This text will be replaced</div>
<script type=’text/javascript’>
var so = new SWFObject(‘URLofPLAYER.SWF‘,’ply’,’470′,’24′,’9′,’#000000′);
so.addParam(‘allowfullscreen’,'true’);
so.addParam(‘allowscriptaccess’,'always’);
so.addParam(‘wmode’,'opaque’);
so.addVariable(‘file’,’MP3URL‘);
so.addVariable(‘duration’,’DURATION‘);
so.write(‘mediaspace’);
</script>
You should also input the duration of the MP3 file, or you can also omit that line altogether.
If you would rather not mess with codes and would rather just copy and paste embed codes without having to modify them, you can always upload single MP3 to an online storage site, such as 4shared and Box.net, which offer embed codes for MP3 files.
Did I miss an MP3 player that’s available for free? Let us know in the comments!

Increase Import Size of File in phpmyadmin (Ubuntu)


Increase Import Size of File in phpmyadmin (Ubuntu)


Increase Import Size of File in phpmyadmin (Ubuntu)

Increase Size of import File in phpmyadmin

Try these different settings in /etc/php5/apache2/php.ini

Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M
Change the values to your requirements. 
Ex:
post_max_size = 20M
upload_max_filesize = 20M
max_execution_time = 60
max_input_time = 60
memory_limit = 8M

----------->then restart your Apache2
Ex:
----------->service apache2 restart

Android Install in Eclipse


android install in eclipse


Android Install in Eclipse

Step1: download the eclipse from the following link
                                eclipse download
Step2: unZip the elipse and install the following plugin in the eclipse
            ADT- https://dl-ssl.google.com/andr
oid/eclipse/(required)
            

Step3:  download the android sdk from following link
             android sdk download
             
Step4: unzip the sdk folder and configure that in the eclipse

           4.1: In eclipse open window--->preferences--->android--->SDKLocation  to configure the                 unziped folder. and --->ok.

Step5: update the sdk tools. 

            5.1:In eclipse open window--->Android SDK Manager-->
            5.2: check the tools and click the install.

Step6: Install the which version you want select that version Sdk platform  and install.

Step7: Configure the emulator.

           7.1:n eclipse open window--->AVD Manager -->

           7.2:  Select new button to open new window
           
           7.3: give name,select the Target version.
           example:
           
           7.4:  click Create AVD button.
            then select the created AVD and click Start button.
            7.5: click Launch button.