Class TicTacToe
- java.lang.Object
-
- WinnerCheck
-
- TicTacToe
-
class TicTacToe extends WinnerCheck
TicTacToe game with 2d array done as a project work for introduction to programming course. Requirements stated that the user needs to be able to adjust gameareas height and width. Gamearea needs to be atleast 3x3 and if its higher than 5x5 then 5 in a row to win is minimum. Game ends when either player or computer wins. It can also end in a draw if the gamefield is full. Computer inputs marks randomly to an empty array spot. Player is asked for empty row and column. Game does victory checks after every move from the point where player/computer last inputted a mark.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
columns
private static java.lang.String
cross
private static java.lang.String
empty
private java.lang.String[][]
gameField
private static int
howManyInRowToWin
private int
maxInRowToWin
private static int
rows
private int
turnsInGame
private static boolean
winnerFound
private static java.lang.String
zero
-
Constructor Summary
Constructors Constructor Description TicTacToe()
Consctuctor for TicTacToe object Constructor does methods that set the premises of the game area.
-
Method Summary
Modifier and Type Method Description void
computerMove()
Computer move is randomly generated but requires an empty spot.void
emptyGameArea(java.lang.String[][] gameField)
Takes the gamefield array as an argument and inputs it full of empty stringsvoid
gameIntro()
Prints intro with information about the game and game area limits.static int
getColumns()
Getter for amount of columns in the gameareastatic int
getHowManyInRowToWin()
Getter for how many marks in a row is needed for win.static int
getRows()
Getter for amount of rows in the gameareastatic boolean
getWinnerFound()
Getter for winner found booleanvoid
playerMove()
Gets input from the player for X positioning.void
playGame()
Handles player and computer movement and win declaration.void
printGameArea(java.lang.String[][] gameField)
Prints the gamearea in its current state.void
setGameAreaSize()
Asks the player for amount of rows and columns for the gamearea and checks the input for errors.void
setHowManyInRowToWin()
Asks the player how many in a row is needed for win.void
setTurnsInGame()
Setter for amount of turns in the game.static void
setWinnerFound()
Setter for winner found boolean.-
Methods inherited from class WinnerCheck
checkColumns, checkDiagonalLeftToRight, checkDiagonalRightToLeft, checkRows, isWinner, setCounter
-
-
-
-
Field Detail
-
gameField
private java.lang.String[][] gameField
-
rows
private static int rows
-
columns
private static int columns
-
howManyInRowToWin
private static int howManyInRowToWin
-
winnerFound
private static boolean winnerFound
-
empty
private static final java.lang.String empty
- See Also:
- Constant Field Values
-
cross
private static final java.lang.String cross
- See Also:
- Constant Field Values
-
zero
private static final java.lang.String zero
- See Also:
- Constant Field Values
-
turnsInGame
private int turnsInGame
-
maxInRowToWin
private int maxInRowToWin
-
-
Constructor Detail
-
TicTacToe
public TicTacToe()
Consctuctor for TicTacToe object Constructor does methods that set the premises of the game area. Including array creation and user input for array size Sets how many marks in a row is required to win Formats the array full of empty string Prints the empty field
-
-
Method Detail
-
setGameAreaSize
public void setGameAreaSize()
Asks the player for amount of rows and columns for the gamearea and checks the input for errors. Formats the 2d array used for the game Sets max marks in a row to the lowest number of columns or rows.
-
setHowManyInRowToWin
public void setHowManyInRowToWin()
Asks the player how many in a row is needed for win. Checks the input for errors and has a required minimum and maximum.
-
setTurnsInGame
public void setTurnsInGame()
Setter for amount of turns in the game.
-
emptyGameArea
public void emptyGameArea(java.lang.String[][] gameField)
Takes the gamefield array as an argument and inputs it full of empty strings- Parameters:
gameField
- 2d array where the game is played.
-
printGameArea
public void printGameArea(java.lang.String[][] gameField)
Prints the gamearea in its current state.- Parameters:
gameField
- 2d array where the game is played.
-
playGame
public void playGame()
Handles player and computer movement and win declaration. Goes on until either turns run out and the field is full or a winner is found.
-
playerMove
public void playerMove()
Gets input from the player for X positioning. Handles errors and requires an empty spot.
-
computerMove
public void computerMove()
Computer move is randomly generated but requires an empty spot.
-
gameIntro
public void gameIntro()
Prints intro with information about the game and game area limits.
-
getRows
public static int getRows()
Getter for amount of rows in the gamearea- Returns:
- returns int value of rows in the gamearea
-
getColumns
public static int getColumns()
Getter for amount of columns in the gamearea- Returns:
- returns int value of columns in the gamearea
-
getHowManyInRowToWin
public static int getHowManyInRowToWin()
Getter for how many marks in a row is needed for win.- Returns:
- returns int value of how many marks in a row is needed for win.
-
setWinnerFound
public static void setWinnerFound()
Setter for winner found boolean.
-
getWinnerFound
public static boolean getWinnerFound()
Getter for winner found boolean- Returns:
- returns boolean value of winner found variable.
-
-


ml-modules
Machine learning as modules
Browser-ready machine learning algorithms as modules.
Demo
A live demo is available here.
Documentation
Documentation can be found here.
Usage
//import the modules
const modules = require("ml-modules");
//select the machine learning module you want, for example
const SVM = modules.SVM; // support vector machine
Modules
Can choose from these machine learning modules:
- SVM
const SVM = modules.SVM;
- KNN
const KNN = modules.KNN;
- RBF
const RBF = modules.RBF;
- RANDF
const RANDF = modules.RANDF;
- LOGREG
const LOGREG = modules.LOGREG;
- NN
const NN = modules.NN;
Algorithms
- Support Vector Machine with different kernels:
- linear
- polynomial
- radial-basis-function (gaussian)
- KNN
- Radial-basis function
- Random Forests
- Logistic Regression
- Neural Net
- multiple layers with costum definition
All algorithms are small modules. The files needed for the algorithm to work are located in his directory, except for the utility functions.
All algorithms share the basic structure.
Example
const algorithm = function() {}; // expose this function
algorithm.prototype = {
// define the function
train: function(data, labels) {
//set up the environment
//train
//stored results
},
predict: function(point) {
//returns the value predicted
},
predictClass: function(point) {
//returns the class predicted
},
getOptions: function() {
//returns an object to be used by the "ui" class
},
setOptions: function(options) {
//set the options
}
};
// helper functions if needed
module.exports = algorithm;
Webpack
A bundler for javascript code: you can use nodejs modules in the brower. All js files will be merged and transpiled into one bundle (index.bundle.js), generated into the ./dist
folder.
To build the source code run in the command line, inside the package.json
directory:
npm install
Now you have installed webpack and the project dependecies. Now you can build with:
npm run build
To be able to watch the files and automatically build on changes, just run the command:
npm run watch
Support on Beerpay
Hey dude! Help me out for a couple of :beers:!


detektiven is Single Page Application written in javascript
Please enable javascript and refresh the page
Instructions are available on enable-javascript.com


