| Adding the 1st frame from another MD3 | |
| You can combine several non-animated MD3-files into 1 animated MD3. This provides a way to make an animated MD3 from, for example, MAP-converted-models made in Radiant (which is what i will do in this example). Because adding a frame from another MD3 is pretty simple, this demo will mainly focus on the construction of animation-frames from a Radiant-model. | |
| If You are only interested in adding a frame, You can go directly to step: "Creating the animated MD3" | |
For this example i recreated (in Radiant) the model of an existing lowrider car. The original model is not animated, and therefore static. I wanted it to bump on its front-wheels. The next 3 images show the brushwork in Radiant: | |
| Radiant issues to be aware of | |
| There is an important thing to know, before starting to create Your own animated Radiant-models. When You arbitrary rotate an object, the textures can get misaligned. This even happens when textures are locked Just take a look at what happens to the car when i rotate it a bit: | |
| The front of the car in its initial position. Textures look fine, because the model has not been rotated yet.. This is the model as i have created it. I mapped all textures onto this model. It is the model as seen on the first 3 images on this page. | |
| The front of the car again, but now after rotation. Textures are misaligned, even with 'Locked Textures' .. | |
| This issue with the misaligned textures can be very annoying. However, when using the 'Add frame[0] from...'-option with this tool, there is some important thing to know about the tool. Something that will make it a lot easier to create modified versions of the initial model: | |
| When combining MD3-files, the texture-coordinates of the first MD3-file are used for all other frames that will be added (from the other files). This means that only the MD3 You start with, must have the textures aligned correctly. The model(s) of the added frames may have their textures all misaligned, those texture-coordinates will be ignored anyway.. | |
| The plan therefore is, that the animated bumpcar will have the original Radiant-model as its first frame. This way those texture-coordinates are used for the remaining frames as well. Since my initial model's textures are correctly mapped onto the model, all following frames (with the rotated models) will be correct too. However, in my case this first frame will not be part of the animation-loop. Later in-game i just skip playing the first frame of the animated MD3, so nobody will notice it's there.. | |
| Making the seperate frames | |
| For this demo i have created some MD3-files. Each MD3 contains the same, but slightly rotated model. I converted all the Radiant-models seperately into MD3-files. Everyone of these MD3-files is non-animated. Here are the different poses of the same car: | |
| I stored all the MD3-files on disk. In my case, the initial, unmodified model's file is called: lowlow_bump.MD3 I've selected the other files too, only to show howmany files i have created for my animation. | |
| Creating the animated MD3 | |
| Now that You have all necessary files for the animation, You can start combining them into 1 animated MD3. The first thing to do is loading the initial MD3. Like said before, this first MD3's texture-coordinates will also be used for any frames that will be added. | |
| Here i choose the initial model. This model will make the first frame of the animation. | |
| The MD3 is loaded. Not yet animated, just the static car.. | |
| Adding frame[0] from another MD3 | |
| With the initial model loaded, select the choice from the menu: 'Add Frame[0] From...' | |
| Now select the MD3 with the second frame of the animation: lowlow_bump_0.MD3 | |
| 1 frame has been added | |
| Once a frame has been added, You can see that the animation-length has increased by a frame. There is also a message in the statusbar, indicating the addition. | |
| Adding more frames to the animation | |
| Repeat the same steps to add the other frames to make the final animated MD3. Once all frames are added, You can save the model; It will then be saved as an animated MD3. You could also edit more of the model, like i did. I changed the shadernames because the demo-MD3 has been placed in another folder. I also smoothed the surface of the windshield so it doesn't look that blocky anymore. The animated model of the lowrider is included in this file: demomodels.zip | |
| Starting an animation from mapscript | |
| From mapscript the animation can be started with the 'startanimation'-command. In my case the final model has 8 frames. My first frame is not really part of the animation-loop, so i skip it. The script-command for my demo-model would then be: startanimation 1 7 12 norandom Note: The first frame of an animation has the frame-number 0 (not 1).. Of course the model i made, is just for this example. It can be different in Your own cases (meaning framenumbers). | |
| Restrictions | |
| All files that are used to combine the final MD3 must contain the same model. That is, the files must have: You will get an error-message if one of those criteria is not met, and no frame will be added. | |
| Thanks | |
| Thanks to meat for his permission to use his model as a blueprint for this example. www.badmeat.com I also included meat's original model for download: lowlow.zip | |


Variables and Nested Statements
Calling Methods & Arguments
We've already talked a bit about methods like BrainPadSetup()
and BrainPadLoop()
. A Method Call is nothing more then when the method is used or called in your program.
Arguments are values passed into these methods. The following examples list the different ways arguments can be used inside a method call.
BrainPad.Buzzer.StartBuzzing(3000);
The above example is used to play a sound on the Buzzer. We pass the argument 3000 to the BrainPad.Buzzer.StartBuzzing()
method call. The 3000 represents the frequency to play.
BrainPad.Wait.Seconds(0.5);
The above example is a method that makes the BrainPad wait 0.5 seconds before executing the next line of code. The 0.5 is the argument.BrainPad.Wait.Seconds()
is called the method call the argument goes inside the method call between the parenthesis ()
of the method.
The Integer Variable
A variable is a location in memory that is reserved for us to use. Instead having to know where the memory is, the system gives us access to that memory using a name we choose as shown in the example below
The type tells the system how much memory to reserve for that one variable. The most widely used variable is an Integer, defined by the int
before the variable name, which is 4 bytes and can hold large numbers and negative numbers. For now, we suggest using Integers for everything, except when fractions are needed (more on that later).
int count;
The above line instructs the system to reserve a variable as an that is named count
and the variable type is an Integer, or int
when coding.
A variable name can use any letters and numbers but it cannot start with a number or contain spaces. Using the underscore symbol is allowed.
Valid variable names:
int count123;
int count_me_in;
int count2var;
In-valid variables names:
int count me;
int count#;
int 2count;
Variables in small programs can use any names. It could even be just "x". However, using a meaningful name is very important when writing programs, as there maybe hundreds of variables in a large program.
One of the benefits of variables, is they can be used to store numbers as shown in the example below.
int count;
count = 10;
...
count = 123;
In the above example, the count
variable is stored with the a value of 10. Later in the code, the same varible is used to store a new number, 123.
Varibles can also be used in equation as shown below
int count = 5;
int result;
result = 5 + count;
In the above example, we create two variables one named count
, which is initilazed with the value of 10, and one named result
which is empty. The last line of code, takes the count
variable and adds 5
then stores the total in the variable we created named result
You can also use the same variable in an equation to increment that variable. Like in the code below.
count = count + 1;
The code example above takes the current value of count
adds 1
to it then stores the result back into the same count
variable. This is handy when incrementing a number like the score in a game or counting the number of times something happens in a program.
Tip
You can shorten the above code to just count++;
It means the same as count = count + 1;
Using Variables to Change Buzzer Tones
In the example below, we create two variables and use them to change the tone of the buzzer, each time a certian button is pressed.
public class Program {
int frequency;
int increment;
public void BrainPadSetup() {
frequency = 0;
increment = 0;
}
public void BrainPadLoop() {
if (BrainPad.Buttons.IsUpPressed()) {
increment = 100;
}
if (BrainPad.Buttons.IsDownPressed()) {
increment = -100;
}
if (increment != 0) {
frequency = frequency + increment;
increment = 0;
BrainPad.Buzzer.StartBuzzing(frequency);
BrainPad.WriteToComputer(frequency);
BrainPad.Wait.Seconds(0.2);
BrainPad.Buzzer.StopBuzzing();
}
}
}
As we use the up and down buttons to change the frequency, the value held by the frequency variable is printed in the Output Window. Using the code above, can we determine the highest frequency a person can hear?
The if-statement with Variables
The same way the if statement was used to check if a button was pressed, it can be used with variables. In the code below we show that if the frequency is larger than 6,000 turn the red light on, otherwise turn it off. Add the code shown below to the BrainPadLoop()
in the example above, right above the BrainPad.Wait.Seconds(0.2)
line.
if (frequency > 6000) {
BrainPad.LightBulb.TurnRed();
}
else {
BrainPad.LightBulb.TurnOff();
}
Pressing the up button will increase the frequency. Once the frequency is greater than 6,000 the red light will turn on.
Inspecting Variables
Printing the variable value worked well for small programs with a single variable. It is not practical to continuously print every variable out when it comes to larger programs. Instead, we can use the debugger feature to pause the code and inspect variables.
public class Program {
int count;
public void BrainPadSetup() {
count = 0;
}
public void BrainPadLoop() {
count = count + 1;
BrainPad.WriteToComputer(count);
BrainPad.Wait.Seconds(0.2);
}
}
Add a breakpoint to the loop as shown below, then Press F5
key or Start
button to start your program and step through the code. Move the mouse over the count
variable in your code and wait a second. A pop up window will come up showing the value of the count variable as pictured below.
If you press the Continue
button the code will continue until the end of the code or it reaches another breakpoint. Since our code is in the BrainPadLoop
it will circle around and stop at the same breakpoint, only this time the count
variable will be incremented by one.
Double Variable
While an Integer can hold large numbers, it can't hold fractions. For example, there is no way to set an integer to 0.5 or 123.8. The variable type double should be used whenever fractions are needed. If a double can hold large numbers and fractions, why not just use it for everything? You certainly can but double type variables require more memory and processing. Fractions are not always desirable in the programming world as shown below.
public class Program {
double frequency;
int increment;
public void BrainPadSetup() {
frequency = 0;
increment = 0;
}
public void BrainPadLoop() {
if (BrainPad.Buttons.IsUpPressed()) {
increment = 100;
}
if (BrainPad.Buttons.IsDownPressed()) {
increment = -100;
}
if (increment != 0) {
frequency = frequency + increment;
increment = 0;
BrainPad.Buzzer.StartBuzzing((int)frequency);
BrainPad.WriteToComputer(frequency);
BrainPad.Wait.Seconds(0.2);
BrainPad.Buzzer.StopBuzzing();
}
}
}
The code above shows how a double isn't always the best variable type choice. Instead of simply passing an integer into StartBuzzing
method we have to cast it as an integer first. This is done by placing (int) before the variable, which requires additional un-needed processing.
Time to go back to our favorite green light! In the code below, we will turn the green light on and off for a specified amount of time, set by a variable called delay. The up and down buttons control the delay variable, causing the light to be on and off longer or shorter. The variable is also printed out using WriteToComputer()
method with ourdelay
variable as its argument.
public class Program {
double delay;
public void BrainPadSetup() {
delay = 0.20;
}
public void BrainPadLoop() {
if (BrainPad.Buttons.IsUpPressed()) {
delay = delay + 0.10;
}
if (BrainPad.Buttons.IsDownPressed()) {
delay = delay - 0.10;
if (delay < 0)
delay = 0;
}
BrainPad.WriteToComputer(delay);
BrainPad.LightBulb.TurnGreen();
BrainPad.Wait.Seconds(delay);
BrainPad.LightBulb.TurnOff();
BrainPad.Wait.Seconds(delay);
}
}
Returned Values
Some methods return a value, like when reading the light sensor. This value can be placed into a variable and this variable can be used with if statements. We have lightbulb and light sensor on the BrainPad. Let's turn the light on when it's dark as shown in Example 15.
public class Program {
double level;
public void BrainPadSetup() {
level = 0;
}
public void BrainPadLoop() {
level = BrainPad.LightSensor.ReadLightLevel();
BrainPad.WriteToComputer(level);
if (level < 0.5) {
BrainPad.LightBulb.TurnWhite();
}
else {
BrainPad.LightBulb.TurnOff();
}
}
}
How can we determine what threshold to use to turn the lightbulb on? This is a perfect example of when inspecting variables is needed. Run the program and test it by placing a finger over the light sensor to block the light. You may need to adjust the threshold from 0.5 to something else. Take a look at the Output Window to see the light levels to determine what value works best for you.
Strings
A string is a type of variable that holds text as shown in the code example below. The text "Hello World!" is considered a string variable. String variables are always surrounded by quotation marks ""
.
BrainPad.WriteToComputer("Hello World!");
It's important to remember that the value 2
and the string "2"
are not the same thing. They may be the same to us but internally in the system they are very different. When x
is an integer adding 2 + 2 means x
equals 4, as you would expect.
x = 2 + 2;
Let's assume str
is a string variable in the example below, what is the value of str?
str = "2" + "2";
The plus sign symbol +
means something different when dealing with strings. Using the plus sign +
to connect strings is called concatenation. Which means a series of interconnected things.
When concatenating strings in the example above, the result is "22". This will make more sense if you try the code below.
str = "Hello number " + "2";
The result is "Hello number 2"
. Note how even a space makes a difference with in the string.
ToString()
One of the important built-in methods for variables is the ToString() method. This method will take the value from count and convert it to a string as shown in the code below.
public class Program {
double count;
public void BrainPadSetup() {
count = 0;
}
public void BrainPadLoop() {
count = count + 1;
BrainPad.WriteToComputer("Count: " + count.ToString());
}
}
The code above continiously increase the count
variable and display it as a string.
The variable count
an integer that starts at zero and increments by one in every loop. The string "Count: " is concatenated before the value to give us these results. It then prints the variable's value in the Output Window, as seen in the image below.
Tip
BrainPad.WriteToComputer()
method is an excellent way to send messages to Visual Studio about things happening in your program while you're debugging. Messages here are only shown in Visual Studio's Output window and don't effect what's displayed on your BrainPad.
C# is smart when it comes to concatenation. Try changing code count.ToString()
to just count
. Concatenating numbers and other objects with strings will automatically call the ToString() method as shown below.
BrainPad.WriteToComputer("Count: " + count);
While loops
A while loop statement in C# repeatedly executes the code within its curly braces {}
as long as a given condition is true. The example below shows the structure of the while loop.
while(as long as this condition is true){
This code is executed
}
You can make a while loop run forever by making it's condition always return true. As shown in the example below. 1 equals 1 is always true.
public class Program {
public void BrainPadSetup() {
int count = 0;
while (1 == 1) {
count = count + 1;
BrainPad.WriteToComputer("Count: " + count);
BrainPad.Wait.Seconds(0.2);
}
}
public void BrainPadLoop() {
//Put your program code here. It runs repeatedly after the BrainPad starts up.
}
}
It should be noted clearly that we used == and not = in the while statement. The single = is used to set a value, not compare them.
The code below sets count
to the value of 10.
int count = 10;
While this code below compares count
to the value of 10 to see if it's equal.
if (count == 10)
The Boolean type true
can also be used as shown in the example below.
public class Program {
public void BrainPadSetup() {
int count = 0;
while (true) {
count = count + 1;
BrainPad.WriteToComputer("Count: " + count);
BrainPad.Wait.Seconds(0.2);
}
}
public void BrainPadLoop() {
//Put your program code here. It runs repeatedly after the BrainPad starts up.
}
}
Finite while loops
Both of the examples above create while loops that never end. So any code below the infinte while loop will never execute. Sometimes we might want to loop until a condition reaches a certain point or value. The code example demonstrates the use of a finite while loop, meaning it will stop looping at some point.
public class Program {
public void BrainPadSetup() {
int count = 0;
while (count < 10) {
count = count + 1;
BrainPad.WriteToComputer("Count: " + count);
BrainPad.Wait.Seconds(0.2);
}
}
public void BrainPadLoop() {
//Put your program code here. It runs repeatedly after the BrainPad starts up.
}
}
The above code counts up to 10 before the while loop stops.
However, the count started at zero, and not one. Why didn't it show the zero? If we look at the code above carefully you'll notice that the first line of code in our while loop increase the count
variable by one. This happens before it is displayed to the Output window. So by the time we reach the line
BrainPad.WriteToComputer("Count: " + count);
the count
variable is already equal to 1
. To fix this we can move the line:
count = count + 1
To the bottom of the while loop. This means the entire contents of the while loop will execute before the count
variable is incremented by 1
There is another possible issue in our code. If we want it to count to 10. The program never prints the value 10 to the Output window.
In plain English, our program says: run the following code as long as count is less than 10. Since 10 is not less than 10, then 10 will not be printed. The while loop can be easily modified so 10 is printed too. The code example below checks if count
is less than or equal to 10.
while (count <= 10)
Nesting
Any reasonably sized program will have loops inside loops, or if statements inside loops, maybe even inside other if statements and loops! This is called nesting. While programmers should try to keep this simple to understand, nesting is sometimes required. How do we write a program that prints one to 10 repeatedly forever? This is accomplished by having two nested while loops. One that counts one to 10, which goes inside another loop that loops indefinitely as shown in code example below.
public class Program {
public void BrainPadSetup() {
int count = 0;
while (true) {
while (count <= 10) {
BrainPad.WriteToComputer("Count: " + count);
count = count + 1;
BrainPad.Wait.Seconds(0.2);
}
}
}
public void BrainPadLoop() {
// Declared but not used
}
}
The above program still will not work the way we want. It will print 1 to 10 only once. Then the program will continue to loop but will not print anything after count
is greater then 10. Can you fix the code without looking at the solution below?
public class Program {
public void BrainPadSetup() {
int count;
while (true) {
count = 0;
while (count <= 10) {
BrainPad.WriteToComputer("Count: " + count);
count = count + 1;
BrainPad.Wait.Seconds(0.2);
}
}
}
public void BrainPadLoop() {
// Declared but not used
}
}
Instead of intializing the count
variable to 0 at the beginning of our code, we do it inside while loop instead. This means after the nested while loop finishs counting to 10, the first while loop goes back to the top and resets our count
variable to 0. Which is less than 10, starting our nested while loop to begin printing again.
The For Loop
The For Loop executes a block of statements, those between its {}
curly braces, repeatedly until the specified condition returns false. For loops are handy for actions where you have to do a specific task a specific number of times. The syntax of the for loop always starts with the keyword for
As noted in the example below.
for (intializer; condition; iterator) {
}
for (int i = 1; i <= 5; i++) {
}
There are 3 parameters inside each for loop, each parameter is sepearted by a ;
semicolon.
First, the variable i
is initialized, in our example we set it to 1
. This step happens only once, regardless of how many times the loop repeats.
The second part of the parameter is the condition part. While our i
variable is less than or equal to 5
the conditon evaluates to true
, so the loop continues.
The last parameter in the for loop is the iterator. Ours says that everytime we reach the end of our loop the i
variable is increased by 1
and then starts back at the top of the loop again. This repeats itself until the condition part of the for loop returns false
.
In the example below we use a for loop to count to 10 and display the value on the BrainPad's display. After the for loop is done, we then display the words "finished"
public void BrainPadSetup() {
for(int i = 1; i <= 10; i++) {
BrainPad.Display.DrawNumberAndShowOnScreen(10, 10, i);
//Pauses the BrainPad 1 second before contining the loop
BrainPad.Wait.Seconds(1);
}
BrainPad.Display.DrawTextAndShowOnScreen(10, 10, "Finished");
}
Arrays
Arrays are an excellent way to store many of the same data type into a single named varible. The array works well with for loops like we just learned previously. In the code examples below we show you how an array is declared and how it's intialized with values.
An array of integers:
int[] nummbers = { 4, 88, 34, 32, 23 };
An array of strings:
string[] names = { "Tom", "Bill", "Sally", "Greg", "Allen" };
The syntax for creating an array, like the ones above, always begin with the data type of the array, followed by []
brackets. Next we give our array a name. Just like our variable names, make the array names meaningful. After naming the array we follow with an =
equal sign. After the equal sign and inbetween the two {}
curly braces is the data we want to store in the array seperated by commas.
Let's now demonstrate how we access the data from within our array, using the for loop we learned earlier. In the code example below we will use our array of strings to display each name stored in the array on the BrainPad display.
class Program {
string[] names = { "Tom", "Bill", "Sally", "Greg", "Allen" };
public void BrainPadSetup() {
for(int i = 0; i < names.Length; i++) {
BrainPad.Display.DrawTextAndShowOnScreen(10, 10, names[i]);
BrainPad.Wait.Seconds(1);
}
BrainPad.Display.DrawTextAndShowOnScreen(10, 10, "Finished");
}
public void BrainPadLoop() {
}
}
If you look closely in our for loop you'll notice in the parameter of our BrainPad.Display.DrawTextAndShowOnScreen()
function, you will see the names[]
array. The elements of an array are stored as shown in the image below.
You'll notice that our array names
contains 5 elements. But the actual location value inside our array starts at 0
, and ends at 4
. Because all arrays start counting at 0
. So the first element of any array, ours as an example will be names[0]
which contains the string "Tom"
. You'll also notice instead of a using a hard coded value in our for loop parameter. We can find out the length of our array, by using the Length
property of names
like this names.Length
. This is something built into the code that returns the length of the array.
Let's show in our previous code example how we can use two arrays together within our for loop, to hold two different values. Using two arrays together in this fashion is often referred to as using parrallel arrays
class Program {
string[] names = { "Tom", "Bill", "Sally", "Greg", "Allen" };
int[] ages = { 15, 21, 36, 50, 17 };
public void BrainPadSetup() {
for (int i = 0; i < names.Length; i++) {
BrainPad.Display.DrawText(10, 10, names[i]);
BrainPad.Display.DrawText(20, 40, ages[i].ToString());
BrainPad.Display.ShowOnScreen();
BrainPad.Wait.Seconds(1);
BrainPad.Display.ClearScreen();
}
BrainPad.Display.DrawTextAndShowOnScreen(10, 10, "Finished");
}
public void BrainPadLoop() {
}
}
Foreach loop
We showed how you can access an array using the for loop. Now we'll show you how to use the foreach loop. The foreach loop is perfect when you have to cycle through only one array at a time. Unlike the previous example where we used parallel arrays, and accessed two different array elements.
In the code below, you'll notice the parameters required for the foreach loop are different then the for loop and don't require 3 parameters. The foreach loop below first creates a string variable called name
within it's parameters. Each time through the foreach loop advances to the next element of the array called names[]
and sets our newly created name
variable to its value. The foreach loop is a good example of why we pick meanful variable names in our code.
foreach(string name in names){
}
Here is a code sample that uses the foreach loop and the names[]
array
class Program {
string[] names = { "Tom", "Bill", "Sally", "Greg", "Allen" };
int[] age = { 15, 21, 36, 50, 17 };
public void BrainPadSetup() {
foreach (string name in names) {
BrainPad.Display.DrawTextAndShowOnScreen(10, 10, name);
}
BrainPad.Display.DrawTextAndShowOnScreen(10, 10, "Finished");
}
public void BrainPadLoop() {
}
}


Getting started - FiCo4OMNeT Simulation Models
You successfully installed the FiCo4OMNeT simulation models for fieldbus simulations. On this page we would like to give you some tips on how to get started.
Documentation
- A changelog can be found in the WHATSNEW file
- More info about the installation procedure can be found in the INSTALL file
- The documentation can be found online,
or generated using OMNeT++ by selecting the FiCo4OMNeT project and then opening "Project" -> "Generate NED Documentation..." (README).
After generating you find the documentation in the doc folder
Examples
- You find simulation examples in the "examples" folder
- Special examples configured in the Abstract Network Definition Language (ANDL) are located in the "examples_andl" folder
Help
References
If you would like to reference this project please use the following publication:
S. Buschmann, T. Steinbach, F. Korf, and T. C. Schmidt. Simulation based Timing Analysis of FlexRay Communication at System Level. In Proceedings of the 6th International ICST Conference on Simulation Tools and Techniques, pages 285-290, New York, Mar. 2013. ACM-DL.(bibtex)
Ressources


Users
list of application users
Update User "
"
Some errors appeared !
First Name
*
Last Name
*
Email
*
Roles
*
Cancel
Submit


Functions should consist of statements designed to perform a single task.
Many functions take parameters.
Many functions return values.
Functions should consist of statements designed to perform a single task.
Many functions take parameters.
Many functions return values.


Max 10 addresses allowed
Multisig wallets need at least {{newmultisigwallet.n > 2 && newmultisigwallet.n || 3}} admins
Multisig wallets need at least 3 admins
Generic error
Description should be long at least 4 characters.
Multisig wallets can have maximum 10 admins
Wallet description (ie: 'Funds for Haiti flood'):
Select the number of minimum signature you want to require for a transfer:
Select the administrator that will be able to sign a transaction provided by this wallet ({{evaluteMultisigType ()}}):


Festival Poster
This piece was done as a final project for the 2D Tools class. The assignment was to make a festival poster using PhotoShop, Illustrator, and InDesign. In addition, we had to use photo images, create a logo, and include a hierarchy of text as requirements of the assignment. I was inspired by Deadmau5 to create this festival poster. The image consists of a sunset background with the Deadmau5 logo glowing, and birds and a girl flying out of its mouth. I enjoyed this assignment as it challenged myself to use everything I've learned in this class from PhotoShop, Illustrator, and InDesign.


Home
Buy
Rent
Sell
View Properties
Contact Us
Sign up
Log in
Ελληνικά
English
Property
#1
Home
Property List
Property
Property Description
Description ...............
Property Details
Type
State
Location
Area
Price
Date Built
Date Published
Share
Related Properties
Property #1
Property #2
Property #3
Property #4


Menu
Foundation 6 HTML5 App
One
One
Two
Three
Two
Three
Search
PLACEHOLDER
Upload File
Add Record
Delete
Record Value
Empty
Edit Record
Value 1
Value 2


Patagonia, Inc. is a fascinating brand. Yvon Chouinard, the founder , is an eccentric.
Recently, Yvon donated the company to a non-profit trust to fight the environmental crisis1.
This level of commitment intrigued me. After listening to a couple of Yvon’s interviews2, I picked up this book with the hope of learning more about him.
Along with Yvon’s personal story, the book also expands his guiding principles on running a business. He provides a lot of examples on adopting these same philosophies in practice at Patagonia.
In a capitalist economy, companies primarily focus on profits and growth. However, Yvon is committed to using Patagonia to change the way business is done. Almost always, business owners, stakeholders treat the company as a cash printing product. According to Yvon, a company is a resource that should be used for the good - to create value rather than just a tool for minting money. This ideology is starkly in contrast with the tech industry, especially with Web3. Yvon’s depth of thoughts without any formal education in business management fascinates me.
Another idea that stood out for me was Yvon emphasis on a long term vision. He has this 100-year timeframe perspective to taking decisions. Usually, stakeholders are under pressure to create short-term gains at the expense of long-term vitality and responsibility. However, Yvon’s approach is rather unique in that he prefers slow, organic growth rather than marketing-driven hype around the brand. In addition to this, the brand builds an ecosystem with it’s dependents and dependencies to guarantee stability.
Perhaps, this approach comes from Yvon’s inherent love for the outdoors, and building tools to improve that experience. He himself admits that he is a craftsman who stumbled into business. His obsession with creating the best product edges him from the rest of the hobbyists.
He raises intriguing questions about being committed to your niche v/s going mainstream by selling out. Should a company compromise quality for scaling in the name of growth?
As expected, I’m totally sold on his philosophy about the environment. I can only hope the ideas in this book translate them to my daily activities. At least, my relationship with material goods will become a bit more deliberate. The key takeaway here for me is that giving away money for environmental initiates is not philanthrophy. It’s about paying dues for our use (aka exploitation) of our planet. So, this money should be cost of doing business or owning a product.
Business is merely a side effect of Yvon’s obsession with improving the ecosystem around the activies that interest him. This books sets few conscientiousness expectations from a business towards it’s customers, employees, and the environment. There is still a lot for me to absorb from this book, particularly about business management. However, that information might become more relevant if I ever own a business and/or manage an organization. Regardless, I intend to revisit the new edition of this book3 some time in the future.
The following passage from the book stuck with me:
I realize now that what I was trying to do was to instill in my company, at a critical time, lessons that I had already learned as an individual and as a climber, surfer, kayaker, and fly fisherman. I had always tried to live my own life fairly simply, and by 1991, knowing what I knew about the state of the environment, I had begun to eat lower on the food chain and reduce my consumption of material goods. Doing risk sports had taught me another important lesson: Never exceed your limits. You push the envelope, and you live for those moments when you’re right on the edge, but you don’t go over. You have to be true to yourself; you have to know your strengths and limitations and live within your means. The same is true for a business. The sooner a company tries to be what it is not, the sooner it tries to “have it all,” the sooner it will die.


class PageLayout extends Filter
Page layout filter.
Adds a layout to the reponse.
Methods
|
__construct(callable|string $layout = null, callable|string $htmlLayout = null)
Constructor. |
||
| mixed |
before(Controller $controller, Request $request)
To be executed before the action. |
|
|
after(Controller $controller, Request $request, mixed $result)
To be executed after the action. |
Details
at line 25
public
__construct(callable|string $layout = null, callable|string $htmlLayout = null)
Constructor.
at line 35
public mixed
before(Controller $controller, Request $request)
To be executed before the action.
at line 48
public
after(Controller $controller, Request $request, mixed $result)
To be executed after the action.


In this blog post we will define acceptance testing, explain why acceptance testing is important, utilize a library to write acceptance tests in and go over a method called Given When Then in Acceptance Testing, and incorporate acceptance testing into a CI/CD pipeline,.
Define Acceptance Testing
An acceptance test is a formal description of the behavior of a software product, generally expressed as an example or a usage scenario. A number of different notations and approaches have been proposed for such examples or scenarios. In many cases the aim is that it should be possible to automate the execution of such tests by a software tool, either ad-hoc to the development team or off the shelf.
An Acceptance Test Suite helps to veriy that an application is delivering the business value that your customers expect. Additionally an acceptance test suite helps guard agains regressions or defect that break preexisting functionality in your application.
Why is Acceptance Testing Important
So besides functioning as a Regression Test Suite as we stated above, an acceptance test suit help to test the business facing side of your application. It is common to have both Unit and Integration Tests for your code but acceptance tests help to prove that your application does what the customer thinks it should do not what a developer intends it to do.
Many companies already invest in a large battery of Manual Acceptance Testing. Some companies are already spending an exhorbitant amount of money on manual acceptance testing. It may be that for each release a contracting company is hired to conduct manual testing of the entire application.
Automated Acceptance Testing helps to protect your application when large refactorings occur in a codebase. If developers are making large scale changes to an application, an automated acceptance test suite can help protect and catch regressions that can occur with such changes.
Acceptance Criteria
Acceptance Criteria are conditions in which a software application needs to satisfy in order to be accepted by a customer. Acceptance Criteria is a set of statements which mentions the result that will either pass or fail for both functional and non-functional requirements for the software project at the current stage. These functional and non-functional requirements are the conditions which can be acceptance.
Acceptance Criteria should always be written before development commences so that it can successfully capture the customer intent rather than iterate functionalities in relation to the development reality. Acceptance Criteria should be written clearly in a simple language that the customer and product owners can understand.
Given When Then
Given When Then is a style of writing tests and was invented by Dan North and is a part of Behavior-Driven Development (BDD). The idea is that you should break down a user story/test into 3 main sections:
- The given part helps describes the state that you are specifying in the user scenario.
- This can also be thought of as a type of precondition before the test starts.
- The when section is the actual behavior that you are trying to specify.
- The then section helps describe the changes you expect due to the specified behavior.
Feature Specification Example
Let us discuss a possible user story that a product owner specified albeit a trivial example.
simple_addition.feature
Feature: Simple Addition of Numbers
In order to do simple math as a developer I want to add numbers
Scenario: Easy Math Problem
Given a list of numbers set to []
When I add the numbers together by []
Then I get a larger result that is the sum of the numbers
Writing tests using Cucumber
Earlier we mentioned that given when then syntax is a style of testing that is a part of BDD. Cucumber is a tool that supports Behavior-Driven Development. Cucumber supports a multitude of languages and we will be using cucumber-js in the tutorial.
You can install cucumber-js by running the following command: npm install --save-dev cucumber
Requirements is node 6 or higher.
Cucumber-js example
Run the following command to create a suitable folder structure:
mkdir -p features/support
Create a feature specification file that uses the Gherkin Syntax by running touch features/simple_addition.feature
Now copy and paste the sample specification we wrote called simple_addition.feature and paste it into the file we just created.
Inside the root of the directory then run ./node_modules/.bin/cucumber-js
and you will see the following output:
Warnings:
1) Scenario: Easy Math Problem # features/simple_addition.feature:3
? Given a list of numbers set to []
Undefined. Implement with the following snippet:
Given('a list of numbers set to []', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
? When I add the numbers together by []
Undefined. Implement with the following snippet:
When('I add the numbers together by []', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
? Then I get a larger result that is the sum of the numbers
Undefined. Implement with the following snippet:
Then('I get a larger result that is the sum of the numbers', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
1 scenario (1 undefined)
3 steps (3 undefined)
0m00.000s
We can copy and paste the snippet that cucumber gave us into a file called steps.js
const { Given, When, Then } = require('cucumber')
const { expect } = require('chai')
Given('a list of numbers set to []', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
When('I add the numbers together by []', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
Then('I get a larger result that is the sum of the numbers', function () {
// Write code here that turns the phrase above into concrete actions
return 'pending';
});
Now run the command: touch features/support/steps.js
and paste these contents.
This will not pass yet as we need to implement our functionality.
Let us create a file called addition.js
addition.js
:
const { setWorldConstructor } = require('cucumber')
class Addition {
constructor() {
this.summation = 0
}
setTo(numbers) {
this.numbers = numbers
}
addBy() {
this.summation = this.numbers.reduce((prev, curr) => prev + curr, 0);
}
}
setWorldConstructor(Addition)
Now let us rewrite a steps.js to this:
steps.js
:
const { Given, When, Then } = require('cucumber')
const { expect } = require('chai')
Given('a list of numbers set to []', function () {
this.setTo([1, 2, 3, 4, 5])
});
When('I add the numbers together by []', function () {
this.addBy();
});
Then('I get a larger result that is the sum of the numbers', function () {
expect(this.summation).to.eql(15)
});
Now when we run our tests we see the following:
npm run acceptance:tests
><EMAIL_ADDRESS>acceptance:tests /Users/jean-marcelbelmont/dev/cucumber-examples
> cucumber-js
...
1 scenario (1 passed)
3 steps (3 passed)
0m00.001s
Here is the npm script acceptance:tests
:
{
"name": "cucumber-examples",
"version": "1.0.0",
"description": "A repo exploring Behavior Driven Development with Cucumber",
"main": "index.js",
"scripts": {
"acceptance:tests": "cucumber-js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/jbelmont/cucumber-examples.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/jbelmont/cucumber-examples/issues"
},
"homepage": "https://github.com/jbelmont/cucumber-examples#readme",
"devDependencies": {
"chai": "^4.1.2",
"cucumber": "^4.2.1"
}
}
Notice that the scripts block is where the script is run.
Incorporate Tests into a CI/CD Pipeline
In order to incorporate cucumber into a CI/CD pipeline you will need to choose a CI/CD tool. For the purposes of this blog post we will use Travis CI.
Travis CI uses a yaml script file and is really easy to incorporate to a Github Project. First create a file called .travis.yml
and then make sure that sign up for https://travis-ci.org
account. You will then need to sync your current Github repos and then toggle on the repo of your choose. Next push up changes to source control and go to the CI build which in my case happens to be https://travis-ci.org/jbelmont/cucumber-examples
.
Here is the .travis.yml
script that the blog post uses:
dist: trusty
sudo: required
language: node_js
node_js:
- 10
script:
- npm run acceptance:tests
Notice that the script part is npm run acceptance:tests
it is defined in the package.json file at the root of the directory.
Final Thoughts
This example while trivial is a good illustration on why using a tool like cucumber is really useful to test your Acceptance Requirements in a programmatic way.
If you would like to look at the Cucumber Examples Repo Go Here
If you like this blog post then please follow me at jbelmont at Github


bitstring reference
require "bitstring"
load the bitstring module
bitstring.pack(format, arg1 [, arg2, …, argn]) → result
bitstring.pack(bitmatch, arg1 [, arg2, …, argn]) → result
Pack one or more elements as specified by format or by bitmatch into regular Lua string.
bitstring.unpack(format, s [, start, end]) → r1 [, r2, …, rn]
bitstring.unpack(bitmatch, s [, start, end]) → r1 [, r2, …, rn]
Unpack one or more elements as specified by format or by bitmatch and return them as multiple values. Substring of s may be specified by start and end parameters. See substring parameters below.
bitstring.compile(format) → bitmatch
Compile format into bitmatch object. Bitmach object may be used where format is expected to increase efficiency of packing/unpacking expressions.
bitstring.hexdump(s [, start, end])
Dump string s into multi line “offset - hexadecimal bytes - text” similar to xxd output. Substring of s may be specified by start and end parameters. See substring parameters below.
Note: Lines are separated by '\n'. I am considering returning a table of lines instead
bitstring.hexstream(s [, start, end])
Dump string s into single line hexadecimal digit stream. Substring of s may be specified by start and end parameters. See substring parameters below.
bitstring.fromhexstream(s [, start, end])
Convert hexadecimal stream of bytes to regular Lua string. Useful for manipulating hexadecimal streams copied from wireshark. Substring of s may be specified by start and end parameters. See substring parameters below.
bitstring.bindump(s [, start, end])
Dump string s into multi line “offset – binary digits - text” similar to xxd -b output. Useful for visually validating UTF-8 input. Substring of s may be specified by start and end parameters. See substring parameters below.
Note: Lines are separated by '\n'. I am considering returning a table of lines instead
bitstring.binstream(s [, start, end])
Dump string s into single line binary digit stream. Substring of s may be specified by start and end parameters. See substring parameters below.
bitstring.frombinstream(s
[, start, end])
Convert
hexadecimal stream of bytes to regular Lua string. Substring of s may
be specified by start and end parameters. See substring parameters
below.
Format
specification
The format string passed to pack/unpack function consists of elements separated by a coma and optional white space. Each element specifies a value that is packed or unpacked, its size, type and endianess. These element parts are delimited by ':'.
More formally
format ::= element | element-list
element ::= size ':' type ':' [endianess]
size ::= number | all | rest
type ::= int | bin | float
endianess ::= big | little
element-list ::= element element-delimiter element-list [ element-delimiter ]
element-delimiter ::= [' ' | '\t' | '\n' ] ',' [' ' | '\t' | '\n' ]
Notes:
Order of elements in format string specifies the order in which corresponding parameters are packed. bitstring.pack(“8:int, 8:int”, 1, 2) will produce a “\1\2” binary string.
The default endianess is big (network byte order). It may be omitted from format specification. bitstring.pack(“16:int”, 0x0a0b”) bitstring.pack(“16:int:big”, 0x0a0b) will both produce binary string “\10\11”.
Little endianess is not allowed for incomplete bytes as it would introduce size irregularities. for example “9:int:little” for 0x01ff would be ff01 which is “16:int:little”
Sizes for integer values are in bits and for binary strings are in bytes. A more flexible choice would be to follow Erlang model where each element has an optional part to specify multiplicity in bits of the the size part. So for an integer “9:int:big:1” would mean 9 bits and for a binary “3:bin:big:8” would mean 24 bits or 3 bytes. This may be useful in some scenarios that I am unaware of. Not adding this flexibility somewhat simplifies the interface and implementation.
There may be trailing delimiters at the end of format string to ease automated creation of programs that use bitstring.
Floating point support is based on underlying C implementation of float and double and the definition of lua_Number. Allowed sizes are 32 for single precision and 64 for double precision numbers. Current implementation is not expected to be portable to different architectures. If half precision is needed or there is a need of support for different floating point representations please start a discussion on http://luaforge.net/projects/bitstring/
Substring parameters
Substring
parameters allow to handle different parts of the same string
parameter in consecutive invocations thus making most parsing tasks
more efficient. Substring parameters specify substring that starts at
start and ends at end inclusively. Parameters may be negative. 1, -1
specify the whole string. Substring parameters behave similarly to
string.sub parameters, however, it is illegal for start or end to be
out of bounds.


Caelimetrix Provides
Data Standardization
Multiple Vendor Sourcing
Data Accuracy
Data Volume
Architecture
❮
❯


This example shows how to use the gmf-mobile-measure-length
and gmf-mobile-measure-point
directives in combination with
ngeo.interaction.MobileDraw
interaction objects to allow
mobile users to measure distances and know the center coordinate on
their devices. The point measure also uses the gmfRaster
service to also obtain the height of the location as well.


General
Leaderboard
Analytics
Maps
Contact Us
Bi-Weekly Beer Tastings
Filter by beer or company...
Ratings by name...
None
Filter by beers tasted...
All beers tasted
Beers I've tasted
Beers I have not tasted
Company
Beer
Beer Type
Avg Rating
Your Rating
Rank
Name
Number of Beers
Avg. Rating
Analytics
Who do you want to see analytics for?
None
What are you interested in?
Maps
Beer Styles
Top / Bottom 10
Year In Review
Rating Distribution
Beers Tasted Worldwide
Beers Tasted in the US
Favorite Brewery Word Cloud
Most Tasted Brewery Word Cloud
Beer Styles Word Cloud
Filter by beer or company...
Style
Average Rating
Number Tasted
Top Beers
Beer Company
Beer Name
Rating
Bottom Beers
Beer Company
Beer Name
Rating
Top Beers in 2019
Beer Company
Beer Name
Rating
Bottom Beers in 2019
Beer Company
Beer Name
Rating
Beers Tasted Worldwide
Beers Tasted in the US
Suggestions
Have questions about the website or suggestions about how to improve the experience?
Please email us at:
<EMAIL_ADDRESS>Find out more on:
Facebook


The Pieces of the Web - Major Concepts
1. Web browser - A program that runs on your computer to display files found on the web
2. Internet - The world's largest computer network
3. HTTP - The main protocol of the web which communicates back and forth between the internet and the servers
4. Servers - The computers that host the files that make up the web
The Pieces of HTML - Hypertext Markup Language
Text content = What you see
Markup = What it looks like (tells the web browser how to display a web page's words and images)
References to other documents like images or videos
Links to other pages
HTML Tag Overview
1. There are opening and closing tags and the name of the tag is always the same
2. The opening tag (the word or letter) is surrounded by a less than and greater than symbol
3. The closing tag is exactly the same as the opening tag with the addition of a slash in front of the tag name/lettter that appears just after the less than symbol
4. The whole of the tag (with the opening and closing tag) is called an element
5. If you leave off the end tag then the tag never ends (example, if you do opening tag for italics which is and never add in an end tag of then all of the content in the document will be in italics
Some HTML Tag Basics:
Anchors
Provide the ability to create a link that when clicked on goes to a web page
Line Break
This is a void tag which allows you to put text on multiple lines. You'll notice that all of your HTML appears on a single line without a line break tag or a paragraph tag. The line break tag is an inline void tag which means it does not require an end tag. Without a line break or a paragraph break, all content in HTML appears on a single line (whitespace)
Paragraph
This tag to create a paragraph (with an invisible box arount the content which can have both height and width). It is not a void tag so it requires both an opening and a closing tag
The following HTML tags are inline elements:
Bold, Italic, Image, Href (to insert a link), Strong, Span, Break
The following are HTML tags are block elements (used to create an imaginary box around the content):
Paragraph, Form, Div (all this does is contain its contents)
HTML Document Structure
1. Start with the Document type with open and close tags that surround the entire document
2. Add a document head tag which = Meta data, Javascript (JS), CSS
3. Add a title tag (open and closed tags)
4. Add a body tag (open and closed tags) which are the contents of the document
5. Use CSS to add styles to the HTML document


pips Red=147 White=133
(CorrectAnswer= 0/0, ErrorScore= 0)
Lewis Deyong was the Master of Ceremonies at the Monte Carlo World Championships for many years and he did an excellent job. He is also the author of “Backgammon – Learning to Win” which, as well as being highly entertaining, is also a very instructive book.
One of the things he talks about in the book is his theory of dice. Basically there are three types: (a) very lucky dice where every number you want arrives promptly; (b) very unlucky dice, the exact opposite of (a) where you just cannot seem to roll anything useful; (c) middle of the road dice where the dice do not particularly favour either player.
Deyong postulated that with (a) you would win most of the time (assuming roughly equal skill levels) and with (b) you would lose most of the time. It is (c) that separates the expert from the intermediate. If you can play average rolls well then in the long-term you are likely to come out ahead.
Let us look at this week’s position. This position occurred with Black leading 4-3 to 7. To his opponent’s consternation, he had just doubled. The double is entirely correct, as is the take. Black’s blitzing threat warrants the double and he has 28 numbers that put a second checker on the bar.
Up until now Black had rolled well but now he managed to produce an absolute lemon – 54 to be precise. The key is not to lose heart or panic when such a roll pops out of the cup but rather to work out how best to play it to your advantage.
The last thing Black should think of is safety. He has doubled so he needs to make his checkers work for him. This eliminates 21/16, 10/6 as a candidate play – Black does not need a fifth checker on his 6-pt. As Black is ahead in the race 21/16, 20/16 is certainly a reasonable play and it maintains connectivity in Black’s position. That move is actually the third best play. The second best play is 20/11, bringing the loose checker on the 20-pt to a very useful position where it can contribute to Black’s home board and/or attack White’s blot (assuming White fans).
Perhaps surprisingly the best play of all is the seemingly wide open 20/16, 13/8! That plays puts all the checkers to work and neatly duplicates White 1’s and 3’s. If White hits then Black will have a lot of return shots and if not hit Black’s position will be very strong.
Problems like this are at the heart of Deyong’s Dice Theory. You have to be good enough to recognise a poor roll for what it is but then have the skill to turn the poor roll into a reasonable one by the way you elect to play it. I’ll wager not many people would find 20/16, 13/8 over the board and even fewer would have the courage the make the move in live play.
One of the things he talks about in the book is his theory of dice. Basically there are three types: (a) very lucky dice where every number you want arrives promptly; (b) very unlucky dice, the exact opposite of (a) where you just cannot seem to roll anything useful; (c) middle of the road dice where the dice do not particularly favour either player.
Deyong postulated that with (a) you would win most of the time (assuming roughly equal skill levels) and with (b) you would lose most of the time. It is (c) that separates the expert from the intermediate. If you can play average rolls well then in the long-term you are likely to come out ahead.
Let us look at this week’s position. This position occurred with Black leading 4-3 to 7. To his opponent’s consternation, he had just doubled. The double is entirely correct, as is the take. Black’s blitzing threat warrants the double and he has 28 numbers that put a second checker on the bar.
Up until now Black had rolled well but now he managed to produce an absolute lemon – 54 to be precise. The key is not to lose heart or panic when such a roll pops out of the cup but rather to work out how best to play it to your advantage.
The last thing Black should think of is safety. He has doubled so he needs to make his checkers work for him. This eliminates 21/16, 10/6 as a candidate play – Black does not need a fifth checker on his 6-pt. As Black is ahead in the race 21/16, 20/16 is certainly a reasonable play and it maintains connectivity in Black’s position. That move is actually the third best play. The second best play is 20/11, bringing the loose checker on the 20-pt to a very useful position where it can contribute to Black’s home board and/or attack White’s blot (assuming White fans).
Perhaps surprisingly the best play of all is the seemingly wide open 20/16, 13/8! That plays puts all the checkers to work and neatly duplicates White 1’s and 3’s. If White hits then Black will have a lot of return shots and if not hit Black’s position will be very strong.
Problems like this are at the heart of Deyong’s Dice Theory. You have to be good enough to recognise a poor roll for what it is but then have the skill to turn the poor roll into a reasonable one by the way you elect to play it. I’ll wager not many people would find 20/16, 13/8 over the board and even fewer would have the courage the make the move in live play.
1. Cubeful 2-ply 20/16 13/8 Eq.: +0.184 0.585 0.264 0.010 - 0.415 0.114 0.004 2. Cubeful 2-ply 20/11 Eq.: +0.155 (-0.029) 0.575 0.241 0.008 - 0.425 0.095 0.002 3. Cubeful 2-ply 21/16 20/16 Eq.: +0.151 (-0.032) 0.586 0.230 0.008 - 0.414 0.114 0.003 4. Cubeful 2-ply 20/15 10/6 Eq.: +0.136 (-0.048) 0.568 0.226 0.006 - 0.432 0.083 0.002 5. Cubeful 2-ply 20/15 13/9 Eq.: +0.121 (-0.062) 0.569 0.241 0.008 - 0.431 0.111 0.003


Thi is the sidebar!
| Food | Description | Price |
|---|---|---|
| Salad | Fresh, delicious Cobb Salad | $7.99 | Burger | 1/4 lb grass-fed burger with choice of cheese | $6.99 |
| Chicken Salad Sandwich | Our world famous chicken salad on a bagel with homemade pickles | $8.99 |
| Buffalo Chicken Sandwich | Spicy fired chicken on a brioche bun | $10.99 |
| Fries | Hand cut potatoes lightly fired and seasoned | $1.99 |
| Soda | Regular, diet, orange, or root beer | $1.00 |
This is where any content in the footer would go.


Kmeans Model Selection in 2D
setSeed(0);
d = 2; ncentres = 3;
mix = gmm(d, ncentres, 'spherical');
mix.centres = [1 1; -1 -1; 0 0];
mix.covars = [0.1 0.1 0.1];
n = 1000; ndx = 1:n;
Xtrain = gmmsamp(mix, n);
n = 1000;
Xtest = gmmsamp(mix, n);
figure;
Ks = [2 3 4 5 10 15 20 25 30];
for i=1:length(Ks)
K = Ks(i);
mu = kmeansFit(Xtrain, K)';
Xhat = kmeansDecode(kmeansEncode(Xtest, mu'), mu');
mse(i) = mean(sum((Xhat - Xtest).^2,2));
subplot(3,3,i)
plot(Xtrain(:,1), Xtrain(:,2), '.');
hold on
for k=1:K
plot(mu(k,1), mu(k,2), 'rs', 'linewidth', 3);
end
title(sprintf('K=%d, mse=%5.4f', K, mse(i)))
end
figure
plot(Ks, mse, 'o-')
title('MSE on test set vs K')
figure;
options = foptions;
for i=1:length(Ks)
K = Ks(i);
mix = gmm(d, K, 'spherical');
mix = gmmem(mix, Xtrain, options);
nll(i) = -sum(log(gmmprob(mix, Xtest)));
subplot(3,3,i)
plot(Xtrain(:,1), Xtrain(:,2), '.');
hold on
mu = mix.centres;
for k=1:K
plot(mu(k,1), mu(k,2), 'rs', 'linewidth', 3);
end
title(sprintf('K=%d, nll=%5.4f', K, nll(i)))
end
figure; plot(Ks, nll, 'o-')
title('NLL on test set vs K')
Maximum number of iterations has been exceeded
Maximum number of iterations has been exceeded
Maximum number of iterations has been exceeded
Maximum number of iterations has been exceeded
Maximum number of iterations has been exceeded
Maximum number of iterations has been exceeded
Maximum number of iterations has been exceeded


Search Tweets
Realtime Tweets
Search Database
Application help
Search
Player information
Search
Search


In this blog post, we’ll be learning how to install a LAMP stack in Ubuntu? I’ll be using Ubuntu 18.04 LTS and it should work very well in upcoming versions of Ubuntu versions too.
Do not use these settings on Live Servers. The settings mentioned here only meant to be for a local development server. Use it on your own risk.
First of all, update your Ubuntu software package repository by executing below commands.
sudo apt update
sudo apt upgrade
If prompted for the password, enter it. Once you update the package repository you can start installing the LAMP stack.
Installing Apache2 and PHP
sudo apt install apache2
sudo apt install php libapache2-mod-php
sudo apt install php-intl # enabling PHP module intl
It’s very important to install and enable php-intl
library to perform various locale-aware operations. To enable this feature after installation, we need to open the php.ini
file. To confirm correct and currently loaded php.ini
file, create a file named info.php
inside /var/www/html/
.
To create info.php
execute below command.
sudo echo "<?php phpinfo(); ?>" >> /var/www/html/info.php
Now open any web browser of your wish and hit the URL http://localhost/info.php
Check for the Loaded Configuration File. Which will look something like this /etc/php/7.x/apache2/php.ini
Here, 7.x
is the PHP version installed on your system.
Now open the same php.ini
file in any text editors like nano or vim. Search for ;extension=intl;
and remove the semicolon from starting of the line, save and exit.
extension=intl;
Restart Apache server
sudo service apache2 restart
By default, the root directory for deploying projects will be /var/www/html
and if you want to change it, we need to edit the 000-default.conf
file. But before that, I’d highly recommend you to keep a copy of this file. If something goes wrong with our configuration file, we can easily revert it back to the original state.
First, create a copy of the file.
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.bkp.conf
Now, you’re good to edit the 000-default.conf
file. Edit with nano or any text editor you’re familiar with.
sudo nano /etc/apache2/sites-available/000-default.conf
Change DocumentRoot
value to something else, save and close the file. Don’t forget to restart Apache server.
Installing MySQL
sudo apt install mysql-server
After installation, it’s time to configure MySQL. In order to do that execute below command.
sudo mysql_secure_installation ## and hit Enter
When you run the above command you’ll be prompted with some questionnaire. Which is required to secure the MySQL installation.
By default MySQL server will not allow you to access the database remotely (MySQL GUI clients like MySQL Workbench, SQLyog, Heidi SQL, etc) with
root
privileges for security reasons. If you’re on the local machine and want to access databases with GUI clients, create a new user or allowroot
user to access databases remotely.
For more read MySQL’s offical doc


200 CIGARETTES (M). (Paramount Pictures/MTV Films/Buena Vista International) Director: Risa Bramon Garcia
Stars: Ben Affleck, Casey Affleck, Dave Chappelle, Guillermo Diaz, Angela Featherstone, Janeane Garofalo, Gaby Hoffmann, Kate Hudson, Courtney Love, Brian McCardie, Jay Mohr, Martha Plimpton, Christina Ricci, Paul Rudd, Jennifer Albano, Elvis Costello, Catherine Kellner. It is New Year's Eve in New York, 1981. Punk rock is in its death throes. This is a more innocent time, before the era of political correctness, smoking bans, and the spectre of AIDS. This low budget comedy follows a disparate group of twentysomething New Yorkers as they look for love and a hot time in the city in the hours leading up to midnight. The common link is that they have all been invited to a party in a loft apartment. While Monica (Martha Plimpton), the hostess, grows increasingly frustrated with the fact that no-one has yet shown up, her potential guests are sorting out a number of personal relationships and trying to organise their dates for the evening. The film cuts between the various characters, but we never really get any feel for them as real people. If the film has anything resembling central characters it is Lucy (Courtney Love) and Kevin (Paul Rudd, from Clueless, etc). Both long time best friends they are without a date for New Year's Eve, and gradually come to realise that may well be perfect partners as the night wears on. First time screen writer Shana Larsen doesn't get overly sentimental about the spirit of the celebrations here. Rather, her script offers up some witty and acerbic observations on relationships. The film is also suffused with a nice touch of irony that is oddly appealing.
200 Cigarettes is the first feature from director Risa Bramon Garcia, a former high powered casting agent, who has assembled an ensemble group of hot young things and rising young stars to bring the characters to life. They deliver enthusiastic performances that capture the spirit of the film. Love in particular is superb, and her flamboyant, brassy screen presence reminded me of a brash, younger Bette Midler. Janeane Garofalo lends her lacerating wit to a small role as Kevin's past lover, a pretentious performance artist named Ellie. Ben Affleck is wasted in a small and meaningless role as a bartender, while younger brother Casey is solid as a young punk who attracts the attention of Val (Christina Ricci), a tough and feisty teeny bopper. Jay Mohr (from Jerry Maguire, etc) plays the womanising Jack, who is desperately trying to ditch the clinging Cindy (Kate Hudson), with whom he spent the previous night. Comic Dave Chappelle is enjoyable as a spaced out cabbie who ferries many of the characters around the city. Singer Elvis Costello contributes a brief cameo for the film's final, delightfully ironic joke. But the film's setting is also a good excuse to crank out yet another great soundtrack of '80's songs, which, in hindsight, is one of the major plusses of this rather slight, but nonetheless entertaining, nostalgia trip. The costumes also beautifully evoke the era. 200 Cigarettes will largely appeal to audiences who still remember this era with a great deal of fondness and who have not yet grown sick of this whole '80's shtick.
*** greg king http://www.netau.com.au/gregking
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.30
|
Per-session settings for the Money class. More...
#include <ql/money.hpp>
Public Member Functions | |
| const Money::ConversionType & | conversionType () const |
| Money::ConversionType & | conversionType () |
| const Currency & | baseCurrency () const |
| Currency & | baseCurrency () |
| Public Member Functions inherited from Singleton< Money::Settings > | |
| Singleton (const Singleton &)=delete | |
| Singleton (Singleton &&)=delete | |
| Singleton & | operator= (const Singleton &)=delete |
| Singleton & | operator= (Singleton &&)=delete |
| ~Singleton ()=default | |
Private Member Functions | |
| Settings ()=default | |
Private Attributes | |
| Money::ConversionType | conversionType_ = Money::NoConversion |
| Currency | baseCurrency_ |
Friends | |
| class | Singleton< Money::Settings > |
Additional Inherited Members | |
| Static Public Member Functions inherited from Singleton< Money::Settings > | |
| static Money::Settings & | instance () |
| access to the unique instance More... | |
| Protected Member Functions inherited from Singleton< Money::Settings > | |
| Singleton ()=default | |
|
privatedefault |
| const Money::ConversionType & conversionType | ( | ) | const |
| Money::ConversionType & conversionType | ( | ) |
| const Currency & baseCurrency | ( | ) | const |
|
friend |
|
private |


{{weatherForm.errorResponse}}
Weather Report for {{weatherReport.city}}
| Date | Summary | Max Temp | Min Temp | Precip Type | Dew Point | Wind Speed | Cloud Cover | Pressure | Humidity |
|---|---|---|---|---|---|---|---|---|---|
| {{ (weather.time*1000) | date: 'dd-MM-yyyy' }} | {{weather.summary}} | {{weather.temperatureMax}} | {{weather.temperatureMin}} | {{weather.precipType}} | {{weather.dewPoint}} | {{weather.windSpeed}} | {{weather.cloudCover}} | {{weather.pressure}} | {{weather.humidity}} |


Before Change
elif "//hls-fpga-machine-learning insert layer-precision" in line:
newline = line
all_precision = OrderedDict()
for layer in model.get_layers():
layer_precision = layer.get_layer_precision()
all_precision.update(layer_precision)
for used_type in all_precision.values():
After Change
if "//hls-fpga-machine-learning insert includes" in line:
newline = line
for include in sorted(set(sum((layer.include_list for layer in model.get_layers()), []))):
newline += "//include "%s"\n" % include
elif "//hls-fpga-machine-learning insert weights" in line:
newline = line
for layer in model.get_layers():
for w in layer.get_weights():


All engineers are fluent in the latest enterprise, mobile and web development technologies.
They collaborate with your team to write, and improve code on a daily basis, using proven practices such as test-driven development and pair programming.
All engineers are fluent in the latest enterprise, mobile and web development technologies.
They collaborate with your team to write, and improve code on a daily basis, using proven practices such as test-driven development and pair programming.
Design


Become a Super Hardware Hacker with Justin Rajewski
If there were an Olympic medal for hardware hacking, Justin Rajewski, the CEO of Embedded Micro, would probably get it.
While most of us take pride in simply being able to use a soldering iron, Justin is way, way beyond our level. He started designing circuits and circuit boards in high school. He then took that crucial step of launching his project to the world, impacting the lives of real people. He called up a manufacturer, had the boards built, assembled the components, and started selling product, first on his own and then through distributors. Yea, at an age when most teenagers were stoked just to build a simple robot from a kit with some servos, Justin was ripping into Eagle PCB design software and getting stuff built, at real manufacturing facilities.
In the summers, Justin worked at Northrop Grumman and discovered that there was a whole new world of power and flexibility with the more arcane, but rapidly growing area of Field Programmable Gate Arrays (FPGA) that enable electronic designers to completely control the hardware. Justin had designed the boards and mapped out the paths of discrete components, now he could design the chips.
OK, take a pause and think about what you would do. Here’s the difference between guys like you and I that come up with ideas and guys like Justin that get major stuff done. You and I would probably start learning about FPGA and possibly buy a board to experiment with, get some LEDs to blink, possibly run a servo, take a YouTube video of the project and then call it a day.
But Justin isn’t a normal hacker like us. He goes big. He decided that FPGA was so cool that the rest of the world needed to learn about it and he was going to move the world in that direction.
To get his project started, Justin built a prototype and put a video up on Kickstarter. You can see the prototype below with hand-soldered connections. Wow, the man can definitely use a soldering iron! Even before he graduated from the EE department of Stanford University, Justin was CEO of a fast-growing electronics FPGA board company with four distributors in the US and one in Germany. His board, the Mojo, is on version 3 and he’s developed add-on boards to the Mojo to add a clock/visualizer shield, a servo shield, and a SDRAM shield.
Hardware hacking has gone mainstream. Most of us are familiar with the hardware hacking product stars Raspberry Pi and Arduino. Those platforms were not challenging enough for Justin.
He chose to specialize in designing with FPGA to unlock the almost limitless possibilities of building any type of digital circuit to accomplish any type of task. Imagine an automobile hot rodder going from buying engines from Ford to designing every aspect of their own engine and then building it in their shop.
Here’s a section from the Embedded Micro site that explains Justin’s passion for FPGA:
You can think of an FPGA as a blank slate. By itself an FPGA does nothing. It is up to you (the designer) to create a configuration file, often called a bit file, for the FPGA. Once loaded the FPGA will behave like the digital circuit you designed!
One of the reasons FPGAs are so awesome is that unlike an ASIC (Application Specific Integrated Circuit) the circuit design is not set and you can reconfigure an FPGA as many times as you like!
I’m just glad we have hackers like Justin to fill in the blank slates in technology and teach the rest of us what to do with those blank slates.
Giant Graphic Equalizer made with FPGA
Justin’s Mojo Board. When you were in school, did you manufacture FPGA boards in your dorm room? I didn’t.
Light Cube
Original kickstarter video


BREAKING: Court grants Maina N1bn Bail
by BankoleA Federal High Court sitting in Abuja on granted bail to the chairman of the defunct pension reform task team Mr. Abdulrashid Maina in the sum of one billion naira with two sureties in like sum.
Reports have it that Both sureties must be serving Nigerian Senators with no criminal cases before the court.
Also read: Police arraign 24-year-old for illegal possession of pistol
Also, both sureties must have fully developed landed property in Maitama or Asokoro district of Abuja.
Details shortly…


The goal of pkgdown is to make it easy for package developers to make elegant and useful package websites. The defaults are tailored for smaller packages and for use on GitHub (using docs/
directory support), but pkgdown is flexible enough to be used as part of a bigger website. There are six parts to a pkgdown site:
To build a pkgdown site, run pkgdown::build_site()
. This will generate a complete site and open your browser for previewing.
You can configure several aspects of your site. Once your finalized site is built and published on the web, you should publicize its URL in a few places:
Your repository description on github.com.
The URL
field of your package DESCRIPTION
, alongside a link to its source:
Twitter, including the #rstats
hash tag.
URL: https://pkgdown.r-lib.org, https://github.com/r-lib/pkgdown
Most pkgdown configuration options are controlled by a YAML format file named _pkgdown.yml
. These options include:
The site title
, if different from the package name.
A path to a set of template
, if you want to override the default page templates provided by the site.
A bootswatch
theme name to easily tweak the overall appearance of the site.
Other options control the appearance of other parts of the site. See the “YAML config” sections of build_site()
and the other build_
functions for complete details.
pkgdown checks for a site configuration file in these locations:
_pkgdown.yml
_pkgdown.yaml
pkgdown/_pkgdown.yml
inst/_pkgdown.yml
Including the configuration file in inst/
enables sites to be built from packages on CRAN without needing the development version of a package.
pkgdown build-ignores _pkgdown.yml
with usethis::use_pkgdown()
. If you use an alternative location be sure to update .Rbuildignore
to avoid a NOTE
during CMD CHECK
.
The home page will be automatically generated from one of the following four files:
index.Rmd
README.Rmd
index.md
README.md
pkgdown tries them in order, which means that if you want different display for GitHub and pkgdown, you can have both README.md
and an index.md
.
In addition to home page content from the README (e.g., installation instructions, simple examples), pkgdown looks for several other items to add to the home page.
---
output: github_document
---
# packagename <img src="man/figures/logo.png" align="right" />
Badges in the home page source file (e.g. README.Rmd
) are linked in the side bar under “Dev status”.
A link for bug reports is added if the BugReports
field in DESCRIPTION
contains a link. You can use [usethis::use_github_links()
] to populate this field.
Licensing information is linked in the side bar using the package LICENSE
and LICENSE.md
files.
Citation information from a inst/CITATION
file is linked in the side bar to the authors page.
Author ORCID identification numbers in the DESCRIPTION
are linked under “Developers” using the ORCID logo ().
Authors@R: c(
person("Hadley", "Wickham"<EMAIL_ADDRESS>role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4757-117X")
)
Extra markdown files (e.g., CODE_OF_CONDUCT.md
) at the base directory or in .github/
are copied to docs/
and converted to HTML.
When including big graphics in the README, you may find it easier to use knitr::include_graphics("foo.png")
combined with chunk option out.width = '100%'
. This will make the graphic scale with the size of the page.
pkgdown creates a function reference in reference/
that includes one page for each .Rd
file in man/
. This is mostly a straightforward translation of Rd to HTML. pkgdown auto-links internal and external function names to their documentation, so build_site()
and dplyr::select()
are linked to the pkgdown and dplyr documentation.
pkgdown includes the output of Rd @examples
on each reference page including data frames and plots. Examples that are bounded by \dontrun { }
are displayed in the page without their output.
pkgdown will generate a complete reference index that by default is just an alphabetically-ordered list of functions. However, the index is more useful with human curation because functions can be grouped and described in categories. To override the default, provide a reference
key in _pkgdown.yml
.
Use template_reference()
to generate a boilerplate reference section in YAML format:
reference:
- title: "Connecting to Spark"
desc: >
Functions for installing Spark components and managing
connections to Spark
contents:
- spark_config
- spark_connect
- spark_disconnect
- spark_install
- spark_log
- title: "Reading and Writing Data"
desc: "Functions for reading and writing Spark DataFrames."
contents:
- starts_with("spark_read")
- starts_with("spark_write")
- matches("saveload")
The reference
should be an array of objects containing title
, desc
(description), and list of contents
. Since common prefix and suffixes are often used for functional grouping, you can use the functions starts_with()
and ends_with()
to automatically include all functions with a common prefix or suffix. To match more complex patterns, use matches()
with a regular expression.
The objects in reference
can also contain a list of targets to exclude
, which allow you to exclude unwanted topics included via contents
.
pkgdown will warn if you’ve forgotten to include any non-internal functions.
See complete details in build_reference()
.
pkgdown will automatically build all .Rmd
vignettes, including those in subdirectories. The only exception are .Rmd
vignettes that start with _
(i.e., _index.Rmd
), enabling the use of child documents in bookdown. Vignette outputs are rendered to articles/
. pkgdown will ignore the output format defined in the yaml header, and always use html_fragment(toc = TRUE, toc_float = TRUE)
.
If you want to include an article on the website but not in the package (e.g., because it’s large), you can either place it in a subdirectory of vignettes/
or add it to .Rbuildignore
. In addition, you must ensure that there is no vignettes:
section in the article’s yaml header. In the extreme case where you want to produce only articles but not vignettes, you should add the complete vignettes/
directory to .Rbuildignore
and ensure that DESCRIPTION does not have a VignetteBuilder
field.
Articles get a default index that can be customised by referring to vignette file names.
Use template_articles()
to generate boilerplate articles section in YAML format:
articles:
- title: "Extend shiny"
desc: >
These packages provide advanced features that can enhance your Shiny
apps.
contents:
- shinydashboard
- shinythemes
- shinyjs
- htmlwidgets
See complete details in build_articles()
.
If NEWS.md
is present, it will be rendered into a single-page Changelog based on markdown level headings. pkgdown assumes your NEWS.md
is formatted using level one headings (#
) to specify package name and version number, and level two headings (##
) to provide topical organization for each release.
Use usethis::use_news_md()
to create and open a template NEWS.md file that can be edited:
See more suggestions for writing news bullets in the tidyverse style guide.
If you have a large NEWS.md
and want to create one page per release, you can create a multi-page change log by configuring the _pkgdown.yml
:
In this case the NEWS.md
is broken up by the version specified in the level one headings. Each version will be rendered to news/
, with one page per minor release, so that 2.2.0
, 2.2.1
, and 2.2.2
are all described on a single page.
If you want to provide detailed release notes aimed at teaching people about the new features, you can put these in e.g., vignettes/news
and customise the navbar. See an example of this strategy in action for readxl.
navbar:
- text: News
menu:
- text: "Blog posts"
- text: "Version 1.1.0"
href: https://www.tidyverse.org/articles/2018/04/readxl-1-1-0/
- text: "------------------"
- text: "Change log"
href: news/index.html
See complete details in build_news()
.
pkgdown websites can integrate search capability using Docsearch from Algolia. Docsearch is a powerful search engine that is free for documentation websites. There are only two steps needed to enable Docsearch on a pkgdown website.
Once you have published your pkgdown website, submit the pkgdown site URL to Docsearch. Docsearch will contact you via e-mail to confirm you are the website owner.
Docsearch will set up a crawler configuration that indexes your site every 24 hours. pkgdown builds a suggested Docsearch crawler configuration in docsearch.json
and you should point the Docsearch team to this configuration as a starting point. If you want to optimize your search, Docsearch will accept pull requests to the configuration that incorporate additional options to fine tune the scraping.
The Docsearch team will e-mail you some JavaScript to integrate into your website.
<script type="text/javascript">
docsearch({
apiKey: 'API_KEY', // a long hex string
indexName: 'INDEX_NAME',
inputSelector: '### REPLACE ME ####',
debug: false // Set debug to true if you want to inspect the dropdown
});
Put the value of the apiKey
and indexName
parameters into your site _pkgdown.yml
under template: params
:
You also need to add a url:
field to _pkgdown.yml
that specifies the location of your documentation on the web. For pkgdown, the URL field is:
If you are building your own custom Docsearch index, you can also include your Docsearch app_id
in _pkgdown.yml
.
See the pkgdown configuration for a functional search configuration.
Once this configuration is complete, you should find a search bar after re-building your site. After search is enabled , pressing shift
+ /
(i.e., “?”) will move the focus to the search bar.