2009-10-08

Silverlight for Windows Embedded^H...^H C++

Microsoft has released Silverlight for Windows Embedded. OK, Silverlight runs also on Embedded Devices, not a big deal, not for me anyways, but the first thing that came to my eye was "Silverlight for Windows Embedded is a native code (C++) UI framework".

Native code (C++) UI framework, awesome! Here is a more wide description from the Overview video:

Is a C++ backend instead of managed, for performance and for footprint, but, also we've taken the toolchain from the Silverlight development process so you still get all the benefits of having the two disciplines of the designer and the developer.

So with Expression Bend you are still able to design all of your UIs and all of the storyboards and animations and all the effects that encapsulate the UI are all still done by the designer and then the developer takes that XAML and instead of writing managed C# or VB they write C++ code.

Next I wanted to see how the code looks like, I've found this tutorial and a document on how to "Create a Custom User Control in Silverlight for Windows Embedded".

I don't see why this C++ Silverlight framework should not be available for Desktop, performance and small footprint are also important for Desktop applications.

This would be a great addition for Visual Studio 2010 for native developers, besides the new Intellisense based on the EDG C++ frontend. But I guess the feature list for Visual Studio 2010 is frozen, maybe for Visual Studio 2012.

If you think that having this technology brought to the Desktop is a good idea please sign this petition and spread the word.

2009-09-30

Batch change script for Visual C/C++ Projects

Visual C/C++ projects are XML files but they have a different file extension (*.vcproj).

Having to change an option to through tens of projects files each with more than one platform (Win32, Win64, Windows Mobile) and multiple configurations (Debug, Release) only by loading the projects in Visual Studio and clicking through the UI is not very appealing.

Since we already know that the project files are XML files one can write a program / script to change the desired option, in my case the change of the C runtime library - dynamic / static.

I have chosen WSH JScript, MSXML 3.0 and XPath to write a script to change Visual C/C++ projects. My decision was due two arguments: JScript is present on Windows XP, and the scripts can be debugged by Visual Studio 2005+ (//X command line parameter).

During the development I have stumbled on a XPath query problem, the function contains was not found in msxml3.dll. The problem was due to the fact that MSXML 3.0 was not instructed to use XPath as selection language (xmlDoc.setProperty("SelectionLanguage", "XPath");). Newer MSXML versions do not have this requirement though.

The message boxes displayed when issued from command line like change_runtime.js myproject.vcproj are due to the fact that JScript is not the default scripting language in WSH. One solution is to call the script like: cscript change_runtime.js myproject.vcproj, which requires some typing, the other solution is to change the default scripting language in WSH, which can be accomplished by running cscript //H:CScript.

The source code can be found here. Changing Visual C/C++ projects just become easier for me :-)

2009-09-19

Browsere moderne

Browserele web moderne (ultimile versiuni) știu să genereze caracterele lipsă din fonturi atunci când pagina web o cere.

Am decis să testez această funcționalitate pe un sistem Windows XP SP2, cu setările implicite (Engleză SUA), și fără actualizări. În special am urmărit cum se descurcă cu caracterele ș și ț cu virgulă, care lipsesc din fonturile cu care vine Windows XP SP2 (pentru mai multe informații a se vedea pagina lui Cristian Secară ș-uri și ț-uri). Ulterior am testat și sistemul de operare Windows 7.

Pagina de test conține o pangramă (Muzicologă în bej, vând whisky şi tequila, preţ fix.) scrisă cu familiile implicite de fonturi serif, fără serif și monospațiat în forma normală și cursivă. Setul de caractere setat a fost UTF-8.

Microsoft Internet Explorer 6


Microsoft Internet Explorer 7


Microsoft Internet Explorer 8


Mozilla Firefox 3.5.3


Google Chrome 3.0


Opera 10.0


Safari 4.0.3


Internet Explorer 6 a fost luat drept referință. Mozilla Firefox s-a descurcat cel mai bine la famillile de fonturi serif și fără serif în forma normală, forma cursivă și cea monospațiată a caracterelor ș și ț nu se integrează foarte bine cu restul caracterelor.

Pentru a repara problema caracterelor ș și ț în fonturile serif și fără serif Microsoft în luna Mai 2007 a scos un pachet de actualizare a unor fonturi din sistemele de operare Windows XP și Windows Vista.

Familia de fonturi monospațiate nu a beneficiat de o actualizare, a se vedea captura de ecran de mai jos:

Microsoft Internet Explorer 8 (cu pachetul de fonturi actualizate)



Windows 7 beneficiază de fonturi monspațiate care conțin caracterele ș și ț, a se vedea captura de ecran de mai jos:



Captura de ecran de mai sus arată o problemă în Internet Explorer 8 din Windows 7, problemă cu varianta implicită a fontului serif. Setarea "clear type" a fost activată, dar dintr-un motiv necunoscut textul este afișat foarte prost.

Mozilla Firefox 3.5.3 afișează corect caracterele ș și ț rulând pe Windows 7:



Google Chrome 3.0 afișează corect caracterele ș și ț rulând pe Windows 7:



Safari 4.0.3 afișează corect caracterele ș și ț rulând pe Windows 7:



Opera 10.0 afișează corect caracterele ș și ț rulând pe Windows 7:



Concluzie: în Windows 7 problema caracterelor ș și ț cu virgulă este deja rezolvată.

Hidden stream

If you wondered why does a security dialog pop up when you try to run the oggcodecs installer (or every executable for that matter) after downloading it from the Internet, this post is for you.

The security dialog looks like:



If you look at the file properties there is no checkbox like "this file came from the Internet" (CHM files have a check for this though), but this information is stored somewhere, in a NTFS Alternate Data Stream.

To check if a file has a NTFS Alternate Data Stream one can use the Streams utility made by By Mark Russinovich of Sysinternals fame.

Running streams oggcodecs_0.81.15562-win32.exe resulted: :Zone.Identifier:$DATA 46.

To view this "Zone.Identifier" stream I have used the more command like more < oggcodecs_0.81.15562-win32.exe:Zone.Identifier which resulted:

[ZoneTransfer]
ZoneId=3