Returns the hyperbolic cosine of a number.
Syntax
hcos(number)
Number is any valid numeric expression for which you want to find the hyperbolic cosine.
Remarks
The formula for the hyperbolic cosine is:
Example
| Expression | Description (Result) |
|---|---|
| hcos(4) | Hyperbolic cosine of 4 (27.3082) |
| hcos(E) | Hyperbolic cosine of the base of the natural logarithm (7.6103) |


This library provides utilities for automatically iterating over all DynamoDB records returned by a query or scan operation using async iterables. Each iterator and paginator included in this package automatically tracks DynamoDB metadata and supports resuming iteration from any point within a full query or scan.
Paginators are asynchronous iterables that yield each page of results returned
by a DynamoDB query
or scan
operation. For sequential paginators, each
invocation of the next
method corresponds to an invocation of the underlying
API operation until all no more pages are available.
Retrieves all pages of a DynamoDB query
in order.
import { QueryPaginator } from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const paginator = new QueryPaginator(
new DynamoDB({region: 'us-west-2'}),
{
TableName: 'my_table',
KeyConditionExpression: 'partitionKey = :value',
ExpressionAttributeValues: {
':value': {S: 'foo'}
},
ReturnConsumedCapacity: 'INDEXES'
}
);
for await (const page of paginator) {
// do something with `page`
}
// Inspect the total number of items yielded
console.log(paginator.count);
// Inspect the total number of items scanned by this operation
console.log(paginator.scannedCount);
// Inspect the capacity consumed by this operation
// This will only be available if `ReturnConsumedCapacity` was set on the input
console.log(paginator.consumedCapacity);
You can suspend any running query from within the for
loop by using the
break
keyword. If there are still pages that have not been fetched, the
lastEvaluatedKey
property of paginator will be defined. This can be provided
as the ExclusiveStartKey
for another QueryPaginator
instance:
import { QueryPaginator } from '@block65/dynamodb-query-iterator';
import { QueryInput } from 'aws-sdk/clients/dynamodb';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const dynamoDb = new DynamoDB({region: 'us-west-2'});
const input: QueryInput = {
TableName: 'my_table',
KeyConditionExpression: 'partitionKey = :value',
ExpressionAttributeValues: {
':value': {S: 'foo'}
},
ReturnConsumedCapacity: 'INDEXES'
};
const paginator = new QueryPaginator(dynamoDb, input);
for await (const page of paginator) {
// do something with the first page of results
break
}
for await (const page of new QueryPaginator(dynamoDb, {
...input,
ExclusiveStartKey: paginator.lastEvaluatedKey
})) {
// do something with the remaining pages
}
Suspending and resuming the same paginator instance is not supported.
Retrieves all pages of a DynamoDB scan
in order.
import { ScanPaginator } from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const paginator = new ScanPaginator(
new DynamoDB({region: 'us-west-2'}),
{
TableName: 'my_table',
ReturnConsumedCapacity: 'INDEXES'
}
);
for await (const page of paginator) {
// do something with `page`
}
// Inspect the total number of items yielded
console.log(paginator.count);
// Inspect the total number of items scanned by this operation
console.log(paginator.scannedCount);
// Inspect the capacity consumed by this operation
// This will only be available if `ReturnConsumedCapacity` was set on the input
console.log(paginator.consumedCapacity);
You can suspend any running scan from within the for
loop by using the break
keyword. If there are still pages that have not been fetched, the
lastEvaluatedKey
property of paginator will be defined. This can be provided
as the ExclusiveStartKey
for another ScanPaginator
instance:
import { ScanPaginator } from '@block65/dynamodb-query-iterator';
import { ScanInput } from 'aws-sdk/clients/dynamodb';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const dynamoDb = new DynamoDB({region: 'us-west-2'});
const input: ScanInput = {
TableName: 'my_table',
ReturnConsumedCapacity: 'INDEXES'
};
const paginator = new ScanPaginator(dynamoDb, input);
for await (const page of paginator) {
// do something with the first page of results
break
}
for await (const page of new ScanPaginator(dynamoDb, {
...input,
ExclusiveStartKey: paginator.lastEvaluatedKey
})) {
// do something with the remaining pages
}
Suspending and resuming the same paginator instance is not supported.
Retrieves all pages of a DynamoDB scan
utilizing a configurable number of scan
segments that operate in parallel. When performing a parallel scan, you must
specify the total number of segments you wish to use, and neither an
ExclusiveStartKey
nor a Segment
identifier may be included with the input
provided.
import { ParallelScanPaginator } from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const paginator = new ParallelScanPaginator(
new DynamoDB({region: 'us-west-2'}),
{
TableName: 'my_table',
TotalSegments: 4,
ReturnConsumedCapacity: 'INDEXES'
}
);
for await (const page of paginator) {
// do something with `page`
}
// Inspect the total number of items yielded
console.log(paginator.count);
// Inspect the total number of items scanned by this operation
console.log(paginator.scannedCount);
// Inspect the capacity consumed by this operation
// This will only be available if `ReturnConsumedCapacity` was set on the input
console.log(paginator.consumedCapacity);
You can suspend any running scan from within the for
loop by using the break
keyword. If there are still pages that have not been fetched, the scanState
property of interrupted paginator can be provided to the constructor of another
ParallelScanPaginator
instance:
import {
ParallelScanInput,
ParallelScanPaginator,
} from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const client = new DynamoDB({region: 'us-west-2'});
const input: ParallelScanInput = {
TableName: 'my_table',
TotalSegments: 4,
ReturnConsumedCapacity: 'INDEXES'
};
const paginator = new ParallelScanPaginator(client, input);
for await (const page of paginator) {
// do something with the first page of results
break
}
for await (const page of new ParallelScanPaginator(
client,
input,
paginator.scanState
)) {
// do something with the remaining pages
}
Suspending and resuming the same paginator instance is not supported.
Iterators are asynchronous iterables that yield each of record returned by a
DynamoDB query
or scan
operation. Each invocation of the next
method may
invoke the underlying API operation until all no more pages are available.
Retrieves all records of a DynamoDB query
in order.
import { QueryIterator } from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const iterator = new QueryIterator(
new DynamoDB({region: 'us-west-2'}),
{
TableName: 'my_table',
KeyConditionExpression: 'partitionKey = :value',
ExpressionAttributeValues: {
':value': {S: 'foo'}
},
ReturnConsumedCapacity: 'INDEXES'
},
['partitionKey']
);
for await (const record of iterator) {
// do something with `record`
}
// Inspect the total number of items yielded
console.log(iterator.count);
// Inspect the total number of items scanned by this operation
console.log(iterator.scannedCount);
// Inspect the capacity consumed by this operation
// This will only be available if `ReturnConsumedCapacity` was set on the input
console.log(iterator.consumedCapacity);
Retrieves all records of a DynamoDB scan
in order.
import { ScanIterator } from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const iterator = new ScanIterator(
new DynamoDB({region: 'us-west-2'}),
{
TableName: 'my_table',
ReturnConsumedCapacity: 'INDEXES'
},
['partitionKey', 'sortKey']
);
for await (const record of iterator) {
// do something with `record`
}
// Inspect the total number of items yielded
console.log(iterator.count);
// Inspect the total number of items scanned by this operation
console.log(iterator.scannedCount);
// Inspect the capacity consumed by this operation
// This will only be available if `ReturnConsumedCapacity` was set on the input
console.log(iterator.consumedCapacity);
Retrieves all pages of a DynamoDB scan
utilizing a configurable number of scan
segments that operate in parallel. When performing a parallel scan, you must
specify the total number of segments you wish to use, and neither an
ExclusiveStartKey
nor a Segment
identifier may be included with the input
provided.
import { ParallelScanIterator} from '@block65/dynamodb-query-iterator';
import DynamoDB = require('aws-sdk/clients/dynamodb');
const iterator = new ParallelScanIterator(
new DynamoDB({region: 'us-west-2'}),
{
TableName: 'my_table',
TotalSegments: 4,
ReturnConsumedCapacity: 'INDEXES'
},
['partitionKey']
);
for await (const record of iterator) {
// do something with `record`
}
// Inspect the total number of items yielded
console.log(iterator.count);
// Inspect the total number of items scanned by this operation
console.log(iterator.scannedCount);
// Inspect the capacity consumed by this operation
// This will only be available if `ReturnConsumedCapacity` was set on the input
console.log(iterator.consumedCapacity);


data-gathering.Rmd
library(fs)
Steps: - 1) create a vector of all species of interest. - 2) decide if want to download mp3 or not. - 3) set directory for mp3 storage.
# list here all the species. bird_species <- c("megascops choliba", "strix hylophila", "pulsatrix koeniswaldiana", "megascops atricapilla", "glaucidium minutissimum") # Should the MP3 be downloaded to the hard disk? download <- TRUE # insert here which folder do you want to store the mp3 files. dir <- "data-raw/mp3_originals" if(!dir.exists(dir)) fs::dir_create(dir)
The warbleR::querxc()
function retrieve mp3 files from xeno-canto.org repository.
The package {wikiaves} is not on CRAN yet. Github install only.
# install.packages("remotes") remotes::install_github("Athospd/wikiaves") library(wikiaves)
# set donwload = TRUE for download the files to your hard disk. metadata_wa <- bird_species %>% wa_metadata(download = download, path = dir) %>% tidyr::nest(mp3_wa = c(-term))


FoodChain
If you change your e-mail address, you will have to validate the new e-mail address.
Sharing the meal experience, for better or worse


Index
All Classes|All Packages
D
- DataField - Variable in class com.ae2dms.UI.HighScoreBar.ScoreItemTemplateController
-
DataField to display the data (duration seconds or steps)
- date - Variable in class com.ae2dms.Business.Data.GameRecord.Record
-
The Date.
- dateFormat - Variable in class com.ae2dms.Business.GameLogger
- debugger - Static variable in class com.ae2dms.Business.GameDebugger
- debugIsActive - Variable in class com.ae2dms.UI.AbstractBarController
-
Whether the debug mode is activated, can be set and the debugger will start to log message
- debugSwitch - Variable in class com.ae2dms.UI.AbstractBarController
-
The Image of Debug button, will be set with change to debugIsActive
- decode(String) - Static method in class com.ae2dms.Business.GameStageSaver
-
decode the object stored in Serialized Base64 string back to object
- Diamond - Class in com.ae2dms.GameObject.Objects
-
Diamond, which represents the position that player have to move Crate to
- Diamond(Level, int, int) - Constructor for class com.ae2dms.GameObject.Objects.Diamond
-
Instantiates a new Diamond.
- DIAMOND_IMAGE - Variable in class com.ae2dms.GameObject.Objects.Diamond
- DiamondBlue - Variable in class com.ae2dms.UI.Menu.ColourPreferenceController
- DiamondBrown - Variable in class com.ae2dms.UI.Menu.ColourPreferenceController
- DiamondGreen - Variable in class com.ae2dms.UI.Menu.ColourPreferenceController
- DiamondRed - Variable in class com.ae2dms.UI.Menu.ColourPreferenceController
- diamondsGrid - Variable in class com.ae2dms.Business.Data.Level
-
the GameGrid which only contains Diamond Object, null at other positions
- diamondsGrid - Variable in class com.ae2dms.Business.GraphicRender
-
The JavaFX GridPane as diamondsGrid to add Diamond, assigned in constructor
- diamondsGrid - Variable in class com.ae2dms.GameObject.Objects.Crate
- diamondsGrid - Variable in class com.ae2dms.UI.Game.GameViewController
-
The JavaFX GridPane as diamondsGrid to add Diamond, assigned in constructor
- DiamondSilver - Variable in class com.ae2dms.UI.Menu.ColourPreferenceController
- disableButton(String) - Method in class com.ae2dms.UI.AbstractBarController
-
disable the button in BottomBar
- document - Variable in class com.ae2dms.Business.GameDocumentTest
- DraggableFloor - Variable in class com.ae2dms.UI.Game.DraggableFloorController
-
The Pane reserved for adding draggable floor into
- DraggableFloor - Variable in class com.ae2dms.UI.Game.GameViewController
-
JavaFX Pane for DraggableFloor
- DraggableFloorController - Class in com.ae2dms.UI.Game
-
Controller for DraggableFloorPane contains mouse event handlers and utils for the dragging and dropping
- DraggableFloorController - Variable in class com.ae2dms.UI.Game.GameViewController
-
Controller for DraggableFloor
- DraggableFloorController() - Constructor for class com.ae2dms.UI.Game.DraggableFloorController
- draggingOnMouseReleased(MouseEvent) - Method in class com.ae2dms.UI.Game.DraggableFloorController
-
called when mouse release dragging if the position of mouse is within Grid, then put the Floor into designated position else put the Floor back to side
- DragList - Variable in class com.ae2dms.UI.Game.DraggableFloorController
-
ArrayList of JavaFX ImageView of Draggable Nodes
- duration - Variable in class com.ae2dms.UI.GameMediaPlayer
-
total duration of the music playing
- durationSeconds - Variable in class com.ae2dms.Business.Data.GameRecord.Record
-
The Duration seconds.
All Classes|All Packages


Software Developer
Find Out More
From a young age, I've always loved to build things and solve problems, whether it was Legos or a puzzle, which transitioned to web development after I discovered how immensely fun and satisfying building a website is.
I also enjoy watching my beloved sports teams-- the Lakers and Dodgers, playing with my dog Luna, and enjoying the beautiful Southern California weather whenever I can.
Bloggr is an application where users can create blog posts where others can read and comment on.
Built with: NodeJS, MongoDB, MaterializeCSS, HandlebarsJS, JavaScript, jQuery, CSS3, and Google OAuth.
Deployed on Heroku.
Macro Counter is a hobby project I created to help educate myself and others to eat better foods daily. The application provides information on what macronutrients actually are, and also allows the user to input the calories, fats and carbs they eat, which are then converted into their actual macronutrient intake.
Built with: HTML5, CSS3, JavaScript, jQuery, and Bootstrap 4.
Deployed on Heroku.
MERN Stack Version Coming Soon!Checklist is a full stack application that allows the user to create checklist items that need to be completed. Application has full CRUD functionality.
Built with: NodeJS, MongoDB, HandlebarsJS, CSS3, Bootstrap 4, JavaScript, jQuery and Passport Local.
Deployed on Heroku.
MERN Stack Version Coming Soon!


