OpenLLM-France/wikimedia huggingface dataset:
# Windows Programming/Obtaining the DDK
## What is the DDK?

Microsoft offers a free Driver Development Kit, for people who are interested in writing device drivers, system services, and other kernel-mode code. The DDK comes with a number of different libraries, extensive documentation, link libraries, a special compiler and linker, and many examples for new driver programmers.
This book discusses the DDK in depth in throughout Section 4, but specifically in the chapter about the DDK.

## Obtaining the DDK

The DDK is available free from microsoft, but not as a download. To obtain the DDK, you must order the software on CD, and this comes with a small shipping and handling fee. The DDK has a number of different options, and installing the DDK with every option will require a large amount of disk space.
The DDK used to be available as a download, but to conserve bandwidth, Microsoft has changed their policy to only offer the DDK as a CD. The SDK, and a number of other CDs are also available to order from Microsoft for free (plus shipping and handling), so this might be worthwhile to check out as well.
Order the DDK
# Windows Programming/Programming Screensavers

Screensavers are graphical programs that will exercise the computer's screen while the computer is not in use, to prevent damage to the screen. Screensavers can also be very aesthetic, interesting, and entertaining however.

## Requirements

Screensaver programs are essentially normal executable programs, with a few small differences:
* They have a .scr extension, instead of a .exe
* They have a ScreenSaverProc, instead of a WindowProc.
* They call DefScreenSaverProc, instead of DefWindowProc.
Also, screensavers must contain a configuration dialog box, that the shell can call when you click on the screensaver and select "properties". The last requirement is that a screensaver must have a string resource, at resource 1, with a description of the screensaver.

## How they Work

Windows will send a number of different arguments to a screensaver, on the commandline, depending on what mode of operation the screensaver must take. Here are some of them:
* /a <hwnd>
* /s
* /c <hwnd>
* /p <hwnd>
The -a option tells the screensaver program to set the associated password, if the screensaver is selected to be password protected. The -s option tells the screensaver to run the graphics, and start saving the screen. The -c option tells the screensaver to display the configuration dialog, and the -p option tells the screensaver to run in preview mode.
The WinMain function should decode the command line, and obtain both the switch (a, s, p, c) and the handle, if specified. The Handle value will be in an ascii string, so that will need to be converted to an integer, and stored into an appropriate HWND variable. The handle provided is the handle to the parent window of the screensaver, which is usually the screensaver tab in the Windows Display dialog box. The screensaver doesn't have a parent window if it is in screensaving mode.
If WinMain has received a -s or a -p, the WinMain should call the ScreenSaverProc. If it has received the -c option, WinMain should call the Dialog box procedure function. If the screensaver receives the -a option, it should bring up a dialog to change the password.
# Windows Programming/Registry API
## The Registry

The registry is a system-defined hierarchical central database in x86, x64 and Mobile versions of Microsoft Windows System. The Windows Registry API provides methods for an application to save and query data stored in the registry. Although the registry was present even in 3.x Windows, it was used to store much less data.
The registry stores configuration settings for software, information about operating system configuration, current hardware profile, drivers' settings etc. It was also designed to replace the old-fashioned way of storing application data in .ini files. On 16-bits Windows systems applications used to store data in configuration files with .ini extensions.
Values are grouped and stored in keys. The registry stores keys in tree format, with keys containing values and sub-keys.
Applications should only modify keys created by itself, and changing or deleting other application's keys and values is not recommended. Also, an application shouldn't modify keys containing important system settings. We should keep these two tips in mind when editing registry (of course there are situations when we want to change some system settings but this is very rare).

## Opening a Key

Keys must be opened before they can be used. To do this, we use either of

### RegOpenKeyEx

    To open any key.

### RegCreateKeyEx

    To create a key or open it if it exists already.

## Values

The value of a key can be obtained by calling RegQueryValueEx.
The RegSetValueEx function is used to associate a value with a key.

## Next Chapter