Firefox is adding this extra information for every executable file downloaded. Does every web browser (I've tested only I few I know of) on Windows add this extra information?
  • Mozilla Firefox 3.5.3 - yes (:Zone.Identifier:$DATA 46)
  • Microsoft Internet Explorer 8.0 - yes (:Zone.Identifier:$DATA 26)
  • Google Chrome 3.0 - yes (:Zone.Identifier:$DATA 24)
  • Safari 4.0.3 - yes (:Zone.Identifier:$DATA 26)
  • Opera 10.0 - no

Interesting how the size of the stream varies with every browser. I have submitted a bug report to Opera, because they should also add this extra information to the downloaded files.

Adding the Zone.Identifier stream can be done easily with a batch file
(from_internet.cmd)

@echo off
if [%1] == [] (

  echo Usage: from_internet.cmd executable_name

) else (

  echo [ZoneTransfer]> %1:Zone.Identifier
  echo ZoneId=3 >> %1:Zone.Identifier

)


Deleting a stream can be done by using streams -d.

2009-05-23

Colorful Epiphany

I always thought that the RGB macro (Win32 GDI) which takes three arguments - red, green and blue - will create a 0xRRGGBB value.

I was wrong! Win32 GDI uses BGR colors! d'oh

Here is another assertion on the path of assertiveness (germ. Durchsetzungsvermögen)

#include <windows.h>
#include <assert.h>

int main()
{
     COLORREF color_rgb = 0xBBAADD;
    
     assert(color_rgb == RGB(0xBB, 0xAA, 0xDD));
}

Cheers!

2009-05-12

Visual Studio 2008 Donation

I would like to thank Opera Software for the retail package of Visual Studio 2008 Standard Edition I just received!


Thank you!

2009-03-11

DirectShow oggenc v0.1

I have created a DirectShow oggenc clone, mainly due to Ticket #1517 (How to calculate the OGG encoding complete percent correctly?). It is a Visual C++ console application which renders an audio file, removes the audio renderer and inserts a Vorbis encoder and an Ogg muxer filter.

The example also illustrates how to use the IVorbisEncodeSettings and IOggMuxProgress COM interfaces.

During the development of the tool I have found out a few quirks of the COM interfaces, all of which I will address in future oggcodecs releases.

The supported audio source file formats are: WAV, MP3, WMA. FLAC and OGG are not supported because I have used IMediaDet DirectShow interface, which is not supported by oggcodecs at this moment.

One can use another methods of determining the length of the audio source file (seeking at the end of the file and getting the position), which would enable support for FLAC and OGG.

Testing the tool showed that encoding a 4m50s audio wave file on Windows Vista 64bit took an average of 18.1 seconds for the 32bit version, while the 64bit version took on average 13.1 seconds, a speed improvement of ~27%.

Source code can be found here, binaries can be found here (32 bit) and here (64 bit).

2009-02-23

Windows 7

Today while doing a bit of research regarding https://trac.xiph.org/ticket/1498
I found out another limitation of the default audio renderer in DirectShow.

The DirectSound audio renderer cannot play 192KHz, 24 bit audio samples. This behaviour was present on Windows XP SP3 and Windows Vista SP1.

To my surprise Windows 7 (build 7000) doesn't have this limitation, Windows Media Player 12 was able to play the 192Khz 24bit sample FLAC file from Linn Records

Windows Media Player 12 also knows about Ogg Vorbis metadata, which came as a surprise as well.

If somebody will ask me why he/she should upgrade to Windows 7 now I now what to answer :)

2009-01-21

Mono 2.2

Recently Mono 2.2 was released. It has a bunch of new stuff, one of them is: SIMD (Single Instruction, Multiple Data) support in Mono.

Miguel de Icaza has a blog entry where he describes the new SIMD support in Mono. He has ported to C# a C++ application, to illustrate the new SIMD stuff, and then he compares the results, the C++ program was rather slow. I had a look at the source code an I've seen that the C++ program was compiled in debug mode.

I've decided to make a few tests for myself. I've used MinGW 4.3.2 and Visual Studio 2005, the tests where run on my Intel Mobile Core 2 Duo T7500.

Here are the results (in seconds):



The parameters for the above results were:



Mono is not quite there yet (at least on Windows).

I had to change the timing code for the C++ code, glib::GTimer is not a very good option on Windows. I've used the high-resolution performance counter, the code is presented below:


#ifndef PERFTIMER_H
#define PERFTIMER_H

#include <windows.h>
#include <string>

#include <iostream>
#include <iomanip>
#include <sstream>

class PerfTimer
{
     LARGE_INTEGER start_;

     LARGE_INTEGER stop_;
     LARGE_INTEGER freq_;
   public:
    
     PerfTimer()
     {
       QueryPerformanceFrequency(&freq_);
     }

    
     void Start()
     {
       QueryPerformanceCounter(&start_);
     }
    
     void Stop()

     {
       QueryPerformanceCounter(&stop_);
     }
    
     std::string ToString()
     {
       const int precision = 10000000;

       unsigned long time = static_cast<unsigned long>(
     (stop_.QuadPart - start_.QuadPart) * precision /
     freq_.QuadPart);
      
       std::ostringstream os;

       os << std::setfill('0');
       os << std::setw(2) << time / precision / 3600 << ":";
       os << std::setw(2) << time / precision % 3600 / 60 << ":";

       os << std::setw(2) << time / precision % 60 << ".";
       os << std::setw(7) << time % precision;
       os << std::setfill(' ');

      
       return os.str();
     }
};

#if 0
int main()
{
   PerfTimer timer;
   timer.Start();

   Sleep(1250);
   timer.Stop();
  
   std::cout << "Time: " << timer.ToString() << std::endl;
  
   return 0;
}

#endif

#endif // PERFTIMER_H




There are a few things I would like to point out about the Mono 2.2 Windows installer.

1. The executable is not digitally signed by Novell.



2. The graphics are hideous, 16 colors dithering? why? Is anybody in their right mind running Windows in 16 colors?


2009-01-18

Windows CE

I've been busy with the port to Windows CE of libogg, libvorbis, libflac. This is only the beginning, there is still allot of work remaining.

Also I've done a bit of restructuring, I've reduced the number of binaries from 30 to 20, by changing from dynamic link libraries to static libraries. I've changed the usage of the CRT, from dynamic to static linking, this has increased the size of the binaries but overall the installer has the same size, thanks to LZMA solid compression :-)

The above changes will ease the usage of the libraries, for example only dsfOggDemux2.dll dsfVorbisDecoder.dll are needed for Vorbis decoding.

I have created my first Windows CE "Hello World" program. I've wanted for a long time to do that. I've learned that Windows CE has only Unicode support, no more multi byte nightmare.

Because you don't have a console attached the classical "Hello World" is a bit different, a bit WIN32 APIsh:


#include <windows.h>

int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd )
{
    
wchar_t message[] = L"Goodbye cruel adventure world!";
    
wchar_t caption[] = L"Monkeys are listening";

    ::
MessageBox(0, message, caption, MB_OK | MB_ICONINFORMATION);
    
    
return 0;
}



If you try to run an executable which is not digitally signed, you are being prompted by the operating system telling you that it's dangerous to run "unknown" software.

Since I have a certificate from CERTUM I have signed the executable, but still the prompt was there. The problem was that my telephone doesn't have the root certificate from CERTUM installed. I've went to CERTUM's root certificate page and taken the "Public Key of Certum Level II", installed it and my program ran without any prompts from the operating system.

And now the mandatory "screen shot":

2009-01-15

Programming -- Principles and Practice Using C++

Is the name of Bjarne Stroustrup's latest book.

Here is a quote for the book's website:
It is designed for classroom use, but written with an eye on self study. Drafts have been used as the basis for first programming classes for electrical engineer, computer engineer, and computer science students at Texas A&M University for three years now.

The first thing that you notice when you open the book it's the color! The book is colored, and it has lots of pictures! You can notice that also in the sample chapters found on the book's website :)

My guess is that it was the author's intention to make it more appealing for the students, having to read more than 1000 black and white pages can have a devastating effect on a student's pathos!

This is the second colored programming book that I have, after "Windows Presentation Foundation Unleashed".

This is Bjarne's first book about graphical user interface (GUI) applications development. He had chosen FLKT as a GUI library, and there are four chapters allocated (~160 pages).

I can't say anything more because I haven't read it, but I can attach a picture:

2009-01-12

OptiPNG

When it comes to saving screen shots, PNG is the number one image format due to its lossless compression.

JPEG has artifacts around text and washed colors because of lossy compression, GIF has a limited color palette (only 256 distinct colors).

Normally PNG files a bit bigger than JPEG and GIF, but with OptiPNG you can decrease the size of a PNG file quite a bit.

