import java.util.logging.Logger;
import java.util.logging.FileHandler;
import java.util.logging.SimpleFormatter;
import java.util.logging.Level;
logger = Logger.getLogger("com.mycompany.conversion"); // logger internal name
FileHandler fileHandler = new FileHandler("basic.conversion.txt", 1000, 1);
fileHandler.setFormatter(new SimpleFormatter());
logger.addHandler(fileHandler);
logger.log(Level.INFO, " Initializing GgWebService");
See also:
C:\Program Files\Java\jdk1.6.0_10\jre\lib\logging.properties
.
Sunday, November 30, 2008
Friday, November 21, 2008
Strings
string is an alias for String
String: UTF16
UTF16
wchar_t: UTF16 on Windows, UTF32 on Unix
wchar_t is not portable, better to use ICU instead.
typedef basic_string < char > string;
typedef basic_string < wchar_t > wstring;
wstring string1 = L"obecně";
UnicodeString: UTF16 internally. Note that the endianess of UTF-16 is platform dependent.
ICU does not use UCS-2. UCS-2 is a subset of UTF-16. UCS-2 does not support surrogates, and UTF-16 does support surrogates.
#ifdef UNICODE
typedef wchar_t TCHAR;
#else
typedef char TCHAR;
#endif
TCHAR * toto = _T("obecně");
Sunday, October 26, 2008
Sunday, October 12, 2008
Eclipse survival kit
create WAR files, or AAR axis2 archive files)
Windows > Preferences > Java > Code Style > Code Templates > Comments
Select Types
- 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
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
You just get "Dynamic Web Project" creation menu only when you install J2EE Eclipse version
- 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
2
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
window->Preferences, ensuite choisir Java->Code Style-> formatter et sélectionner "Java conventions [build-in]".
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.
* 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>
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)
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
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
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.
- 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
- 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
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.
Not a default, need to be added manually to the command line options.
Thursday, May 8, 2008
Windows admin Survival kit
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
.
Wednesday, April 23, 2008
To disable the PC board speaker
- "gestionnaire de peripheriques",
- afficher les peripheriques caches
- "beep", right click, "disable"
- afficher les peripheriques caches
- "beep", right click, "disable"
Thursday, April 10, 2008
MySQL survival kit
C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin>mysqld-nt.exe
You can also start it as a service
On Vista, the db file is:
C:\ProgramData\MySQL\MySQL Server 5.1\data\ibdata1
mysql -u root
> use mysql
> show tables
> CREATE TABLE cumul_bench (
id int(11) NOT NULL auto_increment,
test_desc varchar(100) default '',
tstamp datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (id)
) TYPE=MyISAM;
> show tables
> SHOW COLUMNS FROM cumul_bench
WHERE cat_id REGEXP '^10.{6}$' (start with a 10, followed by 6 digits)
- Enable query log in /etc/mysql/my.cnf (affects performances)
- [mysqld]
- general_log = on
- general_log_file = /var/log/mysql/query.log
Sunday, April 6, 2008
Saturday, April 5, 2008
Vista / W2008server / Windows7 survival kit
* Reading the following, some folders are 'virtualized' on Vista
http://support.microsoft.com/kb/927387
The way around I took, is to create a c:\MyProgramFiles
* To add 'SendTo' shortcuts:
C:\Users\myusername\AppData\Roaming\Microsoft\Windows\SendTo
* Stop continuous OS Disk Access (Vista):
- "points de restauration" in Panel/System/System protection
- Windows Defender
* Remove corrupted thumbnails in Windows7
- cleanmgr.exe (system32) and select "thumbnails". You may have to switch to the "details" view, and back again to the "large icons" view to finalize the reset
http://support.microsoft.com/kb/927387
The way around I took, is to create a c:\MyProgramFiles
* To add 'SendTo' shortcuts:
C:\Users\myusername\AppData\Roaming\Microsoft\Windows\SendTo
* Stop continuous OS Disk Access (Vista):
- "points de restauration" in Panel/System/System protection
- Windows Defender
* Remove corrupted thumbnails in Windows7
- cleanmgr.exe (system32) and select "thumbnails". You may have to switch to the "details" view, and back again to the "large icons" view to finalize the reset
Initials
- AD: Active Directory
- ACL: Access Control List
- CLR: Common Language Runtime
- CLI: Common Language Infrastructure
- CPL: Courant Porteur en Ligne = Power Line Communication (PLC)
- CMF: content management frameworks
- CMS: content management system
- ERP: Enterprise Resource Planning
- GAC: Global Assembly Cache
- GED: Gestion Electronique de Documents
- LRU: Least Recently Used
- IT: Information technology
- LAMP: Linux, Apache, MySQL and PHP
- MOA: Maitrise d'ouvrage (cree les specs, effectue la recette), parois appele "metiers"
- MOE: Maitrise d'oeuvre (recommande, implemente)
- MVP: Minimum Viable Product (asked as a first step for start up )
- PLN = CPL
- RIA: rich Internet application
- SLA: Service Level Agreement. In practice, the term SLA is sometimes used to refer to the contracted delivery time
- WMI: Windows Management Instrumentation
(nom du service en francais: Lanceur de processus DCOM)
- ACL: Access Control List
- CLR: Common Language Runtime
- CLI: Common Language Infrastructure
- CPL: Courant Porteur en Ligne = Power Line Communication (PLC)
- CMF: content management frameworks
- CMS: content management system
- ERP: Enterprise Resource Planning
- GAC: Global Assembly Cache
- GED: Gestion Electronique de Documents
- LRU: Least Recently Used
- IT: Information technology
- LAMP: Linux, Apache, MySQL and PHP
- MOA: Maitrise d'ouvrage (cree les specs, effectue la recette), parois appele "metiers"
- MOE: Maitrise d'oeuvre (recommande, implemente)
- MVP: Minimum Viable Product (asked as a first step for start up )
- PLN = CPL
- RIA: rich Internet application
- SLA: Service Level Agreement. In practice, the term SLA is sometimes used to refer to the contracted delivery time
- WMI: Windows Management Instrumentation
(nom du service en francais: Lanceur de processus DCOM)
Thursday, February 28, 2008
SQL survival kit
SELECT * FROM ITL WHERE str CONTAINS 'BBB'; --> exact match SELECT * FROM ITL WHERE str LIKE 'C'; --> starts with SELECT * FROM mytable WHERE Md IS null; SELECT * FROM mytable WHERE Id>5; SELECT count(*) FROM mytable; --> count the number of rows UPDATE table_13 SET Width=50, Height=50 WHERE id=1; ALTER TABLE mytable ADD COLUMN Width int; ALTER TABLE mytable CHANGE col col_new_name VARCHAR(255); RENAME TABLE mytable TO newtable; DELETE FROM `mytable` WHERE Url LIKE '%sylvain%'; DELETE FROM ourson_offer; DELETE FROM lt.image WHERE lt_kimage_id IN (select lt.image.lt_kimage_id from lt.image INNER JOIN lt.keyword ON lt.image.ltu_kimage_id = lt.keyword.lt_kimage_id WHERE lt.keyword.keyword LIKE '%_dead' ORDER BY lt_kimage_id LIMIT 100000);
- jointure explicite:
SELECT * FROM employee INNER JOIN department ON employee.DepartmentID = department.DepartmentID;jointure implicite:
SELECT * FROM employee, department WHERE employee.DepartmentID = department.DepartmentID;
SELECT COLUMN_NAME FROM information_schema.columns WHERE table_schema='app_v2' AND table_name='guest' ORDER BY COLUMN_NAME;
Tuesday, February 19, 2008
Perl's survival kit
[] empty array
{} empty hash
my $toto = shift equivalent to shift(@_) meaning the first function parameter.
{} empty hash
my $toto = shift equivalent to shift(@_) meaning the first function parameter.
Tuesday, February 5, 2008
msbuild.exe
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe "c:\build\MyBuild.sln" /t:Build /p:Configuration=Release;Platform=Win32 /v:diag
Switch AZERTY/QWERTY key settings (when it is changed using Studio)
When using Visual Studio, it happens that the key settings change from AZERTY to QWERTY. To put them back:
left ALT + SHIFT
left ALT + SHIFT
Sunday, January 13, 2008
Formulas in MS Excel
------ Formulas
2. Type: =(cellname1*cellname2). Substitute "cellname1" and "cellname2" with the names of the cells you would like to multiply.
Also, to mask some of the columns: "Accueuil/Cellules/Format"
------- SUM a column
. Type =SUM in the cell and then select the cells in the column, press enter
------ open a csv with specific separators in Excel
To open these “|” separated files:
Open Excel / Données/ A partir du texte / importer / Suivant / Séparateurs :autres : « | »
------- to change source cells in a pie graph
select the cells in the column, drag and drop the cell group on the pie chart
Friday, January 4, 2008
Disable C$, D$ drives sharing
For NT 4.0/W2K/Windows Server 2003s, the change is: (if the key does not exists, create it)
Hive: HKEY_LOCAL_MACHINE
Key: SYSTEM\CurrentControlSet\Services\LanManServer\Parameters
Name: AutoShareServer
Data Type: REG_DWORD
Value: 0
Do a wait with the Windows API
HANDLE handle = CreateEvent(NULL, TRUE, FALSE, NULL);
WaitForSingleObject(handle,4000);
WaitForSingleObject(handle,4000);
Subscribe to:
Posts (Atom)