Dollar is a Swift library that provides useful functional programming helper methods without extending any built in objects. It is similar to Lo-Dash or Underscore.js in Javascript.
Cent is a library that extends certain Swift object types using the extension feature and gives its two cents to Swift language.
Add github "ankurp/Dollar.swift" ~> 3.0.0
to your Cartfile
and run carthage update
. If unfamiliar with Carthage then checkout their Getting Started section or this sample app
Add pod 'Dollar'
to your Podfile
and run pod install
. Add use_frameworks!
to the end of the Podfile
. Also checkout this sample app. Requires cocoapod version 0.36.1.
git submodule
git submodule add https://github.com/ankurp/Dollar.swift.git
. If not using git download the project using git clone https://github.com/ankurp/Dollar.swift.git
in your project folder.import Dollar
and you can call all of the helper functions.Still stuck. Then checkout this screencast on how to import
Use version 2.2.0
or older for Xcode 6.1 and 6.2.
Using
$.at
Creates an array of elements from the specified indexes, or keys, of the collection. Indexes may be specified as individual arguments or as arrays of indexes.
$.at(["ant", "bat", "cat", "dog", "egg"], indexes: 0, 2, 4)
=> ["ant", "cat", "egg"]
$.compact
Creates an array with all nil values removed.
$.compact([3, nil, 4, 5])
=> [3, 4, 5]
$.compact([nil, nil]) as NSObject[]
=> []
$.contains
Checks if a given value is present in the array.
$.contains([1, 2, 3, 1, 2, 3], value: 2)
=> true
$.contains([1, 2, 3, 1, 2, 3], value: 10)
=> false
$.cycle
Cycles through the array definetly or indefinetly passing each element into the callback function. The second parameter is to specify how many times to cycle through the array. If left out it will cycle indefinetly.
$.cycle([1, 2, 3], 2) {
print($0)
}
// Prints the following
123123
$.difference
Creates an array excluding all values of the provided arrays
$.difference([1, 2, 3, 4, 5], [5, 2, 10])
=> [1, 3, 4]
$.each
Passes each element in the array to the callback
$.each(["A", "B"]) {
println("Value \($0)")
}
=> ["A", "B"]
$.each(["A", "B"]) { (index, elem) in
println("\(index) - \(elem)")
}
=> ["A", "B"]
$.every
Checks if the given callback returns true value for all items in the array.
$.every([1, 2, 3, 4], callback: { $0 < 20 })
=> true
$.every([1, 2, 3, 4]) { $0 == 1 }
=> false
$.fetch
Get element from an array at the given index which can be negative to find elements from the end of the array. A default value can be returned if indexing out of bounds.
let arr = [1, 2, 3, 4, 5, 6, 7, 8]
$.fetch(arr, 100)
=> nil
$.fetch(arr, 100, orElse: 42)
=> 42
$.fetch(arr, -1)
=> 8
$.find
Iterates over elements of an array and returning the first element that the callback returns true for.
$.find([1, 2, 3, 4], callback: { $0 == 2 })
=> 2
$.find([1, 2, 3, 4]) { $0 == 10 }
=> nil
$.findIndex
This method is like find except that it returns the index of the first element that passes the callback check.
let arr = [["age": 36], ["age": 40], ["age": 1]]
let result = $.findIndex(arr) { $0["age"] < 20 }
result
=> 2
$.findLastIndex
This method is like findIndex except that it iterates over elements of the array from right to left.
let arr = [["age": 36], ["age": 40], ["age": 1]]
let result = $.findLastIndex(arr) { $0["age"] > 30 }
result
=> 1
$.first(array: AnyObject[])
Gets the first element in the array.
$.first([1, 2, 3, 4])
=> 1
$.first([])
=> nil
$.second(array: AnyObject[])
Gets the second element in the array.
$.second([1, 2, 3, 4])
=> 2
$.second([1])
=> nil
$.second([])
=> nil
$.flatMap
Maps a function that converts elements to a list and then concatenates them.
let values = [2, 3, 4, 5, 6, 7]
$.flatMap(values) { [$0, $0] }
=> [2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7]
$.flatMap
Maps a function that converts a type to an Optional over an Optional, and then returns a single-level Optional.
let url = NSURL(string: "https://apple.com/swift")
$.flatMap(url) { $0.lastPathComponent }
=> Optional("swift")
Note: This is the same behavior as Optional chaining. The code above translates to
NSURL(string: "https://apple.com/swift/")?.lastPathComponent
=> Optional("swift")
$.flatten
Flattens a nested array of any depth.
$.flatten([[3], 4, 5]) as Int[]
=> [3, 4, 5]
$.flatten([[3], "Hello", 5]) as NSObject[]
=> [3, "Hello", 5]
$.flatten([[[3], 4], 5]) as Int[]
=> [3, 4, 5]
$.frequencies
This method returns a dictionary of values in an array mapping to the total number of occurrences in the array. If passed a function it returns a frequency table of the results of the given function on the arrays elements.
$.frequencies(["a", "a", "b", "c", "a", "b"])
=> ["a": 3, "b": 2, "c": 1]
$.frequencies([1, 2, 3, 4, 5]) { $0 % 2 == 0 }
=> [false: 3, true: 2]
$.indexof
Gets the index at which the first occurrence of value is found.
$.indexOf([1, 2, 3, 1, 2, 3], value: 2)
=> 1
$.indexOf(["A", "B", "C"], value: "B")
=> 1
$.indexOf([3, 4, 5], value: 5)
=> 2
$.indexOf([3, 4, 5], value: 3)
=> 0
$.indexOf([3, 4, 5], value: 2)
=> nil
$.initial
Gets all but the last element or last n elements of an array.
$.initial([3, 4, 5])
=> [3, 4]
$.initial([3, 4, 5], numElements: 2)
=> [3]
$.intersection
Creates an array of unique values present in all provided arrays.
$.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1])
=> [1, 2]
$.last
Gets the last element from the array.
$.last([3, 4, 5])
=> 5
$.lastIndexOf
Gets the index at which the last occurrence of value is found.
$.lastIndexOf([1, 2, 3, 1, 2, 3], value: 2)
=> 4
$.rest
The opposite of initial this method gets all but the first element or first n elements of an array.
$.rest([3, 4, 5])
=> [4, 5]
$.rest([3, 4, 5], numElements: 2)
=> [5]
$.map
Maps each element to new value based on the map function passed
$.map([1, 2, 3, 4]) {
$0 * 2
}
=> [2, 4, 6, 8]
$.min
Retrieves the minimum value in an array.
$.min([2, 1, 2, 3, 4])
=> 1
$.max
Retrieves the maximum value in an array.
$.max([1, 2, 3, 4, 2, 1])
=> 4
$.pluck
Retrieves the value of a specified property from all elements in the array.
let arr = [["age": 20], ["age": 30], ["age": 40]]
$.pluck(arr, value: "age")
=> [20, 30, 40]
$.pull
Removes all provided values from the given array.
$.pull([3, 4, 5, 3, 5], values: 3, 5)
=> [4]
$.pull([3, 4, 5, 3, 5], values: 4)
=> [3, 5, 3, 5]
$.pull([3, 4, 5, 3, 5], values: 3, 4, 5)
=> []
$.range
Creates an array of numbers (positive and/or negative) progressing from start up to but not including end.
$.range(4)
=> [0, 1, 2, 3]
$.range(from: 1, to: 5)
=> [1, 2, 3, 4]
$.range(from: 0, to: 20, incrementBy: 5)
=> [0, 5, 10, 15]
$.range(from: 1, through: 5)
=> [1, 2, 3, 4, 5]
$.range(from: 0, through: 20, incrementBy: 5)
=> [0, 5, 10, 15, 20]
$.reduce
Reduce function that will resolve to one value after performing combine function on all elements
$.reduce([1, 2, 3], initial: 0) { (total, element) in
total + element
}
=> 6
$.sample
Returns a sample item from the array
let arr : Int[] = [2, 1, 2, 3, 4]
$.contains(arr, value: $.sample(arr))
=> true
$.sequence
Creates an array of an arbitrary sequence. Especially useful with builtin ranges.
$.sequence(0..4)
=> [0, 1, 2, 3]
$.sequence(-2.0..2.0)
=> [-2.0, -1.0, 0.0, 1.0]
$.sequence((0..20).by(5))
=> [0, 5, 10, 15]
$.sequence("abc")
=> ["a", "b", "c"]
$.remove
Removes all elements from an array that the callback returns true.
let result = $.remove([1, 2, 3, 4, 5, 6]) {
$0 == 2 || $0 == 3
}
result
=> [1, 4, 5, 6]
$.shuffle
Shuffles and returns the new shuffled array
let result = $.shuffle([1, 2, 3, 4, 5, 6])
result
=> [4, 1, 3, 5, 6, 2]
$.sortedIndex
Gives the smallest index at which a value should be inserted into a given the array is sorted.
$.sortedIndex([3, 4, 6, 10], value: 5)
=> 2
$.sortedIndex([10, 20, 30, 50], value: 40)
=> 3
$.union
Creates an array of unique values, in order, of the provided arrays.
$.union([1, 2, 3], [5, 2, 1, 4], [2, 1])
=> [1, 2, 3, 5, 4]
$.merge
Creates an array of all values, including duplicates, of the arrays in the order they are provided.
let arr = [1, 5]
let arr2 = [2, 4]
let arr3 = [5, 6]
let result = $.merge(arr, arr2, arr3)
result
=> [1, 5, 2, 4, 5, 6]
$.uniq
Creates a duplicate-value-free version of an array.
$.uniq([1, 2, 1, 3, 1])
=> [1, 2, 3]
$.uniq([1, 2.5, 3, 1.5, 2, 3.5]) {
floor($0)
}
=> [1, 2.5, 3]
$.without
Creates an array excluding all provided values.
$.without([3, 4, 5, 3, 5], values: 3, 5)
=> [4]
$.without([3, 4, 5, 3, 5], values: 4)
=> [3, 5, 3, 5]
$.without([3, 4, 5, 3, 5], values: 3, 4, 5)
=> []
$.xor
Creates an array that is the symmetric difference of the provided arrays.
$.xor([1, 2, 3], [5, 2, 1, 4])
=> [3, 4, 5]
$.zip
Creates an array of grouped elements, the first of which contains the first elements of the given arrays.
$.zip(["fred", "barney"], [30, 40], [true, false]) as [NSObject]
=> [["fred", 30, true], ["barney", 40, false]]
$.zipObject
Creates an object composed from arrays of keys and values.
$.zipObject(["fred", "barney"], values: [30, 40])
=> ["fred": 30, "barney": 40]
$.partition
Produces an array of arrays, each containing n elements, each offset by step. Stops after a partition is less than n length.
let arr = [1, 2, 3, 4, 5]
$.partition(arr, n: 2)
=> [[1, 2], [3, 4]]
$.partition(arr, n: 4, step: 1)
=> [[1, 2, 3, 4], [2, 3, 4, 5]]
$.partition(arr, n: 4, step: 1, pad: nil)
=> [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5]]
$.partition(arr, n: 4, step: 1, pad: [6, 7, 8])
=> [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5, 6]]
$.partitionAll
Produces an array of arrays, each containing n elements, each offset by step. Continues after a partition is less than n length.
$.partitionAll([1, 2, 3, 4, 5], n:4, step: 1)
=> [[1, 2, 3, 4], [2, 3, 4, 5], [3, 4, 5], [4, 5], [5]]
$.partitionBy
Applies a function to each element in array, splitting it each time the function returns a new value.
$.partitionBy([1, 2, 3, 4, 5]) { $0 % 2 == 0 }
=> [[1], [2, 4], [3, 5], [6]]
$.partitionBy([1, 7, 3, 6, 10, 12]) { $0 % 3 }
=> [[1, 7], [3, 6], [10], [12]]
$.keys
Creates an array of keys given a dictionary.
$.keys(["Dog": 1, "Cat": 2])
=> ["Dog", "Cat"]
$.values
Creates an array of values given a dictionary
$.values(["Dog": 1, "Cat": 2])
=> [1, 2]
$.merge
Merges all of the dictionaries together and the latter dictionary overrides the value at a given key
let dict: Dictionary<String, Int> = ["Dog": 1, "Cat": 2]
let dict2: Dictionary<String, Int> = ["Cow": 3]
let dict3: Dictionary<String, Int> = ["Sheep": 4]
$.merge(dict, dict2, dict3)
=> ["Dog": 1, "Cat": 2, "Cow": 3, "Sheep": 4]
$.pick
Creates a shallow clone of a dictionary composed of the specified keys.
$.pick(["Dog": 1, "Cat": 2, "Cow": 3], keys: "Dog", "Cow")
=> ["Dog": 1, "Cow": 3]
$.omit
Creates a shallow clone of a dictionary excluding the specified keys.
$.omit(["Dog": 1, "Cat": 2, "Cow": 3], keys: "Cat", "Dog")
=> ["Cow": 3, "Sheep": 4]
$.tap
Invokes interceptor with the object and then returns object.
var beatle = Car(name: "Fusca")
$.tap(beatle, {$0.name = "Beatle"}).color = "Blue"
$.after
Creates a function that executes passed function only after being called n times.
var saves = ["profile", "settings"];
let asyncSave = { (function: () -> ()?) in
function()
// Saving right away for testing
// but in real world would be async
}
var isDone = false
var completeCallback = $.after(saves.count) {
isDone = true
}
for elem in saves {
asyncSave(completeCallback)
}
isDone
=> true
$.bind
Creates a function that, when called, invokes func with the binding of arguments provided.
let helloWorldFunc = $.bind({(T...) in
T[0] + " " + T[1] + " from " + T[2]
}, "Hello", "World", "Swift")
helloWorldFunc()
=> "Hello World from Swift"
$.compose
Compose two or more functions where the return value of the first function is passed into the next function. Useful when chaining functions and returns a function that can be called with variadic argument values or an array of values as input
let double = { (params: Int...) -> [Int] in
return $.map(params) { $0 * 2 }
}
let subtractTen = { (params: Int...) -> [Int] in
return $.map(params) { $0 - 10 }
}
let doubleSubtractTen = $.compose(double, subtractTen)
doubleSubtractTen(5, 6, 7)
=> [0, 2, 4]
let f = $.compose({ (arr: [Int]) -> [Int] in
$.map(arr) { $0 + 1 }
}, { (arr: [Int]) -> [Int] in
$.map(arr) { $0 * 2 }
})
f([1, 2])
=> [4, 6]
$.curry
Returns a function which when invoked either executes the function returning its result, if all function arguments have been provided, or returns another function that accepts one more argument of the remaining function arguments until all arguments are supplied. This is useful for making partial function as seen in these examples.
func adder(x: Int, y: Int, z: Int) -> Int {
return x + y + z
}
let curriedAdder = $.curry(adder)
let addTenAnd = curriedAdder(10)
let addThirtyAnd = addTenAnd(20)
addThirtyAnd(1)
=> 31
addThirtyAnd(50)
=> 80
addTenAnd(10)(10)
=> 30
$.id
The identify function which simply returns the argument its given.
$.id("Hello World from Swift")
=> "Hello World from Swift"
$.memoize
Returns a memoized function to improve performance by caching recursive function values.
var times = 0 // to test memoization
let fibMemo = $.memoize { (fib: (Int -> Int), val: Int) -> Int in
times += 1
return val == 1 || val == 0 ? 1 : fib(val - 1) + fib(val - 2)
}
let x = fibMemo(5)
times
=> 6
times = 0
let y = fibMemo(5)
times
=> 0
times = 0
let z = fibMemo(6)
times
=> 1
$.noop
A no-operation function.
$.noop()
=> nil
$.once
Get a wrapper function that executes the passed function only once. Useful for getting shared config or creating singleton objects.
func createConfig() -> [String: String] {
var i = 1
return [
"App ID": "\(i++)",
"URL": "https://someurl"
]
}
let getConfig = $.once(createConfig)
getConfig()
=> ["App ID": "1", "URL": "https://someurl"]
getConfig()
=> ["App ID": "1", "URL": "https://someurl"]
$.partial
Creates a function that, when called, invokes func with any additional partial arguments prepended to those provided to the new function.
let partialFunc = $.partial({(T...) in
T[0] + " " + T[1] + " from " + T[2]
}, "Hello")
partialFunc("World", "Swift")
=> "Hello World from Swift"
$.times
Call a function n times and also passes the index. If a value is returned in the function then the times method will return an array of those values.
let fun = $.bind({ (names: String...) -> String in
let people = $.join(names, separator: " from ")
return "Hello \(people)"
}, "Ankur", "Swift")
$.times(2, function: fun) as String[]
=> ["Hello Ankur from Swift", "Hello Ankur from Swift"]
$.chain(...)
any
Returns true if callback function returns true for at least one element in the array
var chain = $.chain([1, 2, 3])
chain.any({ ($0 as Int) < 2 })
=> true
all
Returns true if callback function returns true for all elements in the array
var chain = $.chain([1, 2, 3])
chain.all({ ($0 as Int) < 10 })
=> true
each
Passes each element value to the callback function
var chain = $.chain(["Hello", "World"])
var strBuilder = ""
chain.each({ strBuilder += ($0 as String) }).value
strBuilder
=> "HelloWorld"
filter
Filters the arrary to elements for which the callback function returns true
var chain = $.chain([1, 2, 3, 4])
chain.filter({ ($0 as Int) < 3 }).value
=> [1, 2]
first
Returns the first element in the array and terminated the chain
var chain = $.chain([1, 2, 3, 4])
chain.first()
=> 1
second
Returns the second element in the array and terminated the chain
var chain = $.chain([1, 2, 3, 4])
chain.second()
=> 2
third
Returns the third element in the array and terminated the chain
var chain = $.chain([1, 2, 3, 4])
chain.third()
=> 3
flatten
Flattens a nested array of any depth.
chain = $.chain([[1, [2]], [3], 4])
chain.flatten().value
=> [1, 2, 3, 4]
initial
Gets all but the last element or last n elements of an array.
varchain = $.chain([1, 2, 3, 4])
chain.initial(2).value
=> [1, 2]
map
Maps each element to the new value returned in the callback function
var chain = $.chain([1, 2, 3, 4])
chain.map({ ($0 as Int) * 2 }).value
=> [2, 4, 6, 8]
slice
Slices the array based on the start and end position. If an end position is not specified it will slice till the end of the array.
var chain = $.chain([1, 2, 3, 4, 5, 6, 7])
chain.slice(2, end: 4).value
=> [3, 4]
value
Returns the value after evaluating all callbacks
var chain = $.chain([1, 2, 3, 4, 5, 6, 7])
chain.value
=> [1, 2, 3, 4, 5, 6, 7]
Chaining more than one method
$.chain([[1, 2], 3, [[4], 5]])
.initial()
.flatten()
.first()
=> 1
$.chain([1, 2, 3, 4, 5])
.filter { $0 % 1 == 0 }
.map { $0 * 2 }
.all {$0 < 10}
=> false
$.chain([1, 2, 3, 4, 5])
.map({ $0 * 2 })
.flatten()
.initial(2).value
=> [2, 4, 6]
equal
Tells whether two optionals containing Equatable types are equal.
let optionalString: String? = "hello"
let otherOptionalString: String? = "hello"
$.equal(optionalString, otherOptionalString)
=> true
let thirdOptionalString: String? = "goodbye"
$.equal(optionalString, thirdOptionalString)
=> false
let nilOptionalString: String? = nil
let otherNilOptionalString: String? = nil
$.equal(nilOptionalString, otherNilOptionalString)
=> true
<< elem: Element -> [Element]
Overloaded operator to append element to an array or append elements from another array into the first array. Return array with the element appended in the end.
var array = [1, 2, 3]
array << 4
=> [1, 2, 3, 4]
array << [5, 6]
=> [1, 2, 3, 4, 5, 6]
at(indexes: Int...) -> [Element]
Creates an array of elements from the specified indexes, or keys, of the collection.
let array = ["foo", "spam", "bar", "eggs"]
let some = array.at(1, 3)
=> ["spam", "eggs"]
each(callback: (Element) -> ()) -> [Element]
For each item in the array invoke the callback by passing the elem
let array = ["foo", "spam", "bar", "eggs"]
array.each {
println($0)
}
=> ["foo", "spam", "bar", "eggs"]
eachWithIndex(callback: (Int, Element) -> ()) -> [Element]
For each item in the array invoke the callback by passing the elem along with the index
let array = ["foo", "spam", "bar", "eggs"]
array.each { (index, elem)
println("\(index) - \(elem)")
}
=> ["foo", "spam", "bar", "eggs"]
cycle<U>(times: Int, callback: (Element) -> U)
Cycles through the array definetly or indefinetly passing each element into the callback function. The second parameter is to specify how many times to cycle through the array. If left out it will cycle indefinetly.
[1, 2, 3].cycle(2) {
print($0)
}
// Prints the following
123123
[1, 2, 3].cycle {
print($0)
}
// Cycles in an infinite loop
every(callback: (Element) -> Bool) -> Bool
Checks if the given callback returns true value for all items in the array.
["angry", "hungry"].every { (a: String) -> (Bool) in
a.hasSuffix("gry")
}
=> true
fetch(index: Int, orElse: T? = .None) -> T!
Get element from an array at the given index which can be negative to find elements from the end of the array. A default value can be returned if indexing out of bounds.
let arr = [1, 2, 3, 4, 5, 6, 7, 8]
arr.fetch(100)
=> nil
arr.fetch(100, orElse: 42)
=> 42
arr.fetch(-1)
=> 8
findIndex(callback: (Element) -> Bool) -> Int?
This method is like find except that it returns the index of the first element that passes the callback check.
let ind: int? = ["foo", "bar", "spam", "eggs"].findIndex {
$0.length == 4
}
ind! == 2
=> true
findLastIndex(callback: (Element) -> Bool) -> Int?
This method is like findIndex except that it iterates over elements of the array from right to left.
let ind: int? = ["foo", "bar", "spam", "eggs"].findLastIndex {
$0.length == 4
}
ind! == 3
=> true
first() -> Element?
Gets the first element in the array.
let first = ["foo", "bar"].first()
=> "foo"
flatten() -> [Element]
Flattens a nested array of any depth.
let unFlattened = ["foo", ["bar"], [["spam"]], [[["eggs"]]] ]
let flattened = unFlattened.flatten()
=> ["foo", "bar", "spam", "eggs"]
get(index: Int) -> Element?
Get element at index
let element = ["foo", "bar"].get(0)
element!
=> "foo"
let nothing = ["foo", "bar"].get(1000)
=> nil
initial(numElements: Int? = 1) -> [Element]
Gets all but the last element or last n elements of an array.
let initial = ["foo", "bar", "spam"].initial(2)
=> ["foo"]
last() -> Element?
Gets the last element from the array.
let last = ["foo", "bar"].last()
=> "bar"
rest(numElements: Int? = 1) -> [Element]
The opposite of initial this method gets all but the first element or first n elements of an array.
let rest = ["foo", "bar", "spam"].rest(2)
=> ["spam"]
min<T: Comparable>() -> T?
Retrieves the minimum value in an array.
let min = [ 0, 1, 2 ].min()
=> 0
max<T: Comparable>() -> T?
Retrieves the maximum value in an array.
let max = [ 0, 1, 2].max()
=> 2
"A".description -> String
Get string description of Character
let ch: Character = "A"
let str = ch.description
=> "A"
Date.from(#year: Int, month: Int, day: Int) -> NSDate
Returns a new Date given the year month and day
let date = Date.from(2014, 1, 1)
=> "Jan 1, 2014, 12:00 AM"
Date.from(#unix: Double) -> NSDate
Returns a new Date given the unix timestamp (timeIntervalSince1970)
let date = Date.from(unix: 1_388_552_400.0)
=> "Jan 1, 2014, 12:00 AM"
Date.parse(dateStr: String, format: String = "yyyy-MM-dd") -> NSDate
Parses the date based on the format and return a new Date
let parsedDate = Date.parse("2014-01-01", format: "yyyy-MM-dd")
=> "Jan 1, 2014, 12:00 AM"
Date.unix(date: NSDate = NSDate()) -> Double
Returns the unix timestamp of the date passed in or the current unix timestamp
let currentUnix = Date.unix()
=> 1,388,552,400.0
var otherNSDate = Date()
let otherUnix = Date.unix(otherDate)
=> 1,388,552,400.0
Int.hour.fromNow
et al.Use the following syntax to calculate dates and times based on the user's current calendar.
1.day.ago
=> "Apr 10, 2015, 11:51 AM"
4.hours.fromNow
=> "Apr 11, 2015, 3:51 PM"
merge<K, V>(dictionaries: Dictionary<K, V>...)
Merges the dictionary with dictionaries passed. The latter dictionaries will override values of the keys that are already set
var dic = ["foo": "bar"]
let anotherDic = ["foo": "baz", "spam": "eggs"]
dic.merge(anotherDic)
=> ["foo": "baz", "spam": "eggs"]
times(callback: (Int) -> ())
Invoke a callback n times with callback that takes index
5.times { print("Na") }
=> "NaNaNaNaNa"
times (function: () -> ())
Invoke a callback n times
5.times { (a: Int) -> () in print("\(a) ") }
=> 0 1 2 3 4
isEven
Check if int is even
2.isEven
=> true
1.isEven
=> false
isOdd
Check if int is odd
3.isOdd
=> true
2.isOdd
=> false
digits() -> [Int]
Splits the int into array of digits
4208.digits()
=> [4, 2, 0, 8]
next() -> Int
Get the next int
10.next()
=> 11
prev() -> Int
Get the previous int
10.prev()
=> 9
upTo(limit: Int, callback: () -> ())
Invoke the callback from int up to and including limit
3.upTo(5) {
print("Hi")
}
Prints "HiHiHi"
downTo(limit: Int, callback: () -> ())
Invoke the callback from int down to and including limit
3.upTo(0) {
print("Hi")
}
Prints "HiHiHiHi"
.length
Get the length of the string
"Hello".length
=> 5
=~ str: String -> Bool
Does a regex match of whether regex string on the right is matches the string on the left
"Dollar" =~ "oll"
=> true
* n: Int -> String
Get string concatenated n
times
"Hi Swift! " * 3
=> "Hi Swift! Hi Swift! Hi Swift! "
[i: Int] -> Character?
Get character at a subscript
"Hello World"[6] == "W"
=> true
"Hi"[5]
=> nil
[str: String] -> String?
Returns the substring based on the first regex match passed in the subscript
let proj = "Dollar and Cent"
proj["^.+[^and Cent]"]
=> {Some: "Dollar"}
[r: Range<Int>] -> String
Get substring using subscript notation and by passing a range
"Hello World"[0..<5] == "Hello"
=> true
indexOf(char: Character) -> Int?
Get the start index of character
"hello world".indexOf(Character("0"))!
=> 4
indexOf(str: String) -> Int?
Get the start index of string
"hello world".indexOf("llo")!
=> 2
"hello world".indexOf("illo")
=> nil
indexOf(pattern: String) -> Int?
Get the start index of regex pattern inside the string
"hello world".indexOf(".llo")!
=> 1
split(delimiter: Character) -> [String]
Get an array from string split using the delimiter character
"Hello World".split(" ")
=> ["Hello", "World"]
lstring() -> String
Get string without leading spaces
let leadingSpace = " Hello"
leadingSpace.lstrip()
=> "Hello"
rstring() -> String
Get string without trailing spaces
let trailingSpace = "Hello "
trailingSpace.rstrip()
=> "Hello"
strip() -> String
Get string without leading or trailing spaces
let spaces = " Hello "
spaces.strip()
=> "Hello"
init
Init with regex pattern as string
Regex.init("^Hello.World$") // Regex that matches "Hello World"
matches(testStr: String) -> [AnyObject]
Return matches based on String passed.
let re = Regex.init("^Hello.World$")
re.matches("Hello World")
test(testStr: String) -> Bool
let re = Regex.init("^Hello.World$")
re.matches("Hello World")
=> true
re.matches("Str")
=> false
escapeStr(str: String) -> String
Escape string with regex characters
Regex.escape("Hello.World")
=> "Hello\.World"
==
Check the equality of two ranges
(1...5) == (1...5)
=> true
(1..<5) == (1...5)
=> false
eachWithIndex(callback: (T) -> ())
For each index in the range invoke the callback by passing the item in range
(1...5).eachWithIndex { (a: Int) -> () in print("\(a)") }
=> 12345
each(callback: () -> ())
For each index in the range invoke the callback
(1...5).each { print("Na") }
=> "NaNaNaNaNa"
==
Check the equality of two Equatable Optionals
Optional("hello") == Optional("hello")
=> true
Optional("hello") == Optional("goodbye")
=> false
nil as String? == nil as String?
=> true
If you are interested in contributing checkout CONTRIBUTING.md
If you are interested only in pure functional programming import Dollar
otherwise import Cent
which includes extensions for certain object type such as Array for now but more will be added.


One page report on results of marketing research of neighbourhood interests in sport facilities. Made with plotly, pandas, google forms.
Capstone project on Yandex Data School. Comparation of forecast and actual data of NY Yellow Cab calls by region. Tools: Sklearn, pandas, statsmodels, Altair.
Research notebook available upon request.
Preliminary dashboard prototype for digital signage platform Retail Rotor. Tools: mongo, postgresql, python, pandas, sklearn, javascript, vue, vega.
Take a look on ReRotor presentation (content is mine to)
Concept in one printed page. Final images are made by professional designers but concept, content, layouts and sketches are mine.
My old curriculum vitae as one printing page.
Strategy development consulting project. Project had three stages with dozen presentations and reports on different aspects of organization.Final images are made by professional designers but concept, content, layouts and sketches are mine.
Working presentations for communicating organizational change projects within different stakeholders.


Voice of the Mirror: The Truth will oust the Tories from power
The TV debate showed that real choice is between Labour’s change for the better and more of the same from the tired Tories, the Voice of the Mirror writes
by Voice of the Mirror, https://www.mirror.co.uk/authors/voice-of-the-mirror/Cynical liar Boris Johnson failing to answer a question about truth and personal integrity, with the studio audience laughing at him, summed up an evasive TV performance.
Jeremy Corbyn ’s more honest, direct approach was a refreshing contrast in the first head-to-head of the election campaign.
Corbyn swotted Johnson with the observation we’ve endured nine years of coalition chaos under the Tories and he also scored heavily by condemning NHS suffering and privatisation under the Conservatives.
Johnson sounded a stranger to the truth, so voters are right to ask if they can trust a Tory with a history of lies and broken promises.
This battle is about much more than Brexit , no matter how important Britain’s future in or out of Europe is to a section of the electorate.
We saw last night the real choice is between Labour’s change for the better and more of the same from the tired Tories.
Stop the abuse
There can be no justice for victims of domestic violence when more than 10,000 abusers are walking our streets free, cash-strapped police forces too stretched to enact arrest warrants.
Tory cuts to law and order are criminally unfair when the women beaten by brutal partners and husbands are denied proper protection and those accused of unspeakable offences escape the enfeebled arm of the law.
The Tories have failed to take domestic violence seriously – many more people die at the hands of pitiless partners than terrorists, yet spending’s significantly higher combating terrorism than inhuman brutality in homes.
We need to safeguard the abused – and punish the abusers.
Green blessing
A blessing from the Dalai Lama for our Million Trees campaign is an unexpected blossoming to green the country.
Put down deep roots and this will be a better land with the support of Tibet’s spiritual leader.


{% seo %}
{% include nav.html %}
{{ site.title | append: ' by
Boahen Fred
'}}
Built with all the love in the world
{{ content }}


Arsenal team news: Injury, suspension list vs. Norwich City
Arsenal face Norwich City in the Premier League on Sunday afternoon having made the decision to part ways with manager Unai Emery.
by Darren PlantOn Thursday night, the Gunners succumbed to a 2-1 defeat at the hands of Eintracht Frankfurt in the Europa League, a result which represented their seventh match without a win in all competitions.
Ahead of the trip to Carrow Road, Freddie Ljungberg has been placed in charge on an interim basis, with the Swede looking to stake his claim to be handed the reins until at least the end of the season.
Here, Sports Mole rounds up the latest injury and suspension news for the north Londoners ahead of this fixture.
Dani Ceballos
Status: Out
Type of injury: Thigh
Possible return date: December 21 (vs. Everton)
After sustaining a thigh injury while on international duty with Spain, Ceballos has been ruled out until at least the middle of December.
Sead Kolasinac
Status: Minor doubt
Type of injury: Thigh
Possible return date: December 1 (vs. Norwich)
Kolasinac also picked up an injury while on international duty, with a thigh problem keeping the Bosnia-Herzegovina international out for the last two matches. However, the left-sided defender could return for the trip to Carrow Road.
Rob Holding
Status: Major doubt
Type of injury: Knee
Possible return date: December 1 (vs. Norwich City)
Holding has recently sustained a minor knee problem. Having only recently returned from nine months out due to an injury in the same area, no risks will be taken with his fitness.
Hector Bellerin
Status: Minor doubt
Type of injury: Hamstring
Possible return date: December 1 (vs. Norwich)
While Bellerin missed out against Frankfurt on Thursday night with a tight hamstring, the right-back could return for the visit to Norwich.
David Luiz
Status: Major doubt
Type of injury: Chest
Possible return date: December 1 (vs. Norwich)
Luiz needed to be withdrawn with a chest injury during the first half against Frankfurt. While the issue is only said to be minor, the Brazilian may not be risked on Sunday.
Shkodran Mustafi
Status: Major doubt
Type of injury: Knock
Possible return date: December 1 (vs. Norwich)
Like Luiz, Mustafi was substituted with an injury against Frankfurt, with the German sustaining a knock during the closing stages. At this stage, it is unclear whether the defender will recover in time for the next fixture.
ARSENAL'S SUSPENSION LIST
Arsenal have no players who are absent through suspension this weekend.
body check tags ::


Library Project
Using HTML, CSS, Javascript, Firebase
Title
Author
Pages
Read
add
×
Title
Author
Number of Pages
Read
Not Read
Submit
send


Blue squares are invading! Quickly!


| Parameter | Type | Description |
|---|---|---|
* ng-model
string
|
string |
Assignable angular expression to data-bind to. |
name
string
|
string |
Property name of the form under which the control is published. |
ng-true-value
expression
|
expression |
The value to which the expression should be set when selected. |
ng-false-value
expression
|
expression |
The value to which the expression should be set when not selected. |
ng-change
string
|
string |
Angular expression to be executed when input changes due to user interaction with the input element. |
ng-disabled
expression
|
expression |
En/Disable based on the expression. |
md-no-ink
boolean
|
boolean |
Use of attribute indicates use of ripple ink effects. |
aria-label
string
|
string |
Publish the button label used by screen-readers for accessibility. Defaults to the switch's text. |
md-invert
boolean
|
boolean |
When set to true, the switch will be inverted. |


public class SVM extends StatModel
| Modifier and Type | Field and Description |
|---|---|
static int |
C
|
static int |
C_SVC
|
static int |
CHI2
|
static int |
COEF
|
static int |
CUSTOM
|
static int |
DEGREE
|
static int |
EPS_SVR
|
static int |
GAMMA
|
static int |
INTER
|
static int |
LINEAR
|
static int |
NU
|
static int |
NU_SVC
|
static int |
NU_SVR
|
static int |
ONE_CLASS
|
static int |
P
|
static int |
POLY
|
static int |
RBF
|
static int |
SIGMOID
|
COMPRESSED_INPUT,
PREPROCESSED_INPUT,
RAW_OUTPUT,
UPDATE_MODEL
| Modifier | Constructor and Description |
|---|---|
protected |
SVM(long addr)
|
| Modifier and Type | Method and Description |
|---|---|
static SVM |
__fromPtr__(long addr)
|
private static long |
create_0()
|
static SVM |
create()
|
private static void |
delete(long nativeObj)
|
protected void |
finalize()
|
private static double |
getC_0(long nativeObj)
|
double |
getC()
|
private static long |
getClassWeights_0(long nativeObj)
|
Mat |
getClassWeights()
|
private static double |
getCoef0_0(long nativeObj)
|
double |
getCoef0()
|
private static double |
getDecisionFunction_0(long nativeObj,
int i,
long alpha_nativeObj,
long svidx_nativeObj)
|
double |
getDecisionFunction(int i,
Mat alpha,
Mat svidx)
|
private static long |
getDefaultGridPtr_0(int param_id)
|
static ParamGrid |
getDefaultGridPtr(int param_id)
|
private static double |
getDegree_0(long nativeObj)
|
double |
getDegree()
|
private static double |
getGamma_0(long nativeObj)
|
double |
getGamma()
|
private static int |
getKernelType_0(long nativeObj)
|
int |
getKernelType()
|
private static double |
getNu_0(long nativeObj)
|
double |
getNu()
|
private static double |
getP_0(long nativeObj)
|
double |
getP()
|
private static long |
getSupportVectors_0(long nativeObj)
|
Mat |
getSupportVectors()
|
private static double[] |
getTermCriteria_0(long nativeObj)
|
TermCriteria
|
getTermCriteria()
|
private static int |
getType_0(long nativeObj)
|
int |
getType()
|
private static long |
getUncompressedSupportVectors_0(long nativeObj)
|
Mat |
getUncompressedSupportVectors()
|
private static long |
load_0(java.lang.String filepath)
|
static SVM |
load(java.lang.String filepath)
|
private static void |
setC_0(long nativeObj,
double val)
|
void |
setC(double val)
|
private static void |
setClassWeights_0(long nativeObj,
long val_nativeObj)
|
void |
setClassWeights(Mat val)
|
private static void |
setCoef0_0(long nativeObj,
double val)
|
void |
setCoef0(double val)
|
private static void |
setDegree_0(long nativeObj,
double val)
|
void |
setDegree(double val)
|
private static void |
setGamma_0(long nativeObj,
double val)
|
void |
setGamma(double val)
|
private static void |
setKernel_0(long nativeObj,
int kernelType)
|
void |
setKernel(int kernelType)
|
private static void |
setNu_0(long nativeObj,
double val)
|
void |
setNu(double val)
|
private static void |
setP_0(long nativeObj,
double val)
|
void |
setP(double val)
|
private static void |
setTermCriteria_0(long nativeObj,
int val_type,
int val_maxCount,
double val_epsilon)
|
void |
setTermCriteria(TermCriteria val)
|
private static void |
setType_0(long nativeObj,
int val)
|
void |
setType(int val)
|
private static boolean |
trainAuto_0(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj,
long gammaGrid_nativeObj,
long pGrid_nativeObj,
long nuGrid_nativeObj,
long coeffGrid_nativeObj,
long degreeGrid_nativeObj,
boolean balanced)
|
private static boolean |
trainAuto_1(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj,
long gammaGrid_nativeObj,
long pGrid_nativeObj,
long nuGrid_nativeObj,
long coeffGrid_nativeObj,
long degreeGrid_nativeObj)
|
private static boolean |
trainAuto_2(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj,
long gammaGrid_nativeObj,
long pGrid_nativeObj,
long nuGrid_nativeObj,
long coeffGrid_nativeObj)
|
private static boolean |
trainAuto_3(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj,
long gammaGrid_nativeObj,
long pGrid_nativeObj,
long nuGrid_nativeObj)
|
private static boolean |
trainAuto_4(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj,
long gammaGrid_nativeObj,
long pGrid_nativeObj)
|
private static boolean |
trainAuto_5(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj,
long gammaGrid_nativeObj)
|
private static boolean |
trainAuto_6(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold,
long Cgrid_nativeObj)
|
private static boolean |
trainAuto_7(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj,
int kFold)
|
private static boolean |
trainAuto_8(long nativeObj,
long samples_nativeObj,
int layout,
long responses_nativeObj)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid,
ParamGrid gammaGrid)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid,
ParamGrid gammaGrid,
ParamGrid pGrid)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid,
ParamGrid gammaGrid,
ParamGrid pGrid,
ParamGrid nuGrid)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid,
ParamGrid gammaGrid,
ParamGrid pGrid,
ParamGrid nuGrid,
ParamGrid coeffGrid)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid,
ParamGrid gammaGrid,
ParamGrid pGrid,
ParamGrid nuGrid,
ParamGrid coeffGrid,
ParamGrid degreeGrid)
|
boolean |
trainAuto(Mat samples,
int layout,
Mat responses,
int kFold,
ParamGrid Cgrid,
ParamGrid gammaGrid,
ParamGrid pGrid,
ParamGrid nuGrid,
ParamGrid coeffGrid,
ParamGrid degreeGrid,
boolean balanced)
|
calcError,
empty,
getVarCount,
isClassifier,
isTrained,
predict,
predict,
predict,
train,
train,
train
clear,
getDefaultName,
getNativeObjAddr,
save
public static final int C_SVC
public static final int NU_SVC
public static final int ONE_CLASS
public static final int EPS_SVR
public static final int NU_SVR
public static final int CUSTOM
public static final int LINEAR
public static final int POLY
public static final int RBF
public static final int SIGMOID
public static final int CHI2
public static final int INTER
public static final int C
public static final int GAMMA
public static final int P
public static final int NU
public static final int COEF
public static final int DEGREE
public static SVM __fromPtr__(long addr)
public Mat getClassWeights()
public Mat getSupportVectors()
public Mat getUncompressedSupportVectors()
public static ParamGrid getDefaultGridPtr(int param_id)
public static SVM create()
public static SVM load(java.lang.String filepath)
public TermCriteria getTermCriteria()
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid, ParamGrid pGrid, ParamGrid nuGrid, ParamGrid coeffGrid, ParamGrid degreeGrid, boolean balanced)
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid, ParamGrid pGrid, ParamGrid nuGrid, ParamGrid coeffGrid, ParamGrid degreeGrid)
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid, ParamGrid pGrid, ParamGrid nuGrid, ParamGrid coeffGrid)
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid, ParamGrid pGrid, ParamGrid nuGrid)
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid, ParamGrid pGrid)
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid, ParamGrid gammaGrid)
public boolean trainAuto(Mat samples, int layout, Mat responses, int kFold, ParamGrid Cgrid)
public double getC()
public double getCoef0()
public double getDegree()
public double getGamma()
public double getNu()
public double getP()
public int getKernelType()
public int getType()
public void setC(double val)
public void setClassWeights(Mat val)
public void setCoef0(double val)
public void setDegree(double val)
public void setGamma(double val)
public void setKernel(int kernelType)
public void setNu(double val)
public void setP(double val)
public void setTermCriteria(TermCriteria val)
public void setType(int val)
protected void finalize() throws java.lang.Throwable
private static long getClassWeights_0(long nativeObj)
private static long getSupportVectors_0(long nativeObj)
private static long getUncompressedSupportVectors_0(long nativeObj)
private static long getDefaultGridPtr_0(int param_id)
private static long create_0()
private static long load_0(java.lang.String filepath)
private static double[] getTermCriteria_0(long nativeObj)
private static boolean trainAuto_0(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj, long gammaGrid_nativeObj, long pGrid_nativeObj, long nuGrid_nativeObj, long coeffGrid_nativeObj, long degreeGrid_nativeObj, boolean balanced)
private static boolean trainAuto_1(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj, long gammaGrid_nativeObj, long pGrid_nativeObj, long nuGrid_nativeObj, long coeffGrid_nativeObj, long degreeGrid_nativeObj)
private static boolean trainAuto_2(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj, long gammaGrid_nativeObj, long pGrid_nativeObj, long nuGrid_nativeObj, long coeffGrid_nativeObj)
private static boolean trainAuto_3(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj, long gammaGrid_nativeObj, long pGrid_nativeObj, long nuGrid_nativeObj)
private static boolean trainAuto_4(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj, long gammaGrid_nativeObj, long pGrid_nativeObj)
private static boolean trainAuto_5(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj, long gammaGrid_nativeObj)
private static boolean trainAuto_6(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold, long Cgrid_nativeObj)
private static boolean trainAuto_7(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj, int kFold)
private static boolean trainAuto_8(long nativeObj, long samples_nativeObj, int layout, long responses_nativeObj)
private static double getC_0(long nativeObj)
private static double getCoef0_0(long nativeObj)
private static double getDecisionFunction_0(long nativeObj, int i, long alpha_nativeObj, long svidx_nativeObj)
private static double getDegree_0(long nativeObj)
private static double getGamma_0(long nativeObj)
private static double getNu_0(long nativeObj)
private static double getP_0(long nativeObj)
private static int getKernelType_0(long nativeObj)
private static int getType_0(long nativeObj)
private static void setC_0(long nativeObj, double val)
private static void setClassWeights_0(long nativeObj, long val_nativeObj)
private static void setCoef0_0(long nativeObj, double val)
private static void setDegree_0(long nativeObj, double val)
private static void setGamma_0(long nativeObj, double val)
private static void setKernel_0(long nativeObj, int kernelType)
private static void setNu_0(long nativeObj, double val)
private static void setP_0(long nativeObj, double val)
private static void setTermCriteria_0(long nativeObj, int val_type, int val_maxCount, double val_epsilon)
private static void setType_0(long nativeObj, int val)
private static void delete(long nativeObj)


The TC10-interacting protein CIP4/2 is required for insulin-stimulated Glut4 translocation in 3T3L1 adipocytes.
The GTPase TC10 plays a critical role in insulin-stimulated glucose transport. We report here the identification of the TC10-interacting protein CIP4/2 (Cdc42-interacting protein 4/2) as an effector in this pathway. CIP4/2 localizes to an intracellular compartment under basal conditions and translocates to the plasma membrane on insulin stimulation. Overexpression of constitutively active TC10 brings CIP4/2 to the plasma membrane, whereas overexpression of an inhibitory form of TC10 blocks the translocation of CIP4/2 produced by insulin. Overexpression of mutant forms of CIP4/2 containing an N-terminal deletion or with diminished TC10 binding inhibits insulin-stimulated Glut4 translocation. These data suggest that CIP4/2 may play an important role in insulin-stimulated glucose transport as a downstream effector of TC10.


To create chaotic but pleasant images we often do not want to use random.
🢂 We want to smoothly interpolate between the random peaks
Lets play with this, can we use this noise to
🢂 Useful to get a feel for how to scale or speed up the noise
Interpolates between four corners instead of 2 points
The previous noise is called value noise because it is based on interpolations between random values
It still looks pretty blocky, luckily Perlin did not stop!
Here is a comparison of value noise and gradient noise:
The latest masterpiece of Perlin
🢂 Every noise implementation looks and behaves a bit differently and can be better for different situations
🢂 Here is a more detailed breakdown how they are constructed


