Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

sharkbc

@sharkbc
About
Posts
40
Topics
19
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • A stupid question?
    S sharkbc

    hi Jschell, I've just modify my question, it must be ... Is it true or my eyes is wrong? Now the CODE 1 always gives the result is equal Im sure at that time, the database is not change and i do not change any other code in the programe, because after we got the mistake, we debug the code and get it. We just only change

    if(a==b)

    to

    if(a.equals(b))

    Java question java database announcement

  • A stupid question?
    S sharkbc

    Hi all, Near one or two years (version Java at that time is 1.5x), I have a short code to compare 2 Strings in java like bellow: String a = "abc"; String b ="abc";//this is load from the database. CODE 1

    if(a==b){
    System.out.println("equal");
    }else {
    System.out.println("dif");
    }

    and I got the result is dif I remember because after I change the code to String a = "abc"; String b ="abc";//this is load from the database. CODE 2

    if(a.equals(b)){
    System.out.println("equal");
    }else {
    System.out.println("dif");
    }

    It give me the result is equal Is it true or my eyes is wrong? Now the CODE 1 always gives the result is equal

    Java question java database announcement

  • winapi and Jna
    S sharkbc

    Hi Richard MacCutchan, Thanks so much for our discussions so far. I'm trying to do this. Thanks again MacCutchan Best regards,

    Java java com tutorial question

  • winapi and Jna
    S sharkbc

    Hi Richard MacCutchan For sure your answer is correct but it is just only in theory. I need what api or sample code to do this. " 1. Where the mouse is in relation to the character; at the beginning, end, top ,bottom, to the left? 2. How big the character is; height, width, leading, overhang? 3. Has the character been rotated, is it bold or italic? etc. The best way to manage this would be to capture the entire visible portion of the window that the mouse is within " Thanks and Regards,

    Java java com tutorial question

  • winapi and Jna
    S sharkbc

    Hi Richard MacCutchan, It would be better that i show you what i need bellow: My final question is: get text under mouse pointer As you know at the begining i wanna to do this with maximum support from winapi, but as your message winapi can not help all for this task. That's the reseon why I try to do this with one or some support from winapi (instead of thinking winapi can help me to do all for this). It makes me thinking about "how to get the rectangle from mouse point" and do OCR with this information. I got some information from this link before i've post this question at Project.com: http://stackoverflow.com/questions/3877762/get-the-word-under-the-mouse-cursor-in-windows/3877807#3877807 I see some dictionary software did this with click and see (Babylon, ...) Can anybody explain me how they do that or any other solution to make thing posiple? Thanks and Regards,

    Java java com tutorial question

  • winapi and Jna
    S sharkbc

    hi Richard MacCutchan Thanks for quick respone, follow up your message "The characters displayed on the screen are merely coloured pixels and have no direct relationship to the actual characters; " that we only can get the word at the mouse cursor by OCR. have you got any ideas for get the rectangle bounds the text under the mouse. Thanks and Regards,

    Java java com tutorial question

  • winapi and Jna
    S sharkbc

    I repost the link of my question here, how to use SendMessage in Java[^] Thanks and Best regards,

    Java java com tutorial question

  • UTF8 - Java - MS Access 2003
    S sharkbc

    Hi there ! I used bellow code to insert record to MS Access and get record from MS Access. But i could insert or get correctly UTF8 string ? Collapse I have inserted người việt nam but it stored in MS Access like ng??i vi?t nam Have you got any ideas? Thanks in advance!

    import java.io.BufferedReader;
    import java.io.DataInputStream;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import java.io.UnsupportedEncodingException;
    import java.sql.Connection;
    import java.sql.Driver;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.Statement;

    import javax.swing.JOptionPane;

    public class AccessUtil {

    public static String url = "d:/utf-8.mdb";
    private static Connection con_access ;

    private static Connection getConnection() throws Exception {
    Driver d = (Driver)Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    con_access = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" + url +";charSet = UTF8");
    return con_access;
    }

    public static Connection getConAccess(){
    try
    {
    if( con_access == null ){
    con_access = getConnection();
    }
    else if( con_access.isClosed() )
    {
    con_access = getConnection();
    }
    }catch(Exception e){
    e.printStackTrace() ;
    }
    return con_access ;
    }

    public static void main(String[] args) {
    try {
    insertTest( "người việt nam", "người việt nam");
    //getTest( );
    //readFile("d:/testacess.txt");
    } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    }

    public static boolean insertTest( String u1, String u2 )throws Exception {

    Connection con = null ;

    try{

    con = AccessUtil.getConAccess() ;
    Statement s = con.createStatement();

    con.setAutoCommit(false);

    String sql = " insert into tbl_test(u1,u2) values(?,?) " ;

    PreparedStatement pstm = con.prepareStatement( sql ) ;
    pstm.setString(1, u1);
    pstm.setString(2, u2);

    pstm.execute() ;

    con.commit() ;

    }
    catch( Exception e ){

    e.printStackTrace() ;

    try{

    con.rollback() ;
    }
    catch( Exception ex ){}

    throw new Exception( "DB Excetion :"+e.toString() ) ;

    }
    finally{

    try{
    con.close() ;
    }catch(Exception ex){} ;
    }

    return true ;

    }

    public static boolean getTest( )throws Exception {

    Connection con = null ;

    try{

    con = AccessUtil.getConAccess() ;
    Statement s = con.createStatement();

    co

    Java database java question

  • Embed php forms or flash into facebook, step by step
    S sharkbc

    Hi friends ! We have already html forms or flash file(.swf). How can we do to "Embed html forms or flash into facebook". Any ideas or link to do it step by step! Thanks !

    Linux, Apache, MySQL, PHP php html adobe tutorial

  • SEO and php site
    S sharkbc

    Hi everybody! 1. I registered with google analysis already. This tool help me to report visitors and so on... 2.I im finished my site at http://soft-overtime.com 3.I verified this site with google successfully(sitemap and meta tag). When i point these bellow items(in googleWebmaster tools), no data available. # Your site on the web * Top search queries * Links to your site * Keywords * Internal links * Subscriber stats I've got some question: 1. How can i do to let google know which keywords users searched on my site. The same question for others Items. Thanks !

    Linux, Apache, MySQL, PHP question php com tools help

  • JoomFish problem with my component
    S sharkbc

    I found solution. It now work well sharkbc Free ware

    Linux, Apache, MySQL, PHP database help php mysql com

  • How to close MS Word(or any program are in progress) using java
    S sharkbc

    Dear all ! I installed MS Word at C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE I point to WINWORD.EXE and open it. After that, how can close WINWORD.EXE using my java app. Thanks

    Java java tutorial

  • How to get all url of a website
    S sharkbc

    Hi everybody ! How can i get all url of a site(the input parameter is domain name) using Java. Thanks !

    Java java tutorial question

  • JoomFish problem with my component
    S sharkbc

    Dear Marc Firth ! The configuration file has no change(I checked). My website "works well" except my component. Thanks anyway !

    Linux, Apache, MySQL, PHP database help php mysql com

  • JoomFish problem with my component
    S sharkbc

    Hi there ! Im using Joomla 1.5 to build my site. My component(query data from database of website) work well if i don't install joomfish. After i installed Joom!Fish 2.0.4 Stable into my site for translation my component does not work(with error). My code of component as bellow:

    $query='select * from jos_content where sectionid=11 and state=1
    order by catid ';
    $database->setQuery( $query );
    $result=mysql_query($query);

    	while($row=mysql\_fetch\_object($result)){
    
                   echo 'data'.$row->title;
                    }
    

    And i see these bellow warnings if i refer to my component.

    Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\so\components\com_products\products.php on line 131

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\xampp\htdocs\so\components\com_products\products.php on line 131

    Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\so\components\com_products\products.php on line 137

    Any ideas ! Thanks in regards !

    Linux, Apache, MySQL, PHP database help php mysql com

  • put skype and yahoomessenger nick into website
    S sharkbc

    Hi all! Im trying to put my skype nick and yahoo nick into my site. How can i set the images for skype or yahoo messenger when i online and offline following bellow: If im online:the skype image is skypeonline.jpg. If im ofline:the skype image is skypeoffline.jpg. If im online:the yahoo image is yahooonline.jpg. If im ofline:the yahoo image is yahoooffline.jpg. Thanks a lot!

    Linux, Apache, MySQL, PHP question

  • view page source (of a webpage)
    S sharkbc

    Hi all ! I want to receive page source from a hyperlink. This is may code

    public class SourceViewer{
    public static void main (String[] args) throws IOException{

    System.out.print("Enter url of local for viewing html source code: ");
    
    
    //BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    

    // String url = br.readLine();
    //http://vdict.com/Hello,1,0,0.html
    String url = "http://vdict.com/Hello,1,0,0.html";
    try{
    URL u = new URL(url);
    HttpURLConnection uc = (HttpURLConnection) u.openConnection();
    int code = uc.getResponseCode();
    String response = uc.getResponseMessage();
    System.out.println("HTTP/1.x " + code + " " + response);
    for(int j = 1; ; j++){
    String header = uc.getHeaderField(j);
    String key = uc.getHeaderFieldKey(j);
    if(header == null || key == null)
    break;
    System.out.println(uc.getHeaderFieldKey(j) + ": " + header);
    }
    InputStream in = new BufferedInputStream(uc.getInputStream());
    Reader r = new InputStreamReader(in);
    int c;
    while((c = r.read()) != -1){
    System.out.print((char)c);
    }
    }
    catch(MalformedURLException ex){
    System.err.println(url + " is not a valid URL.");
    }
    catch(IOException ie){
    System.out.println("Input/Output Error: " + ie.getMessage());
    }
    }
    }

    it work well with some link. But problem with this link: http://vdict.com/Hello,1,0,0.html[^] this is the result form browser and my program: -Browser:you can see by your self. -My program:

    Date: Fri, 23 Oct 2009 03:53:22 GMT
    Server: Apache/2.2.3 (Red Hat)
    X-Powered-By: PHP/5.1.6
    Expires: Fri, 30 Oct 2009 03:53:22 GMT
    Cache-Control: max-age=360000, must-revalidate
    Pragma: public
    Last-Modified: Fri, 23 Oct 2009 03:53:22 GMT
    Vary: Accept-Encoding
    Content-Length: 2102
    Content-Type: text/html; charset=UTF-8
    Set-Cookie: PHPSESSID=4hgviiktc0gc38aiotd8s6jn37; path=/
    Connection: Close
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
    <meta name='description' content='Vie

    Java help php html apache com

  • hosting web and Xampp
    S sharkbc

    Thanks ! Have a good time Marc Firth!

    Linux, Apache, MySQL, PHP hosting help

  • hosting web and Xampp
    S sharkbc

    I have 2 computer, they are connected together through a switch so i 've got LAN(my system just only 2 computers and has no connect to the Internet( no modem or router)) pc001 I got ip 192.168.1.1 pc002 I got ip 192.168.1.2 on pc001 i install xampp. I hosting some website at pc001 and have some situation like bellow: 1.All website i created by Joomla work well and i can access these website from another computer(Everything good) 2.I created a forum (using MyBB Forum) , it work well when i access on the local computer(the computer which install xampp). When i access forum from pc002 the result is not displayed correctly. Can anybody help me to fixed this. Thanks and regards

    Linux, Apache, MySQL, PHP hosting help

  • PDF2xhtml
    S sharkbc

    * Hi everybody ! * * Im using PDFBox to convert pdf to xhtml. * * Can anybody help me. * * In PDFBox source, there are no class pdf2xhtml but i found a class at * http://lucene.apache.org/tika/xref/org/apache/tika/parser/pdf/PDF2XHTML.html * * How can i use it. * * Thanks and regards

    Java html apache help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups