No installation. USB stick portable applications.
Swiss File Knife

a command line
multi function tool.

remove tabs
list dir sizes
find text
filter lines
find in path
collect text
instant ftp or
http server
file transfer
send text
patch text
patch binary
run own cmd
convert crlf
dup file find
md5 lists
fromto clip
hexdump
split files
list latest
compare dirs
save typing
trace http
echo colors
head & tail
find classes
dep. listing
speed shell
zip search
zip dir list

Depeche View
Source Research
First Steps

firefox add-ons

using vm linux

windows GUI
automation

the d3caster
java game engine

command line
file encryption

free external tools,
zero install effort,
usb stick compliant:

zip and unzip
diff and merge
reformat xml
reformat source

java sources

thread creation

cpp sources

log tracing
mem tracing
hexdump
using printf

articles

embedded
stat. c array
stat. java array
var. c array
var. java array
view all text
as you type
surf over text
find by click
quick copy
multi view
find nearby
fullscreen
bookmarks
find by path
expressions
location jump
skip accents
clip match
filter lines
edit text
highlight
load filter
hotkey list
receive text
send in C++
send in Java
smooth scroll
touch scroll
fly wxWidgets
fly over Qt
search Java

 
Bookmark on del.icio.us Bookmark on Google Add to Mr. Wong
Bookmark on digg.com Add to StumbleUpon Bookmark on Yahoo

 

Copy and paste examples of the printf syntax, and how to use va_arg in a self-defined printf function.

example 01: printing basic datatypes

#include <stdio.h>   // for printf

int main(int argc, char *argv[])
{
   // print "the date is: 05.01.2006",
   // i.e. 2- or 4-digit with leading zeros
   // using 32-bit 'long' datatype
   long lday   = 5;
   long lmonth = 1;
   long lyear  = 2006;
   printf("the date is: %02ld.%02ld.%04ld\n",lday,lmonth,lyear);

   // - print 8-digit hex value
   // - print a pointer value
   unsigned long ulID = 0x12345678;
   unsigned long *pID = &ulID;
   printf("hex value: 0x%02lX at address: %p\n", ulID, pID);

   // - print 4 bytes of a 32-bit ulong value
   //   as separate hex values
   unsigned char uc1 = (unsigned char)(ulID >> 24);
   unsigned char uc2 = (unsigned char)(ulID >> 16);
   unsigned char uc3 = (unsigned char)(ulID >>  8);
   unsigned char uc4 = (unsigned char)(ulID >>  0);
   printf("hex bytes: %02X %02X %02X %02X\n",uc1,uc2,uc3,uc4);

   // - print double value like "70.35000"
   double dTemp = 70.35;
   printf("temperature: %5.5f\n", dTemp);
}

output:

the date is: 05.01.2006
hex value: 0x12345678 at address: 0012FEDC
hex bytes: 12 34 56 78
temperature: 70.35000
example 02: string formatting

#include <stdio.h>   // for printf
#include <string.h>  // for strchr

int main(int argc, char *argv[])
{
   // - print three strings,
   //   - the first  one with 10 chars, left-justified,
   //     and if there are more than 10 chars, truncate the rest.
   //   - the second one with 10 chars, right, prefixed with blanks
   //   - the third  one with  8 chars, right, prefixed with zeros
   char *psz1 = "FooBar Inc. formerly known as Foo Bar Systems Corp.";
   char *psz2 = "NY";
   char *psz3 = "105000";
   printf("company: %-10.10s | "    // continue on next line,
          "location: %10.10s | "    // strings are joined by compiler.
          "turnover: %08s$\n",
          psz1,psz2,psz3
         );

   // - find phrases in a string surrounded by < >
   // - print only the parts between < >
   char *pszFull = "This is a <highlight>hello "
                   "world</highlight> example.\n";
   for (char *pszCur=pszFull; *pszCur;)   // cursor
   {
      char *pszBra = strchr(pszCur, '<');
      if (!pszBra) break;
      pszBra++;   // skip '<'

      char *pszKet = strchr(pszBra, '>');
      if (!pszKet) break;

      // print n characters of a string, suppling length as int
      printf("phrase found: %.*s\n", (int)(pszKet-pszBra), pszBra);

      pszCur = pszKet;  // continue past phrase
   }
}

output:

company: FooBar Inc | location:         NY | turnover: 00105000$
phrase found: highlight
phrase found: /highlight
example 03:
  • writing an own printf-like function for error output
  • printing a progress indicator

#include <stdio.h>   // for printf
#include <string.h>  // for strchr
#include <stdarg.h>  // for va_arg

#ifdef _WIN32
   #define vsnprintf _vsnprintf
#endif

int main(int argc, char *argv[])
{
   // create and use an own printf-like function "perr",
   // which behaves exactly like printf, but
   // -  prefixes the output with "error: "
   // -  prints to stderr stream, not stdout
   void  perr(const char *pszFormat, ...);   // see perr below
   char *pszFileName = "thetestfile.txt";
   long  lStatusCode = 100;
   perr("cannot open file: %s [rc %ld]\n", pszFileName, lStatusCode);

   // print a progress indicator:
   //    "processing file 000 of 050 (00%) ..."
   //    "processing file 001 of 050 (02%) ..."
   //    "processing file 002 of 050 (04%) ..."
   //    ...
   //    "processing file 049 of 050 (98%) ..."
   // but always within the same line.
   long iMaxFiles=50;
   for (long iFile=0; iFile<iMaxFiles; iFile++)
   {
      printf("processing file %03ld of %03ld "
             "(%02ld%%) ... \r",
             iFile, iMaxFiles, iFile*100/iMaxFiles
            );
      fflush(stdout);
   }
   printf("\nprocessing done.\n");

   return 0;
}

void perr(const char *pszFormat, ...)
{
   static char szErrBuf[200];
   va_list argList;
   va_start(argList, pszFormat);
   ::vsnprintf(szErrBuf, sizeof(szErrBuf)-10, pszFormat, argList);
   szErrBuf[sizeof(szErrBuf)-10] = '\0';
   fprintf(stderr, "error: %s", szErrBuf);
}

output: (after program completion)

error: cannot open file: thetestfile.txt [rc 100]
processing file 049 of 050 (98%) ...
processing done.

Download the free Depeche View Lite Text Search Tool

 
 
 
 

 
 
 
 
Supersonic Text File Search - Free Download