The assign.mcmc function uses a Bayesian sparse factor analysis model to estimate the adaptive baseline/background, adaptive pathway signature, and pathway activation status of individual test (disease) samples.
assign.mcmc(Y, Bg, X, Delta_prior_p, iter = 2000, adaptive_B = TRUE, adaptive_S = FALSE, mixture_beta = TRUE, sigma_sZero = 0.01, sigma_sNonZero = 1, p_beta = 0.01, sigma_bZero = 0.01, sigma_bNonZero = 1, alpha_tau = 1, beta_tau = 0.01, Bg_zeroPrior = TRUE, S_zeroPrior = FALSE, ECM = FALSE)
| Y | The G x J matrix of genomic measures (i.g., gene expression) of test samples. Y is the testData_sub variable returned from the data.process function. Genes/probes present in at least one pathway signature are retained. |
|---|---|
| Bg | The G x 1 vector of genomic measures of the baseline/background (B). Bg is the B_vector variable returned from the data.process function. Bg is the starting value of baseline/background level in the MCMC chain. |
| X | The G x K matrix of genomic measures of the signature. X is the S_matrix variable returned from the data.process function. X is the starting value of pathway signatures in the MCMC chain. |
| Delta_prior_p | The G x K matrix of prior probability of a gene being "significant" in its associated pathway. Delta_prior_p is the Pi_matrix variable returned from the data.process function. |
| iter | The number of iterations in the MCMC. The default is 2000. |
| adaptive_B | Logicals. If TRUE, the model adapts the baseline/background (B) of genomic measures for the test samples. The default is TRUE. |
| adaptive_S | Logicals. If TRUE, the model adapts the signatures (S) of genomic measures for the test samples. The default is FALSE. |
| mixture_beta | Logicals. If TRUE, elements of the pathway activation matrix are modeled by a spike-and-slab mixture distribution. The default is TRUE. |
| sigma_sZero | Each element of the signature matrix (S) is modeled by a spike-and-slab mixture distribution. Sigma_sZero is the variance of the spike normal distribution. The default is 0.01. |
| sigma_sNonZero | Each element of the signature matrix (S) is modeled by a spike-and-slab mixture distribution. Sigma_sNonZero is the variance of the slab normal distribution. The default is 1. |
| p_beta | p_beta is the prior probability of a pathway being activated in individual test samples. The default is 0.01. |
| sigma_bZero | Each element of the pathway activation matrix (A) is modeled by a spike-and-slab mixture distribution. sigma_bZero is the variance of the spike normal distribution. The default is 0.01. |
| sigma_bNonZero | Each element of the pathway activation matrix (A) is modeled by a spike-and-slab mixture distribution. sigma_bNonZero is the variance of the slab normal distribution. The default is 1. |
| alpha_tau | The shape parameter of the precision (inverse of the variance) of a gene. The default is 1. |
| beta_tau | The rate parameter of the precision (inverse of the variance) of a gene. The default is 0.01. |
| Bg_zeroPrior | Logicals. If TRUE, the prior distribution of baseline/background level follows a normal distribution with mean zero. The default is TRUE. |
| S_zeroPrior | Logicals. If TRUE, the prior distribution of signature follows a normal distribution with mean zero. The default is TRUE. |
| ECM | Logicals. If TRUE, ECM algorithm, rather than Gibbs sampling, is applied to approximate the model parameters. The default is FALSE. |
The iter x K x J array of the pathway activation level estimated in every iteration of MCMC.
The iter x G matrix of the precision of genes estimated in every iteration of MCMC
The iter x K x J array of probability of pathway being activated estimated in every iteration of MCMC.
The iter x K x J array of pathway activation level (adjusted beta scaling between 0 and 1) estimated in every iteration of MCMC.)
The iter x G x K array of signature estimated in every iteration of MCMC.
The iter x G x K array of binary indicator of a gene being significant estimated in every iteration of MCMC.
The assign.mcmc function can be set as following major modes. The combination of logical values of adaptive_B, adaptive_S and mixture_beta can form different modes.
Mode A: adaptive_B = FALSE, adaptive_S = FALSE, mixture_beta = FALSE. This is a regression mode without adaptation of baseline/background, signature, and no shrinkage of the pathway activation level.
Mode B: adaptive_B = TRUE, adaptive_S = FALSE, mixture_beta = FALSE. This is a regression mode with adaptation of baseline/background, but without signature, and with no shrinkage of the pathway activation level.
Mode C: adaptive_B = TRUE, adaptive_S = FALSE, mixture_beta = TRUE. This is a regression mode with adaptation of baseline/background, but without signature, and with shrinkage of the pathway activation level when it is not significantly activated.
Mode D: adaptive_B = TRUE, adaptive_S = TRUE, mixture_beta = TRUE. This is a Bayesian factor analysis mode with adaptation of baseline/background, adaptation signature, and with shrinkage of the pathway activation level.
mcmc.chain <- assign.mcmc(Y=processed.data$testData_sub, Bg = processed.data$B_vector, X=processed.data$S_matrix, Delta_prior_p = processed.data$Pi_matrix, iter = 20, adaptive_B=TRUE, adaptive_S=FALSE, mixture_beta=TRUE)#>#>