I am a French Bulldog. I like to run, sleep and eat. But most of all I like CSS.
Web Development projects
Online-courses
Find me on Twitter, YouTube, and GitHub.


We are opening March 1st for the 2017 season. We have a wide variety of plants to fill your landscaping or gardening needs. Stop by and check out our pansies.


Methodologies
|
Methodology
|
How much do you know?
|
|
Design Thinking
|
|
|
Scrum
|
|
|
DevOps
|
|
|
Agile
|
|
|
XP
|
|
Programming
|
Language
|
How much do you know?
|
|
Java
|
|
|
Shell
|
|
|
C++
|
|
|
Java Script
|
|
|
Perl
|
|
Database
|
DB
|
How much do you know?
|
|
DB2
|
|
|
SQL
|
|
|
Oracle
|
|
Application Servers
|
AppServer
|
How much do you know?
|
|
Websphere
|
|
|
Weblogic
|
|
Skills
|
Skill
|
How much do you know?
|
|
Automation
|
|
|
Selenium IDE
|
|
|
APIs
|
|
|
Use Case
|
|
|
Test Case
|
|
|
Test Execution
|
|
|
Test Creation
|
|


Mobile First
All modulz are built mobile-first for maximum device compatibil
Boatloads of Awesome
All modulz are built mobile-first for maximum device compatibil
Support for IE8, mobile and tablet devices, screenreaders and color bind
On different screen sizes, fonts automagically scale with the viewport
Make any design your own using the Style Editor. Personalize font colors
China has its own smart car rules.Sit ad omnis essent accumsan, no vis ludus ubique platonem.
Li Jun, a China Academy of Engineering academician and also director of the alliance’s experts’ committee, said that China will also launch design guidance for smart cars, smart map architecture and standards for test grounds.
Li said the smart car industry is able to enlarge the current car industry by 1 trillion yuan ($158.15 billion) and also able to boost fast development in 5G, internet of cars, big data, artificial intelligence and new-energy vehicles.
Zhang Junyi, a partner with NIO Capital, said that the smart car is the trend for the car industry and China’s auto sector will usher in a new key development stage with the improvement of infrastructure, technology, policies and laws.
Li Jun, a China Academy of Engineering academician and also director of the alliance’s experts’ committee, said that China will also launch design guidance for smart cars, smart map architecture and standards for test grounds.
Li Jun, a China Academy of Engineering academician and also director of the alliance’s experts’ committee, said that China will also launch design guidance for smart cars, smart map architecture and standards for test grounds.
Make any design you own using the Style Editor Personalize fonts,colors,and layouts to create the custom look you want
360 King Street
Feastrvale Trevose PA 19057
(755) 564-84-12
yourname@mail.com


Toggle navigation
Koushalya kendra
admin
Profile
Logout
Main
Dashboard
Home
Masters
Qualification
Role
Scheme
Center
Religion
Caste
City
District
State
Bank
Subject
Student
Exams
Question
Notice
Result
Login Page
Warning!
You need to have
JavaScript
enabled to use this site.
Add District
District:
State:
1
2
3
4
Submit
Cancel


Utilities for controlling the size of the shadow below the material and the opacity of the elevation overlay color if it is applied.


>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Voc
!:
Help
Primer
Foreign !:
J interfaces with the environment are provided by the conjunction!: (foreign). In most cases the foreign result is a verb that provides a specific service. The left argument of foreign selects a general family of services and the right argument selects a specific service. The families of services selected by the left argument are:
0 scripts
1 files
2 host commands
3 types
4 names
5 representations
6 time
7 space
9 global parameters
11 windows
13 debug
15 dynamic link library (shared library)
18 locales
128 numerical functions
The foreign conjunction is documented in the J Dictionary.
You have run across a few specific uses of the foreign conjunction in earlier sections.
The derived verb 9!:11 was used in the Print precision section. The 9 selects the global parameters family and the 11 gives a derived verb that sets the print precision.
The load verb uses 0!:0 to load scripts. The left argument selects the scripts family. Look up the definition. The 0 right argument is treated as three decimal digits 000 and therefore executes sentences from a file, stops on an error, and is silent (does not display sentences or results).
>>
<<
Usr
Pri
JfC
LJ
Phr
Dic
Voc
!:
Help
Primer


Check outMoringa SchoolIt's a great place to learn web development skills!
Hello, world!
Welcome to my first web page
Here are some things am going to learn about coding:
Here is a link to my favourite things.


Data Structures | |
| struct | spi_master_priv |
| Private SPI master defintion. More... | |
| struct | spi_device_priv |
| Private SPI device definition. More... | |
Modules | |
| ATxmega128A1 SPI internals | |
Defines | |
| #define | SPI_MASTER_NATIVE_TYPE spi_master_priv |
| Type defintion for spi_master derivation. | |
| #define | SPI_DEVICE_NATIVE_TYPE spi_device_priv |
| Type defintion for native spi_device derivation. | |
Typedefs | |
| typedef uint8_t | spi_id_t |
| SPI Module ID | |
| typedef uint8_t | spi_flags_t |
| SPI setup flags. |
This is ATxmega specific low level handling for Common ATmega and ATxmega SPI internals
| #define SPI_DEVICE_NATIVE_TYPE spi_device_priv |
Type defintion for native spi_device derivation.
Referenced by spi_device_get_size().
| #define SPI_MASTER_NATIVE_TYPE spi_master_priv |
Type defintion for spi_master derivation.
Referenced by spi_master_get_size().
| typedef uint8_t spi_flags_t |
Definition at line 81 of file spi_xmega.h.


Black Friday's Craziest Shoe And Fashion Deals: Adidas, Nike, ASOS, Platypus And More!
by Sarah BasfordIn case you hadn't already exhausted all your funds, Black Friday isn't done with you yet. Fashion, clothing and footwear are also on the menu. We're serving up the best deals across the country if you're looking for new sneakers or need to snap up a new look for an upcoming event. Check out the list below.
Best fashion sales for Black Friday
We'll be adding more as we come across them.

As Lifehacker editors we write about stuff we like and think you'll like too. Lifehacker often has affiliate partnerships, so we may get a share of the revenue from your purchase.


Creative
UI/UX Designer with a passion to make awesome things that are functional and elegant. I dabble in 3D too.
< / Coder >
Front End developer. Lover of Sass, Coffescript and Jade. Burgeoning React.js ninja.
Recent Projects
With The Uprising Creative
×
Anheuser-Busch
Front End - React.js - Responsive Optimization
Tackle Impossible is a project for Anheuser-Busch's campaign against drunk driving. Within the React.js front end, I built out components for the client-facing app and admin pages. I also created routes to register users and save their projects within the Mongo DB database.
×
Art of the Hustle
Front End - OOJS - Responsive Optimization
The Art of the Hustle is an interactive board game created for rapper Yo Gotti. I contributed heavily to the Front-End development as well as the Object Oriented JS structure running the game and leaderboard logic.
×
Chloe x Halle
Design - Front End - Responsive Optimization
Chloe and Halle are a music duo signed to Beyonce's label, Parkwood Entertainment. For this project, I designed aspects of the site and built out its front end functionality.
×
Nike Tech Knit
Front End - D3.js - Responsive Optimization
To promote Nike's new Tech Knit line of clothing, I helped build an interactice site which displays meta-data information about two individuals' day wearing the clothing. For the site, I used D3.js to visualize heart-rate information. I also developed an algorithm which translates temperature into an interactive color gradient.
 I've worked on professional projects for clients such as Nike, Anheuser-Busch, Converse and Disney.
I love collaboration, solving problems and beautiful design. I wake up everyday excited to code and leave campsites better than I found them.


vignettes/spatial_map_viewer.Rmd
spatial_map_viewer.Rmd
The “Spatial map viewer” addin allows viewing of nearest neighbor relationships between cells of selected phenotypes in a single field. Views can be saved for later use.
This addin requires reads data from the Consolidated_data.txt
file created by the “Consolidate and summarize” addin. It can also use the nearest_neighbors.csv
file created by the “Analyze consolidated data” addin when “Save nearest neighbor details” is selected.
The viewer uses both composite and component image files for the fields of interest. These files are written by the inForm export step.
The composite images are shown as the background of the nearest neighbor visualizations. The colors and components shown are determined by the inForm export settings.
The component images are the source of metadata about fields that is needed to properly places cells in the visualizations.
Choose “Spatial map viewer” from the RStudio Addins menu to start the viewer.
The viewer’s initial screen allows you to select the nearest neighbor file and inForm export directory containing the fields of interest.
First, click the “Browse input” button and select the nearest_neighbors.csv
file created by the analysis addin.
Next, click the second “Browse” button and select the inForm output directory corresponding with the nearest neighbors file.
Finally, click “Open Viewer” to start the viewer.
The nearest neighbor viewer allows you to
Select and color phenotypes In this section, select the two phenotypes of interest and the colors to use to display the phenotypes. Both single phenotypes such as CD8+
and multiple phenotypes such as CD8+/PDL1+
are supported.
Select a field to view Use the dropdown to select a particular field, or use the Previous and Next buttons to browse through all the fields.
Select the type of nearest neighbor relationship “Nearest neighbor” is not a symmetric relationship—cell A may have a nearest neighbor B, whose nearest neighbor is not A. Try the different settings to find the one you want.
Control the dot size This slider controls the size of the dots displaying the cells. You may want to make the dots smaller before saving images.
Save a single view or views for all fields The “Save image” button will save the currently displayed image in your browser’s Download folder. The “Save all” button will use the current settings to save a zip file containing images of all fields in the experiment.


|
RAMADDA User Guide
|
Many of the icons that RAMADDA uses are from the FAMFAMFAM SILK icon collection. This is an amazingly well done collection released under the Creative Commons Attribution 2.5 License.
Many of the file icons are from: http://www.splitbrain.org/projects/file_icons.
RAMADDA uses software from:


New 3D printed cases came in today, courtesy of my friend who was willing to print them on his printer. The new case has the holes for power and the heart sensor pre-cut this time, which lets me do a lot less work cutting those holes out. It also fixes a majority of the spacing and fitting issues that I had with the previous iteration of the case, where the battery case didn't fit very well and where there was an extra slot for a touch sensor. Some of the support columns have also been changed from solid columns into only top bits, which allows the case to still support the lid, but saves a lot of interior space.
The first iteration of the case.
The second, newly improved iteration of the case.
You might notice that the button LEDs don't look much like the LEDs from the last post. This is because while I tried to solder the original neopixel nano LEDs, the solder actually melted on the LED end, which meant that the whole thing just broke while soldering. I replaced these with WS2812B LEDs, which are the same ones that I'm using for the main LED array. While not nearly as cool as the original ones, using the same LEDs will probably make troubleshooting and writing code far easier, while these larger LEDs are also quite a bit more robust and tested by the community. These chains of LEDs will be hot-glued to the side of the case some distance away so that the light diffuses properly.
Besides the new case, I've also finished placing and soldering the first of the heart-shaped LED plates, which took about 2 hours of continuous work to do. These come complete with a 1000μF capacitor and a 470Ω resistor attached to the power and signal lines, respectively, so that the whole thing is modular and can be easily tested on its own (also so that I don't forget them later on). The capacitor is attached in parallel across from power to ground, and smooths out any power spikes from the LEDs, while the resistor reduces the noise on the data line. This module was then tested with an Arduino, again with the FastLED library.
Finished LED module.
LED Module being tested.


Data science workflow
Communicating with R Markdown
Programming
Style
Control flow statements
Data science is an exciting discipline that allows you to turn raw data into understanding, insight, and knowledge. 1
tidyverse
The
tidyverse
is an opinionated collection of R packages designed for data science. All packages share an underlying design philosophy, grammar, and data structures. 2
tidyverse
includes packages for importing, wrangling, exploring and modeling data.
The system is intended to make data scientists more productive. To use tidyverse
do the following:
# Install the package
install.packages("tidyverse")
# Load it into memory
library("tidyverse")
tibble
packageThe tibble
package is part of the core tidyverse
.
Tibbles are a modern take on data frames. They keep the features that have stood the test of time, and drop the features that used to be convenient but are now frustrating.
tibbles
are data frames, tweaked to make life a little easier. Unlike regular data.frames
they:
tibbles
To use functions from tibble
and other tidyverse
packages:
# load it into memory
library(tidyverse)
Printing tibble
is much nicer, and always fits into your window:
# e.g. a built-in dataset 'diamonds' is a tibble:
class(diamonds)
## [1] "tbl_df" "tbl" "data.frame"
diamonds
## # A tibble: 53,940 x 10
## carat cut color clarity depth table price x y z
## <dbl> <ord> <ord> <ord> <dbl> <dbl> <int> <dbl> <dbl> <dbl>
## 1 0.23 Ideal E SI2 61.5 55 326 3.95 3.98 2.43
## 2 0.21 Premium E SI1 59.8 61 326 3.89 3.84 2.31
## 3 0.23 Good E VS1 56.9 65 327 4.05 4.07 2.31
## 4 0.290 Premium I VS2 62.4 58 334 4.2 4.23 2.63
## 5 0.31 Good J SI2 63.3 58 335 4.34 4.35 2.75
## 6 0.24 Very Good J VVS2 62.8 57 336 3.94 3.96 2.48
## 7 0.24 Very Good I VVS1 62.3 57 336 3.95 3.98 2.47
## 8 0.26 Very Good H SI1 61.9 55 337 4.07 4.11 2.53
## 9 0.22 Fair E VS2 65.1 61 337 3.87 3.78 2.49
## 10 0.23 Very Good H VS1 59.4 61 338 4 4.05 2.39
## # … with 53,930 more rows
tibbles
Creating tibbles
is similar to data.frame
s, but no strict rules on column names:
(tb <- tibble(x = 1:5, y = 1,z = x ^ 2 + y, `:)` = "smile"))
## # A tibble: 5 x 4
## x y z `:)`
## <int> <dbl> <dbl> <chr>
## 1 1 1 2 smile
## 2 2 1 5 smile
## 3 3 1 10 smile
## 4 4 1 17 smile
## 5 5 1 26 smile
Subsetting tibbles
is stricter than subsetting data.frames
, and ALWAYS returns objects with expected class: a single [
returns a tibble
, a double[[
returns a vector.
class(diamonds$carat)
## [1] "numeric"
class(diamonds[["carat"]])
## [1] "numeric"
class(diamonds[, "carat"])
## [1] "tbl_df" "tbl" "data.frame"
tibbles
You can read more about other tibble
features by calling on your R console:
vignette("tibble")
R Markdown provides an unified authoring framework for data science, combining your code, its results, and your prose commentary.
R Markdown was designed to be used:
for communicating your conclusions with people who do not want to focus on the code behind the analysis.
for collaborating with other data scientists, interested in both conclusions, and the code.
as a modern day lab notebook for data science, where you can capture both your work and your thought process.
R Markdown files are a plain text files with “.Rmd” extension.
---
title: "Title of my first document"
date: "2018-09-27"
output: html_document
---
# Section title
```{r chunk-name, include = FALSE}
library(tidyverse)
summary(cars)
```
## Subsection title
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to
prevent printing of the R code that generated the plot.
The documents must contain YAML header marked with dashes.  Sections and subsections are marked with hashtags.
To produce a complete report containing all text, code, and results:
In RStudio, click on “Knit” or press Cmd/Ctrl
+
Shift + K
.
From the R command line, type rmarkdown::render(“filename.Rmd”)
This will display the report in the viewer pane, and create a self-contained HTML file that you can share with others.
After compiling the R Markdown document from the previous slide, you get this html.
A YAML header is a set of key: value
pairs at the start of your file. Begin and end the header with a line of three dashes (- - -), e.g.
---
title: "Untitled"
author: "Anonymous"
output: html_document
---
You can tell R Markdown what type of document you want to render: html_document
(default), pdf_document
, word_document
, beamer_presentation
etc.
You can print a table of contents (toc) with the following:
---
title: "Untitled"
author: "Anonymous"
output:
html_document:
toc: true
---
In “.Rmd” files, prose is written in Markdown, a lightweight markup language with plain text files formating syntax.
Section headers/titles:
# 1st Level Header
## 2nd Level Header
### 3rd Level Header
Text formatting:
*italic* or _italic_
**bold** __bold__
`code`
superscript^2^ and subscript~2~
Lists:
* unordered list
* item 2
+ sub-item 1
+ sub-item 2
1. ordered list
1. item 2. The numbers are incremented automatically in the output.
Links and images:
<http://example.com>
[linked phrase](http://example.com)
![optional caption text](path/to/img.png)
Tables:
Table Header | Second Header
-------------| -------------
Cell 1 | Cell 2
Cell 3 | Cell 4
Math formulae
$\alpha$ is the first letter of the Greek alphabet.
Using $$ prints a centered equation in the new line.
$$\sqrt{\alpha^2 + \beta^2} = \frac{\gamma}{2}$$
In R Markdown R code must go inside code chunks, e.g.:
```{r chunk-name}
x <- runif(10)
y <- 10 * x + 4
plot(x, y)
```
Keyboard shortcuts:
Insert a new code chunk: Ctrl/Cmd + Alt + I
Run current chunk: Ctrl/Cmd + Shift + Enter
Run current line (where the cursor is): Ctrl/Cmd + Enter
Chunk output can be customized with options supplied to chunk header. Some non-default options are:
eval = FALSE
: prevents code from being evaluatedinclude = FALSE
: runs the code, but hides code and its output in the final documentecho = FALSE
: hides the code, but not the results, in the final documentmessage = FALSE
: hides messageswarning = FALSE
: hides warningsresults = ‘hide’
: hides printed outputfig.show = ‘hide’
: hides plotserror = TRUE
: does not stop rendering if error occursYou can evealuate R code in a middle of your text:
There are 26 in the alphabet, and 12 months in each year.
Today, there are `as.Date("2019-08-23") - Sys.Date()` days left till my next birthday.
There are 26 in the alphabet, and 12 months in a year. Today, there are 325 days left till my next birthday.
R Markdown is relatively young, and growing rapidly.
Official R Markdown website: (http://rmarkdown.rstudio.com)
Further reading and references:
sessionInfo()
command at the end of your document.All the above will help you increase the reproduciblity of your work.
The first step of programming is naming things.
In the “Hadley Wickam” R style convention:
File names are meaningful. Script files end with “.R”, and R Markdown with “.Rmd”
# Good
fit-models.R
utility-functions.R
# Bad (works but does not follow style convention)
foo.r
stuff.r
Variable and function names are lowercase.
# Good
day_one
day_1
# Bad (works but does not follow style convention)
first_day_of_the_month
DayOne
Spacing around all infix operators (=, +, -, <-, etc.):
average <- mean(feet / 12 + inches, na.rm = TRUE) # Good
average<-mean(feet/12+inches,na.rm=TRUE) # Bad
Spacing before left parentheses, except in a function call
# Good
if (debug) do(x)
plot(x, y)
# Bad
if(debug)do(x)
plot (x, y)
# Good
x <- 1 + 2
# Bad (works but does not follow style convention)
x = 1 + 2
{
” should not go on its own line and be followed by a new line.}
” brace can go on its own line.# Good
if (y < 0 && debug) {
message("Y is negative")
}
if (y == 0) {
log(x)
} else {
y ^ x
}
# Bad
if (y < 0 && debug)
message("Y is negative")
if (y == 0) {
log(x)
}
else {
y ^ x
}
if (y < 0 && debug) message("Y is negative")
Booleans are logical data types (TRUE/FALSE) associated with conditional statements, which allow different actions and change control flow.
# equal "==""
5 == 5
## [1] TRUE
# not equal: "!=""
5 != 5
## [1] FALSE
# greater than: ">""
5 > 4
## [1] TRUE
# greater than or equal: ">="" (# similarly < and <=)
5 >= 5
## [1] TRUE
# You can combine multiple boolean expressions
TRUE & TRUE
## [1] TRUE
TRUE & FALSE
## [1] FALSE
TRUE | FALSE
## [1] TRUE
!(TRUE)
## [1] FALSE
In R if you combine 2 vectors of booleans, by each element then use &
. Rember the recycling property for vectors.
c(TRUE, TRUE) & c(FALSE, TRUE)
## [1] FALSE TRUE
c(5 < 4, 7 == 0, 1< 2) | c(5==5, 6> 2, !FALSE)
## [1] TRUE TRUE TRUE
c(TRUE, TRUE) & c(TRUE, FALSE, TRUE, FALSE) # recycling
## [1] TRUE FALSE TRUE FALSE
If we use double operators &&
or ||
is used only the first elements are compared:
c(TRUE, TRUE) && c(FALSE, TRUE)
## [1] FALSE
c(5 < 4, 7 == 0, 1< 2) || c(5==5, 6> 2, !FALSE)
## [1] TRUE
c(TRUE, TRUE) && c(TRUE, FALSE, TRUE, FALSE)
## [1] TRUE
all()
or any()
functions:all(c(TRUE, FALSE, TRUE))
## [1] FALSE
any(c(TRUE, FALSE, TRUE))
## [1] TRUE
all(c(5 > -1, 3 >= 1, 1 < 1))
## [1] FALSE
any(c(5 > -1, 3 >= 1, 1 < 1))
## [1] TRUE
Control flow is the order in which individual statements, instructions or function calls of a program are evaluated.
Control statements allow you to do more complicated tasks.
If
/ else
For
While
Decide on whether a block of code should be executed based on the associated boolean expression.
Syntax. The if statements are followed by a boolean expression wrapped in parenthesis. The conditional block of code is inside curly braces {}
.
if (traffic_light == "green") {
print("Go.")
}
if (traffic_light == "green") {
print("Go.")
} else {
print("Stay.")
}
else if()
if (traffic_light == "green") {
print("Go.")
} else if (traffic_light == "yellow") {
print("Get ready.")
} else {
print("Stay.")
}
For very long sequence of if statements, use the switch()
function
operator <- function(x, y, op) {
switch(as.character(op),
'+' = x + y,
'-' = x - y,
'*' = x * y,
'/' = x / y,
stop("Unknown op!")
)
}
operator(2, 7, '+')
## [1] 9
operator(2, 7, '-')
## [1] -5
operator(2, 7, '/')
## [1] 0.2857143
operator(2, 7, "a")
## Error in operator(2, 7, "a"): Unknown op!
for (i in 1:5){
print(i^2)
}
## [1] 1
## [1] 4
## [1] 9
## [1] 16
## [1] 25
i = 1
while(i <= 5) {
cat("i =", i, "\n")
i = i + 1
}
## i = 1
## i = 2
## i = 3
## i = 4
## i = 5
next
halts the processing of the current iteration and advances the looping index.for (i in 1:10) {
if (i <= 5) {
print("skip")
next
}
cat(i, "is greater than 5.\n")
}
## [1] "skip"
## [1] "skip"
## [1] "skip"
## [1] "skip"
## [1] "skip"
## 6 is greater than 5.
## 7 is greater than 5.
## 8 is greater than 5.
## 9 is greater than 5.
## 10 is greater than 5.
next
applies only to the innermost of nested loops.for (i in 1:3) {
cat("Outer-loop i: ", i, ".\n")
for (j in 1:4) {
if(j > i) {
print("skip")
next
}
cat("Inner-loop j:", j, ".\n")
}
}
## Outer-loop i: 1 .
## Inner-loop j: 1 .
## [1] "skip"
## [1] "skip"
## [1] "skip"
## Outer-loop i: 2 .
## Inner-loop j: 1 .
## Inner-loop j: 2 .
## [1] "skip"
## [1] "skip"
## Outer-loop i: 3 .
## Inner-loop j: 1 .
## Inner-loop j: 2 .
## Inner-loop j: 3 .
## [1] "skip"
break
statement allows us to break out out of a for, while loop (of the smallest enclosing).for (i in 1:10) {
if (i == 6) {
print(paste("Coming out from for loop Where i = ", i))
break
}
print(paste("i is now: ", i))
}
## [1] "i is now: 1"
## [1] "i is now: 2"
## [1] "i is now: 3"
## [1] "i is now: 4"
## [1] "i is now: 5"
## [1] "Coming out from for loop Where i = 6"
Go to “Lec2_Exercises.Rmd” in RStudio.
Do Exercise 1.
A function is a procedure/routine that performs a specific task.
Functions are used to abstract components of larger program.
Similarly to mathematical functions, they take some input and then do something to find the result.
Functions allow you to automate common tasks in a more powerful and general way than copy-and-pasting.
If you’ve copied and pasted a block of code more than twice, you should use a function instead.
Functions become very useful as soon as your code becomes long enough.
set.seed(1)
a <- rnorm(10); b <- rnorm(10); c <- rnorm(10); d <- rnorm(10)
# Bad
a <- (a - min(a, na.rm = TRUE)) /
(max(a, na.rm = TRUE) - min(a, na.rm = TRUE))
b <- (b - min(b, na.rm = TRUE)) /
(max(b, na.rm = TRUE) - min(b, na.rm = TRUE))
c <- (c - min(c, na.rm = TRUE)) /
(max(b, na.rm = TRUE) - min(c, na.rm = TRUE))
d <- (d - min(d, na.rm = TRUE)) /
(max(d, na.rm = TRUE) - min(d, na.rm = TRUE))
# Good
rescale_data <- function(x) {
rng <- range(x, na.rm = TRUE)
return((x - rng[1]) / (rng[2] - rng[1]))
}
a <- rescale_data(a)
b <- rescale_data(b)
c <- rescale_data(c)
d <- rescale_data(d)
To define a function you assign a variable name to a function
object.
Functions take arguments, mandatory and optional.
Provide the brief description of your function in comments before the function definition.
# Computes mean and standard deviation of a vector,
# and optionally prints the results.
summarize_data <- function(x, print=FALSE) {
center <- mean(x)
spread <- sd(x)
if (print) {
cat("Mean =", center, "\n",
"SD =", spread, "\n")
}
list(mean=center, sd=spread)
}
# without printing
x <- rnorm(n = 500, mean = 4, sd = 1)
y <- summarize_data(x)
# with printing
y <- summarize_data(x, print = TRUE)
## Mean = 4.009679
## SD = 1.01561
# Results are stored in list "y"
y$mean
## [1] 4.009679
y$sd
## [1] 1.01561
# The order of arguments does not matter if the names are specified
y <- summarize_data(print=FALSE, x = x)
The value returned by the function is usually the last statement it evaluates. You can choose to return early by using return()
; this makes you code easier to read.
# Complicated function simplified by the use of early return statements
complicated_function <- function(x, y, z) {
# Check some condition
if (length(x) == 0 || length(y) == 0) {
return(0)
}
# Complicated code here
}
Returning invisible objects can be done with invisible()
show_missings <- function(df) {
cat("Missing values:", sum(is.na(df)), "\n")
invisible(df) # this result doesn’t get printed out
}
show_missings(mtcars)
## Missing values: 0
dim(show_missings(mtcars))
## Missing values: 0
## [1] 32 11
The environment of a function controls how R finds an object associated with a name.
f <- function(x) {
x + y
}
R uses rules called lexical scoping to find the value associated with a name. Here, R will look for y
in the environment where the function was defined
y <- 100
f(10)
## [1] 110
This behaviour attracts bugs. You should try to avoid using global variables.
The apply
family functions, are functions which manipulate slices of data stored as matrices, arrays, lists and data-frames in a repetitive way.
These functions avoid the explicit use of loops, and might be more computationally efficient, depending on how big a dataset is. For more details on runtimes see this link.
apply
allow you to perform operations with very few lines of code.
The family comprises: apply, lapply , sapply, vapply, mapply, rapply, and tapply. The difference lies in the structure of input data and the desired format of the output).
apply
operates on arrays/matrices.
In the example below we obtain column sums of matrix X
.
(X <- matrix(sample(30), nrow = 5, ncol = 6))
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 11 21 10 16 7 15
## [2,] 30 13 14 27 23 2
## [3,] 18 3 5 8 4 28
## [4,] 1 20 6 24 26 25
## [5,] 19 9 12 29 22 17
apply(X, MARGIN = 2 , FUN = sum)
## [1] 79 66 47 104 82 87
Note: that in a matrix MARGIN = 1
indicates rows and MARGIN = 2
indicates columns.
apply
can be used with user-defined functions:# number entries < 15
apply(X, 2, function(x) 10*x + 2)
## [,1] [,2] [,3] [,4] [,5] [,6]
## [1,] 112 212 102 162 72 152
## [2,] 302 132 142 272 232 22
## [3,] 182 32 52 82 42 282
## [4,] 12 202 62 242 262 252
## [5,] 192 92 122 292 222 172
apply()
,logColMeans <- function(x, eps = NULL) {
if (!is.null(eps)) x <- x + eps
return(mean(x))
}
apply(X, 2, logColMeans)
## [1] 15.8 13.2 9.4 20.8 16.4 17.4
apply(X, 2, logColMeans, eps = 0.1)
## [1] 15.9 13.3 9.5 20.9 16.5 17.5
lapply()
is used to repeatedly apply a function to elements of a sequential object such as a vector, list, or data-frame (applies to columns).
The output is a list with the same number of elements as the input object.
# lapply returns a list
lapply(1:3, function(x) x^2)
## [[1]]
## [1] 1
##
## [[2]]
## [1] 4
##
## [[3]]
## [1] 9
sapply
is the same as lapply
but returns a “simplified” output.sapply(1:3, function(x) x^2)
## [1] 1 4 9
apply()
, user-defined functions can be used with sapply/lapply
.The idea of passing a function to another function is extremely powerful idea, and it’s one of the behaviours that makes R a functional programming (FP) language.
The apply family of functions in base R are basically tools to extract out this duplicated code, so each common for loop pattern gets its own function.
The package purrr
in tidyverse
framework solves similar problems, more in line with the ‘tidyverse-philosophy’. We will learn in in following lectures.
Go back to “Lec2_Exercises.Rmd” in RStudio.
Do Exercise 2 and 3.
Comments and documentation
Comment your code!
Comments are not subtitles, i.e. don’t repeat the code in the comments.
Use dashes to separate blocks of code:


--- layout: post status: publish published: true title: Being An Independent Fundamental Baptist author: Ryan Hayden wordpress_id: 484 wordpress_url: http://ryan-hayden.com/?p=484 date: '2013-01-28 10:29:17 -0600' date_gmt: '2013-01-28 16:29:17 -0600' categories: - Fundamentalism - featured tags: - featured ---
I am an Independent Fundamental Baptist. Not because of necessity not because my parents are, not because I went to an IFB school or most of my friends are Independent Fundamental Baptists, but because I want to be and because I believe that the original ideals of Independent Fundamental Baptists are closest to what scripture says a church should be.
On this blog, I write regularly about why I am an Independent Fundamental Baptist, and why I think we as a group have some serious issues that need to be worked through. (Incidentally, I am working on a book about this topic.) If this is your first time here, let me suggest some articles to get you up to speed:
[box]
[box]
[box]
[box]
I'll be updating this list regularly, if you have any topics you'd like to suggest, let me know in the comments.


{% extends "global/Page.html" %}
{% load otree static %}
{% block title %}
Part {{ Part }} - Instructions
{% endblock %}
{% block content %}
You will now complete 3 tasks. Of these 3 tasks, only 1 has been chosen for payment. Which one will be revealed
after all three have been completed.
{% next_button %}
{% endblock %}


RQUOTAD
Section: Maintenance Commands (8)Index Return to Main Contents
NAME
quota_nld - quota netlink message daemonSYNOPSIS
quota_nld [ -DCn ]DESCRIPTION
quota_nld is a daemon that listens on netlink socket and processes received quota warnings. Note, that you have to enable the kernel support for sending quota messages over netlink (in Filesystems->Quota menu). The daemon supports forwarding warning messages to the system's DBUS (so that desktop manager can display a dialog) and writing them to the terminal user has last accessed.OPTIONS
- -V, --version
- Shows version of quota tools.
- -D, --no-dbus
- Do not forward quota warnings to DBUS.
- -C, --no-console
- Do not print quota warnings to the terminal.
- -F, --foreground
-
Run daemon in foreground (may be useful for debugging purposes).
SEE ALSO
quota(1), netlink(7), dbus.freedesktop.org
Index
This document was created by man2html, using the manual pages.
Time: 05:34:29 GMT, December 24, 2015


{% extends "base.html" %} {% block content %}
Check your email for instructions to reset your password. Should you not recieve an email, you may have mis-typed it or provided the wrong email address. If you do not recieve an email, or you are unable to reset the password within 10 minutes, please try again.
{% endblock %}


Provides a function for fitting a penalized constrained continuation ratio model using the glmpath algorithm and methods for extracting coefficient estimates, predicted class, class probabilities, and plots.
| Version: | 1.0.7 |
| Depends: | R (≥ 2.10), glmpath |
| Suggests: | tools |
| Published: | 2018-06-30 |
| Author: | Kellie J. Archer |
| Maintainer: | Kellie J. Archer <archer.43 at osu.edu> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| Citation: | glmpathcr citation info |
| Materials: | NEWS |
| CRAN checks: | glmpathcr results |
| Reference manual: | glmpathcr.pdf |
| Vignettes: |
An R Package for Ordinal Response Prediction in High-dimensional Data Settings |
| Package source: | glmpathcr_1.0.7.tar.gz |
| Windows binaries: | r-devel: glmpathcr_1.0.7.zip, r-release: glmpathcr_1.0.7.zip, r-oldrel: glmpathcr_1.0.7.zip |
| OS X binaries: | r-release: glmpathcr_1.0.7.tgz, r-oldrel: glmpathcr_1.0.7.tgz |
| Old sources: | glmpathcr archive |
Please use the canonical form https://CRAN.R-project.org/package=glmpathcr to link to this page.