Results for "Author: ulli"
This article shows the basic concepts of Generic Algorithms. Generic Algorithms (GA) are used to arrive at an optimal solution for problems which cannot be solved by mathmatical rules or formulae. A GA simulates the natural evolution process by selecting and breeding the fittest individuals. According to Darwin's Evolution Theory the "fittest" are those which are best adapted to a competitive and possibly hostile environment...
Analyse Access Database Tables and Fields and optionally alter contents.
This AddIn helps you to explore and document your projects. The documentation is incorporated into the source code and may be printed by the Code Formatter Source Print Facility (updated version soon to follow). Compile the DLL into your VB directory and then use the Add-Ins Manager to load the Explorer Add-In into VB. The Splitterbar.OCX (included in the .zip file) is a Control based on a submission by eidos here at PSC. You should copy it to the Windows System Folder and register it using RegSvr32.
This is my attempt to make a chess program. The AI still needs a lot of cooking but the UI is done and it knows most rules (read the attached F.I.D.E. Laws Of Chess). Don't try yet to play against the computer - you will win :-) or worse - the program may crash. I myself am a below-average chess player, so I cannot say anything about the program's strenght or style of play. Time limit does not work properly, so give it say 6 or 12 seconds thinking time, more will make you wait virtually forever... Problem solving works though, I think. Unfortunately PSC does not let me upload Gradient.OCX or MsgHook.OCX, so you will have to delete all references to them. Also the TTF Amaze is not uploadable, just substitute another nice looking font for it. The piece images were copied from RJSoft's Chess Program, with his permission. Enjoy.
...up to 10,000 digits and more.
Class to encrypt and decrypt a clear text with variable character length encoding. There is no relationship between byte boundaries and encrypted characters, ie an encrypted character may theoretically be anything from 1 to 255 bits long; however this depends on the 'quality' of the key. I am not a cryptoanalyst, but I have a hunch that the variable character length makes this code rather difficult if not impossible to break. One approach may be to scan the encryption for repeating bit-groups and guess the meaning of short groups occuring more frequently than others (like "the", "a", "an" and so forth), or for patterns occuring with a language-specific frequency of vowels and consonants. To forestall that, the encrypting engine uses an initial hash (also derived from the key) and XORs every character with that before encrypting, keeping the result of the XOR for the next character. The decrypting engine of course reverses that process. The encryption engine now features an MD5 message digester which produces a key- and message-dependent binary signature. This signature may be included in the encrypted text to verify it's authenticity. Another advantage of prefixing a message with a signature is the additional scrambling of the encryted text through the previous encrypting of the unpredictable signature (see 'hash' above). This makes the encryption key- and text-dependent, that is, the encryption for a particular character is different when the text is different (apart from being different through hashing). Speed (without debugging) is in excess of 40,000 bytes/sec for encrypting and more than 130,000 bps for decrypting (depending of course on your PC's clock frequency).
This OCX records all mouse and keyboard activities for later playback with original timing. May (but should not) also be used as a stealth keylogger. Try playing back the attached TEST.RCD file :-).
This Add-In creates a Cross Reference Listing for your VB Projects. The X-Ref shows all Public, Global, Friend and Private Data- and Code-Member definitions, where they are defined, their scope (Private / Public / Friend), and what they are: Sub or Function, Property, Event, Variable or Constant. Also shown are all references to these members with ComponentName.MemberName as well as Line and Column numbers. References to Components are also shown. The Cross Reference Listing may be exported to a color-coded RTF file (see screen shot) or to the Clipboard for subsequent pasting into the project or anywhere else. This is the second in the my suite of VB-Add-Ins and goes together with the Code Formatter. It will help you to professionally document your projects in a tidy and consistent way. Compile the DLL into your VB directory and then use the Add-Ins Manager to load the Cross Reference Add-In into VB. Fixed bugs with Resorce Files and Related Documents and added Icons as well as references to Controls, Libraries, and References.
Example to show how to synchronize painting to the Monitor's vertical scan frequency. Painting occurs invisibly during vertical retrace.
Class and exhaustive test rig for FFT and IFFT. See screenshot. Updated for substantial speed improvemnt. Download is 8 kB
This is a 'Finite State Machine' Class to control batch type sequential client programs which fetch records from one or more sequential (normally keyed) data streams and optionally merge them into one stream, and/or exchanges data between matching records. This is done by invoking the discrete procedural steps in a logical sequence (eg FetchNextRecord, GroupHeader, ProcessRecord, GroupFooter etc) which the client program is arranged into. Also supported and invoked are control breaks for outputting subtotals, totals or grand totals; the control breaks are further subdivided into group header and group footer. The class supports a great variety of properties which may come in handy during program execution. Examples for this kind of programs are manifold: Invoicing, batch account-updating from transactions, grouped statistics, budgets and ballances, or report writers with subtotals and totals to name just a few. A comprehensive documentation is included. Compile WinPS 1st, register it if necessary using RegSvr32, and then add a reference to it to TestNewPS (or to any other project that might be using it). Download is 85 kB.
This little gadget creates, plays and optionally saves .wav files. You define duration, frequency and sound characteristics. Update vor visualisation. See screenshot for details. Download ist only 7 kB.
A Memory Mapped File resides in virtual memory from the moment it is opened until it is closed. This makes access to it very fast, in fact read and write merely consist of data moves in memory. All parts of the file are accessible by means of a zero based offset and the length of the data chunks you can transfer is only limited by the file size itself. The system will swap out and in pages of virtual memory as necessary. Only when you close the file the data are "lazily" written to disc, and the Physical Write Operations are limited to the altered memory pages. When you open an MMF you are required to supply an estimate of how large the file is gonna be. Any reasonable estimate will be fine, however, you cannot exceed this estimate, ie you can't extend a file while it is open, but you can truncate the file size to the actual size used when you close it. You can extend an existing file by giving the appropriate estimate when you open it and truncating it to the larger size when closing. MMFs are byte oriented and that requires a bit of understanding the data types which VB uses and how they are represented physically. The class contains tools however to handle the different aspects.
This AddIn will put all necessary instrumentation into your project to create a run profile. Then during execution profile data are acquired and finally evaluated and shown. The data include: ~ number of hits for each line of code ~ total time spent executing each line of code ~ average time spent executing each line of code ~ the code line itself ~ Timing accuracy is quite good and depends on the CPU high resolution timer (which in my AMD Athlon XP1800+ ticks about 3.5 million times a second giving a resolution of .279 µsecs), and utmost care has been taken to remove all data acquisition overhead effects from the execution times shown. Updates include check for isDirty (in which case you may loose the changes you made), better evaluation routine and printing.
Demonstrates the use of a property bag to store "things" in a file in any order and to retrieve those things from that file in any order. "Things" include strings, numerics, results of arithmetic or string operations, booleans, fonts and even pictures.
This is a little cat which yearns for the mouse - at least it follows it with the eyes all the time. You can drag it anywhere you like, and it goes away when you doubleclick it. Try it, download is only five kB.
This project shows how you can intercept GPFs. Instead of crashing your application in case of a GPF, a PopUp is openend showing error details and giving the user the choice between continuing the buggy application or terminating it in a neat and proper way. (This is based on a previous submission. Tested on WinXP only.)
This Add-In analyses all (or selected) controls in a form and assigns or generates the necessary accelerator hotkeys, ie those keys that you press together with the Alt-key to access a control (the underlined characters which are preceeded by an ampersand in code). The problem is that a different accelerator key should be selected from the caption of each individual control. To achieve this one has to generate all possible permutations to find the best solution where the accelerator keys are all different and as far to the left as possible.
This demo application demonstrates the use of a Custom Tooltip Class supporting square and ballon style tooltips, centered at the corresponding control or at the mouse pointer hot spot, with or without title. Individual back- and forecolors and fonts are also possible as well as an assortment of Icons to be displayed in the tooltip and finally individual delay- and show-times. And whats more - the tooltip can now speak using Microsoft's Speech Object Library (SpVoice in sapi.dll), no XVoice.dll or VText.dll! The code is easy to follow and well documented. And on top of that the class is very easy to use. Check it out, download is only 10 kB.
My son and I made this for his IT class. You set or reset the operands bits, the mode, and the injected carry; the binary result, the intermediate and final carry and the overflow bit are then computed and displayed by applying the actual logic in the diagram. Download 8 kB