Gradient sampler for the quadratic loss in LeCun , Schaul, Zhang (2013). More...
#include <stochasticTools.h>
Public Member Functions | |
| stochasticGradientQuadratic (const mat &__H, const mat &__Sigma, const mat &__alpha_optimal) | |
| mat | H () const |
| mat | Sigma () const |
| int | par_dim () const |
| mat | alpha_optimal () const |
| template<class _UniformRandomNumberGenerator > | |
| mat | operator() (_UniformRandomNumberGenerator &__urng, const mat &__alpha) |
Gradient sampler for the quadratic loss in LeCun , Schaul, Zhang (2013).
Gradient sampler for the loss function
where and is a standard normal random variable. Vectors like are row vectors and the matrices are square matrices.The default parameters are two identity matrices and the zero vector.
|
inline |
Constructs the gradient sampler with parameters .
Check that dimensions are consistent
|
inline |
Gets alpha_optimal
|
inline |
Gets H
|
inline |
Gets par_dim
|
inline |
Gets Sigma


Using the Ether Delta smart contract and Fork Delta order book source code, Blockchain Exchange is a semi-decentralized exchange for ERC20 tokens use off-chain order book with the on-chain settlement. The majority of the operation will handle direct on the Blockchain thereby traders never has to go for the ownership for their tokens, enabling the whole system to deal with money transfers and execute trades in a trustless manner.
Unlike centralized exchange decentralized exchange does not depend on any central authority to store user’s fund and facilitate trade. In the case of Blockchain Exchange, funds are stored in a smart contract hosted on the Ethereum network. Trade will occur between user’s wallet and the smart contract.
Just click on the account which is at the top right of trading view and then click on new account. A new address and the private key will generate automatically.
It is very easy! Click on deposit which is at the top left of balance view, select the amount of either Ethereum or tokens you would like to deposit. After that you will be ask to sign or accept the transaction. Once the transaction has been sent, your fund will be deposited into the Ethereum smart contract securely. Then, you will be able to trade on Blockchain Exchange with those funds.
Click on withdraw which is at the top left of balance view, select the amount of either Ethereum or tokens you would like to withdraw. After that you will be ask to sign or accept the transaction. Once the transaction has been sent, you can withdraw your fund securely into your Ethereum account.
It entirely depends on speed of the Ethereum network. In case if you would like to deposits or withdraw your funds quickly then you have to pay higher gas price for your transaction. Generally, in normal gas price withdraw or transfer does not take longer than 5 minutes. However, when the Ethereum network is clogged, transactions could be delayed.
In Blockchain Exchange, you can trade extensive number of tokens that are available on the Ethereum network. We have a dexterous team of professionals who list as many token as possible. You can found the listed tokens at the dropdown near the upper left section of Blockchain Exchange.
You can place an order once funds have been place in the smart contract. If you would like to create a new buy or sell order then find the new order section. Select the buy or sell option and enter the token amount you would like to buy or sell, the price, the expiration time, and hit buy/sell. After that you have to sign the transaction, so that it can be sent to the order book. Once a taker for your order has been found, Blockchain Exchange will use that sign order to execute a trade using the smart contract Ethereum network.
To take your existing order click on the order that you would like to take in the order book. After that a window will appear that will ask you to specify the amount you would like to take. Afterclicking on buy or sell,you will then be prompted to sign the transaction, so that your trade can be sent to the smart contract. Blockchain Exchange will give you a transaction ID and link. You can track your trade status by this link.
Go to My transactions section and click the orders tab. On order tab you will get your listed order with a link to cancel them. You will be asked to sign a transaction in order to cancel the order.
There are two fees associated with Blockchain Exchange. The first is the small Ethereum fee while signing the transactions to the Ethereum network and the second is a 0.3% on execution of orders.
It is very easy, you just need to click on the drop down at the top right of Blockchain Exchange (where you created your account) and click on “Gas Price”at the bottom of that menu. Then, you can set the gas price using Gwei denomination.
To cancel an order, take a look at the My Transactions section and click the Orders tab. Your active orders will be listed there with a link to cancel them. You will be asked to sign a transaction in order to cancel the order.
Using the Ether Delta smart contract and Fork Delta order book source code, Blockchain Exchange is a semi-decentralized exchange for ERC20 tokens use off-chain order book with the on-chain settlement. The majority of the operation will handle direct on the Blockchain thereby traders never has to go for the ownership for their tokens, enabling the whole system to deal with money transfers and execute trades in a trustless manner.
Unlike centralized exchange decentralized exchange does not depend on any central authority to store user’s fund and facilitate trade. In the case of Blockchain Exchange, funds are stored in a smart contract hosted on the Ethereum network. Trade will occur between user’s wallet and the smart contract.
Just click on the account which is at the top right of trading view and then click on new account. A new address and the private key will generate automatically.
It is very easy! Click on deposit which is at the top left of balance view, select the amount of either Ethereum or tokens you would like to deposit. After that you will be ask to sign or accept the transaction. Once the transaction has been sent, your fund will be deposited into the Ethereum smart contract securely. Then, you will be able to trade on Blockchain Exchange with those funds.
Click on withdraw which is at the top left of balance view, select the amount of either Ethereum or tokens you would like to withdraw. After that you will be ask to sign or accept the transaction. Once the transaction has been sent, you can withdraw your fund securely into your Ethereum account.
It entirely depends on speed of the Ethereum network. In case if you would like to deposits or withdraw your funds quickly then you have to pay higher gas price for your transaction. Generally, in normal gas price withdraw or transfer does not take longer than 5 minutes. However, when the Ethereum network is clogged, transactions could be delayed.
In Blockchain Exchange, you can trade extensive number of tokens that are available on the Ethereum network. We have a dexterous team of professionals who list as many token as possible. You can found the listed tokens at the dropdown near the upper left section of Blockchain Exchange.
You can place an order once funds have been place in the smart contract. If you would like to create a new buy or sell order then find the new order section. Select the buy or sell option and enter the token amount you would like to buy or sell, the price, the expiration time, and hit buy/sell. After that you have to sign the transaction, so that it can be sent to the order book. Once a taker for your order has been found, Blockchain Exchange will use that sign order to execute a trade using the smart contract Ethereum network.
To take your existing order click on the order that you would like to take in the order book. After that a window will appear that will ask you to specify the amount you would like to take. Afterclicking on buy or sell,you will then be prompted to sign the transaction, so that your trade can be sent to the smart contract. Blockchain Exchange will give you a transaction ID and link. You can track your trade status by this link.
Go to My transactions section and click the orders tab. On order tab you will get your listed order with a link to cancel them. You will be asked to sign a transaction in order to cancel the order.
There are two fees associated with Blockchain Exchange. The first is the small Ethereum fee while signing the transactions to the Ethereum network and the second is a 0.3% on execution of orders.
It is very easy, you just need to click on the drop down at the top right of Blockchain Exchange (where you created your account) and click on “Gas Price”at the bottom of that menu. Then, you can set the gas price using Gwei denomination.
To cancel an order, take a look at the My Transactions section and click the Orders tab. Your active orders will be listed there with a link to cancel them. You will be asked to sign a transaction in order to cancel the order.