* Security API
# Visual Basic for Applications/The Knuth String Shuffle
## Summary

* This code module includes both a Fisher-Yates character shuffling routine for strings, and a Durstenfeld-Knuth routine to shuffle one-dimensional arrays.
** The procedure FisherYatesStrShuffle shuffles characters of a single string. This is limited to shifting single characters around within one string.
** Procedure KnuthArrShuffle sorts the elements of a one-dimensional array. The procedure is limited only by what can be stored in array elements.
* The two methods are pseudo-random and bias-free. Elsewhere, the use of a random generator does not necessarily guarantee that the results will be free from bias.
* The code can work in any of the MS Office applications that support VBA.

## Code Notes

* The Fisher-Yates shuffle applies a pseudo random selection method. It is described here for characters in a string but a related method, the Durstenfeld-Knuth method is preferred for arrays.
** Taking each element of a string in sequence for repositioning leaves one end of the result string badly biased. The Knuth algorithm instead proposes a random position within the string. The element at that position is then accumulated into the output and removed from the original. Subsequent selections are made in the same way from the ever shortened string.
** Note that there is still the possibility of a given character being unmoved in the process, but only within expectation.
** Set the number of strings required with variable Cycles in the top procedure. The Immediate Window has proved the best place for display and copying.
** It should be pointed out that any attempt to avoid the unmoved elements, will not only change the random nature of the shuffle but prevent the use of other than non-repeat strings. That is to say strings with repeated characters could not then be shuffled.
* The Durstenfeld-Knuth method for arrays differs only slightly from that of the Fisher-Yates implementation.
** To reduce processing, and no doubt to overcome the burden of removing an element from the middle of an array during shortening, the algorithm instead overwrites the element selected for output with the last element. In this VBA implementation the array is then conveniently shortened by one element with Redim Preserve.
* See Fisher Yates Shuffle for a good description of both methods.

## The VBA Code Module

Copy all of the code below into say, an MS Excel standard module, save the workbook as an xlsm file type, and run either of the test procedures to test the requisite code. Be sure to open the Immediate Window for output.

## See Also

* Fisher Yates Shuffle: A very clearly written article in Wikipedia, that explains worked examoles step by step.
# Visual Basic for Applications/Transfer Data to the Worksheet
## Summary

This page gives an overview of transferring data from VBA to the worksheet. The code module includes procedures for transfer of both one and two dimensional arrays to the sheet. Brief code line notes are also included for single line and block transfers.

## Contents of the Module

* The module works best if kept intact. The top procedure has code lines to run the other procedures. Just de-comment the code that you intend to run, and add comment marks to the lines that are not intended to run.
* The code procedures include normal or transposed transfers from two dimensional arrays.
* In addition, the handling of one dimensional arrays has been included. They can be transferred into a column or a row.
* The placement position can be specified in every case.
* Note that the selected worksheet will be cleared on each run, so select a worksheet for output that will not remove essential data.
* ConvColAlphaToNum and ConvColNumToAlpha are included to convert worksheet column references between the alpha and numeric formats.
* Additional procedures have been added for clearing and formatting text and the sheet.
# Visual Basic for Applications/Use Log Files from VBA
## Summary

At times it is useful to write strings to a text file from VBA. For example, for listing files, their hashes, or for simply logging errors. Text files are here intended to mean files with the .txt suffix. There are several procedures listed in the code module for both writing and reading such files.

### Writing to Text Files and Logs

* The procedure SendToLogFile APPENDS a string to a text file. The user optionally selects his own path and file name, but there is no OVERWRITE choice with this method. If user parameters are not given then the defaults are used. This procedure places the parameter string in line with a time date string, with each record entry on a new line.
* The procedure LogError1 is intended to APPEND log errors, and is an example of the Print# statement. It is assumed here that the log file will always be placed in the same folder as the calling Workbook. As such, no path check is needed, and the minimum of coding applies. All formatting of the parameter text is assumed to be done externally. Readers can find format details for Print# in VBA help, and might also care to compare the advantages of using the Write# statement instead.
* The procedure LogError2 is also intended to APPEND log errors and performs the same task as LogError1. It is however an example of the OpenTextFile method of the Scripting object. This procedure needs a reference in the VBA editor to Microsoft Scripting Runtime. Notice that this log will write every successive record into the first line unless vbNewLine characters are included at the end of the parameter string itself.
* Procedure WriteToFile REPLACES any existing text, as opposed to appending it to any existing entries.
* There are conventions in logging. Logging with a text file (.txt) means placing each record on the same line with the individual fields separated by a single tab character. The number of fields is the same for each record. Another convention is to use a comma-separated file format (.csv) where the fields are separated by commas instead of tabs. Both of these formats can be imported into MS Office applications,though users should pay particular attention as to how different log writing methods handle quotes.

### Reading Text Files and Logs

* VBA can also read text files into code for processing. However, once the notion of reading files is introduced, the choice of writing formats becomes more important. In addition, file reading can place more demands on error handling, and testing for path integrity.
* The procedure GetAllFileText returns the entire contents of a .txt file . Readers should first confirm that the text file exists. File utilities elsewhere in this series would suit this purpose.
* The procedure GetLineText returns an array of text file lines. The same comments regarding early file checks also apply in this case.
# Visual Basic for Applications/VBA Code to Read ASCII Log Data from LAS File
## Summary

This page lists a VBA Sub procedure to read data from a LAS file. A LAS file is an industry-standard binary format for storing airborne LIDAR data. Sub procedure requirements:
* A LAS file must be located in the same folder where the macro-enabled Excel file is located
* The active worksheet must have in cell A1 the name of the LAS file

## Example Data to Test

You may create a ASCII file with extension LAS using the following example of data.
* Screenshot showing content of LAS file
* Screenshot showing data in LAS file

## Output on worksheet after running VBA Sub

* Screenshot showing Excel active worksheet after running VBA Sub
* Shows screenshot of Excel worksheet
# Visual Basic for Applications/Time Lapsed Between Dates
## Summary

This module contains VBA code to calculate the lapsed time between two fully expressed dates; that is, containing both date and time information. It can run in any MS Office applications like Excel that can run VBA code.
* This procedure shows how to extract integer values of the time components from a date variable rather than the more usual string representation of a date. That is to say, assuming that the difference between two dates is two days, to extract the integer two instead of some date string for the year 1900.
* Date variables contain a combination of both dates and times, but they need not do so. Some have only dates and some have only times, and when converted to the single data type, they can be seen to represent days in their integer parts and times in their fractions. Although the input parameters can contain any date variables, exact results are obtained only when both times and dates are included in each parameter. If time data is missing from a date, the calculation is still performed but uses midnight as the assumption.
* The integer part of a date-converted-to-single is just the number of days since 31 Dec 1899 . It follows then that negative integer parts describe the days before that reference date. In fact the date function can be used for dates in the Gregorian calendar from Aug 2, 718 through Dec 31, 9999, though this differs when other calendars are in use. Add integers to, or subtract integers from date variables to modify the date by that number of days. Subtraction also applies.
* The fractional part of a date represents a part of a day. The individual parts of time within it can be obtained as follows; multiply the date variable by 86400 to find the whole-seconds; by 1440 for whole-minutes; and by 24 for whole-hours. Then convert these results to the single data type before taking each integer part. To modify an existing date variable by a number of seconds, we simply add 1/86400 to it for each second; 1/1440 per minute, 1/24 per hour, and as stated earlier, whole units for days. Subtraction also applies.
* Various functions also exist to simplify date-time handling.

## The Code Module

Copy all of the VBA code below into a standard module.
* Run the top procedure to test the function. Two examples are given; one for exact date-time data and another where some time data is missing.
* The output result is a colon-separated string, containing any of a selection of formats; seconds only, minutes-seconds, hours-minutes-seconds, or days-hours-minutes-seconds. The format option is set with sConfig, and the optional units label is returned in sLabel.
* The procedure's detail is useful. The procedure LapsedTime illustrates the basics of multi-component extraction, as compared to the use of the VBA DateDiff function's counting intervals of one type.

## See Also

* Calculate Elapsed Time - Microsoft: An article by Microsoft describing methods of avoiding error in time comparisons.
# Visual Basic for Applications/The Elusive Button
## Summary

These VBA code modules are intended for Microsoft Excel. They show how to make a button that continually escapes attempts to click it. The code needs only a user form called UserForm1, and two command buttons, CommandButton1 and CommandButton2; The code will size the controls and the form itself.

## Code Notes

* The MouseMove event applies to specific controls; in this case a CommandButton. It fires whenever the mouse moves anywhere within the area of the control, and is used here to move the control before the user can select it.
* The code proposes random direction and shift amounts, then checks to make sure that the resulting shift will stay on the form, before moving the control. When a proposed shift is rejected, the fact that the mouse is still moving ensures that another event will still fire before a selection can be made. Selection HAS been known to happen, perhaps when there is an unlikely number of rejected shift values; a click procedure has been included to note the fact, just in case.
* The VBA help page for this event has an impressive set of options, as yet unexplored here.

## The ThisWorkbook Module

Copy this code into the ThisWorkbook module of the project. Save the file as xlsm type. It will run whenever the file is opened.

## The Userform1 Module

Copy this code into the UserForm1 module. It can be accessed by double-clicking the userform in design mode. Save the file, making sure it is xlsm type. The code is run by opening the file or by clicking the above Open event procedure in the ThisWorkbook module.

### Code Modifications

Added colors and overlaps, 2 Feb 2019 Added notes to code, 2 Feb 2019
# Visual Basic for Applications/Validate with the Like Operator
## Summary

This VBA example can be run in any of the commonly used Microsoft Office applications. The examples on this page make use of the Like operator to compare strings. The first example shows how to check that a string conforms to the correct format of the United Kingdom's National Insurance Number (NINO), a number used in much the same way as the US Social Security Number (SSN). The rules for the format are clear so it makes a good example. Unlike examples elsewhere in this set that check for illegal characters while they are being entered, this method is carried out only when the user has completed the entry.

## The VBA Code

* The code needs a user form called Userform1, two text boxes, TextBox1 and TextBox2, and a command button called CommandButton1. Set the UserForm1 property ShowModal to false for convenient study. Copy the code below into the three respective modules and save the workbook with an xlsm file suffix.
* When the workbook is opened, the user form will be displayed. Type a number format into TextBox1 and when complete, press the tab key to move to the next textbox. If the number format is correct then the insertion point will move, but if not it will stay in the faulty text ready for correction. Setting the Cancel argument of BeforeUpdate to true prevents the move.
* Note that the Before_Update event will not run at all unless a change has been made the text since the last time that the insertion point entered the box. So, to labor the point, after leaving the box, if the user clicks in it again without changes, the event does not run when moving on. If this poses a problem then consider the use of the Exit event for testing.
* See also Input Boxes for a number of other validation-related procedures.

### Code Changes

There are no changes so far.
# World Stamp Catalogue/Mozambique
## Postage Stamps by Year

1870-77 1881-85 1886 1893-94 1898-1901 1902 1903
1911 1912 1914 1915 1921 1921-22 1925
1930-1933 1938-1939 1944-1947 1948-1949 1950 1951
1952-1953 1954-1958 1959-1960 1960s 1970s 1980s
1990s 2000s
# World Stamp Catalogue/Mozambique/1954-1958

4th Centenary of Sao Paulo city
| Date Issued | Denom. | Paper. | Color | Perf. | Type Die/Wmk | Subject | Cat. No. Mi/Sc/Gi | Design | No. Issued | Designer/ Engraver | notes |
| 1954 | 3$50 | Enamel | Multi | 13½ | REG | | SC MI 440 YT 450 SG AF* 411 | | | Designer: Lithographed | |
Map of Mozambique
| Date Issued | Denom. | Paper. | Color | Perf. | Type Die/Wmk | Subject | Cat. No. Mi/Sc/Gi | Designer/ Engraver |
| 1954-10-15 | $10 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 387 MI 441 YT 442 SG AF* 412 | Designer: Moura, José Lithographed |
| | $20 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 388 MI 442 YT 443 SG AF* 413 | Designer: Moura, José Lithographed |
| | $50 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 389 MI 443 YT 444 SG AF* 414 | Designer: Moura, José Lithographed |
| | 1$00 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 390 MI 444 YT 445 SG AF* 415 | Designer: Moura, José Lithographed |
| | 2$30 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 391 MI 445 YT 446 SG AF* 416 | Designer: Moura, José Lithographed |
| | 4$00 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 392 MI 446 YT 447 SG AF* 417 | Designer: Moura, José Lithographed |
| | 10$00 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 393 MI 447 YT 448 SG AF* 418 | Designer: Moura, José Lithographed |
| | 20$00 | Enamel | Multi | 13½ | REG | Mozambique Map | SC 394 MI 448 YT 449 SG AF* 419 | Designer: Moura, José Lithographed |
Manila and Sofala first philatelic exhibition
# World Stamp Catalogue/N
### N

* Nagorno-Karabakh
* Namibia
* Naples
* Natal
* Nauru
* Neopolitan Province
* Nepal
* The Netherlands
* Netherlands Antilles (Curacao)
* Netherlands Indies
* Netherlands New Guinea
* New Brunswick (Canada)
* New Caledonia
* New Hebrides (British)
* New Hebrides (French)
* New Republic
* New South Wales
* New Zealand
* New Zealand Territories
* Newfoundland (Canada)
* Nicaragua
* Niger
* Nigeria
* Nigerian Territories
* Niuafo'ou
* Niue
* Norfolk Island
* North Borneo
* North Ingermanland
* North Korea (DPRK)
* North West Pacific Islands
* Norway
# XSLTForms/Installing and Testing

Installing and using XSLTForms to support Web-based applications requires two steps:
* Download and install XSLTForms on your server, and point your forms to it as described below.
* If your forms involve submission of form data to the server, you'll need to make arrangements for your server to accept PUT or POST requests.
How these work depend on the context in which you are installing XSLTForms.
If you're using XSLTForms with a generic HTTP server, see below.
If you're using the version of XSLTForms included with MarkLogic server or the eXist XML database, both of these tasks are already taken care of for you, as part of the installation and configuration of the XML database. See the documentation!
# XSLTForms/Contributing Code

The XSLTForms project has over its history moved through several source-code repositories. A Web search will find multiple SourceForge and GitHub repositories for the project.
Note: The original plan for this book was to populate the two pages linked from the table of contents with the titles XSLT 1.0 stylesheet - Templates and Javascript - Classes and Functions with auto-generated documentation for the xsltforms.xsl and xsltforms.js; as may be seen from the page histories, the Javascript documentation was auto-generated in 2010 and the XSLT documentation has never been generated. A new plan for providing documentation for would-be contributors may be needed.

## Active repository

Currently (February 2017), active development takes place in a GitHub repository called xphoneforms; builds can be obtained from the repositories named xsltforms on GitHub and SourceForge but these are currently just copies from the development repository.

## Proposing changes

Currently (February 2017), the best way to propose changes to XSLTForms is probably to use GitHub's 'pull request' feature:
* Fork the xphoneforms repository.
* Make your changes in your forked copy.
* Test them.
* Use the GitHub Make pull request button to create a pull request for the main repository which includes the changes you want to propose.
Note that the directory /src/js contains both an xsltforms.js and an xsltforms2.js subdirectory. If you are proposing changes to the current XSLTForms, there is no need to make changes in the latter: the two directories will be synchronized when required.