Microsoft Windows

How to enable tracing and message logging

Tracing:
Windows Communication Foundation (WCF) uses the tracing mechanism defined in the System.Diagnostics namespace. In this tracing model, trace data is produced by trace sources that applications implement. Each source is identified by a name. Trace consumers create trace listeners for the trace sources for which they want to retrieve information. To receive trace data, you must create a listener for the trace source.

Activity Tracing and Propagation:
Having ActivityTracing enabled and propagateActivity set to true in the system.ServiceModel trace sources for both the client and service provide correlation of traces within logical units of processing (activities), across activities within endpoints (through activity transfers), and across activities spanning multiple endpoints (through activity ID propagation).

These three mechanisms (activities, transfers, and propagation) can help you locate the root cause of an error more quickly using the Service Trace Viewer tool. For more information, see Using Service Trace Viewer for Viewing Correlated Traces and Troubleshooting.

The following link describe in details:
How to enable tracing and message logging

Creating a Windows service for Glassfish

Steps

  1. Install a Glassfish Applications server from http://www.oracle.com/technetwork/middleware/glassfish/downloads/index.html
  2. Open a Windows Command Line: Start Menu -> Run
  3. Change to your glassfish/bin directory

    cd $GLASSFISH/bin
  4. Execute the following command (for Glassfish v3):

    asadmin create-service --name "$SERVICENAME" $DOMAIN

    $SERVICENAME ... the name of your Windows service
    $DOMAIN... the name of your application domain in the glassfish
  5. Execute the following command (for Glassfish v2):

    C:\WINDOWS\system32\sc.exe create $SERVICENAME binPath= "$glassfish-root\lib\appservService.exe \"$glassfish-root\bin\asadmin.bat start-domain --user admin --passwordfile $glassfish-root\passwordfile $DOMAIN\" \"$glassfish-root\bin\asadmin.bat stop-domain $DOMAIN\"" start=auto DisplayName="$DISPLAYNAME"

    $SERVICENAME ... the name of your Windows service
    $DOMAIN... the name of your application domain in the glassfish
  6. Check if your windows service was created correctly and set to start automatically:
    1. Goto: Start -> Administrative Tools -> Services
    2. Right klick on your service and select properties
    3. Check if Startup typ is set to Autmatic
  7. Klick Start, to start the service

Commands (only Glassfish v3)

  • To start the service from commandline: /path/to/$SERVICENAME start
  • To stop the service from commandline: /path/to/$SERVICENAME stop

Adding a ODBC connection to MySQL and use it within Microsoft Excel

Microsoft Excel offers to connect to all common database management systems (DMBS) trough the ODBC interface. Excel has a built connector for Microsoft Access and Microsoft SQL. Since we are using MySQL we need acces the DBMS go trough ODBC.

An ODBC connection brings two components into play:

  1. ODBC driver manager

    The ODBC driver manager handels all the installed ODBC connectors. Microsoft Excel uses the ODBC driver manager which interfaces the ODBC connector to Microsoft Excel. Windows offers an integrated driver manager. To open it click the Start button -> Control panel -> Administrative tools -> Datasources (ODBC).
    ATTENTION: Since Mac OS X (10.6) there is no built in ODBC driver manager availble. Therefore it has to be manually installed under Mac OS X greater or equal than version 10.6. A recommendation is to use iODBC, an open ODBC driver manager. It is available for Linux as well. Download it at: http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads and install it

  2. ODBC database connector/driver

    This connector is needed for each particular database management system (DMBS) as its implementd DMBS specific that means there is no common connector for all DBMS available. In our case as we want to use MySQL we need the MySQL ODBC driver either for Windows or Mac OS X. Download the connector at: http://www.mysql.com/downloads/connector/odbc/
    ATTENTION: Check for which if your Excel is a 32 bit version or a 64 bit version. Even you are using a 64 bit version of Windows, if you have a 32 bit version of Excel running on it you need the 32 bit version!

Once the driver is installed, it can be configured trough the driver manager. Open either iODBC (in case of Mac OS X) or the built in driver manager of Windows (Start button -> Control panel -> Administrative tools -> Datasources (ODBC)) and you are able to add a new user data source (a so called DSN). For this DSN you must provide all relevant information (e.g server address and port, username, password, database name). A easy to understand wizard will guide you trough this process. This works quite similar under Mac or Windows.

Once the DSN is configured properly it is possible to use this database within Excel.
Open a new spreadsheet and klick on Data -> Other sources -> From Microsoft Query (see an attached screenshot of a German Excel version). Then you can select the previously configured DSN of your datasource. Select them and Microsoft SQL appears (see attached screenshot). You can enter your query here and execute it. Once the query is valid, Excel offers you different choices what to do with the retrieved data (please see an attached screenshot). You can simply add the result set to a table or transform it into a pivot table.

Use Samba or OpenSSH

If you want to host (or have access to) network folders that can be accessed with Windows in Linux systems you can use Samba[1]. You just have to install and configure it which can be very tricky.
On the other hand if you want to have access between Linux computers you can use OpenSSH which is already included in most of the Linux distributions.

[1] http://en.wikipedia.org/wiki/Samba_%28software%29
[2] http://www.openssh.com/

Set Prefered Language

According to http://www.w3.org/International/questions/qa-lang-priorities this is simple:

Firefox
To change your language preferences go to Tools > Options (Windows) or Edit > Preferences
got to tab Content. Down right of Languages click on the button Choose.

* You can add languages to this from a (long) pre-defined set, and Firefox will send all the languages you choose with the Accept-Language header in the order in which you arrange them.
* You can't create custom language tags using the standard interface. (You can, however, via about:config, using intl.accept_languages if you are geeky enough.)

Safari
On Mac OS X the language sent is that specified in the OS X system language preferences. To change those preferences go to System Preferences > Language & text > Language. You can have a long list of languages in this dialog box, but Safari will only send the top item with the Accept-Language header. You can't create custom language tags.

On Windows, you can't change the language sent by Safari. The language sent with the Accept-Language header is derived from your system settings.

Google Chrome
To change your language preferences go to Options (Windows) or Chrome > Preferences (Mac OS X), and select Under the Bonnet > Web Content > Languages & Spellchecker settings.

You can add languages to this from a pre-defined set, and Chrome will send all the languages you choose with the Accept-Language header in the order in which you arrange them. You can't create custom language tags.

Opera
On Windows you can change your language preferences at Menu > Settings > Preferences > General > Language > Details (button).

DropBox folder sync Software

The solution is a little Program, for Windows, called “Dropbox Folder Sync”. You can find it on the following Homepage: http://satyadeepk.in/dropbox-folder-sync/. It’s freeware and only needs an NTFS partition with DropBox installed on it. It works up from Windows XP and only requires .NET framework 4.0.
Once installed, you would be able to Sync/Unsync each folder with an right click on it. “Dropbox Folder Sync” will then copy this folder to your DropBox folder, and create an symbolic link on the same location with the junction utility.

Providing internet access with Microsoft ISA-Server

The Microsoft ISA-Server can be uses as a proxy server to provide internet access to a school class. Additionally it gives the possibility to define a firewall to restrict access to some ports. Also it provides a traffic analyser. I installed the ISA-Server on a on Microsoft Windows 2003.
Since my schoolmates had also the task to set up different servers and test them they wanted the opportunity to work from home on their tasks. The conclusion was to install a VPN. For this the ISA-Server was ideal. After a couple of configurations it was possible for my class mates to create a VPN tunnel from home to our class network and work on their projects.

OutOfMemoryException when using WEKA 3-6 under Windows 7

Firstly the Weka-User has to extend the memory available for the Java virtual machine by setting appropriate options. With Sun's JDK the Weka-User can set the parameter "-Xmx1024m" to set the maximum Java heap size to 1024MB.
Under Windows 7 The Weka-User can set this parameter under Control Panel -> Java -> Java -> View -> Runtime Parameters.

Secondly the Weka-User has to change the "maxheap" parameter in the RunWeka.ini File. This file is contained in the root directory of your Weka installation. By setting "maxheap=1024m" the maximum heap size is set to 1024MB.

Power shell script

Windows PowerShell is Microsofts solution for automate administative tasks on local or remote Windows systems. The task are written in PowerShell scripts and executed on the command line.

The solution of the problem is to write a script, that remote connects to each target server and read out the disk size and free space of each disk. The script sends the result to an email adress.
The monitored servers are saved in an txt file. The script is sceduled by the windows task scheduler once a day.

The interesting part of the script

foreach($server in $servers)
{
$disks = Get-WmiObject -ComputerName $server -Class Win32_LogicalDisk;
foreach($disk in $disks)
{
$size = $disk.Size;
$freespace = $disk.FreeSpace;
}
}

This information can be outputed directly or further processed by the script

This information can be outputed or

Create an "own package" for the 64 bit Operating Systems

It seems that the actual versions of xampp are for 32bit-versions of Windows operating systems. But after some search in the internet I found the good hint that all the parts of the xampp package are also alone available and I just needed the webserver (apache), php and mysql and all three are available in a 64 bit version.
I've downloaded that three that are normally part of the package, installed them make some changes in the configuration (I found a tutorial on the internet for this) and it worked.

Pages

Subscribe to Microsoft Windows