Ooops!!! 500
Looks like something went wrong! (500)
We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.
We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.


Tutorial: Javascript ES6 (ES2015), get started quickly with babel v6+, Gulp, Browserify and Use Arrow Functions, Classes, Import syntax…
Javascript Tutorial: How to set up Gulp for Developing ES2015 React v0.14+ Applications with Babelify & Browserify


|
The Turner DiariesThis is the white supremacist, anti-government hate literature that inspired Timothy McVeigh to blow up the Alfred P. Murrah federal building in Oklahoma City. It was written in 1978 by the now-deceased Dr. William Pierce, founder of the white supremacist organization known as the National Alliance. (The listed author, "Andrew Macdonald," was just a nom de plume.)The Turner Diaries tells the tale of Earl Turner, a righteous, upstanding caucasian who joins an underground resistance movement after the Jew-Negro conspiracy completed its overthrow of the United States government. And, if you haven't already guessed, the book is written in the form of a diary. The journals recount in vivid detail what it was like to live through the hellish days of November 1989, when the Zionists and their Negro henchmen finally went door-to-door, confiscating everyone's guns. This was the last straw, triggering full-blown guerrilla warfare against the apparatus of the government. The race war was remarkably one-sided. The white supremacist forces rolled on to victory after victory, beginning with California. Which is where they demonstrated the lengths to which one has to go in order to achieve permanent victory:
Coming through the mountains just north of Los Angeles we encountered a long column of marchers, heavily guarded by GI's and Organization personnel. As we drove slowly past, I observed the prisoners closely, trying to decide what they were. They didn't seem to be Blacks or Chicanos, and yet only a few of them appeared to be Whites. Many of the faces were distinctly Jewish, while others had features or hair suggesting a Negroid taint. The head of the column turned off the main roadway into a little-used ranger trail which disappeared into a boulder-strewn canyon, while the tail stretched for several miles back toward the city. There may have been as many as 50,000 marchers, representing all ages and both sexes, just in the portion of the column we passed.  They used an ammonium nitrate-fuel oil truck bomb to accomplish this feat, which is ultimately what suggested the idea to McVeigh. Some people claim that McVeigh's truck bomb was an homage to the one described in the book, but there are really only so many variables you can play with when you assemble an ANFO bomb. And anything that size is going to require a truck to move it.
The Organization inexorably rolled on to victory after victory, like an Aryan juggernaut. It all eventually culminated in Turner's strike against the Pentagon, which consisted of a light plane kamikaze attack with an onboard 60-kiloton nuclear bomb. But not before Earl got to recite his histrionic farewell address:
"Brothers! Two years ago, when I entered your ranks for the first time, I consecrated my life to our Order and to the purpose for which it exists. But then I faltered in the fulfillment of my obligation to you. Now I am ready to meet my obligation fully.  Do you accept it?" Wow, what discipline. You have to assume that the crowd spent the day practicing that reply, or else they were reading from cue cards. Like his protagonist Earl Turner, Pierce himself was a zealot who aspired to go down in Whitey History. His self-appointed role was that of the Thomas Paine of his movement, whose works were intended to motivate the White Man into restoring our nation's racially-intolerant glory. Of course, the Founding Fathers never advocated premeditated genocide or the slaughtering of whole cities. But Pierce was probably confident that if George Washington could have known that the mongrels would eventually take control of his beloved democracy, the Father of Our Country would have personally launched a global extermination campaign against the alien races. As literature, of course, it's nothing but an abject failure. The writing is stiff, the characters are ridiculously one-dimensional, the plot monotonous, and the premise as droll as you can get. The end result comes off sounding like it was written by a skinhead stuck in study hall for a week with nothing else to do. Above all, the book is just plain boring. But if you read it for insight into the dreams of a committed white supremacist, it might be worthwhile. Just be sure to keep an abundant supply of caffeine handy. |


compute-prior-dist <number of bins> <psp file>
Computes the distribution of priors from a file in MEME PSP format. The distribution is scaled and binned into the number of bins specified on the command line.
The number of increments to scale the distribution into.
The name of a PSP file in MEME PSP format.
The output is sent to standard output, and contains one number per line.
The first two lines are the minimum and maximum priors. Each succeeding line contains the probability that a prior is in the bin.
The prior is derived from the bin number (counting from 0) using the formula:
prior = ((bin #) / (num bins - 1) * (max prior - min prior)) + (min prior)
See the sample output.
There are no optional arguments.


Endless Plains [am68], plain, in Imperia, peasants: 100
Last updated Turn #111
Endless Plains [am68], plain, in Imperia, peasants: 100
------------------------------------------------------------------------
21: Rond Mertian [w2j], refugee, arrived from the north.
23: Rond Mertian [w2j], refugee, went south.
23: Band of thieves [gn7u], bandits, number: 20, arrived from the west.
Routes leaving Endless Plains:
North, plain, to Endless Plains [al68], 7 days
East, plain, to Endless Plains [am69], 7 days
Garrison [dm3p], garrison, Imperial Empire, with six peasants
South, mountain, to Imperial Mountains [an68], 10 days
West, plain, to Endless Plains [am67], 7 days
It is raining.
Seen here:
Stack of centaurs [go2q], centaurs, number: 39
Stack of nazgul [bx7l], nazgul, number: 4
Mob [er2p], angry peasants, number: 26, on guard
Rond Mertian [w2j], refugee
Band of thieves [gn7u], bandits, number: 19


Technical Project Manager 👩🏼💻
March 2015 - September 2020
Used TypeScript, JavaScript, CSS, HTML to create custom campaigns for clients globally. Used elements in the DOM and datalayer to better target users.
Worked closely with the product and engineering team, provided feedback on the platform and participated in the weekly sprint as well as took part in UAT sessions for new features.
Managed a team of four and worked with them to help them grow in their roles. Made sure each had a personal development plan in place to help them grow professionally and in their roles.
Moved the task management for the project management team from SalesForce to JIRA. Updated the internal worklfow to improve processes and increase speed of delivery to the clients.
Worked closely with the sales and account management teams globally to ensure value is delivered to all clients. Owned the technical setup for new and existing clients in the US market.


Honestly speaking, these 'About me' sections are so hard to write; there's either so much to say
that you don't know where to start, or there is nothing to say at all. But I'll give it a go.
I'm a data-enabled software engineering professional with focus on cross-functional enterprise
applications and data acccess platforms. Architecting and building highly available, performant
and scalable distributed
systems. Industry experience with writing RESTful APIs, backend design, efficient data access layers, big data,
modeling/warehousing, and building ETL pipeline
solutions.
Having had the fortune of working on both software enineering and big data architecture,
I bring in a diverse set of skills and an end-to-end expertise in clean and efficient coding,
practical knowledge of design patterns(for APIs as well as database solutions) and test-driven
development.
I'm also a chronic automator and web scraper, which blends in well with my innate
DRY(Don't-Repeat-Yourself) personality type. Besides my work, I also work on creating pro-bono
infomercial products aimed at teaching software development to the less priviledged.
Quite recently, I joined Thoughtworks Inc. as a Sr. Data Engineer(Remote). Super stoked to start this new journey!!
In the recent past, I was working with
with Deloitte in their Analytics and Technology practice. The sheer exposure to range of technology at my
workplace has made me comfortable working fullstack and back - right from digging into css, to
writing APIs, to creating batch/streaming backend solutions.
I write software backends that power
performant data analytics platforms for leading banks across the globe. I also have previous experience working
with top US Pharma giants, mainly on optimizing their data
refineries & adjusting Incentive Compensation programmes. Banking and Pharma - needless to say, code that I commit has to respect the country specific boundaries, regulations and policies. But
this complexity drives me to create simple yet maintainable solutions.
When I'm not fighting fire at home, I enjoy automating mundane tasks on the web (admittedly a
life-hacker). I keep keen interest in shortform video editing - a skill I picked up while
creating inhouse tutorial videos for firms I work(ed) at.Other interests include pondering about
life, sometimes long enough to drop
nuggets of wisdom - I'm my personal 'quote philosopher'. Besides that, I also have a penchant
for humor, memes & staying woke.
Worked in large scale data refining and incentive compensation programs for sales representatives. Clients included Top 5 Pharma companies in USA and Europe.
Development of confidential data and reporting platform on graduation completion and retention rates based on demographics - age, race & gender. End-users/Stakeholders incuded Board of Directors at Texas A&M University.
Clients include top 3 banks in USA. Worked mainly in Transaction Monitoring and KYC(Know Your Customer) analysis. Dealt with Data Engineering, Software Architecture, Python automation, Machine Learning applications in FinTech as well as developing scalable backend for a data curation SAAS tool.
Key accomplishments:
Key core courses completed:
One fine day during the last Christmas vacation, my broken earphone led me to investigate a notorious bot culture on Amazon.
Linkedin article Github link Nbviewer linkWrote a couple of blogposts to simplify understanding and highlight importance of OOPs at the backdrop of test driven development
Read part 1 Read part 2Using built in Unix tools to download all the artwork hosted by the newly opened Louvre website
Read Blog YT screencastThis was the week when Microsoft overtaking Apple was the breaking news. I tried to source external data & plot this decade long game of catch-up.
Github link Nbviewer linkA genuine request from my cousin to list all 'h1b sponsoring' companies for Data Science/ML positions. My very first UNPAID freelancing gig. Thanks a lot, cousin!
Github link Nbviewer linkWeekend long hackathon conducted by Analytics Vidhya to predict loan defaults. Surprisingly only adding a couple of simple features worked superbly!
Github link Nbviewer linkJust a fun scraping project to get press briefings data from official state.gov website. Then plotting annual heatmaps to compare Obama & Trumps first 2 years in White house.
Github link Nbviewer linkThis is still work in progress. Trying to classify whether a tweet is humorous or not. My capstone project for Machine Learning Guild.
Github link Nbviewer linkCreated skeleton for now. Add more info here.
Github link


Project Description
The goal of the project was to create a realistic open ocean surface using height maps and normal maps.
To create a more realistic look, the color of the water comes from the value of the reflection vectors intersection with the skybox. Specular lighting is also implemented wiht a fixed light source.


--- title: Getting Started ---
This page gives an overview on how to deploy and use Chronos. To learn more about Chronos itself, check the about page. To get an overview on what Chronos can do for you, check the features page.
There are different approaches on how to setup Chronos. The easiest and recommend way is to use the install script. The GitHub readme outlines the necessary steps to install Chronos Control using the provided install script. Please make sure to check the requirements section and to install missing software if required.
If you already have an evaluation client for your system you now need to connect it with Chronos Control. In the Chronos terminology, the module which handles this communication is called Chronos Agent. We provide a reference implementation of Chronos Agent in Java. We recommend using this implementation for your projects because it supports all available features.
If you are using a non-jvm language, it is possible to write your own Chronos Agent. The whole communication between Chronos Agent and Chronos Control is REST-based which makes it easy to implement. Please get in touch with us if you implemented our own Chronos Agent library and consider sharing it.
With the MongoDB Demo Client we provide a demo implementation of an evaluation client supporting Chronos. This implementation wraps the Yahoo YCSB benchmark. Check ChronosAgent.java to see how simple it is to enable an existing benchmark to be used with Chronos.
Please consider making Chronos even better by contributing to its development. This does not necessarily mean writing code; also contributions to this website or a documentation are equally appreciated. Please get in touch with us in case you are interested.
Open source software is from anyone for anyone. Here a few suggestions what you can do:
Please let us know if you have troubles with setting-up or using Chronos. Please either open an issue on GitHub or directly get in touch with us via e-mail.
Also if we did a good job and you have no issues with Chronos we are very happy to hear from you. Getting feedback on how Chronos improves your workflow motivates us to continuously improve Chronos and to add additional features.


Scrawl.js
- demonstration 209
Position DOM elements using pivot
Extensions: shape, phrase, path, wheel, stacks
0%
20%
40%
60%
80%
100%
0%
20%
40%
60%
80%
100%
0%
20%
40%
60%
80%
100%
0%
20%
40%
60%
80%
100%
0%
20%
40%
60%
80%
100%
0%
20%
40%
60%
80%
100%
0%
20%
40%
60%
80%
100%
Scenario:
???
Actions:
???
Known browser issues:
???
Result images:


Navbar Link
menu
Virtual Conferencing and Social VR
Virtual Reality as a medium for scholarly and social interaction
In conjunction with the conference on the Digital Reading Condition at Aarhus University (February 11, 2021), we have created these VR rooms for attendees and guests
Room 1
Room 2
Room 3
Room 4
All these rooms are identical, but occupancy is limited to 25. Join any one by clicking on the button. If that room is full, please try the next.


Sign up for Our Newsletter But I must explain to you how all this istaken idea of denouncing. SUBSCRIBE


Either, or both. This is a design decision.
Floating point would probably be best for a real application, but, to simplify things let us:
int
variable.integer
arithmetic.int
.
All this work will be done with the methods and variables
of a FahrConvert
object.
With these decisions made,
the application code can be sketched out:
public class FahrConvert { int fahrTemp ; // input from the user: Fahrenheit temperature int celsTemp ; // result: Celsius temperature public FahrConvert() // constructor for FahrConvert { . . . . . } // The application public void convert( ) { celsTemp = ((fahrTemp-32) * 5) / 9; } . . . . . public static void main ( String[] args ) { FahrConvert fahr = new FahrConvert() ; . . . . . } }
We could continue on from here and develop a non-GUI application where main()
does input and output.
You might do this if you wanted to debug the application code before working on the
GUI.
Now give some thought to the graphical interface.


Ask a judge to make a repayment plan
The court affordability calculator has determined a new repayment plan as the most the defendant can afford to repay.
| Regular payments of | £75 | |
| Frequency of payments | Weekly | |
| Make the first payment on | 1 {{ now | date("add", 1, "month") | date( "MMMM YYYY" ) }} | |
| Last payment on | 1 {{ now | date("add", 13, "month") | date( "MMMM YYYY" ) }} | |
| Length of repayment plan | 1 year |


Provides configuration objects that are used to control how each of the different series types will be rendered.


The union keyword can be used along with a bitfeild. Here's an example of some syntax.
//Defines a special datatype for reading/writing
//from our a hardware register controlling some LEDs
//and a servo.
typedef union
{
struct
{
uint8_t firstLedBit :1;
uint8_t secondLedBit :1;
uint8_t reservedBitsA :2;
uint8_t servoControlBit :1;
uint8_t reservedBitsB :3;
} bits;
unsigned char rawRegisterValue;
}hwControlReg_t;
int main(void)
{
hwControlReg_t writeHwControlData;
//Init all the bits in the register to 0;
writeHwControlData.rawRegisterValue = 0;
//A function defined elsewhere that writes
//the data we give it to the control register.
WriteToRegister(writeHwControlData);
//Turn on on the first LED.
writeHwControlData.bits.firstLedBit = 1;
//REMEMBER: overwrites the entire register.
//Stores the value 00000001 into the register,
//clobbering any data that was there before.
//To write only single bits in the register
//at a time, see the section on Bit Manipulation
WriteToRegister(writeHwControlData);
//Turn on the second LED
writeHwControlData.bits.secondLedBit = 1;
return 0;
}
When the union and bitfeild are used together, it allows for granular control of the individual bits, and for easily writing to all of the bits at once.
The syntax is a little dense, so don't feel bad if it still looks like magic. Here is a break down of what each part is doing.
typedef union //"typedef" means a new type is going to be defined.
//"union" means the type will have two or more ways
// it can be read (or written).
{
struct // UNION PART 1: Can be read as a struct
{
//The struct in question contains a
//bitfield.
uint8_t firstLedBit :1;
uint8_t secondLedBit :1;
uint8_t reservedBitsA :2;
uint8_t servoControlBit :1;
uint8_t reservedBitsB :3;
/**** The bitfeild looks like this in memory: ********
Bit: Use:
1 used for firstLED.
2 used for secondLED.
3 These two bits reserved (not currently in use.)
4 "
5 used for servo control.
6 Last three bits reserved.
7 "
8 "
******************************************************/
} bits;
unsigned char rawRegisterValue; //UNION PART 2: can be read as an 8-bit character.
}hwControlReg_t; //Our new type will be called a "hwControlReg_t".
© 2017


Small-budget films need govt. support: actor
by Special CorrespondentThe government should encourage good films made on small budgets, actor Santhosh Keezhattoor has said. “It is very difficult for such films even to get theatres for screening,” he told reporters here on Thursday.
Odunnon, in which Santhosh plays the lead, releases on Friday. “It is a film that talks about some relevant issues and has been received well after it was previewed,” he said. “Such films need all the encouragement.”
Odunnon marks the directorial debut of Noushad Ibrahim, a seasoned theatre actor and winner of the Kerala Sangeetha Nataka Academy Award. “The film is about a man who is haunted by his fear of snakes,” he said. “It may talk about serious issues but it is not made as a so-called art film.”
The film’s producer Sathyan Koyilandy said he had to face a lot of issues because of the attitude of some officials of the Animal Welfare Board of India. “Since the film has scenes involving snakes, we needed their permission and it proved such a major problem,” he said. “The film’s release was delayed by two years and a half because of that”.


Japanese Fairy Tales
by Yei Theodora Ozaki
This is a collection of Japanese fairy tales translated by Yei Theodora Ozaki based on a version written in Japanese by Sadanami Sanjin. According to Ozaki, "These stories are not literal translations, and though the Japanese story and all quaint Japanese expressions have been faithfully preserved, they have been told more with the view to interest young readers of the West than the technical student of folk-lore." Ozaki freely added to and changed the original stories for color and background.
Source: Ozaki, Y.T. (1908). Japanese Fairy Tales. New York: A.L.Burt Company.
- The Adventures of Kintaro, the Golden Boy
- The heroic adventures of Kintaro.
- The Bamboo-Cutter and the Moon-Child
- A bamboo cutter finds a small, luminescent girl, and raises her as Princess Moonlight. She refuses all suitors, befriends the Emperor, and eventually returns to her rightful home, the Moon.
- The Farmer and the Badger
- A badger kills a farmer’s wife, and the farmer asks a rabbit to get revenge for him.
- The Goblin of Adachigahara
- priest looks for lodging in the night and is given shelter by an old woman. She goes to gather more wood, and she tells him not to look in the back room. Curiosity gets the better of him, and he looks in the room and sees horrible things. He realizes she is the Goblin of Adachigahara, and flees. She chases him through the night, but he prays to Buddha and keeps running. Morning dawns, making the goblin disappear, and the priest is safe.
- The Happy Hunter and the Skillful Fisher
- The brothers The Happy Hunter and The Skillful Fisherman change occupational places one day. The Hunter does not know how to fish, and loses his brother’s hook. The Skillful Fisherman is very angry and demands his hook back. The Hunter searches and searches to no avail, until an old man appears and tells him to travel to the Sea King’s realm to find the hook. He does so, and finds the hook and makes many new friends. He stays in the Sea King’s realm for three years, and then he returns to land. He gives the hook to his brother, and the brother is angry that he no longer has an excuse to steal his brother’s wealth and title. The Skillful Fisherman then plots to kill his brother, but the Happy Hunter thwarts his plan by using talismans given to him by the Sea King. The Skillful Fisherman is thus impressed by his brother’s power and vows to be obedient to him from then on.
- The Jelly Fish and the Monkey
- The jelly fish, who originally had a shell and four legs, fails in a mission for the Dragon King of the Sea. As punishment his bones are removed, and he is beaten into a pulp. Thus the modern jelly fish was created.
- The Mirror of Matsuyama
- A husband gives his wife a mirror, and when she is on her deathbed, she gives it to her daughter. The daughter thinks she sees her mother’s soul in it and spends much time staring into it after her father remarries. The stepmother begins resenting the daughter’s relationship with her father and starts to hate her; she thinks the daughter is doing black magic to curse her, and she tells the father of it. The father confronts the daughter, and he finally realizes that the daughter is innocent and is simply still brokenhearted over her mother’s death. The stepmother is moved by the daughter’s story to renounce her hate, and the father, stepmother, and daughter finally become a happy family.
- Momotaro, or the Story of the Son of a Peach
- An old woman finds a large peach in a river, and when she and her husband cut it open to eat it, they find a child inside. They are overjoyed to now have a son to ease their lonely days. When the boy is fifteen, he goes off to rid the land of devils who live on an island, and takes a dog, a monkey, and a pheasant with him. He is victorious over the devils and returns home to live happily with his parents.
- My Lord Bag of Rice
- A Japanese warrior defends the Dragon King by killing his enemy, the monster centipede. In gratitude the Dragon King gives the warrior several presents, including a bag of rice that never runs out, and he comes to be known as My Lord Bag of Rice.
- The Ogre of Rashomon
- A brave warrior fights an ogre, cutting off his arm. The ogre runs away, and the warrior keeps the arm as a prize. Later, the warrior’s old nurse appears at his door and pleads to see the arm. He lets her, and she grabs it, turning into the ogre. The ogre thus gets away with his arm, and is scared enough of the warrior that he never troubles the city again.
- The Quarrel of the Monkey and the Crab
- The monkey and the crab were playing along the river. The monkey finds a persimmon seed and the crab a rice dumpling; the monkey convinces the crab to exchange the items. The crab grows a tree from the seed, and asks the monkey to help him pick the fruit. The monkey is greedy, and eats all the fruit and then throws hard seeds at the crab, killing him. The crab’s son plans revenge on the monkey, eventually killing him.
- The Sagacious Monkey and the Boar
- An old monkey is to be sent to the butcher by his master, since his age has caused him to stop performing as well as he used to. The monkey overhears this plan and goes to a boar for advice. The boar comes up with a plan: The boar will steal the couple’s child, and the monkey will run after him and rescue the child, thus earning the family’s love and respect for the rest of his days. The plan works.
- The Shinansha, or the South Pointing Carriage
- How the Emperor Kotei invented many useful things, defeated his enemy, and went to Heaven on the back of a Dragon.
- The Stones of Five Colors and the Empress Jokwa
- A Chinese Empress quells an uprising and then has to mend the heavens and the pillars that hold up the sky.
- The Story of Prince Yamato Take
- A story of how Prince Take got his name and many of his daring deeds.
- The Story of Princess Hase
- How Princess Hase was conceived and lived her good life.
- The Story of the Man Who Did Not Wish to Die
- How Sentaro was taught not to covet unending life.
- The Story of the Old Man Who Made Withered Trees to Flower
- A childless couple love their dog very dearly, and the dog finds gold coins buried under their tree. The old man is grateful and loves his dog even more. The man has a very jealous and hateful neighbor, who tries to copy his neighbor’s luck by borrowing the dog and making him dig. The hateful man finds only garbage, and kills the dog in rage. The good man asks for the tree in remembrance of his dog, and the tree’s wood is made into a mortar that produces unending food. The jealous neighbor asks to borrow it and destroys it when it won’t also give him food. More events continue until the good man is eventually given riches by a lord for his kindness to him, and when the hateful man tries to copy the kindness, he is arrested as an imposter and jailed forever, thus finally being punished for his crimes.
- The Story of Urashima Taro, the Fisher Lad
- How disobedience ruined the life of Urashima Taro.
- The Tongue-Cut Sparrow
- A fairy sparrow teaches a cross old woman a lesson.
- The White Hare and the Crocodiles
- A hare deceives many crocodiles, then mocks them, and the crocodiles pull out all of his fur in retaliation. The hare is suffering, and a fairy man comes along and tells him to bathe in the sea and lie in the sun to recover his fur, but the man was spiteful and his advice only increases the hare’s pain. A kind fairy man comes by and listens to the hare’s sad story, telling him his pain is the consequence of his behavior to the crocodiles. The hare agrees and repents, and the kind man tells him how to heal his wounds and regrow his fur. The hare correctly predicts that the princess the other men were off seeking would deny them and instead choose the kind man for her husband.
- Year Published: 1908
- Language: English
- Country of Origin: United States of America
-
Readability:
- Flesch–Kincaid Level: 7.4
- Word Count: 66,254
- Genre: Fairy Tale/Folk Tale
- Keywords: adventure, hero, warrior


{% extends 'nehlwebsite/base.html' %} {% load static %} {% load crispy_forms_tags %} {% block css %} {% endblock %} {% block content %}
Use this form to submit the goal scorers for the game, submit goals for both teams. If no goals were scored just press submit without adding any scorers.


Represents a null terminated unicode string.
This implementation is uses pointers to null terminated wide character arrays. Reference counts are not used. Characters are unicode.
| UString() | Constructors. |
| append() | Append to string. |
| capacity() | Returns capacity of string (not including terminator) |
| compareTo() | Case sensitive comparison |
| ensureCapacity() | Make sure buffer is big enough. |
| equals() | Case sensitive comparison for equality |
| equalsIgnoreCase() | Case insensitive comparison for equality. |
| indexOf() | Finds first occurrance of character or string. |
| lastIndexOf() | Finds last occurrance of character or string. |
| length() | Return length to terminator |
| operator(wchar_t*)() | wchar_t* conversion |
| operator+() | UString concatenation operators. |
| operator=() | Assignment operators. |
| operator==() | Comparison operators for strings. |
| startsWith() | Tells if this string starts with the given string. |
| substring() | Extracts a substring. |
| toLowerCase() | Convert UString to lower case. |
| toUpperCase() | Convert UString to upper case. |
| ~UString() | Destructor |
UString( const int length=0 )
UString( const String& str );
UString( const wchar_t* psz );
UString( const wchar_t* ps, const int len );
Constructors. Parameters specify an initial string in one of a variety of formats or give an integer for the initial capacity.
void append( const UString& str) inline
void append( const wchar_t* psz )
void append( wchar_t ch )
Append to string.
int capacity() const inline;
Returns capacity of string (not including terminator)
int compareTo( const UString& str ) const
int compareTo( const wchar_t* psz ) const
Case sensitive comparison
void UString::ensureCapacity( int len )
Make sure buffer is big enough.
bool equals( const wchar_t* psz ) const
bool equals( const UString& str ) const
Case sensitive comparison for equality
bool equalsIgnoreCase( const wchar_t* psz ) const
bool equalsIgnoreCase( const UString& str ) const
Case insensitive comparison for equality.
int indexOf( wchar_t ch ) const
int indexOf( const wchar_t* psz ) const
int indexOf( const UString& str ) const
Finds first occurrance of character or string.
int lastIndexOf( wchar_t ch ) const
int lastIndexOf( const wchar_t* psz ) const
int lastIndexOf( const UString& str ) const
Finds last occurrance of character or string.
int UString::length() const
Return length to terminator
operator const wchar_t*() const inline;
wchar_t* conversion
wchar_t* + UString
UString + UString
UString + wchar_t*
UString concatenation operators.
(UString) = (UString);
(UString) = (wchar_t *);
(UString) = (wchar_t);
Assignment operators.
(UString) <op> (UString)
(UString) <op> (wchar_t*)
(wchar_t*) <op> (UString)
Comparison operators for strings. These are case sensitive and not localized.
There are a complete set of comparison operators for UString's and wchar_t*'s. Operators are: ==, !=, <=, >=, <, and >.
bool startsWith( const wchar_t* psz ) const
bool startsWith( const UString& str ) const
Tells if this string starts with the given string. Case dependent.
UString substring( int start ) const
UString substring( int start, int end ) const
Extracts a substring.
Extracts from the start index to just before the end index. If no end index is given, extracts to the end of the string. The indices must be contained within the string and end>=start.
void UString::toLowerCase()
Convert UString to lower case. Current c locale is used.
void UString::toUpperCase()
Convert UString to upper case. Current c locale is used.
UString::~UString()
Destructor


|
Judge Gene Autry
by Francis M. Nevins
GOLDTOWN GHOST RIDERS (Columbia, 1952, directed by George
Archainbaud from a screenplay by Gerald Geraghty) was one of
the last features starring cowboy hero Gene Autry and the only
Western I've ever seen where the protagonist is a judge. Not
only is the story built around a legal gimmick but the hard-riding
straight-shooting hero gives a whole new meaning to judicial
activism. Circuit judge Autry happens to be present when Goldtown's
corrupt political boss (Carleton Young) is shot down on the street
by an ex-convict (Kirk Riley) recently released after serving
ten years for murder. Riley then claims that trying him for what
he just did would constitute double jeopardy, because Young is
the same man for whose murder he'd been convicted ten years before!
This is a ploy today's law-trained
moviegoers are familiar with from DOUBLE JEOPARDY (1999),
in which the framed and imprisoned Ashley Judd got out and set
about tracking down her husband with the same intent as Kirk
Riley in GOLDTOWN and on the same nonsensical legal theory. I've
traced the gimmick as far back as the 1920s when English thriller
writer "Seamark" (Austin J. Small) used it in the short
story Query (collected in OUT OF THE DARK, Hodder
& Stoughton 1931).
When the story was reprinted in the US in the August 1948 issue
of Ellery Queen's Mystery Magazine, it came to the attention
of a number of people in Hollywood who liked the legal gimmick
so much they appropriated it---without credit or payment to Austin
J. Small. The Query ploy served as the basis of Double
Jeopardy (1949), a 15-minute filmed episode of the TV anthology
series FIRESIDE THEATER, and a few years later was put
at the center of this Autry film. I'm sure it popped up on the
tube many more times before migrating to the big screen in the
Ashley Judd picture.
Most of GOLDTOWN GHOST RIDERS consists of a long long
flashback
describing how the characters got to where we saw them in the
first ten minutes. When asked to accept an appointment as circuit
judge, Autry first objects that he's a rancher with zero knowledge
of law, but agrees to serve after he's told that "law's
just common sense." By the
time the flashback is over we've learned that, after escaping
from Kirk
Riley's death trap, Carleton Young came back to Goldtown and
took it
over again, undisguised and unrecognized by Autry or anyone else
in the picture. Yeah, right. Finally we return to the present
as Riley in turn is shot down by Young's cronies, who themselves
are gunned down by the phantom riders of the title. This is hardly
a great movie or even a first-class shoot-em-up, but in any survey
of the cinematic frontier or the cinematic judiciary its corkscrew
plot, plus its juristic and supernatural overtones (both minimal)
and the easy-on-the-eyes desertscapes that were French-born director
Archainbaud's passion, entitle it to a moment in the (blazing)
sun.
Posted October 8, 2003
|


Counted loops or FOR / NEXT loops can be regarded as special cases of repetition and, depending on the language in which they are implemented, are implemented as either pre-test or post-test repetitions.
Develop a procedure to print out the 12 times table.
FOR i = 1 to 12 STEP 1 Display "12 x ", i," = ", (12*i) NEXT i
for (var i = 1; i < 13; i = i + 1) { console.log('12 x ' + i + ' = ' + (i * 12)); }
To represent a FOR / NEXT loop in flowchart format, it is necessary to describe the required logic as the equivalent pre- or post-test.
Open this document in Chrome and open the developer tools Windows: F12 or Ctrl-shift+I, Mac: Cmd + Opt + I.
Click run button.
Observe the console output.
Modify program.js
: Develop a procedure to print out the 7 times table.


How @font-face works
By using the @font-face rule we can enable the use of web fonts in our sites. Since icon fonts are just another web font, it's important that you understand how web fonts work before deploying icon fonts in your projects.
Although the syntax has evolved over the years, here’s the currently accepted standard for @font-face syntax. Please be aware that there are multiple variations on this syntax.
@font-face {
font-family: 'font name';
src: url('font.eot');
src: url('font.eot?#iefix') format('embedded-opentype'),
url('font.woff') format('woff'),
url('font.ttf') format('truetype'),
url('font.svg#chunky_mobile') format('svg');
font-weight: normal;
font-style: normal;
}
‘Font name’ would be the name you use when defining the font-family property, and the multiple src attributes (and values) deal with the tricky nature of browser support for multiple font formats. Font-weight and font-style are used to define the base weight and style of the font.
Let's try it!
Display the home icon: