OpenLLM-France/wikimedia huggingface dataset:
# Visual Basic for Applications/Arrays

This lesson introduces arrays.

## Objectives and Skills

Objectives and skills for arrays include:
* Declaring and initializing fixed-size arrays
* Changing the size of an array dynamically

## Readings

* Wikipedia: Array data type
* Microsoft: Declaring Arrays
* Microsoft: Using Arrays
* Microsoft: ReDim Statement

## Activities

* Initialize an Array
** Review Microsoft: Array Function.
** Create a macro that initializes an array with three values, such as the scores of three assignment grades.
* Calculate Average
** Review MathsIsFun: Average.
** Extend the macro above so that it calculates and displays the average of the three array values.
* Store Values in an Array
** Extend the macro above so that instead of initializing the array with three values, the macro uses InputBox to request the three values from the user and store the values in the array.
** Calculate and display the average of the three array values as before.
* Age Calculations
** Create a macro that asks the user how old they are in years, and then calculate and display their approximate age in months, days, hours, and seconds. Use an array to store the input value and the values for months, days, hours and minutes as they are calculated. Then display the results.
* Area Calculations
** Create a macro that asks the user for the dimensions of different shapes and then calculate and display the area of the shapes. Use an array to store the input values and the values for the results as they are calculated. Then display the results.

## See Also

* EasyExcelVBA: Arrays
# Visual Basic for Applications/Conditions

This lesson introduces conditions.

## Objectives and Skills

Objectives and skills for conditions include:
* Applying If...Then and If...Then...Else decision structures to control execution of code
* Applying a Select Case decision structure to control execution of code

## Readings

* Wikipedia: Conditional (computer programming)
* Wikipedia: Switch statement
* Microsoft: Variant Data Type
* Microsoft: Using If...Then...Else Statements
* Microsoft: Using Select Case Statements

## Activities

In these activities you will create macros that use input boxes to obtain user input, variables and conditions to perform calculations, and message boxes to display results. Your macros should include Option Explicit, Dim, InputBox, MsgBox, titles on the dialog boxes, an icon on the message box, and use appropriate data types for your variables.
* Logical Operators
** Review Microsoft: Logical Operators.
** Create a macro that uses different values and conditions to show that in VBA zero is false and anything non-zero is true. Also show that the explicit value of False is 0 and the explicit value of True is -1.
* Age Calculations - If/ElseIf/Else
** Create a macro that asks the user how old they are in years. Then ask the user if they would like to know how old they are in months, days, hours, or seconds. Use an If/ElseIf/Else statement to display their approximate age in the selected time frame.
* Temperature Conversion - If/ElseIf/Else
** Review MathsIsFun: Conversion of Temperature.
** Create a macro that asks the user if they would like to convert Fahrenheit to Celsius or Celsius to Fahrenheit. Use an If/ElseIf/Else statement to determine their selection and then gather the appropriate input and calculate and display the converted temperature.
* Area Calculations - If/ElseIf/Else
** Review MathsIsFun: Area of Plane Shapes.
** Create a macro that asks the user what shape they would like to calculate the area for. Use an If/ElseIf/Else statement to determine their selection and then gather the appropriate input and calculate and display the area of the shape.
* Age Calculations - Select Case
** Create a macro that asks the user how old they are in years. Then ask the user if they would like to know how old they are in months, days, hours, or seconds. Use a Select Case statement to display their approximate age in the selected time frame.
* Temperature Conversion - Select Case
** Review MathsIsFun: Conversion of Temperature.
** Create a macro that asks the user if they would like to convert Fahrenheit to Celsius or Celsius to Fahrenheit. Use a Select Case statement to determine their selection and then gather the appropriate input and calculate and display the converted temperature.
* Area Calculations - Select Case
** Review MathsIsFun: Area of Plane Shapes.
** Create a macro that asks the user what shape they would like to calculate the area for. Use a Select Case statement to determine their selection and then gather the appropriate input and calculate and display the area of the shape.

## See Also

* EasyExcelVBA: Condition Statements
# Visual Basic for Applications

Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language, Visual Basic 6, and its associated integrated development environment (IDE). VBA is built into most Microsoft Office applications, including Office for Mac and other applications such as Microsoft MapPoint and Microsoft Visio.
This course comprises 16 lessons on the use of Visual Basic for Applications in Microsoft Office. Primary focus is on using VBA in Excel, but there are also lessons on VBA in Word, PowerPoint, Outlook, and Access. Each lesson includes a combination of Wikipedia and Microsoft readings, YouTube videos, and hands-on learning activities.

## Preparation

This is a third-semester, college-level course. Learners should already be familiar with introductory computer concepts and have advanced or proficient-level computer skills.

## Lessons

* Introduction to Macros
* Recording Macros
* Editing Macros
* Variables
* Expressions
* Conditions
* Loops
* Arrays
* Errors
* Procedures
* Classes
* Word
* Excel
* PowerPoint
* Outlook
* Access

## See Also

* Computer Skills
* Digital Literacy
* Microsoft Office
* Visual Basic
# Visual Basic for Applications/Custom Dialog Boxes

This lesson introduces custom dialog boxes.
# Visual Basic for Applications/Editing Macros

This lesson introduces editing macros.

## Objectives and Skills

Objectives and skills for editing macros include:
* Setting procedure options by using the Macro Options dialog box
* Modifying the Visual Basic development environment

## Readings

* Microsoft: Create or Delete a Macro
* Excel-Easy: Create a Macro
* Microsoft: Run a Macro
* Microsoft: MsgBox Function
* Home & Learn: The Excel Visual Basic for Applications Development Environment

## Multimedia

* YouTube: Excel VBA MsgBox Tutorial

## Activities

* Display content in a message box.
** Using Excel, create a new macro that uses MsgBox to display "Hello <your name>!". Insert your name in the macro.
** Experiment with running your macro using <F5>, using the Macros dialog box, and assigning a shortcut key.
* Run a macro.
** Run your Hello macro using a button on the Quick Access toolbar.
** Run your Hello macro using a button in a custom tab or custom group on the Ribbon.
** Run your Hello macro using a graphic object area.
* Run a macro automatically.
** Configure your Hello macro to run automatically whenever the workbook is opened Auto_Open.
** Test your macro to ensure that it runs automatically.
** Test holding down the Shift key to prevent your macro from running automatically.
* Research VBA malware.
** Review SC Magazine: VBA Malware on the Rise.
** Consider how easy it is to create malware using VBA.
** Research and consider ways to protect yourself from VBA malware.

## See Also

* Microsoft: Getting Started with VBA in Microsoft Office 2010
# Visual Basic .NET/Reusable Code

Previously we have learned about declaring variables and writing logical code. This lesson will focus on making reusable code through the use of functions, modules and subprocedures.

## Introduction

Imagine that you have a fully fledged GUI interface for your program. A treeview control, several text boxes, some buttons, a few menus, and other odds and ends. Your program takes values entered into the text boxes and adds them to the treeview control. But you don't want just any values, you want MAC addresses. MAC addresses consist of 6 pairs of 2 digit hexidecimal characters. You want to validate the txt put in the control. Also, you want to add the value to the treeview control, but only if it is not already there.

## The wrong way and the right way

One might be tempted to write code that produces the desired result for an action that you know several code blocks will need to perform. This works and is not hard to do, but it wastes a lot of space and makes your code harder to read, and harder to fix.
The above code helps illustrate. Both procedures execute exactly the same with only slight variations. Why not consolidate that code so that if future code additions need it, they can call it too? Below is how one might do this.
Ahh, but what if I wanted to have the type of control change between code block? Easy, Just specify the type of control as another argument.

## Functions

I know I went over functions previously, but it is worth noting that functions are specifically designed to be re-usable code. Take some value or reference (or not) do something and return a value. They are really not designed to do anything else. You can obviously affect objects with a function like changing colors in a control or something, but a function has to return a value (along all code paths I might add). There is no similar stipulation for Subroutines.

## Exercise

Try designing a form with two buttons and two textboxes. Write some code that has one button multiplying the value in one textbox by 2 and outputting to the second textbox, and the other button multiplying by four and outputting the same way. An example of the finished code can be found on the talk page.
# Visual Basic for Applications/Access

This lesson introduces Access macros.

## Objectives and Skills

Objectives and skills for Access scripting include:
* Using Microsoft Access ADO objects

## Readings

* Microsoft: Introduction to the Access 2010 Templates
* Microsoft: Displaying Data from a Recordset in an Excel Worksheet
* Excel-Spreadsheet: DAO/ADO Objects

## Activities

In these activities you will create macros which interact with Access databases.
* Northwind Table
** Create an Excel macro that selects data from the Northwind Access database and inserts it into the active worksheet. The macro should place in the active worksheet the full name and email address of each employee using the Employees table. Your module should include Option Explicit, Dim, and use appropriate data types for variables.
* Northwind Update
** Create an Excel macro that pulls data from an Excel worksheet and updates an Access database. The Northwind company is expecting rapid growth and has decided that first-name-only email addresses are not going to be effective going forward. Using the worksheet generated in Activity 1, create an Excel macro that updates each employee record in the database and sets the email address to a first-initial, last-name format, such as flastname@northwindtraders.com. This may either be completed using Recordset.Edit and field values or Connection.Execute and SQL UPDATE.
* Northwind Query
** Create an Excel macro that pulls data from the Northwind Access database and inserts it into the active worksheet. The macro should place in the active worksheet the name of each employee, total items sold, and total item value sold using the Employees, Orders and OrderDetails tables. Items is a sum of the [Order Details].Quanity. Value is the sum of [Order Details].[Unit Price] * [Order Details].Quantity * (1 - [Order Details].Discount). The macro should add a total row at the bottom of the imported data. Use the Cell.FormulaR1C1 property to add the formula for the two totals. Your module should include Option Explicit, Dim, and use appropriate data types for your variables. Create a query in Access inside the Northwind database that selects and returns the required data. Then use macro code in Excel to select the query results and place them in the active worksheet.
# Walsh permutation; bent functions

Each bent function corresponds to a Walsh permutation, as shown in the following examples. All bent functions in the same sec correspond to the same Walsh permutation.
Below are four examples how a Walsh permutation follows from a bent function. This is the meaning of the matrices:
* sec matrix of the bent function
* same matrix, XORs with top row indicated by circles
* only the XORs from last matrix
* rows complemented that had a 1 in the leftmost position (permuted binary Walsh matrix)
* permutation matrix corresponding to the permuted Walsh matrix
There are four big equivalence classes of 4-ary bent functions with Hamming weight 6.

## BEC 391

BEC 391 with only one SEC corresponds to the complemented bit permutation wp(14,13,11, 7):

## BEC 381

BEC 381 with 3 SECs corresponds to the bit permutations wp(2,1,8,4), wp(4,8,1,2) and wp(8,4,2,1). They correspond to the simple permutations with the numbers 7, 16 and 23 - the three permutations of 4 elements that have two 2-cycles.

## BEC 382

BEC 382 with 12 SECs corresponds to 12 Walsh permutations with the following compression vectors:
| 4 8 9 6 6 9 1 2 | 8 4 10 5 10 5 2 1 | 2 9 8 6 6 1 9 4 | 8 12 2 3 12 4 3 1 | 2 5 10 4 10 1 8 5 | 4 12 3 2 12 8 1 3 |
The cubes of these permutations are the three bit permutations mentioned in the section above. The cube of wp(12, 4, 3, 1) is wp(4, 8, 1, 2)

## BEC 383

BEC 383 with 12 SECs corresponds to 12 Walsh permutations with the following compression vectors:
| 2 13 10 6 14 1 9 5 | 10 13 2 3 12 4 11 5 | 6 5 11 4 10 9 8 7 | 4 12 11 6 14 9 1 3 | 6 13 3 2 12 8 9 7 | 8 12 10 7 14 5 3 1 |
The squares of these permutations are the complements of the bit permutations that correspond to the six transpositions of four elements. The square of wp(12, 4, 11, 5) is wp(14, 11, 13, 7). That is the complement of wp(1, 4, 2, 8), which corresponds to the transposition of four elements that swaps the two in the middle.
# Walsh permutation; nimber multiplication; powers of wp(15, 5,11,13)

Walsh permutation wp(15,5,11,13), related to the nimber multiplication table, has one fixed point and a 15-cycle. Thus it has 15 different powers, which form a cyclic group.
| Cycle graph of the cyclic group Z$_{15}$ | The 15 permutations in a matrix, below the dual matrix The black numbers are the exponents. The grey numbers from 1 to 15 on the left refer to the Walsh functions defined by the pattern of odd numbers. The orange numbers in the dual matrix read f.r.t.l. give the compression vectors. |
This is the group's Cayley table, showing the multiplication of the compression matrices:
These 15 Walsh permutations are also closed under addition (bit-XOR) together with the neutral element wp(zeros)=zeros. This is the corresponding Cayley table, where 0 stands for the netral element and all other n for wp(15, 5,11,13)^(n-1):
The matrix is symmetric and the permutations formed by the rows are not Walsh.
# War
## Learning Projects

The study of war is a multidisciplinary and interdisciplinary activity, since war can be examined through so many different prisms; history, politics, sociology, philosophy and law, to name just the most obvious.
As a result, there are a variety of learning projects on Wikiversity which pertain to the study of war.
* The School of Strategic Studies degree course is currently the premier resource on Wikiversity for an all inclusive look at war over four years.
* The War Seminar is a learning project devoted to discussions about the history of war as a cultural practice and current wars in the world.
* The School of History has many topics relating to war, including Hitler's Germany, Imperialism and Revolutionary Russia.
* For a look at war from an alternative direction, the Division of Peace Studies examines conflict resolution and peace in religion.
* Bullshit in Seven Languages - a study of how propagandists justify wars
# Walsh permutation; nimber multiplication; patterns

In the multiplication table of 4-bit nimbers five Walsh permutations of the binary Walsh matrix of order 16 can be found. One matrix is found, when the dark fields (with odd binary digit sum) in the multiplication table are seen as binary ones. The other four matrices are shown below the multiplication table.
| The binary digit sum of dark gray fields in the multiplication table is odd, for light gray fields it's even. The dual matrix below shows the single bits of the entries. | The binary digit sum of dark gray fields in the multiplication table is odd, for light gray fields it's even. The dual matrix below shows the single bits of the entries. | wp(15, 5,11,13) 1 fixed point and 1 15-cycle Sequence: (0,15,5,10, 11,4,14,1, 13,2,8,7, 6,9,3,12) Inversion vector: (0,0,1,1, 1,4,1,6, 2,7,5,6, 7,5,11,3) Inversion number: 60 | wp(15, 5,11,13) 1 fixed point and 1 15-cycle Sequence: (0,15,5,10, 11,4,14,1, 13,2,8,7, 6,9,3,12) Inversion vector: (0,0,1,1, 1,4,1,6, 2,7,5,6, 7,5,11,3) Inversion number: 60 |
| wp( 8,12,10,15) 4 fixed points and 4 3-cycles Sequence: (0,8,12,4, 10,2,6,14, 15,7,3,11, 5,13,9,1) Inversion vector: (0,0,0,2, 1,4,3,0, 0,5,8,3, 8,2,6,14) Inversion number: 56 | wp( 4, 8, 5,10) 1 fixed point and 5 3-cycles Sequence: (0,4,8,12, 5,1,13,9, 10,14,2,6, 15,11,7,3) Inversion vector: (0,0,0,0, 2,4,0,2, 2,0,8,6, 0,4,8,12) Inversion number: 48 | wp( 2, 3,12, 4) 1 fixed point and 5 3-cycles Sequence: (0,2,3,1, 12,14,15,13, 4,6,7,5, 8,10,11,9) Inversion vector: (0,0,0,2, 0,0,0,2, 4,4,4,6, 4,4,4,6) Inversion number: 40 | wp( 1, 2, 8,12) 4 fixed points and 4 3-cycles Sequence: (0,1,2,3, 8,9,10,11, 12,13,14,15, 4,5,6,7) Inversion vector: (0,0,0,0, 0,0,0,0, 0,0,0,0, 8,8,8,8) Inversion number: 32 |
It is remarkable that the left one of the small matrices under the multiplication table resembles the sequency ordered Walsh matrix while the right one resembles the natural ordered W.m.
The four permutations that permute the s.o.W.m. in the four small matrices may deserve a closer look:
wp( 1,14, 4, 8), wp( 3, 9,12, 4), wp( 9,13, 1, 2), wp( 7,11, 3, 1). The bitxor is wp(12, 1,10,15).
wp(129,2,6,10,30,34,102,170) permutes the s.o.W.m. of order 256 into element 7 of the respective dual matrix. This permutation is also self-inverse, and has 32 fixed points. This is its compression matrix:
# What Breaks your Wu'du?

Acts that break your Wu'du:
* Passing urine, feces or gas
* Sexual discharge from the penis or vagina
* Deep sleep that makes a person completely unaware of his surroundings
* Loss of consciousness
* Vomit
* Losing one's reason by taking drugs or any intoxicating stuff.
# What Matters/Beauty, awe
## Beauty, awe

We find beauty in something done well. Works of art provide some of the most profound, emotionally moving experience available to human beings. When we address difficulty in terms of the call to beauty, new invitations come alive. Beauty is a gentle but urgent call to awaken. Enjoy Denis Dutton's February 2010 TED talk on a Darwinian theory of beauty ̶ that art, music and other beautiful things, far from being simply "in the eye of the beholder," are a core part of human nature with deep evolutionary origins.

### Assignment:

Part 1: Notice everyday beauty as follows:
* Watch the sunrise
* Take a walk somewhere nearby. Notice each beautiful thing you see or hear. Make a list of this everyday beauty.
* Savor the beauty in your life.
Part 2: Practice miksang—good eye—as follows:
* Read the article “What is Miksang?”
* Read the article “Turn a Lens Toward Your Life”.
* Follow the guidance given in the section “Capture the Moment” Note, no camera is necessary. The essence of the technique is in noticing the beauty.
* Practice miksang aurally. Notice pleasant sounds such as song birds, running water, or children playing.
Part 3: Browse beautiful photos, for example:
* Photos in the flickr "Beautiful Earth" group.
* Photos in the flickr "So simple, so beautiful" group.

### Suggestions for further reading:

* Dutton, Denis (2010). The Art Instinct: Beauty, Pleasure, and Human Evolution. Bloomsbury Press. pp. 288. ISBN 978-1608190553. http://www.theartinstinct.com/.
* What Is Beauty?, TED Radio Hour, December 31, 2015.
* [Evaluate the book: Beauty: A Very Short Introduction ]
* [Evaluate the book: Senses of Mystery: Engaging with Nature and the Meaning of Life, by David E. Cooper ]

### References:

* ↑ Dutton, Denis (2010). The Art Instinct: Beauty, Pleasure, and Human Evolution. Bloomsbury Press. pp. 288. ISBN 978-1608190553. http://www.theartinstinct.com/.
* ↑ O'Donohue, John (2005). Beauty: The Invisible Embrace. Harper Perennial. pp. 272. ISBN 978-0060957261.
# Wet Shaving

Many people find wet shaving the most comfortable, pleasant, and affordable way to shave. Here are the basic steps in shaving with a mug, soap, and brush.
* 1) Begin by holding the brush under running water to get it thoroughly wet. Then shake it once or twice to remove the excess water.
* 2) Keep the soap in a bowl or mug. Move the brush in a circular motion over the surface of the soap to create a soapy lather. Use enough water to wet the soap, but not so much that it gets very runny. You may wish to use a shaving cream (from a squeeze tube, never an aerosol can) rather than a soap. The technique is basically the same. Creams often need less water
* 3) Use the brush to carry the soapy foam from the mug and create a lather all over your face and beard. You may have to add some water (to the brush) at this time to get a rich foamy lather on your face. The lather should be wet and stiff, not runny The purpose of all this is to moisten the beard and keep it moist during the shave.
* 4) Use your razor to shave off the whiskers, the lather comes off with it. You will soon learn the best direction to pull the razor ("with the grain") for each section of your face to get the most comfortable, close shave. Some men find that a second shave is required. You may want to use a towel or facecloth when you are done with the razor to get the last bits of lather off your face. I don't use any after shave lotion (because the shaving does not cause me any irritation and I don't like the smell of the lotion) but you may prefer to put some on now.
* 5) Rinse the brush off, shake most of the water off, and hang it to dry with the bristles down.

## Further Reading

Students interested in learning more about shaving may be interested in these materials:
* Body Hair Removal, from Wikibooks.
# What Matters/Adopt a Global Perspective
## Adopt a Global Perspective

If you grew up living in a small isolated village you would naturally assume, perhaps without ever giving it a second thought, that what you see is all there is. You might believe the people of your village are the only people in the world, all the world's people have customs and culture like yours, and the ecology, geology, and climate of the world is like what you experience around you. Such is the tyranny of evidence.
But correspondence with reality is the true test of a belief, and that reality must include the broad scope of a global perspective.
Work to understand our world from a global perspective.

### Assignment:

* List ideas and beliefs you had earlier in your life that had to be discarded, revised, or generalized to accommodate the broader perspective you gained as you matured.
* As you go through your daily and weekly activities, notice what attitudes, beliefs, and behaviors originate from a tribal perspective and what ones are from a global perspective. Notice if you tempted to apply tribal thinking to address a global problem.
* Complete the Global Perspective course in the Applied Wisdom Curriculum.

### Suggestions for further reading:

* Kelleher, Ann; Laura Klein (2005). Global Perspectives: A Handbook for Understanding Global Issues. Prentice Hall. pp. 240. ISBN 978-0131892606.
* Greene, Joshua (December 30, 2014). Moral Tribes: Emotion, Reason, and the Gap Between Us and Them. Penguin Books. pp. 432. ISBN 978-0143126058.