You go down the left path and eventually come to a large square area. It has a ceiling above it, unlike the rest of the maze where the sky has been visible. In the center of the open space is a pedestal, with what appears to be a button on top of it. What do you do?


You have been idle for .
Select the task you want to track the time for, or just press cancel if you don't want to track the time.


KubeVirt with Ansible, part 1 – Introduction
KubeVirt is a great solution for migrating existing workloads towards Kubernetes without having to containerize everything all at once (or at all). If some parts of your system can run as pods, while others are perfectly fine as virtual machines, KubeVirt is the technology that lets you seamlessly run both in a single cluster.
And with the recent release of Ansible 2.8 containing a new set of dedicated modules, it’s now possible to treat KubeVirt just like any other ansible–supported VM hosting system. Already an Ansible user? Or maybe still researching your options? This series of posts should give you a good primer on how combining both technologies can ease your Kubernetes journey.
Prerequisites
While it’s possible to specify the connection and authentication details of your k8s cluster directly in the
playbook, for the purpose of this introduction, we’ll assume you have a working kubeconfig file in your system. If
running kubectl get nodes
correctly returns a list of nodes and you’ve already deployed KubeVirt, then you’re
good to go. If not, here’s a KubeVirt quickstart (with Minikube).
Basic VM management
Before we get down to the YAML, please keep in mind that this post contains only the most interesting bits of the playbooks. To get actually runnable versions of each example, take a look at this code repository.
Let’s start with creating the most basic VM by utilizing the kubevirt_vm module, like so:
kubevirt_vm:
namespace: default
name: vm1
state: running
And now run it:
[mmazur@klapek blog1]$ ansible-playbook 01_vm1_running.yaml
(…)
TASK [Create first vm?] *******************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "It's impossible to create an empty VM or change state of a non-existent VM."}
PLAY RECAP ********************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Oops, too basic. Let’s try again, but this time with a small set of parameters specifying cpu, memory and a boot disk. The latter will be a demo image provided by the KubeVirt project.
kubevirt_vm:
namespace: default
name: vm1
cpu_cores: 1
memory: 64Mi
disks:
- name: containerdisk
volume:
containerDisk:
image: kubevirt/cirros-container-disk-demo:latest
disk:
bus: virtio
And run it:
[mmazur@klapek blog1]$ ansible-playbook 02_vm1.yaml
(…)
TASK [Create first vm, for real this time] ************************************************************************
changed: [localhost]
PLAY RECAP ********************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
It worked! One thing to note is that by default kubevirt_vm will not start a newly–created VM. Running kubectl get vms -n default
will confirm as much.
Changing this behavior requires specifying state: running
as one of the module’s parameters when creating a new VM. Or we can get vm1 to
boot by running the first playbook one more time, since this time the task will be interpreted as attempting to change the state of
an existing VM to running, which is what we want.
[mmazur@klapek blog1]$ ansible-playbook 01_vm1_running.yaml
(…)
TASK [Create first vm] ********************************************************************************************
changed: [localhost]
PLAY RECAP ********************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
While the first two runs likely finished almost immediately, this time around ansible-playbook
is waiting for the VM to boot, so
don’t be alarmed if that takes a bit of time.
If everything went correctly, you should have an actual virtual machine running inside your k8s cluster. If present, the virtctl
tool
can be used to log onto the new VM and to take a look around. Run virtctl console vm1 -n default
and press ENTER to get a login prompt.
It’s useful to note at this point something about how Ansible and Kubernetes operate. This is best illustrated with an example. Let’s run the first playbook one more time:
[mmazur@klapek blog1]$ ansible-playbook 01_vm1_running.yaml
(…)
TASK [Create first vm?] *******************************************************************************************
ok: [localhost]
PLAY RECAP ********************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
The output is almost the same as on the previous run, with the one difference being that this time no changes were reported (changed=0
).
This is a concept called idempotency and is present in both Kubernetes and Ansible (though not everywhere).
In this context it means that if the state you want to achieve with your playbook (have the VM running) is the state that the cluster
currently is in (the VM is already running) then nothing will change, no matter how many times you attempt the operation.
NOTE: Kubernetes versions prior to 1.12 contain a bug that might report operations that didn’t really do anything as having
changed things. If your second (and third, etc.) run of 01_vm1_running.yaml
keep reporting changed=1
, this might be the reason why.
Let’s finish with cleaning up after ourselves by removing vm1. First the relevant YAML:
kubevirt_vm:
namespace: default
name: vm1
state: absent
And run it:
[mmazur@klapek blog1]$ ansible-playbook 03_vm1_absent.yaml
(…)
TASK [Delete the vm] **********************************************************************************************
changed: [localhost]
PLAY RECAP ********************************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Now the VM is gone, which running kubectl get vms -n default
will confirm.
Just like before, if you run the playbook a few more times, the play recap will keep reporting changed=0
.
Next
Please read part two for a wider overview of available features.


The API Superstore are certified for Windows, Mac, Android 4.0+ and Apple iOS 6.0+ developemnt platforms. Unlimited download from over 50,000 API's with 1-click installation. From e-commerce to interactive maps. The API Superstore saves you
Testimonials
This is the Best Website that i have used in the past 5 years! Keep up the good work.
Jon Smith - Zeekwire
The API Superstore team has created super easy to use interface for app browsing and all are free
Jane Joe - Hanger App
If you are a startup,I would high recommended that you sign up for this service! It works great and it's affordable!


Timeout for I/O on internal comm channels
ipc_timeout
The parameter specifies a timeout in seconds for I/O on internal communication
channels. The purpose is to break out of deadlock situations. If the timeout is
exceeded the software aborts with a fatal error.


Shri Y.S Jaganmohan Reddy
Hon'ble Chief Minister of A.P
Make your concern heard! Students being the future of our country, the State thrives to ensure that the students study with ease. The Student Grievance Redressal Portal has been developed with the vision to decrease the distance between the authorities and the students.This portal aims to speed up the process of addressing the concerns of the students.This portal is made available to the students of the Universities and Institutions of Andhra Pradesh for effective redressal and tracking of the status of their concerns.The State assures the students that each grievance will be effectively handled by the members of the Students Grievance Redressal Committee of their respective Institute.
Submit a detailed explanation of problem
Keep an eye on the progress of your complaint.
See the solution suggested by the counsellor


Search for a new UI5 Top 5 in 2018
Remember last years SAPUI5 Top 5? Well, here’s the announcement for a new SAP Community Competition – The UI5 Top5 edition 2018.
[author:
Twan van den Broek
]
Remember last years SAPUI5 Top 5? Well, here’s the announcement for a new SAP Community Competition – The UI5 Top5 edition 2018.
[author:
Twan van den Broek
]
The 4th UI5con was organised mostly by the UI5 developer themselves and was to say it shortly: not only the biggest, but the best UI5con ever, ever!!
When I arrived at Frankfurt Airport in order to attend (4th) UI5con@SAP, I knew that it was going to be a great day full of valuable content and enthusiastic people, just like the first one happened...
On Friday June 30. the “Community networking” event for UI5 developers took place at the SAP Education center in St. Leon-Rot. It was the largest UI5 event until now, showing that the...
Our friends from Hackerstolz are opening up a new OpenUI5 stream in their Hackschool format. Next workshop is happening at 4th of June in Mannheim and you can find more information on their...
At NCDEVCON - North Carolinas Premier Web Mobile Conference - Alex shows how to build instant prototypes with UI5 in this recording. Watch how to build UI5 apps with just very few steps.
I just returned from FOSDEM, the conference for free and open source software developers that’s held annually in Brussels. It’s a super event that has a long pedigree already, and has managed to...
I just returned from FOSDEM, the conference for free and open source software developers that’s held annually in Brussels. It’s a super event that has a long pedigree already, and has managed to...
A very interesting interview about OpenUI5 from the D-Code Berlin 2014. Guests: Tobias Oetzel, UI5 Developer (SAP), Janina Blaesius, UI5 Developer (SAP), Tim Back, Chief Development Architect...
OpenUI5, a powerful web UI library has recently entered the Open Source world. As the developers, we want to introduce you to it and demonstrate how you can easily develop responsive web apps that run...
With the initial setup work of the Open Source project partly done and partly in progress, we want to create more public awareness around OpenUI5 and bring it closer to developers around the world. So...
Go to the original postLast updated on May 30, 2018 12:00 PM UTC
External links are selected and reviewed when the page is published. Further content is included from other feed sources directly (see subscriptions). We are not responsible for the content of external websites. This feed is powered by planetplanet.


Stephanie Zheng
Stephanie designed a project about Chinese herbs, including each herb's description, uses and effects, with the aim to popularize these herbs. Her digital publication is published through ISSUU. Her print-on-demand book is available on the Blurb platform.


So there can be the case that your Figma file is showing that there are styles defined and present in the file, but when querying it via the API endpoint to get file-styles (/v1/files/<file-id>/styles
) it might return empty styles array.
Simple fix is to go into the Figma file and Publish those styles (you can do it from the drop-down at the top by clicking file’s name).
Now if you query that endpoint, you will find the published styles available there.
Additional text just to help search-engines
- figma api styles empty
- figma api not returning styles
- no styles present in figma api


Toggle navigation
Home
Event Name
Start Time:
End Time:
Add a song for:
Add a priority song for:
Created by
your favorite DJ.


{{ $related := (where site.RegularPages "Type" "in" site.Params.mainSections).Related . | first 5 }} {{ with $related }}


Thanks!
When I release this thing, I'm going to write a PDF that describes how to use it--a very concise one, I don't want to write a book, but the editor can do a LOT more than what you see here. Just briefly, here are a couple of the technical features:
Edit Anything - EVERY resource with a value can be edited in some way
Merging - You can combine your world with someone else's in a single click! Makes collaboration a snap.
Import/Export - No more losing your work when you update the world editor--by Exporting from one version editor, all your data is put into a VERY robust, error-tolerant format that can be Imported by the next.
Compile - When I have a complete version of the world, a simple script that takes all of the game's resources (images in any format, textures, .X models, .MDJ models, mesh skins, scenery, terrain, spawn points, races, classes, maps, spells, and more!) and compiles them into two compressed files: an encrypted file for the client, and one with all the secret stuff for the server. In addition, the compiler performs optimization on the maps and textures to save space, and can even be configured (in the future) to generate reduced-quality versions for a smaller download size or lower-end computers! What's even more exciting is that, to add new stuff to the game, the programs that run the game will never have to change--just compile a new version of the world, and they'll run it!
There's much more to share, but I'm going to get back to tailoring the editor till then


Following the IV administration of indium-111 Zevalin, anterior and posterior images of the body were obtained at two hours and 48 hours post injection.
Dose mCi
None.
The early images obtained at two hours postinjection show normal distribution of indium-111 Zevalin in the blood pool, liver, spleen, and kidneys.
Delayed images obtained at 48 hours after injection show normal uptake in the liver, spleen, and bladder.
Normal tracer activity in the blood pool, liver, spleen and bladder is identified.


Parker Movie Expo
Home
(current)
Contact Us
Login
Sign Up
Payment type
Select
GooglePay
Paytm
PhonePe
Bank Name
Select
Canara Bank
Bank Of India
Indian Bank
TMB
IOB
Branch Name
Select
Taramani
Thiruvanmiyur
Adyar
Besant Nagar
Perungudi
chromepet
Kandanchavadi
Vadapalani
Name
Card Number
CVV
Expiration Month
Select
January
February
March
April
May
June
July
August
September
October
November
December
Expiration Year
Select
2019
2020
2021
2022
2023
2024
2025
Submit


enum class FpxBank
Maybank2U |
|
Cimb |
|
PublicBank |
|
Rhb |
|
HongLeongBank |
|
AmBank |
|
AffinBank |
|
AllianceBankBusiness |
|
BankIslam |
|
BankMuamalat |
|
BankRakyat |
|
Bsn |
|
Hsbc |
|
Kfh |
|
Maybank2E |
|
Ocbc |
|
StandardChartered |
|
UobBank |
brandIconResId |
val brandIconResId: Int |
code |
val code: String |
displayName |
val displayName: String |
id |
val id: String |
get |
Return the FpxBank that matches the given bank code (e.g. "affin_bank", "hsbc"), or null if no match is found. fun get(bankCode: String?): FpxBank? |


{% extends 'base.html' %} {% load staticfiles %} {% block content %}
We create, stock and repair a range of beautiful clothing "Quality clothing at an affordable price"
We offer a range of high quality dress/suit making along garment alteration and restoration services
We can create clothing to your design, with the materials you want.
As if by magic, we restore damaged clothing back to it's former glory.
Clothing we have designed ourselves and high quality garments we have sourced.
We can help bring old clothing back to life with new designs!


|
JQ6500 MP3 Player Arduino Library
A simple library to control a JQ6500 MP3 Player Module from an Arduino.
|
Public Member Functions | |
| JQ6500_Serial (Stream *dev) | |
| Create JQ6500 object. More... | |
| JQ6500_Serial (Stream &dev) | |
| void | play () |
| Start playing the current file. | |
| void | restart () |
| Restart the current (possibly paused) track from the beginning. More... | |
| void | pause () |
| Pause the current file. More... | |
| void | next () |
| Play the next file. | |
| void | prev () |
| Play the previous file. | |
| void | nextFolder () |
| Play the next folder. | |
| void | prevFolder () |
| Play the previous folder. | |
| void | playFileByIndexNumber (unsigned int fileNumber) |
| Play a specific file based on it's (FAT table) index number. More... | |
| void | playFileNumberInFolderNumber (unsigned int folderNumber, unsigned int fileNumber) |
| Play a specific file in a specific folder based on the name of those folder and file. More... | |
| void | volumeUp () |
| Increase the volume by 1 (volume ranges 0 to 30). | |
| void | volumeDn () |
| Decrease the volume by 1 (volume ranges 0 to 30). | |
| void | setVolume (byte volumeFrom0To30) |
| Set the volume to a specific level (0 to 30). More... | |
| void | setEqualizer (byte equalizerMode) |
| Set the equalizer to one of 6 preset modes. More... | |
| void | setLoopMode (byte loopMode) |
| Set the looping mode. More... | |
| void | setSource (byte source) |
| Set the source to read mp3 data from. More... | |
| void | sleep () |
| Put the device to sleep. More... | |
| void | reset () |
| Reset the device (softly). More... | |
| byte | getStatus () |
| Get the status from the device. More... | |
| byte | getVolume () |
| Get the current volume level. More... | |
| byte | getEqualizer () |
| Get the equalizer mode. More... | |
| byte | getLoopMode () |
| Get loop mode. More... | |
| unsigned int | countFiles (byte source) |
| Count the number of files on the specified media. More... | |
| unsigned int | countFolders (byte source) |
| Count the number of folders on the specified media. More... | |
| unsigned int | currentFileIndexNumber (byte source) |
| For the currently playing (or paused, or file that would be played next if stopped) file, return the file's (FAT table) index number. More... | |
| unsigned int | currentFilePositionInSeconds () |
| For the currently playing or paused file, return the current position in seconds. More... | |
| unsigned int | currentFileLengthInSeconds () |
| For the currently playing or paused file, return the total length of the file in seconds. More... | |
| void | currentFileName (char *buffer, unsigned int bufferLength) |
| Get the name of the "current" file on the SD Card. More... | |
Protected Member Functions | |
| void | sendCommand (byte command, byte arg1, byte arg2, char *responseBuffer, unsigned int bufferLength) |
| Send a command to the JQ6500 module,. More... | |
| void | sendCommand (byte command) |
| void | sendCommand (byte command, byte arg1) |
| void | sendCommand (byte command, byte arg1, byte arg2) |
| unsigned int | sendCommandWithUnsignedIntResponse (byte command) |
| Send a command to the JQ6500 module, and get a response. More... | |
| unsigned int | getVersion () |
| int | waitUntilAvailable (unsigned long maxWaitTime=1000) |
Protected Attributes | |
| Stream * | _serial |
|
inline |
Create JQ6500 object.
You can use any Serial libraries that implement a Stream object, for example:
JQ6500_Serial mp3(Serial);
Of course, power and ground are also required, VCC on JQ6500 is 5v tolerant (but RX isn't totally, hence the resistor above).
And then you can use in your setup():
mp3.begin(9600) mp3.reset();
and all the other commands :-)
| unsigned int JQ6500_Serial::countFiles | ( | byte | source | ) |
Count the number of files on the specified media.
| source | One of MP3_SRC_BUILTIN and MP3_SRC_SDCARD |
| unsigned int JQ6500_Serial::countFolders | ( | byte | source | ) |
Count the number of folders on the specified media.
Note that only SD Card can have folders.
| source | One of MP3_SRC_BUILTIN and MP3_SRC_SDCARD |
| unsigned int JQ6500_Serial::currentFileIndexNumber | ( | byte | source | ) |
For the currently playing (or paused, or file that would be played next if stopped) file, return the file's (FAT table) index number.
This number can be used with playFileByIndexNumber();
| source | One of MP3_SRC_BUILTIN and MP3_SRC_SDCARD |
| unsigned int JQ6500_Serial::currentFileLengthInSeconds | ( | ) |
For the currently playing or paused file, return the total length of the file in seconds.
| void JQ6500_Serial::currentFileName | ( | char * | buffer, |
| unsigned int | bufferLength | ||
| ) |
Get the name of the "current" file on the SD Card.
The current file is the one that is playing, paused, or if stopped then could be next to play or last played, uncertain.
It would be best to only consult this when playing or paused and you know that the SD Card is the active source.
Unfortunately there is no way to query the device to find out which media is the active source (at least not that I know of).
| unsigned int JQ6500_Serial::currentFilePositionInSeconds | ( | ) |
For the currently playing or paused file, return the current position in seconds.
| byte JQ6500_Serial::getEqualizer | ( | ) |
Get the equalizer mode.
| byte JQ6500_Serial::getLoopMode | ( | ) |
Get loop mode.
| byte JQ6500_Serial::getStatus | ( | ) |
Get the status from the device.
CAUTION! This is somewhat unreliable for the following reasons...
| byte JQ6500_Serial::getVolume | ( | ) |
Get the current volume level.
| void JQ6500_Serial::pause | ( | ) |
| void JQ6500_Serial::playFileByIndexNumber | ( | unsigned int | fileNumber | ) |
Play a specific file based on it's (FAT table) index number.
Note that the index number has nothing to do with the file name (except if you uploaded/copied them to the media in order of file name).
To sort your SD Card FAT table, search for a FAT sorting utility for your operating system of choice.
| void JQ6500_Serial::playFileNumberInFolderNumber | ( | unsigned int | folderNumber, |
| unsigned int | fileNumber | ||
| ) |
Play a specific file in a specific folder based on the name of those folder and file.

To use this function, folders must be named from 00 to 99, and the files in those folders must be named from 000.mp3 to 999.mp3
So to play the file on the SD Card "/03/006.mp3" use mp3.playFileNumberInFolderNumber(3, 6);
| void JQ6500_Serial::reset | ( | ) |
Reset the device (softly).
It may be necessary in practice to actually power-cycle the device as sometimes it can get a bit confused, especially if changing SD Cards on-the-fly which really doesn't work too well.
So if designing a PCB/circuit including JQ6500 modules it might be worth while to include such ability (ie, power the device through a MOSFET which you can turn on/off at will).
| void JQ6500_Serial::restart | ( | ) |
Restart the current (possibly paused) track from the beginning.
Note that this is not an actual command the JQ6500 knows what we do is mute, advance to the next track, pause, unmute, and go back to the previous track (which will cause it to start playing.
That said, it appears to work just fine.
|
protected |
Send a command to the JQ6500 module,.
| command | Byte value of to send as from the datasheet. |
| arg1 | First (if any) argument byte |
| arg2 | Second (if any) argument byte |
| responseBuffer | Buffer to store a single line of response, if NULL, no response is read. |
| buffLength | Length of response buffer including NULL terminator. |
|
protected |
Send a command to the JQ6500 module, and get a response.
For the query commands, the JQ6500 generally sends an integer response (over the UART as 4 hexadecimal digits).
| command | Byte value of to send as from the datasheet. |
| void JQ6500_Serial::setEqualizer | ( | byte | equalizerMode | ) |
Set the equalizer to one of 6 preset modes.
| equalizerMode | One of the following, |
| void JQ6500_Serial::setLoopMode | ( | byte | loopMode | ) |
Set the looping mode.
| loopMode | One of the following, |
| void JQ6500_Serial::setSource | ( | byte | source | ) |
Set the source to read mp3 data from.
| source | One of the following, |
| void JQ6500_Serial::setVolume | ( | byte | volumeFrom0To30 | ) |
Set the volume to a specific level (0 to 30).
| volumeFrom0To30 | Level of volume to set from 0 to 30 |
| void JQ6500_Serial::sleep | ( | ) |
Put the device to sleep.
Not recommanded if you are using SD Card as for some reason it appears to cause the SD Card to not be recognised again until the device is totally powered off and on again :-/


Welcome To PRGS
Public Raise Government Solve
HomePage
Sign Out
Service ID
Description
Priority level
Department
Status
Service Id
Description
Level
Department
Status


A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot-radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.
The fire spreads around corners. It ignites flammable objects in the area that aren't being w orn or carried.
At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the damage increases by 1d6 for each slot level above 3rd.


Whenever you launch the Unity editor, the Home Screen displays. If you have no existing Unity projects on your computer, or Unity doesn’t know where they are, it asks you to create a project.
To get started, you can click on New project which will take you to the Home Screen’s Create Project view. See the section on this in Creating a Project to find out more. Alternatively, if you already have a Unity project on your computer, you can open it from this screen. See Opening a Project to find out more.
Whenever you start the Unity editor, the Home Screen displays. From here, you can select NEW in the top right corner, to switch to the Create Project view.
To bring up the Home Screen’s Create Project view when you are already in the Unity editor, select New Project… from the File menu.
From the Home Screen’s Create Project view, you can name, set options, and specify the location of your new project.
To create a new project:
The name defaults to New Unity Project but you can change it to whatever you want. Type the name you want to call your project into the Project name field.
The location defaults to your home folder on your computer but you can change it. EITHER (a) Type where you want to store your project on your computer into the Location field. OR (b) Click on the three blue dots ‘…’. This brings up your computer’s Finder (Mac OS X) or File Explorer (Windows OS).
Then, in Finder or File Explorer, select the project folder that you want to store your new project in, and select “Choose”.
Select 3D or 2D for your project type. The default is 3D, coloured red to show it is selected. (The 2D option sets the Unity Editor to display its 2D features, and the 3D option displays 3D features. If you aren’t sure which to choose, leave it as 3D; you can change this setting later.)
There is an option to select Asset packages… to include in your project. Asset packages are pre-made content such as images, styles, lighting effects, and in-game character controls, among many other useful game creating tools and content. The asset packages offered here are free, bundled with Unity, which you can use to get started on your project. EITHER: If you don’t want to import these bundled assets now, or aren’t sure, just ignore this option; you can add these assets and many others later via the Unity editor. OR: If you do want to import these bundled assets now, select Asset packages… to display the list of assets available, check the ones you want, and then click on Done.
Now select Create project and you’re all set!
When you start the Unity editor, the Home Screen’s Open Project view displays. From here you can choose the project you want to open. To bring up the Home Screen’s Open Project view when you are already in the Unity editor, select Open Project from the File menu.
The Home Screen’s Open Project view lists all the projects the Unity editor knows about. (If the editor is newly installed and doesn’t know the location of your existing projects, it prompts you to create a new project. See Starting Unity for the First Time to find out more.)
Click on any of the projects listed to open them. If your project is not listed, you need to tell the editor where it is.
To locate and open an existing project which isn’t listed:
Select Open. This brings up your computer’s Finder (Mac OS X) or File Explorer (Windows OS).
In Finder or File Explorer, select the project folder that you want to open and select “Open”.
(NOTE: To open a Unity project, there is no specific Unity project file that you select. A Unity project is a collection of files, so you need to tell the Unity editor to open a folder, rather than a specific file.)


Contents
About the CANlab Core Tools repository and CANlab toolboxes
Dependencies:
Available Toolboxes:
Quick start instructions
mypath = what(fullfile('CanlabCore', 'CanlabCore'));
if isempty(mypath)
disp('Download CanlabCore from Github, and go to that folder in Matlab')
disp('by dragging and dropping it from Finder or Explorer into the Matlab Command Window')
return
end
mypath = mypath(1).path;
base_dir_for_repositories = fileparts(fileparts(mypath));
cd(base_dir_for_repositories)
fprintf('\nInstalling repositories in %s\n', base_dir_for_repositories);
setupfile = fullfile(mypath, 'canlab_toolbox_setup.m');
if ~exist(setupfile, 'file')
disp('Something went wrong. I can''t find canlab_toolbox_setup.m');
disp('This file should be included in the CanlabCore Github repository.')
end
canlab_toolbox_setup
Installing repositories in /Users/torwager/Documents/GitHub
-----------------------------------------
Checking and/or installing CANlab tools in:
/Users/torwager/Documents/GitHub
-----------------------------------------
Looking for CANlab repositories and adding to Matlab path:
CANlab core tools - Object-oriented interactive analysis and tools used in other functions CanlabCore
CANlab help examples - Example scripts and html output, second-level analysis batch scripts CANlab_help_examples
MKDA meta-analysis toolbox - Coordinate-based meta-analysis of neuroimaging data Canlab_MKDA_MetaAnalysis
FMRI_simulations - Misc tools for simulating and testing power and image data FMRI_simulations
Private masks and signatures - Selected models shared on request MasksPrivate
M3 Mediation toolbox - Single and Multi-level mediation tools MediationToolbox
Neuroimaging_Pattern_Masks - meta-analysis masks, signatures, parcellations Neuroimaging_Pattern_Masks
Robust regression toolbox - Voxel-wise robust regression for neuroimaging data RobustToolbox
CanlabPrivate - Private repository for lab members and collaborators CanlabPrivate
-----------------------------------------
-----------------------------------------
Repository: CANlab core tools - Object-oriented interactive analysis and tools used in other functions
Site:CanlabCore
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/CanlabCore -name "fmri_data.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/CanlabCore
-----------------------------------------
Repository: CANlab help examples - Example scripts and html output, second-level analysis batch scripts
Site:CANlab_help_examples
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/CANlab_help_examples -name "a2_second_level_toolbox_check_dependencies.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/CANlab_help_examples
-----------------------------------------
Repository: MKDA meta-analysis toolbox - Coordinate-based meta-analysis of neuroimaging data
Site:Canlab_MKDA_MetaAnalysis
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/Canlab_MKDA_MetaAnalysis -name "i_density.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/Canlab_MKDA_MetaAnalysis
-----------------------------------------
Repository: FMRI_simulations - Misc tools for simulating and testing power and image data
Site:FMRI_simulations
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/FMRI_simulations -name "power_figure3_num_comparisons.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/FMRI_simulations
-----------------------------------------
Repository: Private masks and signatures - Selected models shared on request
Site:MasksPrivate
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/MasksPrivate -name "apply_nps.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/MasksPrivate
-----------------------------------------
Repository: M3 Mediation toolbox - Single and Multi-level mediation tools
Site:MediationToolbox
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/MediationToolbox -name "mediation_brain.m"
Warning: Function vecnorm has the same name as a MATLAB builtin. We
suggest you rename the function to avoid a potential name conflict.
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/MediationToolbox
-----------------------------------------
Repository: Neuroimaging_Pattern_Masks - meta-analysis masks, signatures, parcellations
Site:Neuroimaging_Pattern_Masks
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/Neuroimaging_Pattern_Masks -name "apply_all_signatures.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/Neuroimaging_Pattern_Masks
-----------------------------------------
Repository: Robust regression toolbox - Voxel-wise robust regression for neuroimaging data
Site:RobustToolbox
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/RobustToolbox -name "robust_results_batch.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/RobustToolbox
-----------------------------------------
Repository: CanlabPrivate - Private repository for lab members and collaborators
Site:CanlabPrivate
Finding repo: Running command:
find /Users/torwager/Documents/GitHub/CanlabPrivate -name "power_calc.m"
Found and added to path with subfolders: /Users/torwager/Documents/GitHub/CanlabPrivate
-----------------------------------------
All CANlab repositories previously installed. Saving path


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/equality.20from.20scratch.html ---
While looking at Kevin's great blog post about unsigned integers from scratch I thought to push myself a little bit and I've tried to do them even more from scratch, by giving up the existing eq
or =
.
So let's say we have an inductive xnat
and an inductive xnat equality
like this:
inductive xnat : Type | zero : xnat | succ : xnat → xnat inductive equality (a : xnat): xnat → Prop | refl : equality a
We're getting reflexivity for free from the type system, but we want to prove transitivity and symmetry. Let's assume we don't know anything about default parameters, universes, etc, but we know about recursors. We might write something like this:
definition equality.symm: Π (a b : xnat), Π eq1 : (equality a b), equality b a := λ a b : xnat, λ eq1 : (equality a b), equality.rec_on eq1 _
And now, the strangest thing happens, the placeholder no longer expects a proof of equality b a
, suddenly equality a a
suffices. This relieves us, and we proceed, almost automatically, to write (equality.refl a)
instead of the placeholder, and this typechecks. Phew.
But why does it typecheck? Why suddently a proof of equality a a
is good enough as a proof of equality b a
. Is there something special in the type-system that makes it work?
Look at the type of equality.rec_on
.
protected def equality.rec_on : Π {a : xnat} {C : xnat → Sort l} {a_1 : xnat}, equality a a_1 → C a → C a_1
It says that if you want to prove a property C
of a_1 : xnat
given equality a a_1
, it suffices to prove C a
. In this case we know equality a b
, so we need a property C
depending on b
such that C a
is easy. In this case we take \lam b, equality b a
as our C
, so C a
is equality a a
which we prove by refl
, and C b
is equality b a
which is what we wanted to show.
You should be sure to look at the definition of equality.symm
with pp.all true
, so you can see how lean filled in the "motive" C
in that rec_on application
or use @equality.rec_on
and fill in all the fields yourself
Thanks Mario, this is making it less magical. I'm on your most recent suggestion.
Kenny Lau once said to me "Lean does not do magic", and at that time I thought that lots of things Lean did (simp, type class inference) were magic. Kenny's comment spurred me on to trying to figure out how everything was working; the point is that Lean never does magic, and in any given case you can simply look at what it did and how it did it. Figuring out how to do that really helped me to learn Lean better.
Ah, of course, it makes sense. equality a b
is the same as (equality a) b
. So our C
becomes equality a
. Thanks Mario!
ah, be careful: equality a
would be a perfect motive to prove equality a b -> equality a b
, but this is symmetry, so there is a twist
So the solution is simply @equality.rec_on a (equality a) b eq1 (equality.refl a)
, and that makes sense.
Is C
the motif?
yes, that's the usual terminology
sometimes you get an error message talking about a motive, that's what it is referring to
If you use the "flipped" motive λ b, equality b a
, you have:
#check λ a b eq1, @equality.rec_on a (λ b, equality b a) b eq1 (equality.refl a) -- : ∀ (a b : xnat), equality a b → (λ (b : xnat), equality b a) b
and notice that the conclusion there, (λ (b : xnat), equality b a) b
, beta reduces to equality b a
which is the desired symmetrized equality
Yes you're right, I didn't notice this wasn't typechecking. This lambda abstraction is a really nice trick, I don't think I would have come up with this myself.
Anyway, thank you Mario, I think this is now really clear.
I'll try to work through transitivity in a similar manner
the really interesting thing is that lean will automatically do that lambda abstraction trick
Now, @Kevin Buzzard if this is not magic I don't know what is.
I'm not sure it's magic
Is it just matching types up?
I'm not quite following, I'm trying to get on a bus in Majorca
the algorithm is very simple: the goal says equality b a
, and we just replace every b
with a
, then we look at what we changed and replace that with a variable, let's call it x
. So the motive is λ x, equality x a
this produces a lambda term such that replacing x
with b
gives us our original goal, and replacing x
with a
gives us our new goal which should be easier, in this case equality a a
you should try using this algorithm in the proof of transitivity to work out the right motive, then see whether you got it right by letting lean do it for you
I've actually just done it in my head. It worked:
inductive xnat : Type | zero : xnat | succ : xnat → xnat inductive equality (a : xnat): xnat → Prop | refl : equality a definition equality.trans: Π (a b c : xnat), Π eq1: (equality a b), Π eq2 : (equality b c), equality a c := λ a b c : xnat, λ eq1 : (equality a b), λ eq2 : (equality b c), @equality.rec_on b (λ x, equality a x) c eq2 eq1
I'm sure I'll learn the algorithm one day, but I think I'll go and buy some beef now. Cooking sous vide steaks for friends this evening.
Thank you Mario, this was really helpful!
Warning: sometimes Lean can't generate the right motive. CS people start going on about higher order unification being undecidable when this sort of thing comes up. The problem is that if Lean can figure out that C b
is supposed to be f a b c b = 0
then it can't work out if C x
is supposed to be f a x c x = 0
or f a b c x = 0
or ... etc. So don't expect Lean to do miracles. See https://leanprover.github.io/theorem_proving_in_lean/interacting_with_lean.html#elaboration-hints
Remember -- Lean does not do magic. Part of the art is working out when you're asking Lean to do magic :-)
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


In rural Panama, women have traditionally relied on men for their income. In 2005, there was a dramatic disparity in the country between men and women’s income. The male population had an overwhelming majority of 91 percent of men with their own income, as compared to only 52 percent of women. While the gap has steadily decreased in recent years, there is still significant disparity between men and women in rural communities.
Urban communities in Panama have a higher percentage of people employed. However, there is still a gap between men and women. At the latest census in 2010, 27 percent of urban Panamanian women did not have their own income. In the same year, only 7 percent of men relied on someone else for their income.


Machine Learning on Stock Market Data
20% Outperformers
10% Outperformers
BitCoin Sentiment Analysis
Mylan Sentiment Analysis
GitHub Repo


No instances to list.
| Name | Definition | Project | Build status | Hash | Running containers | Created | Updated |
|---|---|---|---|---|---|---|---|
| {{ instance.name }} | {{ instance.definition.name }} | {{ instance.definition.project.name }} | Completed Failed In progress | {{ instance.hash || '—' }} | {{ getRunningServicesCount(instance.services) }}/{{ instance.services.length }} | {{ instance.createdAt | relativeDate }} | {{ instance.updatedAt | relativeDate }} |


LuaWinAPI is a wrapper for WinAPI functionality.
Because LuaWinAPI is the basis for another project called LuaVenster the development is driven by the LuaVenster requirements. Although the name LuaVenster is a reminescent to the Win32 Python GUI libraries Venster and VensterCE they have no common roots other than the same spirit in being a minimal lightweight wrapper that integrates smoothly into the target language.
LuaWinAPI depends on bit32 and the LuaCWrap project (http://github.com/oberhofer/luacwrap). If you use LuaRocks this dependencies are resolved automatically.
For a beginner I would recommend to install the latest "Lua for Windows" setup from from the Lua for windows project and install LuaWinAPI via LuaRocks.
Install on console via
luarocks install luawinapi
This installs the LuaCWrap and the LuaWinAPI binary rock and you are ready to go.
First download the source code via git
git clone git://github.com/oberhofer/luawinapi.git master
or unpack the package you got via the download option
Edit ./etc/msvc.bat and set the correct path to the Lua for Windows header and library files.
Open a Visual Studio .NET Command Prompt
Change path to the luacwrap root directory
Execute
etc\msvc.bat
As a result you should have now the files luawinapi.dll within your source directory. To execute the unittest, do
cd src
lua unittest.lua
To install LuaWinAPI into Lua for Windows copy the file luawinapi.dll to the Lua for Windows clibs directory.
This module has been tested with the luawinmulti project from Thijs Schreijer (https://github.com/Tieske/luawinmulti). After creating a basic Lua installation with luawinmulti you can use luarocks to install LuaCWrap
luarocks install luacwrap
Then you can install LuaWinAPI. You have to set the LUACWRAP_INCDIR variable to specify the path to the LuaCWrap header file because it is needed to compile the LuaWinAPI module. The LuaCWrap rock installs this header file in the rocks tree. Locate it and give it to LuaRocks like this:
luarocks install LUACWRAP_INCDIR=c:\Lua\lib\luarocks\rocks-5.1\luacwrap\1.2.0-1\include
This library does not wrap any ANSI versions of the WinAPI calls or structs. Only the "W" functions and structs are supported. The advantage is better portability to WinCE (although not to Win95 but that's ok :-). As Lua does not support UNICODE directly we have to deal with some inconveniences aka. conversions. Fortunately lua has opaque strings so this is not really a problem.
Parts of the WinAPI are kind of object oriented. The LuaWinAPI project tries to "recreate" the object oriented nature for handles in Windows. All functions where the first parameter is a HANDLE type like HWND, HDC, HRGN or HMSGQUEUE are grouped together within a type I call an "abstraction". Because of this you are able to call these functions in two ways:
This behaviour is achieved by collecting the appropriate functions and adding them to the specific HANDLE metatable.
A central element of the LuaWinAPI library is the creation, registration and handling of WNDPROC callbacks. This is done by so called thunks, little stubs of code which provide the callback entry point and dispatch the WNDPROC callback to the registered lua functions.
To create a WNDPROC callback and associate it with a given lua function write
WndProc_callback = winapi.WndProc.new(object, myWndProc, errorProc)
where myWndProc is a lua function with the following signature
function myWndProc(hwnd, msg, wParam, lParam, object, prevproc)
The object parameter takes any Lua object and could be used to specify context information for the callback, while errorProc specifies a function that is used to handle internal errors. In most cases you can specify these parameters to nil/none. The prevproc parameter could be used to call the previous window procedure.
Many WinAPI specific programming tasks could be elegantly solved by subclassing existing controls. You could use SetWindowLong/GetWindowLong to achieve that but LuaWinAPI provides a convenience shortcut to subclass an existing window.
Subclass_callback = winapi.WndProc.subclass(hwnd, object, subClassWndProc)
The window function always receives two additional parameters a object parameter which had been specified on subclassing and the prevproc parameter which could be used to call the original window procedure.
function subClassWndProc(hwnd, msg, wParam, lParam, object, prevproc)
... do something
return winapi.CallWindowProcW(prevproc, hwnd, msg, wParam, lParam)
end
Most wrappers for structs and simple functions are generated from two description files within the gen directory:
The script genwrap.lua takes these annotations and creates the source files
The struct declarations are converted into luacwrap compatible descriptors which could be registered via the luacwrap library.
The wrappers for window enumeration have been implemented manually because of the callback mechanism and/or return values in use. These functions are
Because of actual needs within LuaVenster there are additional functions within the wrapper that extends WinAPI. These are:
void DrawXorBar(HDC hdc, int x1, int y1, int width, int height)
LuaWinAPI is licensed under the terms of the MIT license reproduced below. This means that LuaWinAPI is free software and can be used for both academic and commercial purposes at absolutely no cost.
Copyright (C) 2011-2016 Klaus Oberhofer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


--- layout : default.html title : Curfew Pass System | Login --- e - Curfew Pass system Sri Lanka Police * Curfew Pass for - Please select category Personal Business Expatriate {{> personal.form }} {{> business.form }} {{> expatriate.form }} Proceed


Do you want to join a rapidly-growing team to generate innovative supply-chain solutions? Trinity Shipping Company has the energy and creativity of a young company, but the establishment and reliability that comes from three generations of successful history in the transportation industry. We strive to create and maintain a company culture of innovation, integrity, and inclusivity. Send us your CV at<EMAIL_ADDRESS>Phones
US:<PHONE_NUMBER>Emails
<EMAIL_ADDRESS>1316 Airlie Road
Wilmington, NC 28403
East Coast Operations
Charleston, SC
West Coast Operations
Los Angeles, CA


--- layout: post permalink: compete.html Tags: Array NameOfCoupon: Compete Cash Back Summary: See our Compete Coupon Code, Compete Rebate, Compete Promo Code, Compete Discount, Compete Coupon Cash Back Rebate here.  We have the best Compete Rebate anywhere. thesis_keywords: Compete, Compete Coupon Code, Compete Discount, Compete Rebate product_name: Compete hop_url: http://www.icouponblog.com/hop.php?id=401 ---
Complete is a new breed of analytical company that has collected survey data from over 2million internet users. This valuable compilation of information helps to understand consumers habit, preference, shopping styles etc. Knowing your customer better and understanding their needs will help you to attract their attention, satisfy their need and thereby increase your sales and profits. Check out Complete now completely and you will be extremely excited with what you see. Use our discount coupon to get a great price!
Complete is a great product for advertisers, agencies and media companies. It provides them with actionable intelligence. You can create a more effective websites and targeted advertising campaigns. Complete will allow you to out think and out perform your competitor. Rely on Complete for the best and complete information which will help you make your marketing strategies that will increase your profits. Check out Complete. You will be completed satisfied. Complete will help your company and profits grow to your satisfaction.
Complete’s products include online media planning and measurement tools as well as digital research in the automotive, financial services, consumer goods, media, retail and travel industry. You can measure the effectiveness of your marketing tools through Complete. You can also target your hard to reach costumers by their behavior matches. Complete has many effective and successful tools to make your business a success. Check out our cash back rebate and other coupons for best deals on Complete.


{% include meta_tags/base.html %}
{% include google_analytics.html %}
{% include jillstyling.html %}
{% include cookie_banner.html%}
{% include page/header.html %}
{% include page/project_navigation.html %}
{% include page/project_sub_navigation.html %}
{% include page/title.html %}
{{ content }}
{% include page/footer.html %}


Seq has a value of =$seq$=
Seq (=$seq$=) is blank
Body = =$body$=
Body contains body.
Body does not contain body.
20 greater than =$seq$=
20 not greater than =$seq$=


Record: 0 rounds played. 0 correct.
description goes here
a matching game designed by Henry Fritz
MIT License, feel free to fork it here on codepen or github
if you'd like to try it out with an example set, you can try this one, based on schema.org's full list of types.


Quicksort's worst-case case cost
is O(n^2)
and its average-case cost is
O(n \log n)
. This means that the fraction of
input cases with cost O(n^2)
must:
n
grows.n
n!
For any size n
, it does happen that there are
inputs that have cost n^2
.
But if there were a constant fraction of such cases
regardless of n
, then the average would also
be n^2
.
So the fraction must be be dropping as n
grows.


Preparation time
less than 30 mins
Cooking time
1 to 2 hours
Serves
Serves 12
Dietary
Preheat the oven to 180C/350F/Gas 4.
In a bowl, crush the oatcakes and mix in the melted butter, then press into a 25cm/10in springform cake tin.
For the filling, place the ricotta cheese, soft cheese, eggs and salt and freshly ground black pepper into a food processor and pulse until smooth.
Add the Roquefort cheese and dried figs to the food processor and pulse again.
Spoon the cheese mixture onto the oatcake base and transfer to the oven to bake for one hour. Remove from the oven and allow to cool.
For the onions, place the balsamic vinegar, caster sugar, nutmeg, baby onions and garlic into a small pan over a medium heat. Bring to the boil, then reduce the heat to simmer until the onions have softened and the liquid has reduced to a syrup.
To serve, cut the cheesecake and place a wedge of the cheesecake onto each plate. Top with some of the onions and place a small handful of watercress, mustard cress and beetroot leaves alongside. Drizzle around the remaining syrup from the onions.


Hudson Yards construction workers injured in scaffold collapse
by WABCHUDSON YARDS, Manhattan (WABC) -- Four construction workers were injured in Manhattan when a scaffold collapsed.
The accident happened Monday morning on the 18th floor of a 58-story building under construction at the Hudson Yards site located at 415 10th Avenue.
The Department of Buildings said that the cross-bracing on the scaffold was inadequate.
The scaffold collapsed from the 18th to the 17th floor after a load of material was placed on it.
None of the workers were seriously injured, and all four were taken to the hospital.
DOB inspectors ordered the contractor to repair the scaffolding and issued a violation for failure to safeguard workers.
A partial stop work order was also issued.


Basic Use
docstr_md.python.PySoup
class docstr_md.python.PySoup(code=None, path='', parser='sklearn', src_href=None) [source]
This class parses raw Python code for easy conversion to markdown.
| Parameters: | code : str, default=None
Raw Python code. path : str, default=''
Path to python file. One of
If input as a string, |
|---|---|
| Attributes: | objects : list
List of soup objects; expressions (
The input
Import path for soup objects. Setting the import path for the soup automatically sets the import path for its
Path to the file in the source code repository (e.g. Github). Setting the source code path for the soup automatically sets the source code path for its
The |
Examples
Create a python file with parseable docstrings.
from docstr_md.python import PySoup
# replace with the appropriate file path and docstring parser
soup = PySoup(path='path/to/file.py', parser='sklearn')
Methods
convert_ast_object(self, obj) [source]
Convert an ast
object to a soup object.
| Parameters: | obj : ast.Expr, ast.FunctionDef, or ast.ClassDef
|
|---|---|
| Returns: | soup_object : Expr, FunctionDef, or ClassDef
Specified in docstr_md/python/soup_objects.py. |
rm_properties(self) [source]
Remove methods with getter, setter, and deleter decorators from all
ClassDef
soup objects in the objects
list.
| Returns: | self : docstr_md.python.PySoup
|
|---|
Examples
Create a python file with a class with methods decorated with
@property
, @x.setter
, or @x.deleter
.
from docstr_md.python import PySoup
soup = PySoup(path='path/to/file.py', parser='sklearn')
soup.rm_properties()
The ClassDef
soup objects' methods
will no longer include
properties.
rm_objects(self, *names) [source]
Remove objects by name.
| Parameters: | *names : str
Object names to remove. |
|---|---|
| Returns: | self : docstr_md.python.PySoup
|
keep_objects(self, *names, keep_expr=True) [source]
Keep objects by name.
| Parameters: | *names : str
Object names to keep. keep_expr : bool, default=TrueIndicates that expressions (which don't have names) should be kept. |
|---|---|
| Returns: | self : docstr_md.python.PySoup
|
docstr_md.python.compile_md
def docstr_md.python.compile_md(soup, compiler='sklearn', outfile=None) [source]
Compile markdown from a PySoup
object.
| Parameters: | soup : PySoup
Soup object to convert to markdown. compiler : callable or str, default='sklearn'
If input as a string, it File to which to write the markdown. |
|---|---|
| Returns: | markdown : str
Markdown formatted as output by the |
Examples
Create a python file with parseable docstrings.
from docstr_md.python import PySoup, compile_md
# replace with the appropriate file path and parser
soup = PySoup(path='path/to/file.py', parser='sklearn')
# replace with your desired compiler and output file path
compile_md(soup, compiler='sklearn', outfile='path/to/outfile.md')
You can find the compiled markdown file in test.md
.


--- layout: tweet ---
Best code comments: http://tinyurl.com/4qs8x3
4/28/2009, 12:03:33 PM
Favs: 1
Retweets: 0


The 88th Academy Awards airs on February 28th, which means we are counting down the days to find out if Leonardo DiCaprio will finally bring home an Oscar. We’re pretty sure Leo is tired of hearing “better luck next year”, so we wanted to build an Oscar predictor to let him know if he should bother practicing that acceptance speech or not. Actually no, we just wanted to build an Oscar predictor.
So, what does it take to get that golden statue anyhow? We used the IMDb database to find gather as many features as we could on movies that have been nominated for an Oscar, and trained several versions of Oscar predictors using data from 1981 to 2004. For each version, we counted how many times we got it right using data we set aside from the Oscars in 2005 and 2006. This was a good way to see how our final Oscar predictor would fare in future Academy Awards. We finally settled on 'Oscar Predictor 7.0', a model that predicted Oscar outcomes with an 81% accuracy rate. The predictor was built using a Random Forest Classifier, but instead of getting into the nitty-gritty details about what that means, we’ll give you the Buzzfeed version.
That’s right, when it comes to winning an Oscar, it seems that given a film is nominated, it will more likely win if released later in the year. According to the Oscar Rulebook (yes, there is such a thing), films must be released by December 31 of the previous year in order to be eligible for the February award show. Seems like filmmakers don’t want to show all their cards too early according to the data. Nominated movies that were released in August, September, November and December won over 30% of the time compared to movies released in May, which won less than 20% of the time. While we cannot say that releasing a movie in December will increase your chances of winning an Oscar, there does seem to be something magical about that time of year.
Image credit: giphy
Our analysis also used information about the countries of origin of each movie. Now, the Oscars are an American event, and American films take home the lion's share of the awards. But in terms of percentage of nominated movies that win, two countries stand out: Italy and Spain. Over 40% of nominated movies from Italy take home an Oscar, and Spanish-origin came out to be an important predictor in one of our models. The USA (and other English-speaking countries) didn't fare nearly as well. Bet you regret not paying attention in high school Spanish class now, huh?
Image credit: kym-cdn
IMDb gives a list of keywords and genres associated with a movie. Oscar Predictor 7.0 found that these were pretty helpful in separating the Haves and the Have-Nots. Films with keywords like 'blood' and 'violence' (especially those in the 'Thriller' genre) tend to perform poorly. Yet somehow, war movies do really well in our model. If you find that a bit contradictory, then you can always make a family film or musical. Those also tend to win more than other genres.
Image credit: tumblr
Yeah, so it’s pretty easy to win an Oscar… all you have to do is get nominated for Best Picture. All jokes aside, we found that movies nominated for Best Picture tend to win in at least one category, even if they don’t get to take home the big prize. We figured this is largely because a movie nominated for Best Picture is an all-around good movie, maybe even nominated for several other categories.
Image credit: giphy
Oddly enough, there are some categories that, if nominated for, lowers a film’s probability of winning. A couple versions of our Oscar Predictor indicated that filmmakers should avoid being nominated for Best Cinematography, Best Sound Mixing, Best Costume Design if they want a chance at winning an Oscar. These are almost like second tier categories...so one possible theory is that the big guys (the ones that were nominated for Best Picture) were also nominated for these secondary awards. The little guys, who only had one shot at winning an Oscar for having great costumes, has no chance. Bummer.
Image credit: giphy
Now before you go off and make your Oscar-winning movie, we want to leave you with one final quote for thought, from five-time Oscar winner Clint Eastwood:
Winning an Oscar is every filmmaker's dream. As movie buffs and aspiring filmmakers (…just kidding), we wanted to see what it took to win the golden statue. Currently there are 24 categories ranging from Best Picture to Best Sound Editing. We all had our own suspicions of what movie features are associated with winning an Oscar. We set out to find the probability of a film winning an Oscar given it is nominated. More specifically, we wanted to find a classifier that could identify the winners and the losers.
We obtained a complete list of all the Oscar nominated films through the 79th Academy Awards in 2006 from ya-shin.com. Although the data came in a csv file, there were several layers of data cleaning involved before being able to analyze the data. We analyzed only the data between 1981-2006, as the categories have remained relatively constant during this period. The data for each movie included the categories the film was nominated for and won. To include features for the films that could be predictive of winning an Oscar, we utilized the IMDbpy package to complete our dataset. IMDbpy is a Python package that contains various movie features from the IMDb database.
The data had a handful of continuous and semi-continuous variables such as runtime and month of release date, however the majority of the features were categorical, such as genre and keywords. Knowing that sklearn could only accept numerical variables as inputs, we converted all the categorical variables into dummy variables. To reduce the dimensionality, we used only the most-common categories in our analysis.
We began with exploratory data analysis to identify what variables would be important in building an effective classifier. Grouping the movies by winners and losers, we were able to visually determine if any variables were good separators. For example, a film nominated for Best Picture is more likely to win an Oscar. This makes sense because films nominated for Best Picture tend to be the best movies across all categories. Therefore, even if the movie does not win Best Picture, it is likely to win an Oscar in one or more different categories.
We were also curious to see if keywords could be predictive of Oscar winners. For each of the top 25 keywords, we found the proportion of nominated films that won, which are plotted below. Among the frequent keywords were "blood", "death", and "violence". From EDA, it was difficult to tell which keywords would be helpful in our classifer.
Also, the month of release also seems to be associated with winning. In terms of raw numbers, movies that come out late in the year, especially November and December, receive the most number of nominations and awards. But in terms of percentage of nominated movies that actually win awards, there is no clear-cut best month. August, September, November, and December all seem to have an equally large rate of nominated movies that win big.
Since our project was focusing on prediction, we fit a variety of statistical models and tested the performance of each on data from the 2005 and 2006 Oscars (the latest years that we had data for). Ultimately, we found that the machine learning technique called Random Forests performed the best. It predicted Oscar winners for 2005-2006 with an 81% accuracy. This is an improvement from a 71% baseline accuracy (if we predicted all movies to be losers). So although there’s clearly room for improvement, the relative success of our final model indicates that we did capture some of the most important features that make a movie Oscar-worthy.
We used decision surfaces to see how the classifer was deciding who was a winner when it came to month of release and number of nominations. The plot confirms that there are many winners late in the year. The plot also illustrates that the movies released later in the year must receive more nominations to increase probability of winning. However, we suspect that this may be overfitting a few end-of-the-year high performance losers, and further analysis is needed.
Moving forward, we would like to look at predicting what kinds of movies win certain awards (i.e., Best Picture, Best Costume Design, etc.). In order to maximize the amount of data we were working with, our analysis treated each ;win' as an equivalent outcome, when this is not in fact the case. Ideally, we would collect more data and use a wider range of years to perform a new analysis on each individual award, since only a fraction of total movies nominated for an Oscar are nominated for any one award. Another possible extension is analyzing which features make a movie more likely to be nominated in the first place, in comparison to the general body of movies that are release in any given year.
We also felt that we could have improved our accuracy by incorporating more features, particularly a movie's cast, into a predictor. Typically Oscar-winning movies have a cast full of A-list actors and actresses. Although we did develop a way to compute the "star power" for a given movie, it was very computationally intensive, making time the only obstacle from including the cast. This also could have been extended to compute "director power" and "producer power."
Lastly, we would consider using a different method to create keyword features in our analysis. To reduce the dimensionality of our data, we only selected the top 25 most-commonly appearing keywords in Oscar-nominated movies (out of a total of more than 15,000 that appeared at least once). Many of these keywords dealt with closely-related subjects, so we could have clustered them into broader 'themes' using Latent Dirichlet Allocation (LDA) to capture more information from each film.
Image credit: mshcdn
For even more details, see our full work on github!


A story is a sequence of events and can be temporal (happen within the viewer's mind) or spatial (occur physically). A story (sequence of events) is expressed through narration, or the recounting of events. A narrative is a method of telling a story and is tangible. We know that a narrative is tangible because we can perceive the telling of stories through written text, sound, performance, image, etc. A narrative account of a split-second could last for the entire retelling whereas an event that lasted 100 years could be retold in a few seconds. Narrative places emphasis, focus, and perspective for stories. A plot is the connective tissue between story events, describing the causal relationships and context for viewers.
Watch Kurt Vonnegut's humorous lecture on storytelling. Shapes of Stories (4:36)
Below, I have written a story (based on real events). I then described the plot of the story, and used written narrative to tell a single moment in the story from a third person Point of View.
(1) A new family sets off on a routine, but potentially dangerous voyage. (2) Their baby gets sick (3) Their vessel takes on water. (4) They call for help. (5) They get rescued and face public scrutiny
Simon and Mary, along with their newborn child, plan to cross the Pacific Ocean in their sailboat–a journey they have done many times. They take all necessary precautions before the trip. Despite being cleared for travel, their baby gets a fever. There is a harsh storm that damages their sailboat and it began taking on water.  The rescue team arrives in helicopter and they abandon their sailboat. They must then defend themselves from public scrutiny related to child endangerment and the high cost of a rescue at sea.
"The waves have been crashing against the hull for hours. This has to be the worst storm we've ever sailed through," Simon thought to himself. To his horror, sea water begin to pour in through a crack at the base of the mast. He pulled the bright orange emergency beacon out of its case and looked at it. He looked over at Mary, who was sitting at the back of the cabin, cradling their infant. "If we turn the beacon on, it's all over," he yelled. She nodded, confirming the heavy weight of the decision. After all, it wasn't just a boat, it was also their home and they were about to abandon it. Forever.
A narrative structure orders or disorders the events of a story for the audience, and combines those events with plot. A linear narrative is chronological, whereas a non-linear narrative is non-chronological. There are commonly used frameworks for storytelling which started with Aristotle's three-part structure consisting of a beginning, middle, and end. From there, structures become more nuanced and descriptive.
Stories are big business. Hollywood films tend to have structural models that traditionally sell well in the box office, increasing the probability that they will see a return on the production investment. The perception is that experimental or uncommon narrative structures tend to be risky. The same can be said for large game developers who are inclined to produce sequels of top-selling titles.
This can explain why many of the boundary-pushing films tend to come from independent authors and screenwriters, indie game developers, and indie filmmakers. They have less of a financial stake in the outcomes of sales, and are more likely to focus on new modes of expression, craft, and originality of content.
Gustav Freytag (1816 - 1895), a German dramatist and novelist, developed a structure for the way stories are told in ancient Greek and Shakespearean drama. This analysis is known as Freytag's analysis, dramatic structure, or Freytag's Pyramid. His analysis consisted of the following five acts:
This five-act structure works well when describing Greek and Shakespearean plays. However, there are many ways to analyze the structure of a narrative. Most contemporary stories can be described with according to common structural breakdowns – the Three Act, Four Act, Five Act, Seven Act, and Hero's Journey. These structures can help us understand how a story is told, and act as a heuristic for writing your own story.
The following Plot Diagram shows the Five Act plot points laid over a Three Act structure.
A non-linear structure is not necessarily chronological or cause-and-effect based. Story is unfolded simultaneously and recursively. Non-linear narratives are often used to create links between things that are otherwise not connected to create meaning or tension, a device used commonly in surrealism.
The story you experience in an interactive narrative work is not predetermined. The story path is chosen based on a viewer's choices. In video games, the number of story events that can be chosen through interaction can be quite high, making subsequent play-throughs unique. Newer games rely on generative algorithms and artificial intelligence to create the environment around these choices.
An interactive narrative is comprised of decision or action points called nodes, where the user impacts the unfolding of the narrative by making a choice or performing an action. The choice the user makes can determine which branching narrative path is taken. The decisions themselves are part of the plot, which handles dramatization of the events.
For example, let's say you are playing a hypertext narrative, and your character is a young woman who sees a hooded figure shoplifting. The options to proceed include a) tell the shopkeeper, b) follow the shoplifter, or c) do nothing. Depending on which choice you select, the story will progress through on one of three branching paths.
A critical story path can be thought of as the shortest path possible through a series of decision nodes to complete the interactive story.
To develop the critical path:
The branching structure is the structure used in "choose your own adventure" books and most interactive narratives. One problem with branching structures is the tendency to create overly complicated story paths.
In this linear structure, a user must complete node's requirements to continue to the next node.
In this linear structure, a user would follow the 12 stages of the hero's journey. However, there can be fewer or additional stages and still be considered a journey structure. Some stories continue around this path, creating a continuous.
In this quasi-linear structure, users are given the opportunity to explore multiple storylines running in parallel. There is typically no way to experience all of the stories at once, though they may intersect at opportune times.
The drill-down is a bi-linear structure and encourages users to move through a story vertically and laterally, where lateral movement represents plot points and vertical movement represents the gathering additional details about the plot.
A sandbox structure is one where the story unfolds based on how a player chooses to interact in what is typically a large, open environment. This is a loose structure where the setting of the story often becomes central to the experience.
A graph structure is where all nodes simultaneously connect with every other node bi-bidirectionally. Discerning a plot causality in such a structure can be difficult.
Quite often, no perfect model exists for the kind of story that needs to be told. Part of the creative process for writing a narrative is producing the model that can best support the story.


public class Adapter
extends java.lang.Thread
| Modifier and Type | Field and Description |
|---|---|
private boolean |
active
Activity indicator
|
private int |
activeSensors
Number of active(connected) sensors
|
private short |
firmware
Adapter firmware
|
(package private) static short |
FIRMWARE_VERSION
Adapter firmware version, for emulator always 0
|
private java.lang.String |
id
Adapter Id
|
private boolean |
internetConnection
Internet connection indicator
|
private Logger |
logger
Instance of class
Logger |
private java.util.List<Message> |
messages
Unsent messages list.
|
private java.lang.String |
name
Adapter name
|
private AdapterPanel |
panel
Instance of class
AdapterPanel ,null if no panel |
(package private) static int |
PROTOCOL_STATIC_SIZE
Size of protocol message static fields in bytes
|
private int |
registeredSensors
Number of adapter's registered sensors
|
private Scheduler |
scheduler
Instance of class
Scheduler |
private java.util.ArrayList<Sensor> |
sensors
List of sensors.
|
private int |
sensorsCount |
private Server |
server
Instance od class
Server with server information |
private short |
serverProtocol
Communication protocol between server and adapter
|
(package private) static int |
SLEEP_TIME
Time for thread sleep, when adapter thread is not active
|
private boolean |
terminate
Termination indicator
|
| Constructor and Description |
|---|
Adapter(AdapterPanel panel,
Logger logger)
Assigns panel and logger to new instance of this class, creates instance of class
Scheduler . |
Adapter(Logger logger)
Creates instance of this class and class
Scheduler . |
| Modifier and Type | Method and Description |
|---|---|
void |
activateSensor()
Increase number of active sensors
|
void |
addSensor(java.util.Properties properties)
|
void |
addSensor(SensorPanel panel)
Adds new instance of class
Sensor to list of sensors. |
java.nio.ByteBuffer |
createAdapterHeader(int valuesSize)
Creates
ByteBuffer , writes adapter's information to it according to adapter -> server protocol and returns it
to sensor. |
void |
deactivateSensor()
Decrease number of active sensors
|
void |
delete()
Delete adapter and all it's components
|
void |
deleteMessagesFromSensor(Sensor sensor)
When sensor has unsent messages, removes them.
|
SensorPanel |
deleteSensor(int id)
Deletes sensor of given id.
|
int |
getActiveSensors()
Returns number of active sensors
|
java.lang.String |
getAdapterId()
Returns adapter's id
|
java.lang.String |
getAdapterName()
Returns adapter's name
|
short |
getFirmware()
Returns firmware version
|
boolean |
getInternetConnection()
Returns internet connection indicator
|
Logger |
getLogger()
Returns adapter's logger
|
Message |
getNextMessage()
Returns next unprocessed message
|
int |
getRegisteredSensors()
Returns number of registered sensors
|
java.util.ArrayList<Sensor> |
getSensors()
Returns list of adapter's sensors
|
int |
getSensorsCount()
Returns number of sensors registered on adapter
|
Server |
getServer()
Returns server instance
|
short |
getServerProtocol()
Returns version of protocol between adapter and server
|
void |
initScheduler()
Starts
scheduler 's thread and starts processing messages. |
boolean |
isActive()
Returns adapter's activity status
|
void |
messageSuccessfullySent()
When message is successfully sent, it is removed from
messages list
and line in "To be sent" log is removed. |
void |
registerSensor()
Register new sensor for adapter
|
void |
run()
Ancestor class
Thread implementation. |
void |
sendMessage(java.lang.String logMsg)
Writes message to logger, doesn't sent any messages to server.
|
void |
sendMessage(java.lang.String logMsg,
java.nio.ByteBuffer msg,
Sensor sender)
|
void |
setActiveSensors(int activeSensors)
Sets number of active sensors
|
void |
setActivity(boolean b)
Sets adapter's activity to given value and updates adapter's detail panel.
|
void |
setAdapterId(java.lang.String id)
Sets adapter's id
|
void |
setAdapterName(java.lang.String name)
Sets adapter's name
|
void |
setInternetConnection(boolean b)
Sets internet connection indicator
|
void |
setRegisteredSensors(int registeredSensors)
Sets number of registered sensors.
|
void |
setServerParameters(ServerPanel panel,
java.lang.String host,
java.lang.String ip,
int port)
Used when all adapters share one
ServerPanel . |
void |
setServerParameters(java.lang.String host,
java.lang.String ip,
int port)
|
void |
setServerProtocol(short serverProtocol)
Sets version of protocol between adapter and server
|
void |
setStoreValuesHistory()
sets if history of sensor's values should be stored
|
void |
startScheduler()
Starts
scheduler 's message processing |
void |
startSensorTimers()
Starts all timers for sensor's in
sensors list. |
void |
stopScheduler()
Stops
scheduler from processing more messages |
void |
stopSensorsTimers()
Stops all timers for sensor's in
sensors list. |
void |
terminateAdapter()
Terminates adapter's thread
|
void |
unregisterSensor()
Unregister new sensor from adapter
|
void |
updateDetails()
If adapter has
panel , refreshes adapter's information. |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private boolean terminate
private boolean active
private java.lang.String name
private java.lang.String id
private short firmware
private boolean internetConnection
private int activeSensors
private int registeredSensors
private short serverProtocol
private AdapterPanel panel
AdapterPanel
,null if no panelprivate java.util.List<Message> messages
Message
private int sensorsCount
static final int SLEEP_TIME
static final int PROTOCOL_STATIC_SIZE
static final short FIRMWARE_VERSION
public Adapter(Logger logger)
Scheduler
. Used when all adapters have one logger
.logger
- adapter's logger, not nullpublic Adapter(AdapterPanel panel, Logger logger)
Scheduler
.
Used when every adapter has own panel
and logger
.panel
- adapter's panel,not nulllogger
- adapter's logger, not nullpublic void setServerParameters(ServerPanel panel, java.lang.String host, java.lang.String ip, int port)
ServerPanel
.
Sends server parameters to scheduler
.panel
- panel showing server information, not nullhost
- server connection hostname, null when ip
is not nullip
- server connection ip address, null when host
is not nullport
- server connection port, not nullpublic void setServerParameters(java.lang.String host, java.lang.String ip, int port)
host
- server connection hostname, null when ip
is not nullip
- server connection ip address, null when host
is not nullport
- server connection port, not nullpublic void initScheduler()
scheduler
's thread and starts processing messages.
Shows errors:
SERVER_NOT_CREATED
when server is null
public void run()
Thread
implementation. Runs until terminate
is set to true
.
When adapter is not active, sets thread to sleep for SLEEP_TIME
.run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void addSensor(SensorPanel panel)
Sensor
to list of sensors. Registers sensor for this adapter.
Used when sensor has GUI own GUI panelpanel
- sensor's panel for displaying information about sensorpublic void addSensor(java.util.Properties properties)
Sensor
to list of sensors
.
Registers sensor for adapter. Sets Sensor
's Sensor.fullMessage
to write full messages.
If sensor initialization is successful, activates this sensor.properties
- public java.nio.ByteBuffer createAdapterHeader(int valuesSize)
ByteBuffer
, writes adapter's information to it according to adapter -> server protocol and returns it
to sensor.valuesSize
- (number of sensors * (long size in bytes + 2 bytes for sensor type)) - maximum possible sensor values message size.public void stopSensorsTimers()
sensors
list.public void startSensorTimers()
sensors
list.public void setStoreValuesHistory()
public void updateDetails()
panel
, refreshes adapter's information.public void messageSuccessfullySent()
messages
list
and line in "To be sent" log is removed.public void sendMessage(java.lang.String logMsg)
logMsg
- message to be written to logpublic void sendMessage(java.lang.String logMsg, java.nio.ByteBuffer msg, Sensor sender)
logMsg
- message to be written to logmsg
- protocol correct message, that will be sent to serversender
- sensor, that sent the messagepublic void stopScheduler()
scheduler
from processing more messagespublic void startScheduler()
scheduler
's message processingpublic void deleteMessagesFromSensor(Sensor sensor)
sensor
- sensor, which messages should be removedpublic void delete()
public SensorPanel deleteSensor(int id)
SensorPanel
, returns it.public void terminateAdapter()
public void registerSensor()
public void unregisterSensor()
public void activateSensor()
public void deactivateSensor()
public Message getNextMessage()
public boolean isActive()
true
if adapter is active, else false
public void setActivity(boolean b)
scheduler
's processingb
- value of adapter's activitypublic java.lang.String getAdapterId()
public void setAdapterId(java.lang.String id)
id
- adapter's idpublic int getActiveSensors()
public void setActiveSensors(int activeSensors)
activeSensors
- number of active sensorspublic int getRegisteredSensors()
public void setRegisteredSensors(int registeredSensors)
registeredSensors
- public short getServerProtocol()
public void setServerProtocol(short serverProtocol)
serverProtocol
- public boolean getInternetConnection()
true
if there is internet connection, false
otherwisepublic void setInternetConnection(boolean b)
b
- public java.lang.String getAdapterName()
public void setAdapterName(java.lang.String name)
name
- name of adapterpublic int getSensorsCount()
public Logger getLogger()
public java.util.ArrayList<Sensor> getSensors()
public Server getServer()
public short getFirmware()


Datasets for Text Mining
Selecting, Scraping, and Cleaning
Selecting Data
- Big data is less valuable than beautiful data.
- Google used big data to recognize cats.
- You'll need crafted data to recognize something more interesting.
Contrastive Sampling
- Think about concrete research questions.
- List the kinds of texts that could help answer them.
- Think about proxy variables for phenomena of interest.
- Select a subset of texts with many similarities.
- Identify precise differences among those texts that relate to your proxy variables.
- Conceive an ideal. Then use available datasets to find a compromise.
Contrasting Reviewed and Unreviewed Poetry
- Research Question: How do the standards governing literary prestige change?
- Kind of Text: Historical works of literature charted across time.
- Proxy Variable: The existence of reviews in prestigious periodicals (easy to measure) implies prestige (hard to measure).
- Similarity: Focus on works in one genre (books of poetry).
- Difference: Divide the set into books of poetry that were reviewed, and books of poetry that were not reviewed.
- Available Data: Assume that books randomly drawn from a large pool of data weren't reviewed.
Workflow
- Three steps:
- Select data using process described before.
- Download data using HTTrack or wget.
- Clean data using Notepad++ or TextWrangler.
Download data using HTTrack
- The quick version (to be expanded):
- Download and install HTTrack: https://www.httrack.com/page/2/en/index.html
- Step through the settings pages by pressing the "Next" button; adjust settings when necessary.
- Start the download process. When it's complete, you'll have a set of HTML files.
Clean data using TextWrangler (Mac Only)
Clean data using TextWrangler (Mac Only)
- Open TextWrangler, and load an HTML file.
- Look for the top-level "Search" menu option. Select "Find".
- Near the bottom of the "Find" window, select "Grep".
Clean data using TextWrangler (Mac Only)
- In the top text field (labeled "Find"), type "<[^<>]*>".
- The expression has four parts. It will find every sequence of characters that
- < -- Begins with a '<'.
- [^<>] -- Continues with characters that are neither '<' or '>'.
- * -- Has zero or more of those characters.
- > -- Ends with a '>'.
Clean data using TextWrangler (Mac Only)
- Leave the bottom text field (labeled "Replace) empty, and click the "Replace All" button.
- The rule has found all HTML tags and replaced them!
More to come on using Notepad++ in Windows, including screenshots.
Lindsay Van Tine, Mitch Fraas, and Scott Enderle


Drawing Canvas
TkMap Option :
QTestAlarm
Shifter View
Non-Geom View
Summary View
Alarm View
Expert View
Select & Plot Summary:
Global Tracks
Local Tracks
Slide Show of Summary Plots:
Select Type :
HardwareError
Connection Run
Timing Run
Gain Run
Vpsp Run
Pedestal Run
Sub-Detectors:
TIB
Sub-Detectors:
TIB
Modules
TIB
Global
Drawing Options
Toggle logy
DrawOption:
Normal
Box
Lego1
Lego2
Y-Projection


Heathrow Terminal 1 TW6 1JS
Heathrow Terminal 2 TW6 1JS
Heathrow Terminal 3 TW6 1JS
Heathrow Terminal 4 TW6 2GA
Heathrow Terminal 5 TW7 2GA
GATWICK AIRPORT NORTH RH6 0PJ
GATWICK SOUTH RH6 0PJ
LUTON AIRPORT LU2 9LY
Stansted Airport CM24 1QW
LONDON CITY AIRPORT E16 2PB
Saloon Car
Estate Car
Executive Car
MPV Car


---
title: Hands on Firefox-OS Apps - Introducing CSP
description: >
Smile. Laugh.
created: !!timestamp '2013-07-01 00:00:00'
tags:
- HTML5
- CSS3
- JavaScript
- CSP
toc:
- getting--started
- C--S--P
- links
tweetShortUrl: https://bit.ly/1zWUFwk
readTime: 3
---
{% mark excerpt -%}
I'm a die-hard fan of Mozilla Firefox. I always wanted to contribute to Mozilla in one or the other ways. This year only, it happened that I started getting involved in Open Source projects. Good Luck that I was familiar with **Git** as I used it merely for the purpose of storing my college projects :). Mozilla's Open Source projects inspired me to contribute this time. Meanwhile, I heard the news of FIREFOX-OS, yeah, FIREFOX-OS(FOS) is a Linux-based open source operating system for smartphones and tablet computers being developed by MOZILLA.
{% endmark %}
So the journey begins from here. I found an article to get started with developing FIREFOX-OS Applications, apps nothing more than Open web pages, that is HTML5 Apps. Yeah! right, directly reuse the prior knowledge about front-end development to create awesome applications running on firefox OS phones.
Here it is! Beautiful official FIREFOX-OS website.
+++++
+++++
Getting started with FOS-App: Calculator
----------------------------------------
I started developing an App for FOS, though a simple Calculator App performing some basic arithmetic calculations. I opted this app just to give a try and get familiar with the process that goes around. I successfully created the app using HTML5, CSS3 and JavaScript. It's so simple no, easily have an FOS app from your already created HTML5 driven app.
I follow the procedure to submit an FOS app on firefox marketplace. I use App Validator just to ensure me that my App is too good :). App Validation failed with errors and warnings. Crap! Wait! What's that? CSP validation errors and warnings. Ah, that's what Mozilla always focus on, **Security**.
A primary goal of CSP is to mitigate and report XSS attacks. XSS attacks exploit the browser's trust of the content received from the server. Malicious scripts are executed by the victim's browser because the browser trusts the source of the content, even when it's not coming from where it seems to be coming from.
**Content Security Policy (CSP)** is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware.
CSP is designed to be fully backward compatible; browsers that don't support it still work with servers that implement it, and vice-versa. Browsers that don't support CSP simply ignore it, functioning as usual, defaulting to the standard same-origin policy for web content. If the site doesn't offer the CSP header, browsers likewise use the standard same-origin policy.
*Here is a list of Default CSP restrictions*
eval() is one such Default_CSP_restriction and *was* also the core of my Calcultor app :)
+++++
+++++
Dealing with CSP
----------------
Include **'use strict'** in your script files. Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions.
A nice Reference to it by Mozilla. Strict_mode
Initialized my own load method named *init* as
{% syntax javascript %}
var Calculator = {
init: function init() {
document.addEventListener('mousedown', this);
},
};
window.addEventListener('load', function load(evt) {
window.removeEventListener('load', load);
Calculator.init();
});
{% endsyntax %}
Functions like onclick, onmousedown, and so on called within HTML file are restricted. So I suggest using *data-type attribute* and listening events in the method defined as *handleEvent*
{% syntax html %}
{% endsyntax %}
{% syntax javascript %}
handleEvent: function handleEvent(evt) {
this.target = evt.target; // get the target/caller invoking it
var value = this.target.value, // get the value of attribute *value* of caller
id = this.target.id; // get the id of caller
switch (this.target.dataset.type) {
case 'submit': // check the data-type
this.CALL_DESIRED_FUNCTION_NAME(*params*) // call event driven function
break;
/* all cases as per your data-type attribute goes here...
don't forget to use *break;* unless more than one data-types
need to behave similar on events. */
}
}
{% endsyntax %}
After adopting CSP rules, I headed towards designing my own *eval* method since it is restricted by CSP. Below is the code to execute valid arithmetic expressions without using the JavaScript function *eval()*.
Note: *this.disp.value* is containing the arithmetic expression given as an input by the user in the text field.
{% syntax javascript %}
compute: function compute() {
var sign = 1;
if (this.disp.value[0] == '-') {
sign = -1;
}
this.disp.value = this.calculate(this.disp.value,sign);
return this.disp.value;
},
calculate: function calculate(input, sign) {
var opr_list = {
add : '+',
sub : '-',
div : '/',
mlt : '*',
mod : '%',
pow : '^'
};
opr_list.opr = [[ [opr_list.mlt] , [opr_list.div] , [opr_list.mod]],
[ [opr_list.add] , [opr_list.sub] , [opr_list.pow] ]];
var input = input.replace(/[^0-9%^*\/()\-+.]/g,'');
var output, i, n, re;
for(i = 0, n = opr_list.opr.length; i < n; i++ ) {
re = new RegExp('(\\d+\\.?\\d*)([\\'+opr_list.opr[i].join('\\')+'])(\\d+\\.?\\d*)');
re.lastIndex = 0;
while(re.test(input) ) {
output = this.compute_result(opr_list,sign*RegExp.$1,RegExp.$2,RegExp.$3);
if (isNaN(output) || !isFinite(output)) {
return output;
}
input = input.replace(re,output);
}
}
return output;
},
compute_result: function compute_result (opr_list, a, op, b) {
switch(op){
case opr_list.add: return a+b; break;
case opr_list.sub: return a-b; break;
case opr_list.div: return a/b; break;
case opr_list.mlt: return a*b; break;
case opr_list.mod: return a%b; break;
case opr_list.pow: return Math.pow(a,b); break;
default: null;
}
}
{% endsyntax %}
+++++
+++++
About the App
-------------
Browse the full source code here
Download the App at Firefox Marketplace
My next FOS-App is coming soon... :)
+++++


A free frontend framework and template based on Bootstrap.
lymUI is being built from the source of Bootstrap. This makes it easy to learn and fast to use. Maybe it will even have its own documentation.
Aiming for a simple look, lymUI removes all unnecessary styles from Bootstrap and replaces many with some good looking new elements.
lymUI comes with many prebuilt webpages coded in Jade (also preprocessed to HTML), saving you time and work.


bm::bvector< Alloc >::insert_iterator Class Reference
[The Main bvector<> Group]
Output iterator iterator designed to set "ON" bits based on input sequence of integers (bit indeces).
More...
#include <bm.h>
Detailed Description
template<class Alloc>
class bm::bvector< Alloc >::insert_iterator
Output iterator iterator designed to set "ON" bits based on input sequence of integers (bit indeces).
STL container can be converted to bvector using this iterator Insert iterator guarantees the vector will be dynamically resized (set_bit does not do that).
- Note:
- If you have many bits to set it is a good idea to use output iterator instead of explicitly calling set, because iterator may implement some performance specific tricks to make sure bulk insert is fast.
Definition at line 335 of file bm.h.
Member Typedef Documentation
Definition at line 342 of file bm.h.
Definition at line 339 of file bm.h.
Definition at line 343 of file bm.h.
Definition at line 344 of file bm.h.
Definition at line 341 of file bm.h.
Constructor & Destructor Documentation
template<class Alloc>
| bm::bvector< Alloc >::insert_iterator::insert_iterator |
( |
bvector< Alloc > & |
bvect |
) |
[inline] |
Definition at line 346 of file bm.h.
Member Function Documentation
Returns *this without doing anything (no-op)
Definition at line 370 of file bm.h.
Returns *this. This iterator does not move (no-op)
Definition at line 374 of file bm.h.
Returns *this. This iterator does not move (no-op)
Definition at line 372 of file bm.h.
Field Documentation
The documentation for this class was generated from the following file:


Scenario Management
Saved Scenarios
Welcome!
This page generates a curling house with stones in play to create in-game scenarios for teams or skips to discuss their strategy for that end. When ready to see a new scenario, click 'Regenerate House'.
Saving Scenarios
If you like a scenario you can enter notes about it, for example how you or your team would handle it, and click the 'Save' button. This will keep a copy of the scenario with your notes in your current browser only. If you leave and return to the site on the same computer and browser the saved scenarios will appear. If you use a different browser, on your phone for example, the scenarios will likely not appear. You can remove saved scenarios by clicking the 'Clear' button or clearing your browsing data.
How it Works
Below are the details about how each part of a scenario is generated.
- End
- Randomly selected from 1st to 10th
- Stone Colour
- Randomly selected from selected colours (check out Advanced Configuration)
- Position Throwing
- Number of stones already thrown is randomly selected between 3 and 15 (see 'Min. Stones Thrown' in the Advanced Configuration). The position is calculated based on this. For example, if 11 stones have been thrown then the next stone is the twelveth or the team with hammer third's second stone.
- Hammer
- Based on stones already thrown. If the next stone to come is an odd stone, the team does not have hammer. If the next stone to come is an even stone, the tead has hammer.
- Score Differential
- Randomly selected between 0 (tied) and 6. "Up" or "Down" is randomly selected except for the first end when its always tied.
Stone Placement
The stones are placed in the play area randomly using a weighted distribution. The play area has been divided into four 'zones' with each one being assigned a weight to affect the probability that zone will be selected by the randomizer. The zones and default probabilities are detailed below. The weights can be configured in the 'Advanced Configuration' area.
| Zone | Location | Probabilty |
|---|---|---|
| 1 | Hogline to 9ft past hogline | 8% |
| 2 | 9ft past Hogline to Top of House | 22% |
| 3 | Top of House to T-Line | 40% |
| 4 | T-Line to Back Line | 30% |
Additionally to prevent all stones from being in play, the randomizer gives each stone a 45% chance of staying in play. Stones that 'fail' this test are removed.


Tag cloud zines programming resources tutorial jekyll github web ruby grace hopper celebration conference personal oh-my-zsh help zines Zine Culture + Computer Science programming Manually Updating oh-my-zsh Make a Free Blog with Jekyll and GitHub Pages Zine Culture + Computer Science resources Make a Free Blog with Jekyll and GitHub Pages Zine Culture + Computer Science tutorial Manually Updating oh-my-zsh Make a Free Blog with Jekyll and GitHub Pages Zine Culture + Computer Science jekyll Make a Free Blog with Jekyll and GitHub Pages github Make a Free Blog with Jekyll and GitHub Pages web Make a Free Blog with Jekyll and GitHub Pages ruby Make a Free Blog with Jekyll and GitHub Pages grace hopper celebration Pre Grace Hopper Celebration conference Pre Grace Hopper Celebration personal Pre Grace Hopper Celebration oh-my-zsh Manually Updating oh-my-zsh help Manually Updating oh-my-zsh


Overview | Reports | Quarter | Contract
| Vendor Name: | GREENLAND INTERNATIONAL CONSULTING LTD |
| Reference number: | KW405-14-1077 |
| Contract Date: | 2015-03-06 |
| Description of work: | 0491 Other Prof. Serv. - Management consulting - OGD or programs |
| Contract period: | 2015-02-27 to 2016-03-31 |
| Delivery Date: | |
| Contract Value: | $140,910.00 |
| Comments: | Evaluation of policy options to achieve phosphorus and other nutrient reductions from Canadian sources |