I have taken a screen shot of vorbis.com and saved it under different file formats:
  • BMP - 2.956.854 bytes
  • PNG - 130.174 bytes (IrfanView level 9 compression)
  • PNG - 115.491 bytes (Microsoft Paint)
  • JPEG - 99.003 bytes (80% compression)
  • GIF - 90.024 bytes
  • PNG - 88.040 bytes (OptiPNG on Microsoft Paint's PNG file)
  • PNG - 87.967 bytes (OptiPNG on IrfanView's PNG file)

OptiPNG has been created by Cosmin Truţa, yet another famous Romanian computer science engineer star

2009-01-06

XAML in native C++

With the advent of WPF and XAML Microsoft has changed the way GUI Windows applications are developed, by introducing markup language into GUI development.

Unlike previous GUI APIs, the core of the WPF is written entirely in managed code, there is nothing for native C++ developers, there is not even support for C++/CLI (one can do some workarounds, but no support from the IDE and Blend)

Today I have found out that CodeJock has added support (see press release) for XAML scripts in their Xtreme ToolkitPro library. They do not support everything from WPF, they started adding markup properties for various GUI elements, in time the support will continue to grow.

The XAML section of their forums contains lots of information on the topic, which stuff is working, which is not. There I have found out sample applications, an early version of their MarkupPad (now an year old), which shows the capability of their XAML parser.

I have made a screenshot with MarkupPad and XAMLPad:



They both look the same, then I have had a look with Process Explorer and here is another picture with the results (see memory footprint):



I am aware that the comparison is not fair, CodeJock doesn't have a full XAML parser (no Timeline, no 3D, no...), but these are facts which can be seen at the moment.

Hats off for CodeJock for adding this functionality, I guess Microsoft could have done the same for MFC, but they don't care anymore about native GUI development, the latest new blood in MFC was bought from BCGSoftware, which doesn't have any support for XAML in their flagship products, namely BCGControlBar

It would be nice to have an open source, cross platform, native C++ XAML parser.

2009-01-04

Python has a bin

I mainly use Python on Windows as a calculator. I can use expressions, variables, and it can handle really big numbers.

When I need to transform decimals into hexadecimal I use hex(number) function. On many occasions I've tried bin(number) and failed because until Python 2.6 there was no bin function, it took me some time to realize why it worked :) then I've read Python 2.6 change log.

Python 2.6 is cooler now with the bin function!

2008-12-07

New oggcodecs release

I'm proudly presenting Oggcodecs "Nikolaus" release.

This version has lots of bugfixes, particularly to Theora and FLAC. I've added support for Windows x64 versions.

For Windows XP x64 you will need to use Media Player Classic Home Cinema or some other 64 bit player, because Windows Media Player doesn't install the 64 bit version.

If you want to use Windows Media Center on Windows Vista x64 you will need to point it to the 64 bit Windows Media Player.

Windows Vista x64 has the 32 bit version of Windows Media Player set by default. For more information about this issue visit this page.

Oggcodecs installer sets the file associations to the 64 bit version of Windows Media Player, so it will work out of the box without needing to switch on the 64 bit version.

For more information about the release visit the Oggcodecs DirectShow homepage

2008-11-02

A fish called Xiphophorus

The current unstable version of DirectShow OggCodecs is coming along nicely. In order to prepare for a release party (OggCodecs or Theora 1.0), I've asked my girlfriend if she could paint a T-Shirt with the "Fish".

Here are some pictures documenting the process:





Thank you Alina-Simona!

2008-10-14

GMX Multimessenger uses(?) oggcodecs

Today I've installed a new Instant Messenger program - GMX Multimessenger (available only in German).

By looking in the programs instalation folder (while trying to enable HTTP Proxy) I found out these familiar DLLs:
dsftheoradecoder.dll
dsftheoraencoder.dll
libooogg.dll
libootheora.dll

Those DLLs are part of oggcodecs! thus meaning that they use oggcodecs, or?

Although they mention Theora in Settings page:


while trying to use Video Chat an Adobe Flash window was opened. Video Chat is done using Adobe Flash!

I've tried to enable Theora Video Chat but failed, the above mentioned DLLs are not even loaded by the process.

They mention Xiph.org, CSIRO and Zentaro Kavanagh in About dialog, but I don't know how they use Theora codec:

2008-09-16

They don't make'em as they used to...

Why does Thread.Sleep Method (Int32) have a signed parameter for the duration of time? Can you go back in time with a negative value? Is this an undocumented method of undoing things?

Compare this (System.Threading.Thread.Sleep) with this (Win32 Sleep).

Usually INFINITE is set to the maximum value. For Win32 API this would be 2^32 -1, for .NET that would be 2^31-1. The .NET INFINITE is half of the Win32 API INFINITE.

Instead of maximum sleep time of 49.71 days you get only 24.85 days... :)

2008-09-14

IBC

Today I've visited IBC in Amsterdam. I must say that it was impressive. I have failed to cover everything in just six hours. Somehow I've missed the Fluendo booth, but had a short talk with a guy from BBC's Dirac booth.

Next year I plan to visit more. No pictures at the moment, hopefully I can get some from one of my colleagues.

Edit: And the promised picture is here:



ADAM - Professional Audio (Ogg that is :)

2008-08-20

First CodeProject Article!

My first CodeProject Article - regsvr42: Generate SxS Manifest Files from Native DLLs for Registration-Free COM. It was really fun to write, not to mention very useful. I wish I had this tool a few years ago, when I was hunting after COM interfaces into COM components.

Don't forget to logon CodeProject and give a high mark! :-)

2008-08-15

Boost 1.36.0

Boost 1.36.0 has been released and is available from SourceForge.

This release include four new libraries:
  • Accumulators: Framework for incremental calculation, and collection of statistical accumulators, from Eric Niebler.
  • Exception: A library for transporting of arbitrary data in exception objects, and transporting of exceptions between threads, from Emil Dotchevski.
  • Units: Zero-overhead dimensional analysis and unit/quantity manipulation and conversion, from Matthias Schabel and Steven Watanabe
  • Unordered: Unordered associative containers, from Daniel James.
Updated libraries include Asio, Assign, Function, Hash, Interprocess, Intrusive, Math, MPI, Multi-index Containers, PtrContainer, Spirit, Thread, Wave, and Xpressive.

On the same note Microsoft released the first Service Pack for Visual Studio 2008. C++ gets TR1 (shared_ptr, regex and more!) and new MFC face lift classes.

2008-08-14

Visual C++ 2008 Keybinding Reference Poster

One thing I haven't studied since my first encounter with Visual Studio, and back then I haven't had such a nice pdf, is the Visual C++ Keybinding.

Microsoft has nicely made this available for Visual C++ 2008!

I did not know that CTRL+SHIFT+INS is the keymapping for Edit.CycleClipboardRing, I always used Visual Assist's CTRL+SHIFT+V functionality - a menu, not some selected text which you can cycle through. This functionality can come in handy when you don't have access to Visual Assist, either by being stranded in C# land where the landlord is named Resharper or by using the Express (no addons) edition.

Don't forget to print the "Poster", you! might learn something new about Visual C++ Keybinding.

Note: Usually I'm OK with the default Visual C++ keybinding, but since Visual C++ 2003 they've changed the F7 keybinding from "Build Project" to "Build Solution". Visual C++ 2008 has F7 or CTRL+SHIFT+B mapped to "Build Solution". I've customized F7 to Build.BuildSelection (works somehow better than Build.BuildOnlyProject)

2008-06-22

Windows XP Manifest File Maker

Windows XP has introduced a new theming API. You can make your applications to use this new theming API by the use of a .manifest file. This manifest file can sit alongside your application or in your applications resource part.

Here is a batch file which creates such a manifest file:

@echo off

rem (c) 2008 Cristian Adam

if [%1] == [] (

echo Usage: make_manifest file.exe

) else (

if exist %1.manifest goto :EOF

echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes" ?^> >> %1.manifest
echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"^> >> %1.manifest
echo ^<description^>Windows Forms Common Control manifest^</description^> >> %1.manifest
echo ^<dependency^> >> %1.manifest
echo ^<dependentAssembly^> >> %1.manifest
echo ^<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /^> >> %1.manifest
echo ^</dependentAssembly^> >> %1.manifest
echo ^</dependency^> >> %1.manifest
echo ^</assembly^> >> %1.manifest

)


And now a screenshot to show the before and after state:

2008-06-15

First release of oggcodecs

I've released my first release of oggcodecs:

Current UNSTABLE Version (0.80.15039) - 14.06.2008
Changes this version

* Support for Microsoft Windows Vista
* Updated compiler to Visual Studio 2008 Express, which drops support for Windows 9x, NT 4.
* Updated libspeex to version 1.2 beta 1
* Updated libvorbis to version 1.2.1 (20080501)
* Updated libogg to version 1.1.3
* Updated libtheora to version 1.0beta3 (20080416)
* Updated libFLAC to version 1.2.1
* Fixed crash at the end of incomplete Theora files.

2008-06-12

Google Translate Learned Romanian

I found out recently that Google translate knows how to translate from Romanian to English and from English to Romanian.

I've used Goosh - Google Shell - to translate a quote from a previous post:

guest@goosh.org:/web> translate en ro This is a great victory for the glorious people of Romania!
translating "This is a great victory for the glorious people of Romania!" from "english" to "romanian":

"Aceasta este o mare victorie pentru oamenii de glorie a Romaniei!"


It's pretty good, with time it will become better :-)

2008-06-11

Why Microsoft? Why?!

Take the cab file format. It's present on every windows from Windows 95. If you use the LZW compression algorithm you get small archives.
986.875 oggcodecs.7z
1.150.890 oggcodecs.cab
1.618.917 oggcodecs.zip

It's better than zip and a bit worse as 7-zip.

The problem with cab file format it's that it's hard to use it in command line.

For example here is what you need to code to compress one directory into a cab file:
for %%i in (oggcodecs\*.*) do echo "%cd%\%%i" >> files.ddf
makecab /L . /D CompresionMemory=21 /D CompressionType=LZX /D DestinationDir=oggcodecs /F files.ddf
del files.ddf
move disk1\1.cab oggcodecs.cab
rmdir disk1
del setup.inf
del setup.rpt

Pretty hard core. One might say that this is not a tool to be used from a command line as rar or other popular archiving programs. This is done only once by me in a script file, so I can live with it.

The problem is with the extraction method. I have created a folder inside that cab file, which I can see with Total Commander, 7-zip File Manager etc, but with Windows Explorer I see directly the files, without the directory. There is one command line program which handles cab archives - expand.exe. Expand.exe doesn't know about directories in cab files, there is no switch to instruct him to preserve the directory structure from the cab file.

Why Microsoft? Why?

The solution is simple, create the destination folder first, d'oh!

mkdir oggcodecs
expand oggcodecs.cab -F:* oggcodecs\

Why not use 7-zip and ignore all this trouble? A cab file I can digitally sign and you can see it's coming from me and you don't need a 3rd party program to unpack!

2008-06-10

Why Microsoft? Why?!

I haven't mentioned here that I lost my fate in Microsoft that they can deliver good development tools a long time ago, I guess that was when I saw Visual Studio .NET 2002 for the first time. The .NET age fuc*ed it up real good.

At work I have Visual Studio 2003 and 2005 installed on D drive. Now I had to install Visual Studio 2008 on my system. I choose D drive, I verify every component that it should install on D drive and click Next, Next... Finish.

To my surprise the C++ component (VC directory) was installed on C drive, I said to myself... hmm, maybe I've forgot to install it on D, but it was working and I've ignored the issue.

The problem was when I've tried to compile something from the console. I've opened a console, setup the environment variables "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" and then hit nmake.

It complained that it could not find rc.exe, WTF. Then I found out that rc.exe is part of the Microsoft SDK which was on D (D:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\). When I try to setup the environment variables for Microsoft SDK ("d:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\SetEnv.Cmd" ) it complains that it can not find a compiler...

So now I'm installing everything on C drive, because for Microsoft, C++ should stay on C drive.

Edit: It works now (everything is on drive D), I've uninstalled all the programs that had a connection with Visual Studio 2008. If at first you don't succeed then try again, and again, and again.

2008-06-07

Authenticode

By using code signing with a certificate provided by Certum I was able to change how the oggcodecs installer looks on Windows Vista from this:



to this:



The name of the installer looks different, but my name is displayed under :)

Maintainer for Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC

I probably should have blogged sooner, but here it is: I'm the current maintainer for Directshow Filters for Ogg Vorbis, Speex, Theora and FLAC.

If you want a hardware Ogg Player you should consider buying a Trekstor Samsung (most of their MP3 players support Ogg Vorbis and FLAC formats) product!

2008-05-31

New beta version of Y!M 9

Yahoo Messesnger 9.0 has reached version 9.0.0.1389. This version fixes the long standing bug with Romanian „ă” character inserted with AltGr-A which was interpreted as Ctrl-Alt-A.

This is a great victory for the glorious people of Romania!

2008-04-29

Pimpin' Windows XP's cmd.exe

I like the command line interface, not because I own a Das Keyboard and I'm forced to look at the screen, but because I like to type.

Windows XP's cmd.exe was not one of my favorite consoles, it lacked configurability, especially in the font area. You have only two options when it comes fonts: raster fonts and "Lucida Console".

I grew accustomed with "DejaVu Sans Mono" font from my Linux days and since then when I think about a monospaced font I think of "DejaVu Sans Mono".

One option is to use an alternative console, but I found out that it's not as fast as cmd.exe.

The solution is to replace "Lucida Console" with "DejaVu Sans Mono"! Just fire you your favourite font editor and do the required changes, then install the new "Lucida Console" and that's it.

Here is a screenshot with my pimped cmd.exe



In the meantime I've found an easier way of changing the console font, read more about it here

2008-03-09

Limba noastră-i o comoară

This post is intended to the Romanian audience.

Astăzi am dat peste ceva la care nu m-am gândit niciodată, să traduc în limba română cuvintele cheie din C/C++.

Soluţia este simplă, se foloseşte preprocesorul, iată un exemplu:


#include <cstdio>
#include "romanian.h"

folosim spatiunume::std;

int principal()
{
    scrie("Salutare Lume!\n");
}


Arată foarte interesant. Am văzut acest lucru la semnătura lui Marian Dragomir, iar fişiereul "romanian.h" arată astfel:



#ifndef ROMANIAN_H
#define ROMANIAN_H

#define asm asm
#define auto auto
#define pausa break
#define caz case
#define cara char
#define const const
#define continua continue
#define predefinit default
#define fa do
#define dublu double
#define altfel else
#define enum enum
#define extern extern
#define flotador float
#define pentru for
#define dutela goto
#define daca if
#define expandeaza inline
#define int int
#define lung long
#define registru register
#define restrict restrict
#define intoarce return
#define mic short
#define semnat signed
#define marimede sizeof
#define static static
#define structura struct
#define comuta switch
#define definestetip typedef
#define tipde typeof
#define uniune union
#define farasemn unsigned
#define vid void
#define inflamabil volatile
#define atitcit while
/* definitii pentru C++ */
#define bool bool
#define prinde catch
#define clasa class
#define mold_const const_cast
#define sterge delete
#define mold_dinamic dynamic_cast
#define explicit explicit
#define export export
#define fals false
#define prieten friend
#define mutabil mutable
#define spatiunume namespace
#define nou new
#define operator operator
#define privat private
#define protejat protected
#define public public
#define mold_reinterpreteaza
#define molda_static static_cast
#define sablon template
#define acesta this
#define arunca throw
#define adevarat true
#define intentioneaza try
#define numetip typename
#define idtip typeid
#define folosim using
#define virtual virtual
#define lchar_t wchar_t

/* definitii de functii comune */
#define principal main
#define scrie printf

#endif


