Sunday, October 12, 2008

Eclipse survival kit





  • To find the associated bracket in a Java source on Eclipse, double-click the bracket to find the matching one.
  • Select square: Alt+Shift+A
  • Smaller fonts: open the General > Appearance > Colors and Fonts preference page. Select Basic>Text Fonts, Edit and change font size
    create WAR files, or AAR axis2 archive files)
  • Change author / user:
    Windows > Preferences > Java > Code Style > Code Templates > Comments
    Select Types
  • When installing Eclipse on Kubuntu, install on /usr/local, otherwise you may have issues with the plugins install




  • CDT
    - tab spaces not taken into account (Helios, Ubuntu 64 bits)
    - Needed to do a "apt-get update" after installing CDT otherwise, gave me funky compile error messages on printf and stuff
    - To access the gdb CLI, select the gdb process node in the Debug view. The gdb command line will then be available in the Console view. Though no prompt is visible, you can enter commands at the bottom line of the Console view. Doing so may desynchronize the IDE and gdb, so be careful when driving the debugger using this interface.
    - automatic save: Windows > Preferences > General > Workspace
  • cmake



  • create  a sibbling directory of the sources root:     search-l-2S-build 


  • cd search-l-2S-build 


  • cmake -G "Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../search-l-2S 


  • In eclipse CDT:


  • File > Import Existing Projects into Workspace > Next


  • Select root directory => Répertoire "cmakebuild" créé plus haut


  • Source accessible in "Subprojects".

  • ./eclipse_cdt -vmargs -XX:PermSize=512m -XX:MaxPermSize=512m -Xms1024m -Xmx1024m


  • J2EE
    You just get "Dynamic Web Project" creation menu only when you install J2EE Eclipse version



  • Useful files
        - eclipse.ini


  • if you get black zones within the Eclipse editor, you will have to switch from GTK3 to GTK2. To do this, add the following two lines to eclipse.ini  
  • --launcher.GTK_version
  • Software sites 
  • maven2 - http://download.eclipse.org/technology/m2e/releases


  • Problems
  • when using the maven plugin, the "Java build path" in the Eclipse will take the default JRE Eclipse config unless you specify "maven-compiler-plugin" as artifact in the pom.xml with version 1.8 for example
  • Formatting
    window->Preferences, ensuite choisir Java->Code Style-> formatter et sélectionner "Java conventions [build-in]".


  • Ganimede: 3.4 .. 25 June 2008
  • Galileo: 3.5 .. 24 June 2009
  • Helios: 3.6 .. 23 June 2010
  • C# survival kit

    * C# is the first “component oriented” language in the C/C++ family

    * csharp string <--> C++ wchar_t
    * to display a string from multiline (somewhat equivalent to the C++ backslash ):
    string toto = @"toto
    toto";
    * One must specify “override” to the method in the subclass if one want to override a virtual method from the superclass (as opposed to C++ where override is automatic)
    * Mutexes are of two types: local mutexes and named system mutexes. If you create a Mutex object using a constructor that accepts a name, it is associated with an operating-system object of that name. Named system mutexes are visible throughout the operating system, and can be used to synchronize the activities of processes.

    Sunday, September 14, 2008

    HTML frames automatic refresh

    <script type="text/javascript">
    top.frames['frame1'].location.reload();
    top.frames['frame2'].location.reload();
    </script>

    <html>
    <frameset rows="50%,50%">
    <frame src="TestResults.html" name="frame2">
    <frame src="Hem-1.0/nunit-logs/results-nunit_32.xml" name="frame1">
    <frame src="Hem-1.0/nunit-logs/results-nunit_64.xml" name="frame1">
    </frameset>
    </html>

    Sunday, June 8, 2008

    Registry (Windows autologon, colors)

  • How to do it trough the registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
    String Value: DefaultUserName=domain/Administrator
    String Value: DefaultPassword=up...
    String Value: AutoAdminLogon=1

    also possible is DefaultUserName=username


  • If you have a color problem from Remove server client (Ubuntu):

    XP Mode with 32 bit color + integration is possible!
    I found an easier way to get 24 bit colors with integration on here.
    1. Run regedit in XP.
    2. Navigate to [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services].
    3. Add a DWORD Value named "ColorDepth" w/o parenthesis.
    4. Right-click it, modify, then put "4" in the Value data.
    5. Restart XP mode / Reboot
  • Friday, May 30, 2008

    SVN survival kit

    > Hello, somehow when I update the repository, another username/password is being use.

    Tortoise SVN | Settings | Saved Data | Authentication Data | Clear

    That will clear the stored information, and you will be prompted for
    it the next time it's needed.

  • Other useful commands:
    - svn list svn://whatever.com
    - svn status --show-updates --verbose | sort -k 2rn | less
    - svn log --verbose --limit 10
    - svn status -u (same as --show-updates, svn status usually doesn't check the repository, except when using -u, it just add a * when a file needs updating)
    - delete directory
    - - svn delete directory
    - - svn ci -m " " directory

  • tagging
    - svn copy -m " " svn://192.168.0.1/seng/trunk/ svn://192.168.0.1/seng/tags/2.4/
    - svn move -m " " svn://192.168.0.1/seng/tags/2.4/trunk svn://192.168.0.1/seng/tags/2.4/2.4.0.a1








  • Status values
    A: Resource is scheduled for Addition
    D: Resource is scheduled for Deletion
    M: Resource has local Modifications
    C: Resource has Conflicts (changes have not been completely merged between the repository and working copy version)
    X: Resource is eXternal to this working copy (may come from another repository). See «svn:externals»
    ?: Resource is not under version control
    !: Resource is missing or incomplete (removed by another tool than Subversion)
    ~: Something is messed up
  • Sunday, May 25, 2008

    /MP C++ compilation option in VS2008

    "Multi-processor" compilation.
    Not a default, need to be added manually to the command line options.

    Thursday, May 8, 2008

    Windows admin Survival kit

  • C:\> FOR %f IN (dir c:\tmp\*.*) DO toto.exe %f param2

  • tracert.exe

  • C:\Windows\System32\drivers\etc\hosts

  • To change program that start when Windows starts

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    RunOnce
    RunServices
    RunServicesOnce

    If what you are looking for is not there, you can check also: HKEY_CURRENT_USER
    .
  •