Spor la scris „poezii”! ;-)

2007-11-24

Windows Time Sync

Sometimes you need to know if your computer has the correct time, what do you do to ensure that?

On Windows XP you double click on the clock in the right corner of your screen select "Internet Time" and click "Update Now". All the times I did this I got an error. Windows has only two entries in that combobox, and both return errors, why?!

Today I have gone a step further I googled for more Internet Time Servers, on this page I've found plenty. For example Germany has 214 servers in a time server pool (de.pool.ntp.org).

It was about time ;-)

2007-11-10

New Updates to MFC in Visual Studio 2008

Here is an half an hour interview with Pat Brenner on the topic "New Updates to MFC in Visual Studio 2008".

A very informative movie, my favorite quote is "we kinda moved out from the '90s"!

And a quick summary:

What's new for MFC developers:
  • Ribbon

  • Customisable Menubar / Toolbar

  • Visual Studio 2005 like Docking

  • Tabbed MDI

  • New status bar

  • and many more



  • You can get a full visual tour on what's new on the Visual C blog entry.

    Here is a screenshot of MFC demo made by the Wizard:




    All this functionality is available now from 3rd party vendors, but this will be backed by Microsoft. Impressive!

    Edit MFC Update powered by BCGSoft as you can read here.

    Y!M 9.0 Without Ads

    One way to disable the ads from the main window of Yahoo Messenger 9.0 is to cut access to one specific file. With this version it doesn't work any more the trick of clearing the file and making it read only.

    If you have installed Y!M on a NTFS file system you are lucky, you can remove the Read security attribute and the ads are gone (at least until they fix this too).

    Here is the code to remove the access to the file from the command line, or batch file:
    cacls "%PROGRAMFILES%\Yahoo!\Messenger\Cache\urls.xml"  /E /P %USERNAME%:N


    If you want to bring the ads back because they were adding color to your contact list here is the command line to do just that:
    cacls "%PROGRAMFILES%\Yahoo!\Messenger\Cache\urls.xml"  /E /P %USERNAME%:F


    I hope they won't read this blog and fix the hole until the final version 9.0 gets out next year ;-)

    Edit: by upgrading to version 9.0.0.907 I found out that removing reading rights from the file was not enough, you need to fiddle with the Windows Registry e bit. Here is a batch file that does it for you:

    @ECHO OFF
    TITLE Remove ads from Yahoo Messenger 9

    > %TEMP%.\noYMads.reg ECHO REGEDIT4
    >>%TEMP%.\noYMads.reg ECHO.
    >>%TEMP%.\noYMads.reg ECHO [HKEY_CURRENT_USER\Software\Yahoo\Pager\YUrl]
    >>%TEMP%.\noYMads.reg ECHO "First Login Beacon"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Change Room Banner"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Finance Disclaimer"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Messenger Ad"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Chat Adurl"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Calendar Alert Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Conf Adurl"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Mail Alert Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "News Alert Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Personals Alert Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Stock Alert Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Webcam Viewer Ad Medium"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Webcam Viewer Ad Big"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Webcam Viewer Ad"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Webcam Upload Ad"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Chat Transition Ad"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "N2Phone Adurl"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Webcam Viewer Ad Bid"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "IMVironment Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Auction Alert Ad URL"="noads.html"
    >>%TEMP%.\noYMads.reg ECHO "Login Mobile Ad"="noads.html"
    REGEDIT /S %TEMP%.\noYMads.reg
    DEL %TEMP%.\noYMads.reg

    cacls "%PROGRAMFILES%\Yahoo!\Messenger\Cache\urls.xml" /E /P %USERNAME%:N

    2007-11-09

    Yahoo Keyboard Patch!

    Yahoo! Messenger had a very annoying problem, text selection with Ctrl-A was done when it shouldn't be done.

    For example Windows maps AltGr key to Ctrl-Alt keys combination, which is default behaviour. Yahoo! Messenger treats AltGr-A as Ctrl-Alt-A but then it gets the Ctrl-A part, whole text selection, and afterwards it goes to normal keyboard handling, which with a certain Romanian keyboard layout generates the character "ă", but because the text was selected before, "ă" was the only character left in the sentence you wrote.

    This was very annoying, but then by using the wonderful Microsoft technology called Detours I was able to intercept certain WIN32 API Messages and prevent the text selection from happening. Yahoo! keyboard patch was created.

    Cristian Secară was very nice to host this patch on his webserver, also he made some very good suggestions which improved whole the quality of the software.

    The patch is available at this location (Romanian language only).

    Note: this patch also works with other keyboard layouts, for example the Hungarian default keyboard layout can be used to generate the character "ä" now.

    2007-10-29

    To C or Not to C

    Today I was a bit puzzled by this code (test.c):

    #include <stdio.h>

    int main()
    {
        int i = ceil(2.9f);
        printf("i is: %d\n", i);
    }

    I had compiled the code using the command cl test.c, clean compile no warnings, no messages, after running the program the result was: i is: 1024. WTF?!

    The proper compile command cl /W4 test.c returned this:

    test.c(5) : warning C4013: 'ceil' undefined; assuming extern returning int

    C assumes a bit too much.

    Next time I want to try a code snippet I won't use the .c extension, I'll use .cc, one character makes a big difference:

    test.cc(5) : error C3861: 'ceil': identifier not found


    D'oh, I forgot to #include <math.h>!

    2007-07-13

    Pidgin gems

    Pidgin keyboard shortcuts cannot be edited by using a configuration dialog, but they can be edited "by hand".

    I wanted two actions to remap: closing the conversation dialog with Escape key and show/hide offline buddies with Control-H.

    This can be achieved by editing the ".purple/accels" file, which is located in your home directory on Linux and in "{drive letter}:\Documents and Settings\{user name}\Application Data" on Windows, and inserting the following lines:


    (gtk_accel_path "<PurpleMain>/Buddies/Show Offline Buddies" "<Control>h")
    (gtk_accel_path "<main>/Conversation/Close" "Escape")

    2007-03-29

    CMake support for SciTE

    I have added support for CMake in SciTE text editor. It should be available in the upcoming 1.73 release.

    Here is a picture of a rather small CMake script file:

    2007-02-02

    Eclipse C++ Programming with MinGW

    MinGW brings the powerful (free) GNU C++ compiler to the Windows world. The only drawback is that you get only command line tools, no GUI interface. While this is OK only for small programs, it becomes an issue when you need a debugger and / or the project contains more than one source file.

    That's where Eclipse kicks in. With the CDT plug-in you can edit, compile and debug your C++ programs.

    These are the required downloads (compiler, debugger and editor):
    • MinGW and GDB installers from here (I've downloaded MinGW-5.1.3.exe from MinGW->Current section) and from here for the latter (I've downloaded gdb-6.3-2.exe from Snapshot section)
    • EasyEclipse for C and C++ from here (I've downloaded release 1.2.1.1).

    After creating a C++ project in Eclipse you will notice that there is warning complaining that cygpath is not found, it's a benign warning since we're not using Cygwin to build programs.

    Eclipse expects that g++, make and gdb executables to be in PATH, since I don't like to pollute the global PATH environment variable with MinGW executables I've created a "launcher" for Eclipse that adds MinGW to PATH before running Eclipse.

    Here is the code (eclipse.js):
    var program = "eclipse.exe";

    // Add the arguments
    for (var i = 0; i < WScript.Arguments.length; ++i)
    {
        program += " " + WScript.Arguments.Item(i);
    }

    var shell = new ActiveXObject("WScript.Shell");

    // Add mingw to path
    var env = shell.Environment("PROCESS");
    var path = "c:\\mingw\\bin;";
    path += env("PATH");
    env("PATH") = path;

    // Execute the program and don't wait for completion
    shell.Exec(program);


    Copy the "launcher" to Eclipse directory (c:\Program Files\EasyEclipse for C and C++ 1.2.1.1) and use it from now on to start Eclipse.

    We need one more step to get everything to work, change the C/C++ build command from make to mingw32-make (or rename mingw32-make it to make in c:\mingw\bin, if you want the eclipse project to be crossplatform) like in the picture bellow:


    That was all. Now we have a full C++ IDE. Now we can develop console applications or Win32 C GUI applications. For C++ GUI applications we can use the free (GPL) Trolltech Qt library.

    2007-01-15

    It's not a bug, it's a feature

    In my previous post I've said that I found a C# bug, now I've found out that it's not a bug, that behavior is by design.

    It's written in the C# standard, around page 88 (110 real page):

    [Note: As specified above, the declaration space of a block cannot share names with the declaration spaces of any nested blocks. Thus, in the following example, the F and G methods result in a compile-time error because the name i is declared in the outer block and cannot be redeclared in the inner block. However, the H and I methods are valid since the two i’s are declared in separate non-nested blocks.

    class A
    {
        void F() {
            int i = 0;
            if (true) {
                int i = 1;
            }
        }
        void G() {
            if (true) {
                int i = 0;
            }
            int i = 1;
        }
        void H() {
            if (true) {
                int i = 0;
            }
            if (true) {
                int i = 1;
            }
        }
        void I() {
            for (int i = 0; i < 10; i++)             H();         for (int i = 0; i < 10; i++)             H();     } }

    end note]


    I hate compilers that impose stupid constrains.

    2007-01-10

    My first C# bug

    Consider this piece of code:
    class Foo
    {
        public static void Bar()
        {
            if (true)
            {
                int i = 0;
            }
            int i = 1; // CS0136
        }
        
        public static void Main()
        {
        }
    }


    Any C (C++, Java) coder will say that there is nothing wrong with that code.
    I thought that was the same in C# language, I was wrong.
    Here is the output from Visual Studio .NET 2003:
    test.cs(9,13): error CS0136: A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i', which is already used in a 'child' scope to denote something else

    test.cs(9,13): error CS0103: The name 'i' does not exist in the class or namespace 'Foo'

    Here is the output from Visual Studio 2005:
    test.cs(9,13): error CS0136: A local variable named 'i' cannot be declared in this scope because it would give a different meaning to 'i', which is already used in a 'child' scope to denote something else


    While VS2005 got better than VS2003, but it's still in error.

    Here is what MSDN has to say about error CS0136

    Compiler Error CS0136A local variable named 'var' cannot be declared in this scope because it would give a different meaning to 'var', which is already used in a 'parent or current' scope to denote something else
    A variable declaration hides another declaration that would otherwise be in scope. Rename the variable that is declared on the line that generated CS0136.
    The following sample generates CS0136:

    // CS0136.cs
    namespace x
    {
       public class a
       {
          public static void Main()
          {
             int i = 0;
             {
                char i = 'a';   // CS0136, hides int i
             }
             i++;
          }
       }
    }



    Well, in our case i variable was declared after the if block and not before it. It doesn't make any sense to say that the second i is in the if's i scope.

    I know it's a bad practice to reuse the same name for more variables in a function, but I don't expect that to be an error, just a warning at the highest warning level.

    What's sad is that the alternative C# implementation, naming Mono, has the same behaviour. Here is the output:
    test.cs(9,7): error CS0136: A local variable named `i' cannot be declared in this scope because it would give a different meaning to `i', which is already used in a `child' scope to denote something else
    test.cs(7,8): (Location of the symbol related to previous error)


    They've copied Microsoft's implementation bug by bug (for compatibility :). The sad part is that this bug was reported to Mono in 2003 but they've closed it saying it's not a bug. Here is the link to that bug

    By the way I've posted a comment there, just to complain about it :)

    It seems that this is not a bug, but a feature, read more about it here

    2006-12-22

    NTFS3g on OpenSuse 10.2

    I have installed openSuSE 10.2 on my brand new computer (bought more than a month ago).

    I'm happy with openSuSE 10.2, YaST has been improved, it gives more feedback to the user. Now there is an native KDE updater, so I don't have to install a GNOME Mono application, the source repository knows about YUM repositories, and so on and so forth.

    After installing it I've noticed that my Windows XP wasn't booting anymore. The fact was that I had two NTFS partitions, the first had the boot loader and boot.ini and the second had Windows files. The second partition number had shifted after creating two linux partitions, so Windows boot loader got confused and refused to work.

    Well I said, it's easy, all I have to do is to modify boot.ini and change multi(0)disk(0)rdisk(0)partition(2) to multi(0)disk(0)rdisk(0)partition(4). There was one problem, that the file resided on a NTFS file system. Linux has readonly access by default.

    Eeeek, but then I remembered that there is something new out there ntfs-3g that can mount read/write a NTFS file system.

    I've searched the net and found that I had to install fuse, fuse-ntfsprogs and ntfs-3g packages. The first two came with openSuSE 10.2, the latter from GURU 3rd party repository. GURU had a ntfs-3g version from 20061115, which was too old for fuse 2.6.0 that came with openSuSE 10.2. Eeeek.

    The solution was to get the latest and greatest sources and the RPM spec files from fuse and ntfs-3g to create my own rpm packages.

    I've got fuse 2.6.1 and ntfs-3g 20061218, after hacking the RPM spec files I've managed to create two nice rpm packages. The problem was that the command ntfs-3g /dev/hda1 /windows/C was still failing. Eeeek again.

    The problem was with the fuse kernel module, it was too old. openSuSE 10.2 fuse spec file didn't create a kernel module because kernel included the fuse module. I've hacked fuse RPM spec file to --enable-kernel-module, all nice until the very last step when the packages were to be created. Because fuse.ko module was still in RPM's database, RPM could not create a new module that contained fuse.ko because of some incompatibilities later on. Tired of eeeking.

    Solution was to copy the new fuse.ko module and store it somewhere, then put back --disable-kernel-module in fuse RPM spec and run a rpmbuild -ba fuse.spec. Then I've copied fuse.ko over the one from /lib/modules/linux-2.6.18.../kernel/fs/fuse/fuse.ko.
    After installing fuse and fuse-devel packages I've build ntfs-3g package, installed it and the command: ntfs-3g /dev/hda1 /windows/C was working!

    In order to always mount read/write I've modified /etc/fstab and instead of ntfs I've put ntfs-3g and removed the ro (read only) flag from the next option on the same line.

    After modifying boot.ini and a reboot I got my Windows XP back!

    In conclusion, I like openSuSE they didn't made all the things easy, most of them are easy but some issues are still to be fixed, like the one above. One can say that this is the price to pay for bleeding edge software, but every now and then it's fun to hack something, to remember the good old days of hacking Slackware to do the things you wanted.

    2006-12-03

    The DaVinci Code

    I've just finished reading The DaVinci Code by Dan Brown. I've done this after watching the movie twice, at the cinema and the director's cut on my computer.

    I've enjoyed the book more, in the movie they've made some hacks to keep the plot on the feet.

    If you haven't read the book please do so ;)

    2006-11-05

    Winter


    Winter came too soon this year, I mean it's just 5 November! and the picture was taken in the morning.

    2006-08-02

    DVB-T Modulator

    Recently I've got to play with Fabrice Bellard's low cost analog and digital tv modulator.

    It took me a while to get it working, it didn't work with nvidia cards so I've tested a ATI Radeon 9200, like Fabrice mentiones on his webpage. What Fabrice doesn't say is that you need to use "radeon" driver, not vesa, not ati.

    I've used a Pinnacle 320e receiver, which can scan the two DVB-T channels but no preview.

    That was sad, I was expecting it to work, but now that it doesn't work, how to debug it? you can't, Fabrice didn't publish the source code.

    2006-04-29

    2006-04-04

    MSDN

    As a C++ programmer when you want to use MSDN just for C++ and STL the filter "Visual C++" is not helping. You get all sort of matches but not the ones you need.

    You need to filter just the right stuff. You need to go to Help->Edit Filters and create a new filter with these contents:
    ("DevLangVers" ="kbLangCPP") or ("TechnologyVers" ="kbSTL")

    Now if you want to search for map, you'll get the right match.

    2006-03-29

    Windows XPE

    I have just finished hacking my first Windows Live setup - I have accelerated video drivers, audio, I can see movies using ffdshow, Mozilla Firefox, Total Commander, Norton Ghost, DirectX.

    I have used BartPE and Sherpya WinPe Stuff.

    The hard part was getting NVidia drivers to work and then the sound drivers. Now I can say that I have a better undestanding of manual loading of drivers on Windows XP :)

    Pretty nice stuff, but you have to work to get it working...

    2006-03-17

    Viewing CHM files from a Network Drive

    This issue was bugging me for a long time, now I found out how to fix it.

    All you need is this key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions, with a DWORD entry MaxAllowedZone set to 1.

    This was a side effect for a security patch from Microsoft.

    2006-03-16

    Root Power

    Writing rootkits is fun. I needed to a device driver for Windows XP that could hide a process, disable keyboard and mouse and hide directories, these are some definitions for a rootkit.

    There are some inconveniences, like resetting the operating system because you did something wrong... things don't work like in userland.

    Tools like Compuware VToolsD (for Windows 9x) and Compuware Driver Studio (for Windows NT+) make your life way easier. For the first you don't have to write code in assembler, you can write code in C and C++ and for the latter you can write code in C++.

    I guess my next root kit, after the one for Windows 9x and the one for Windows XP, would be for Linux, but on Linux having access to the source code of the operating system is a big bonus.

    In the end it's not that hard, with proper tools and with proper knowledge you can do anything :-)

    2006-03-10

    Tarom

    And now for my fist blog photo...

    Brainbench

    I've taken some Brainbench tests, now I have more than "Typing Speed & Accuracy" results :) Here is my public transcript.

    And now for some pictures:

    2006-01-14

    xterm fonts and colours

    The default settings for xterm in OpenSUSE 10 are crappy, the font is small, white background, black foreground... yucky.

    Ok, it's not that obvious to configure X applications, they don't have menus, dialog boxes like the KDE applications. You have to edit ~/.Xresources and add some lines and then run xrdb ~/.Xresources (you can use -merge to merge the settings). You can find out what lines to add to ~/.Xresources by having a look at /user/X11R6/lib/X11/app-defaults/XTerm and by consulting the manual page (man xterm).

    Here is what my ~/.Xresources file contains:
    xterm*background: black
    xterm*foreground: white
    xterm*faceName: Andale Mono
    xterm*faceSize: 9
    xterm*geometry: 100x30
    I usually use konsole, but some applications open xterm for shell access. SlickEdit is one of those applications ;)