RouterResponse
public class RouterResponse
The RouterResponse class is used to define and work with the response that will be sent by the Router
.
It contains and allows access to the HTTP response code (e.g. 404 Not Found
), the HTTP Headers
and the body of the response.
It can also render template files, using a template engine registered to the router.
Usage Example:
In this example response
is an instance of the class RouterResponse
.
The content type and status code of the response are set.
The String Hello world
is added to the body and the response is transmitted.
router.get("/example") { _, response, next in
response.headers["Content-Type"] = "text/html"
response.status(.OK)
try response.send("Hello world").end()
}
-
Set of cookies to return with the response.
Declaration
Swift
public var cookies = [String: HTTPCookie]()
-
Optional error value.
Declaration
Swift
public var error: Swift.Error?
-
HTTP headers of the response.
Declaration
Swift
public var headers: Headers
-
HTTP status code of the response.
Declaration
Swift
public var statusCode: HTTPStatusCode
-
User info. Can be used by middlewares and handlers to store and pass information on to subsequent handlers.
Declaration
Swift
public var userInfo: [String: Any] = [:]
-
End the response.
Throws
Socket.Error if an error occurred while writing to a socket.Declaration
Swift
public func end() throws
-
Set the status code.
Declaration
Swift
public func status(_ status: HTTPStatusCode) -> RouterResponse
Parameters
status
The HTTP status code object.
Return Value
This RouterResponse.
-
Redirect to path with status code.
Throws
Socket.Error if an error occurred while writing to a socket.Declaration
Swift
public func redirect(_ path: String, status: HTTPStatusCode = .movedTemporarily) throws -> RouterResponse
Return Value
This RouterResponse.
-
Render a resource using Router’s template engine.
Throws
TemplatingError if no file extension was specified or there is no template engine defined for the extension.Declaration
Swift
public func render(_ resource: String, context: [String:Any], options: RenderingOptions = NullRenderingOptions()) throws -> RouterResponse
Parameters
resource
The resource name without extension.
context
A dictionary of local variables of the resource.
options
Rendering options, specific per template engine
Return Value
This RouterResponse.
-
Render a resource using Router’s template engine.
Throws
TemplatingError if no file extension was specified or there is no template engine defined for the extension.Declaration
Swift
public func render<T: Encodable>(_ resource: String, with value: T, forKey key: String? = nil, options: RenderingOptions = NullRenderingOptions()) throws -> RouterResponse
Parameters
resource
The resource name without extension.
with
A value that conforms to Encodable that is used to generate the content.
forKey
A value used to match the Encodable value to the correct variable in a template file. The
forKey
value should match the desired variable in the template file.options
Rendering options, specific per template engine
Return Value
This RouterResponse.
-
Render a resource using Router’s template engine.
Throws
TemplatingError if no file extension was specified or there is no template engine defined for the extension.Declaration
Swift
public func render<I: Identifier, T: Encodable>(_ resource: String, with values: [(I, T)], forKey key: String, options: RenderingOptions = NullRenderingOptions()) throws -> RouterResponse
Parameters
resource
The resource name without extension.
with
An array of tuples of type (Identifier, Encodable). The Encodable values are used to generate the content.
forKey
A value used to match the Encodable values to the correct variable in a template file. The
forKey
value should match the desired variable in the template file.options
Rendering options, specific per template engine
Return Value
This RouterResponse.
-
Set the pre-flush lifecycle handler and return the previous one.
Declaration
Swift
public func setOnEndInvoked(_ newOnEndInvoked: @escaping LifecycleHandler) -> LifecycleHandler
Parameters
newOnEndInvoked
The new pre-flush lifecycle handler.
Return Value
The old pre-flush lifecycle handler.
-
Set the written data filter and return the previous one.
Declaration
Swift
public func setWrittenDataFilter(_ newWrittenDataFilter: @escaping WrittenDataFilter) -> WrittenDataFilter
Parameters
newWrittenDataFilter
The new written data filter.
Return Value
The old written data filter.
-
Perform content-negotiation on the Accept HTTP header on the request, when present.
Uses request.accepts() to select a handler for the request, based on the acceptable types ordered by their quality values. If the header is not specified, the default callback is invoked. When no match is found, the server invokes the default callback if exists, or responds with 406 “Not Acceptable”. The Content-Type response header is set when a callback is selected.
Throws
Socket.Error if an error occurred while writing to a socket.Declaration
Swift
public func format(callbacks: [String : ((RouterRequest, RouterResponse) -> Void)]) throws
Parameters
callbacks
A dictionary that maps content types to handlers.
-
Send a UTF-8 encoded string.
Declaration
Swift
public func send(_ str: String) -> RouterResponse
Parameters
str
The string to send.
Return Value
This RouterResponse.
-
Send an optional string. If the
String?
can be unwrapped it is sent as a String, otherwise the empty string (“”) is sent.Declaration
Swift
public func send(_ str: String?) -> RouterResponse
Parameters
str
The string to send.
Return Value
This RouterResponse.
-
Set the HTTP status code of the RouterResponse and send the String description of the HTTP status code.
Declaration
Swift
public func send(status: HTTPStatusCode) -> RouterResponse
Parameters
status
The HTTP status code.
Return Value
This RouterResponse.
-
Send data.
Declaration
Swift
public func send(data: Data) -> RouterResponse
Parameters
data
The data to send.
Return Value
This RouterResponse.
-
Send a file.
Throws
An error in the Cocoa domain, if the file cannot be read.Note
Sets the Content-Type header based on the
extension
of the file. If the fileName is relative, it is relative to the current directory.Declaration
Swift
public func send(fileName: String) throws -> RouterResponse
Parameters
fileName
The name of the file to send.
Return Value
This RouterResponse.
-
Set headers and attach file for downloading.
Throws
An error in the Cocoa domain, if the file cannot be read.Declaration
Swift
public func send(download: String) throws
Parameters
download
The file to download.
-
Sets the Content-Type header as application/json, Serializes an array into JSON data and sends the data. If the data is not a valid JSON structure, it will not be sent and a warning will be logged.
Declaration
Swift
public func send(json: [Any]) -> RouterResponse
Parameters
json
The array to send in JSON format.
Return Value
This RouterResponse.
-
Sets the Content-Type header as
application/json
, Serializes a dictionary into JSON data and sends the data. If the data is not a valid JSON structure, it will not be sent and a warning will be logged.Declaration
Swift
public func send(json: [String: Any]) -> RouterResponse
Parameters
json
The Dictionary to send in JSON format as a hash.
Return Value
This RouterResponse.
-
Sends an Encodable type, encoded using the preferred
BodyEncoder
based on theAccept
header sent in the request, and sets the Content-Type header appropriately. If no Accept header was provided, or if no suitable encoder is registered with the router, the encoder corresponding to thedefaultResponseMediaType
will be used.Declaration
Swift
public func send<T : Encodable>(_ obj: T) -> RouterResponse
Parameters
obj
The Codable object to send.
Return Value
This RouterResponse.
-
Sets the Content-Type header as
application/json
, Encodes an Encodable object into data using aJSONEncoder()
and sends the data.Declaration
Swift
public func send<T : Encodable>(json: T) -> RouterResponse
Parameters
json
The JSON Encodable object to send.
Return Value
This RouterResponse.
-
Encodes an Encodable object into data using a
JSONEncoder()
and sends the data with JSONP callback.Throws
JSONPError.invalidCallbackName
if the the callback query parameter of the request URL is missing or its value is empty or contains invalid characters (the set of valid characters is the alphanumeric characters and[]$._
).Declaration
Swift
public func send<T : Encodable>(jsonp: T, callbackParameter: String = "callback") throws -> RouterResponse
Parameters
json
The JSON object to send.
callbackParameter
The name of the URL query parameter whose value contains the JSONP callback function.
Return Value
This RouterResponse.


Cookies
An HTTP cookie (web cookie, browser cookie) is a small piece of data that a server sends to the user’s web browser. The browser may store it and send it back with later requests to the same server. Typically, it’s used to tell if two requests came from the same browser - keeping a user logged-in, for example. It remembers stateful information for the stateless HTTP protocol.
Cookies are mainly used for three purposes:
Session management: Logins, shopping carts, game scores, or anything else the server should remember
Personalization: User preferences, themes, and other settings
Tracking: Recording and analyzing user behavior
To help you efficiently send cookies to browsers,
CodeIgniter provides the CodeIgniter\Cookie\Cookie
class to abstract the
cookie interaction.
Creating Cookies
There are currently four (4) ways to create a new Cookie
value object.
<?php
use CodeIgniter\Cookie\Cookie;
use DateTime;
// Using the constructor
$cookie = new Cookie(
'remember_token',
'f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6',
[
'expires' => new DateTime('+2 hours'),
'prefix' => '__Secure-',
'path' => '/',
'domain' => '',
'secure' => true,
'httponly' => true,
'raw' => false,
'samesite' => Cookie::SAMESITE_LAX,
]
);
// Supplying a Set-Cookie header string
$cookie = Cookie::fromHeaderString(
'remember_token=f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6; Path=/; Secure; HttpOnly; SameSite=Lax',
false, // raw
);
// Using the fluent builder interface
$cookie = (new Cookie('remember_token'))
->withValue('f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6')
->withPrefix('__Secure-')
->withExpires(new DateTime('+2 hours'))
->withPath('/')
->withDomain('')
->withSecure(true)
->withHTTPOnly(true)
->withSameSite(Cookie::SAMESITE_LAX);
// Using the global function `cookie` which implicitly calls `new Cookie()`
$cookie = cookie('remember_token', 'f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6');
When constructing the Cookie
object, only the name
attribute is required. All other else are optional.
If the optional attributes are not modified, their values will be filled up by the default values saved in
the Cookie
class.
Overriding Defaults
To override the defaults currently stored in the class, you can pass a Config\Cookie
instance or an array of defaults to the static Cookie::setDefaults()
method.
<?php
use CodeIgniter\Cookie\Cookie;
use Config\Cookie as CookieConfig;
// pass in a Config\Cookie instance before constructing a Cookie class
Cookie::setDefaults(new CookieConfig());
$cookie = new Cookie('login_token');
// pass in an array of defaults
$myDefaults = [
'expires' => 0,
'samesite' => Cookie::SAMESITE_STRICT,
];
Cookie::setDefaults($myDefaults);
$cookie = new Cookie('login_token');
Passing the Config\Cookie
instance or an array to Cookie::setDefaults()
will effectively
overwrite your defaults and will persist until new defaults are passed.
Changing Defaults for a Limited Time
If you do not want this
behavior but only want to change defaults for a limited time, you can take advantage of
Cookie::setDefaults()
return which returns the old defaults array.
<?php
use CodeIgniter\Cookie\Cookie;
use Config\Cookie as CookieConfig;
$oldDefaults = Cookie::setDefaults(new CookieConfig());
$cookie = new Cookie('my_token', 'muffins');
// return the old defaults
Cookie::setDefaults($oldDefaults);
Accessing Cookie’s Attributes
Once instantiated, you can easily access a Cookie
’s attribute by using one of its getter methods.
<?php
use CodeIgniter\Cookie\Cookie;
use DateTime;
use DateTimeZone;
$cookie = new Cookie(
'remember_token',
'f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6',
[
'expires' => new DateTime('2025-02-14 00:00:00', new DateTimeZone('UTC')),
'prefix' => '__Secure-',
'path' => '/',
'domain' => '',
'secure' => true,
'httponly' => true,
'raw' => false,
'samesite' => Cookie::SAMESITE_LAX,
]
);
$cookie->getName(); // 'remember_token'
$cookie->getPrefix(); // '__Secure-'
$cookie->getPrefixedName(); // '__Secure-remember_token'
$cookie->getExpiresTimestamp(); // Unix timestamp
$cookie->getExpiresString(); // 'Fri, 14-Feb-2025 00:00:00 GMT'
$cookie->isExpired(); // false
$cookie->getMaxAge(); // the difference from time() to expires
$cookie->isRaw(); // false
$cookie->isSecure(); // true
$cookie->getPath(); // '/'
$cookie->getDomain(); // ''
$cookie->isHTTPOnly(); // true
$cookie->getSameSite(); // 'Lax'
// additional getter
$cookie->getId(); // '__Secure-remember_token;;/'
// when using `setcookie()`'s alternative signature on PHP 7.3+
// you can easily use the `getOptions()` method to supply the
// $options parameter
$cookie->getOptions();
Immutable Cookies
A new Cookie
instance is an immutable value object representation of an HTTP cookie. Being immutable,
modifying any of the instance’s attributes will not affect the original instance. The modification always
returns a new instance. You need to retain this new instance in order to use it.
<?php
use CodeIgniter\Cookie\Cookie;
$cookie = new Cookie('login_token', 'admin');
$cookie->getName(); // 'login_token'
$cookie->withName('remember_token');
$cookie->getName(); // 'login_token'
$new = $cookie->withName('remember_token');
$new->getName(); // 'remember_token'
Validating a Cookie’s Attributes
An HTTP cookie is regulated by several specifications that need to be followed in order to be
accepted by browsers. Thus, when creating or modifying certain attributes of the Cookie
,
these are validated in order to check if these follow the specifications.
A CookieException
is thrown if violations were reported.
Validating the Name Attribute
A cookie name can be any US-ASCII character, except for the following:
control characters;
spaces or tabs;
separator characters, such as
( ) < > @ , ; : \ " / [ ] ? = { }
If setting the $raw
parameter to true
this validation will be strictly made. This is because
PHP’s setcookie()
and setrawcookie()
will reject cookies with invalid names. Additionally, cookie
names cannot be an empty string.
Validating the Prefix Attribute
When using the __Secure-
prefix, cookies must be set with the $secure
flag set to true
. If
using the __Host-
prefix, cookies must exhibit the following:
$secure
flag set totrue
$domain
is empty$path
must be/
Validating the SameSite Attribute
The SameSite attribute only accepts three (3) values:
Lax: Cookies are not sent on normal cross-site subrequests (for example to load images or frames into a third party site), but are sent when a user is navigating to the origin site (i.e. when following a link).
Strict: Cookies will only be sent in a first-party context and not be sent along with requests initiated by third party websites.
None: Cookies will be sent in all contexts, i.e. in responses to both first-party and cross-origin requests.
CodeIgniter, however, allows you to set the SameSite attribute to an empty string. When an empty string is
provided, the default SameSite setting saved in the Cookie
class is used. You can change the default SameSite
by using the Cookie::setDefaults()
as discussed above.
Recent cookie specifications have changed such that modern browsers are being required to give a default SameSite
if nothing was provided. This default is Lax
. If you have set the SameSite to be an empty string and your
default SameSite is also an empty string, your cookie will be given the Lax
value.
If the SameSite is set to None
you need to make sure that Secure
is also set to true
.
When writing the SameSite attribute, the Cookie
class accepts any of the values case-insensitively. You can
also take advantage of the class’s constants to make it not a hassle.
<?php
use CodeIgniter\Cookie\Cookie;
Cookie::SAMESITE_LAX; // 'lax'
Cookie::SAMESITE_STRICT; // 'strict'
Cookie::SAMESITE_NONE; // 'none'
Sending Cookies
Set the Cookie
objects in the CookieStore
of the Response object, and
the framework will automatically send the cookies.
Use CodeIgniter\HTTP\Response::setCookie()
to set:
<?php
use CodeIgniter\Cookie\Cookie;
use Config\Services;
$response = Services::response();
$cookie = new Cookie(
'remember_token',
'f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6',
[
'max-age' => 3600 * 2, // Expires in 2 hours
]
);
$response->setCookie($cookie);
You can also use the set_cookie()
helper function:
<?php
use CodeIgniter\Cookie\Cookie;
helper('cookie');
$cookie = new Cookie(
'remember_token',
'f699c7fd18a8e082d0228932f3acd40e1ef5ef92efcedda32842a211d62f0aa6',
[
'max-age' => 3600 * 2, // Expires in 2 hours
]
);
set_cookie($cookie);
Using the Cookie Store
Note
Normally, there is no need to use CookieStore directly.
The CookieStore
class represents an immutable collection of Cookie
objects.
Getting the Store from Response
The CookieStore
instance can be accessed from the current Response
object.
<?php
use Config\Services;
$cookieStore = Services::response()->getCookieStore();
Creating CookieStore
CodeIgniter provides three (3) other ways to create a new instance of the CookieStore
.
<?php
use CodeIgniter\Cookie\Cookie;
use CodeIgniter\Cookie\CookieStore;
// Passing an array of `Cookie` objects in the constructor
$store = new CookieStore([
new Cookie('login_token'),
new Cookie('remember_token'),
]);
// Passing an array of `Set-Cookie` header strings
$store = CookieStore::fromCookieHeaders([
'remember_token=me; Path=/; SameSite=Lax',
'login_token=admin; Path=/; SameSite=Lax',
]);
// using the global `cookies` function
$store = cookies([new Cookie('login_token')], false);
// retrieving the `CookieStore` instance saved in our current `Response` object
$store = cookies();
Note
When using the global cookies()
function, the passed Cookie
array will only be considered
if the second argument, $getGlobal
, is set to false
.
Checking Cookies in Store
To check whether a Cookie
object exists in the CookieStore
instance, you can use several ways:
<?php
use CodeIgniter\Cookie\Cookie;
use CodeIgniter\Cookie\CookieStore;
use Config\Services;
// check if cookie is in the current cookie collection
$store = new CookieStore([
new Cookie('login_token'),
new Cookie('remember_token'),
]);
$store->has('login_token');
// check if cookie is in the current Response's cookie collection
cookies()->has('login_token');
Services::response()->hasCookie('remember_token');
// using the cookie helper to check the current Response
// not available to v4.1.1 and lower
helper('cookie');
has_cookie('login_token');
Getting Cookies in Store
Retrieving a Cookie
instance in a cookie collection is very easy:
<?php
use CodeIgniter\Cookie\Cookie;
use CodeIgniter\Cookie\CookieStore;
use Config\Services;
// getting cookie in the current cookie collection
$store = new CookieStore([
new Cookie('login_token'),
new Cookie('remember_token'),
]);
$store->get('login_token');
// getting cookie in the current Response's cookie collection
cookies()->get('login_token');
Services::response()->getCookie('remember_token');
// using the cookie helper to get cookie from the Response's cookie collection
helper('cookie');
get_cookie('remember_token');
When getting a Cookie
instance directly from a CookieStore
, an invalid name
will throw a CookieException
.
<?php
// throws CookieException
$store->get('unknown_cookie');
When getting a Cookie
instance from the current Response
’s cookie collection,
an invalid name will just return null
.
<?php
cookies()->get('unknown_cookie'); // null
If no arguments are supplied in when getting cookies from the Response
, all Cookie
objects
in store will be displayed.
<?php
cookies()->get(); // array of Cookie objects
// alternatively, you can use the display method
cookies()->display();
// or even from the Response
Services::response()->getCookies();
Note
The helper function get_cookie()
gets the cookie from the current Request
object, not
from Response
. This function checks the $_COOKIE
array if that cookie is set and fetches it
right away.
Adding/Removing Cookies in Store
As previously mentioned, CookieStore
objects are immutable. You need to save the modified instance
in order to work on it. The original instance is left unchanged.
<?php
use CodeIgniter\Cookie\Cookie;
use CodeIgniter\Cookie\CookieStore;
use Config\Services;
$store = new CookieStore([
new Cookie('login_token'),
new Cookie('remember_token'),
]);
// adding a new Cookie instance
$new = $store->put(new Cookie('admin_token', 'yes'));
// removing a Cookie instance
$new = $store->remove('login_token');
Note
Removing a cookie from the store DOES NOT delete it from the browser. If you intend to delete a cookie from the browser, you must put an empty value cookie with the same name to the store.
When interacting with the cookies in store in the current Response
object, you can safely add or delete
cookies without worrying the immutable nature of the cookie collection. The Response
object will replace
the instance with the modified instance.
<?php
use Config\Services;
Services::response()->setCookie('admin_token', 'yes');
Services::response()->deleteCookie('login_token');
// using the cookie helper
helper('cookie');
set_cookie('admin_token', 'yes');
delete_cookie('login_token');
Dispatching Cookies in Store
Deprecated since version 4.1.6.
Important
This method is deprecated. It will be removed in future releases.
More often than not, you do not need to concern yourself in manually sending cookies. CodeIgniter will do this
for you. However, if you really need to manually send cookies, you can use the dispatch
method. Just like
in sending other headers, you need to make sure the headers are not yet sent by checking the value
of headers_sent()
.
<?php
use CodeIgniter\Cookie\Cookie;
use CodeIgniter\Cookie\CookieStore;
$store = new CookieStore([
new Cookie('login_token'),
new Cookie('remember_token'),
]);
$store->dispatch(); // After dispatch, the collection is now empty.
Cookie Personalization
Sane defaults are already in place inside the Cookie
class to ensure the smooth creation of cookie
objects. However, you may wish to define your own settings by changing the following settings in the
Config\Cookie
class in app/Config/Cookie.php file.
Setting |
Options/ Types |
Default |
Description |
|---|---|---|---|
$prefix |
|
|
Prefix to prepend to the cookie name. |
$expires |
|
|
The expires timestamp. |
$path |
|
|
The path property of the cookie. |
$domain |
|
|
The domain property of the cookie.with trailing slash. |
$secure |
|
|
If to be sent over secure HTTPS. |
$httponly |
|
|
If not accessible to JavaScript. |
$samesite |
|
|
The SameSite attribute. |
$raw |
|
|
If to be dispatched using |
In runtime, you can manually supply a new default using the Cookie::setDefaults()
method.
Class Reference
- class CodeIgniter\Cookie\Cookie
- static setDefaults([$config = []])
- Parameters
$config (
\Config\Cookie|array
) – The configuration array or instance
- Return type
array
- Returns
The old defaults
Set the default attributes to a Cookie instance by injecting the values from the
Config\Cookie
config or an array.
- static fromHeaderString(string $header[, bool $raw = false])
- Parameters
$header (
string
) – TheSet-Cookie
header string$raw (
bool
) – Whether this cookie is not to be URL encoded and sent viasetrawcookie()
- Return type
Cookie
- Returns
Cookie
instance- Throws
CookieException
Create a new Cookie instance from a
Set-Cookie
header.
- __construct(string $name[, string $value = ''[, array $options = []]])
- Parameters
$name (
string
) – The cookie name$value (
string
) – The cookie value$options (
array
) – The cookie options
- Return type
Cookie
- Returns
Cookie
instance- Throws
CookieException
Construct a new Cookie instance.
- getId()
- Return type
string
- Returns
The ID used in indexing in the cookie collection.
- getPrefix() → string
- getName() → string
- getPrefixedName() → string
- getValue() → string
- getExpiresTimestamp() → int
- getExpiresString() → string
- isExpired() → bool
- getMaxAge() → int
- getDomain() → string
- getPath() → string
- isSecure() → bool
- isHTTPOnly() → bool
- getSameSite() → string
- isRaw() → bool
- getOptions() → array
- withRaw([bool $raw = true])
- Parameters
$raw (
bool
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with URL encoding option updated.
- withPrefix([string $prefix = ''])
- Parameters
$prefix (
string
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new prefix.
- withName(string $name)
- Parameters
$name (
string
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new name.
- withValue(string $value)
- Parameters
$value (
string
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new value.
- withExpires($expires)
- Parameters
$expires (
DateTimeInterface|string|int
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new cookie expires time.
- withExpired()
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie that will expire from the browser.
- withNeverExpiring()
Deprecated since version 4.2.6.
Important
This method is deprecated. It will be removed in future releases.
- Parameters
$name (
string
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie that will virtually never expire.
- withDomain(?string $domain)
- Parameters
$domain (
string|null
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new domain.
- withPath(?string $path)
- Parameters
$path (
string|null
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new path.
- withSecure([bool $secure = true])
- Parameters
$secure (
bool
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new “Secure” attribute.
- withHTTPOnly([bool $httponly = true])
- Parameters
$httponly (
bool
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new “HttpOnly” attribute.
- withSameSite(string $samesite)
- Parameters
$samesite (
string
) –
- Return type
Cookie
- Returns
new
Cookie
instance
Creates a new Cookie with new “SameSite” attribute.
- toHeaderString()
- Return type
string
- Returns
Returns the string representation that can be passed as a header string.
- toArray()
- Return type
array
- Returns
Returns the array representation of the Cookie instance.
- class CodeIgniter\Cookie\CookieStore
- static fromCookieHeaders(array $headers[, bool $raw = false])
- Parameters
$header (
array
) – Array ofSet-Cookie
headers$raw (
bool
) – Whether not to use URL encoding
- Return type
CookieStore
- Returns
CookieStore
instance- Throws
CookieException
Creates a CookieStore from an array of
Set-Cookie
headers.
- __construct(array $cookies)
- Parameters
$cookies (
array
) – Array ofCookie
objects
- Return type
CookieStore
- Returns
CookieStore
instance- Throws
CookieException
- has(string $name[, string $prefix = ''[, ?string $value = null]]) → bool
- Parameters
$name (
string
) – Cookie name$prefix (
string
) – Cookie prefix$value (
string|null
) – Cookie value
- Return type
bool
- Returns
Checks if a
Cookie
object identified by name and prefix is present in the collection.
- get(string $name[, string $prefix = '']) → Cookie
- Parameters
$name (
string
) – Cookie name$prefix (
string
) – Cookie prefix
- Return type
Cookie
- Returns
Retrieves an instance of Cookie identified by a name and prefix.
- Throws
CookieException
- put(Cookie $cookie) → CookieStore
- Parameters
$cookie (
Cookie
) – A Cookie object
- Return type
CookieStore
- Returns
new
CookieStore
instance
Store a new cookie and return a new collection. The original collection is left unchanged.
- remove(string $name[, string $prefix = '']) → CookieStore
- Parameters
$name (
string
) – Cookie name$prefix (
string
) – Cookie prefix
- Return type
CookieStore
- Returns
new
CookieStore
instance
Removes a cookie from a collection and returns an updated collection. The original collection is left unchanged.
- dispatch() → void
- Return type
void
Dispatches all cookies in store.
- display() → array
- Return type
array
- Returns
Returns all cookie instances in store.
- clear() → void
- Return type
void
Clears the cookie collection.


2 instantiations of ConnectJobOperation
System.Management.Automation (2)
engine\remoting\client\Job.cs (2)
1985
connectJobOperations.Add(new
ConnectJobOperation
(childJob));
2009
connectJobOperations.Add(new
ConnectJobOperation
(childJob));


Toggle navigation
Latex Converter
Upload
Status
Download
Upload
To convert Latex File load it into the Box below
You can put max. 1 file into the box.
(
)
0 means unlimited downloads
Start
Cancel
Delete


# -*- coding: utf-8 -*-
# Natural Language Toolkit: Tokenizers
#
# Copyright (C) 2001-2013 NLTK Project
# Author: Edward Loper<EMAIL_ADDRESS># Michael Heilman<EMAIL_ADDRESS>\
#\ (re-port from http://www.cis.upenn.edu/~treebank/tokenizer.sed)
#
# URL: <http://nltk.sourceforge.net>
# For license information, see LICENSE.TXT
#
# Modifications in lines 84 and 85 added by Jose Luis Bellod Cisneros
r"""
Penn Treebank Tokenizer
The Treebank tokenizer uses regular expressions to tokenize text as in Penn\
Treebank.
This implementation is a port of the tokenizer sed script written by Robert\
McIntyre
and available at http://www.cis.upenn.edu/~treebank/tokenizer.sed.
"""
import re
from nltk.tokenize.api import TokenizerI
[docs]class TreebankWordTokenizer(TokenizerI):
"""
The Treebank tokenizer uses regular expressions to tokenize text as in \
Penn Treebank.
This is the method that is invoked by ``word_tokenize()``. It assumes \
that the
text has already been segmented into sentences, e.g. using \
``sent_tokenize()``.
This tokenizer performs the following steps:
- split standard contractions, e.g. ``don't`` -> ``do n't``
- treat most punctuation characters as separate tokens
- split off commas and single quotes, when followed by whitespace
- separate periods that appear at the end of line
>>> from topics.meneame_tokenizer import TreebankWordTokenizer
>>> s = '''Good muffins cost $3.88\\nin New York.Please buy me\\ntwo'''
>>> TreebankWordTokenizer().tokenize(s)
['Good', 'muffins', 'cost', '$', '3.88', 'in', 'New', 'York.',
'Please', 'buy', 'me', 'two']
>>> s = "They'll save and invest more."
>>> TreebankWordTokenizer().tokenize(s)
['They', "'ll", 'save', 'and', 'invest', 'more', '.']
"""
# List of contractions adapted from Robert MacIntyre's tokenizer.
CONTRACTIONS2 = [re.compile(r"(?i)\b(can)(not)\b"),
re.compile(r"(?i)\b(d)('ye)\b"),
re.compile(r"(?i)\b(gim)(me)\b"),
re.compile(r"(?i)\b(gon)(na)\b"),
re.compile(r"(?i)\b(got)(ta)\b"),
re.compile(r"(?i)\b(lem)(me)\b"),
re.compile(r"(?i)\b(mor)('n)\b"),
re.compile(r"(?i)\b(wan)(na) ")]
CONTRACTIONS3 = [re.compile(r"(?i) ('t)(is)\b"),
re.compile(r"(?i) ('t)(was)\b")]
CONTRACTIONS4 = [re.compile(r"(?i)\b(whad)(dd)(ya)\b"),
re.compile(r"(?i)\b(wha)(t)(cha)\b")]
[docs] def tokenize(self, text):
#starting quotes
text = re.sub(r'^\"', r'``', text)
text = re.sub(r'(``)', r' \1 ', text)
text = re.sub(r'([ (\[{<])"', r'\1 `` ', text)
#punctuation
text = re.sub(r'([:,])([^\d])', r' \1 \2', text)
text = re.sub(r'\.\.\.', r' ... ', text)
text = re.sub(r'[;@#$%&]', r' \g<0> ', text)
text = re.sub(r'([^\.])(\.)([\]\)}>"\']*)\s*$', r'\1 \2\3 ', text)
text = re.sub(r'[?!]', r' \g<0> ', text)
text = re.sub(r"([^'])' ", r"\1 ' ", text)
#parens, brackets, etc.
text = re.sub(r'[\]\[\(\)\{\}\<\>]', r' \g<0> ', text)
#Spanish '¿' and '¡'
text = re.sub(r'\xbf', r' \g<0> ', text) # ¿
text = re.sub(r'\xa1', r' \g<0> ', text) # ¡
#add extra space to make things easier
text = " " + text + " "
#ending quotes
text = re.sub(r'"', " '' ", text)
text = re.sub(r'(\S)(\'\')', r'\1 \2 ', text)
text = re.sub(r"([^' ])('[sS]|'[mM]|'[dD]|') ", r"\1 \2 ", text)
text = re.sub(r"([^' ])('ll|'LL|'re|'RE|'ve|'VE|n't|N'T) ", r"\1 \2 ",
text)
for regexp in self.CONTRACTIONS2:
text = regexp.sub(r' \1 \2 ', text)
for regexp in self.CONTRACTIONS3:
text = regexp.sub(r' \1 \2 ', text)
# We are not using CONTRACTIONS4 since
# they are also commented out in the SED scripts
# for regexp in self.CONTRACTIONS4:
# text = regexp.sub(r' \1 \2 \3 ', text)
return text.split()
if __name__ == "__main__":
import doctest
doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE)


{% extends 'layout.html' %} {% block body %}
Medicinal Chemist: Synthesizing small molecules to aid drug discovery
Computational Chemist: Designing molecules to increase hit rate in drug discovery
I am a medicinal chemist with 5 years of experience, and I am looking for new job opportunities in this field. I am an enthusiastic and dedicated professional. I have synthesized more than 100 compounds for ABC project in China in 2016 and a few of them showed strong activity towards XYZ. Additionally, I designed small molecules for medicinal chemists to help increase hit rate in EFG project in Berlin in 2018 and this greatly reduced the time for finishing the whole project. I am skilled in computer programming, communication, and teamwork.
{% endblock %}


Functions | |
| path (step) | |
| if | mod (length(neighbors), 2) |
| copy_matrix (w, v)=0 | |
| if | has_path (copy_matrix, v, w, n) break else copy_matrix(v |
| end end end | copy_matrix (v, w)=0 |
Variables | |
| function | path |
| copy_matrix = A | |
| v = 1 | |
| step = 1 | |
| neighbors = find(copy_matrix(v,:)) | |
| else for | w |
| num_edges = num_edges-1 | |
| if has_path | ( | copy_matrix | , |
| v | , | ||
| w | , | ||
| n | |||
| ) |
| path | ( | step | ) |
| neighbors = find(copy_matrix(v,:)) |
| num_edges = num_edges-1 |
| while num_edges step = 1 |
| v = 1 |
| if w |


My Portfolio: Mirriam Ronoh
This is my Google Software-Product-Sprint portfolio.
Click here for some of my favorite TV characters:
My Background
My full name is Mirriam Chemutai Ronoh. I was born and raised in Kericho County, Kenya. A little bit about my names; my grandmother gave me the name Mirriam, it's a Biblical name, though it's spelt Miriam in the Bible. In my tribe (Kipsigis), middle names are given with respect to the time of birth. I was named Chemutai because I was born at dawn. 'Mutai' means dawn in my tribe and 'Che' is a girl's name's prefix. Ronoh is my surname. I went to an all girls' boarding school, Alliance Girls' High School, in a small town called Kikuyu, which is about an hour from the capital, Nairobi. After graduating from high school, I took a gap year before joining college. At the time, I was working and applying for college. I was fortunate to gain an admission to the University of Pennsylvania. At the time, I was still undecided on what I wanted to pursue, and after taking some Computer Science classes, I declared a Computer and Information Science major after my freshman year. I also plan to minor in Mathematics. Looking ahead, I am still quite unsure about what I want to do after graduation. I am interested in pursuing a Masters or a pHD program in Machine Learning. Artficial Intelligece fascinates me and I would love to be part of the commmunity that is trying to positively change various aspects of life through computer technology.
During me free time, I like to stay indoors. Mostly, I like putting on headphones and clean the house, organize my space or cook something I like. On a Friday night, you'd likely find me keeping up with a show on Netflix, going to catch a movie at the theatre or just sleeping. My weekends are mostly spent doing some schoolwork and hanging out with friends. On new interests, I am trying to learn how to play a violin and cook better.
Projects
I haven't really worked on personal projects yet but I have worked on some really interesting projects as part of my class assignments. Below are some of my favorites (all implemented in Java):
(a)Travelling Salesperson Problem: In a problem with thousnads of destinations and distances between any two destinations, finding the shortest distance through all the destinations can be daunting. This problem was implemeted by use of simple iteration techniques such as a while loop and linked lists to maintain the order of traversion of the whole map.
(a)Spellchecker: Built a program that checks and corrects grammar mistakes in a file. This was accomplished by using File I/O to read an input file and every word mispelt corrected by rearranging the letters into dictionary words. The new grammatically-correct file is then made available to the user by writing to an output file.
(a)Pennpals: Created an interactive chatting platform that enables users to register by assigning each user a distinct ID and username. Some users can create groups (channels), each with its name, where one user is the owner who admits other members and can also remove members. Users can send send messages to each other and also to channels.
(a)Hashing and Tries: Implemented a working HashMap using a resizing linked list. Every new item inserted into the map is assigned a location with respect to its key hashcode.
Links
Github: mirriamchemu
My LinkedInImages
These are images from Diani Beach, Mombasa, Kenya
These are just random pictures:
Photography
During my freshamn year in college, I took a photography class. I found this class quite interesting because it was a black-and -white photography class. This meant that we had to go outdoors and take a couple shots on film then spend about four hours in the dark room developing the films. We took a variety of pictures depending on the theme of the week, portraiture, available light, cityscapes, etc. I kept an album of some of my favorite shots from the class, four of which I've shared below. On a random day, I enjoy photographing strutures with unique designs, beatiful sceneries, and random pictures of my friends.
Hidden Talents
1. Juggle (Just two balls though, either one or both hands)
2. Braid hair
3. Hula Hooping
Content From Server
This is supposed to be the content fetched from the /data URL


asdf plugin list all- Install a plugin:
asdf plugin add name- List all available versions for a package:
asdf list all name- Install a specific version of a package:
asdf install name version- Set global version for a package:
asdf global name version- Set local version for a package:
asdf local name version


{% extends 'templates/nhs_transaction_layout.html' %} {% block pageTitle %}NHS.UK prototyping kit{% endblock %} {% block content %} Back Item name Item information: Stuff goes here when we know what said stuff is. Error description: Missing stuff Correction submitted! {% endblock %}
Stuff goes here when we know what said stuff is.
Missing stuff


5 KMD to the first user to provide the correct answer to the following puzzle in #cryptopuzzle channel. Only one (initial) answer accepted per user!
smk76213-Dec-19 01:42 AM
I am: is that the correct answer?
Dr.Terminus13-Dec-19 01:42 AM
Wanna give at least a few people a chance to be around..
I know a lot of smart and resourceful people around here, not sure how long these puzzles I have as my first batch can hold up lol
Dr.Terminus13-Dec-19 01:55 AM
Again, only one (initial) answer will be accepted per user which must be posted right here in this channel.
Alright13-Dec-19 01:57 AM
waiting...
Dr.Terminus13-Dec-19 02:00 AM
A man with 6 sections of chain wants to link them together to make one single chain containing 29 links. The 6 sections of chain are comprised of:
-------- (8 Links)
------- (7 Links)
----- (5 Links)
---- (4 Links)
--- (3 Links)
-- (2 Links)
His blacksmith charges $0.50 for opening a chain link and $0.75 for closing a chain link.
What is the cheapest price the job can be completed for? Briefly explain how this cheapest possible price is achieved.
Oszy13-Dec-19 02:01 AM
$35? (i am out messed it up already )(edited)
Dr.Terminus13-Dec-19 02:02 AM
Many more to come in future
already getting next one prepped
Oszy13-Dec-19 02:04 AM
this felt more like A levels than a crypto puzzle tbh
Dr.Terminus13-Dec-19 02:04 AM
there will be riddles
trivia
all kinds of interesting community entertainment
1
I'll also popcorn
Provide funds to other guest hosts to ask their favorite genre trivia, riddles puzzles etc.
I might need to report, or get a way to sticky latest riddles somehow, otherwise too few might see them
Open to suggestions
Alright13-Dec-19 02:07 AM
he watches a youtube tutorial and does it himself for $0
Dr.Terminus13-Dec-19 02:07 AM
Clever
but the rules are presented legitimately. Not misdirecting. Looking for the way to pay the man as he charges and get this job done
I'll give you two both 1 more guess each.. This being the opening puzzle ever..
Sorta beta
I'll make it clear in the future when there is no trickery / misdirection / 'JOKE' to the puzzle
1 more answer each! use wisely
Alright13-Dec-19 02:09 AM
is the chain linear?
ie, no forking, branching off
Dr.Terminus13-Dec-19 02:09 AM
I tried to do a little illustration
idea is to make -------- (8 Links)
------- (7 Links)
----- (5 Links)
---- (4 Links)
--- (3 Links)
-- (2 Links)
turn into ----------------------------- 29 links in a row
I'm sure my formatting will improve in time
I might even create jpegs for a lot of the puzzles
Might play around with raising reward if puzzle goes unanswered for too long...
maybe x 2 reward each day it goes unanswered
maybe x2 reward each hour unanswered for other sessions
For 10 KMD!!! [SOLVED]
A man with 6 sections of chain wants to link them together to make one single chain containing 29 links in a row:
-----------------------------
The 6 sections of chain are comprised of:
-------- (8 Links)
------- (7 Links)
----- (5 Links)
---- (4 Links)
--- (3 Links)
-- (2 Links)
His blacksmith charges $0.50 for opening a chain link and $0.75 for closing a chain link.
What is the cheapest price the job can be completed for? Briefly explain how this cheapest possible price is achieved.(edited)
5 KMD to the first user who answers correctly
Once again, only one (initial) answer will be accepted per user which must be posted right here in this channel.
kolo13-Dec-19 02:35 AM
1.25*5 (6.25) with linear chain as described above assuming all links are initially closed and you need to close all of them back, 1.25 total if one link can be used to combine all sections into one forking mess
Dr.Terminus13-Dec-19 02:36 AM
no forks
both answers incorrect
kolo13-Dec-19 02:39 AM
True, understood, counting
Dr.Terminus13-Dec-19 02:41 AM
1 more guess for you too. If anyone deserves it you do
In future, to answer after initial wrong answer would only give the right answer to the chat and the first person to copy / past the solution here
kolo13-Dec-19 02:42 AM
I know the answer, will send you in dm
Next one please
Dr.Terminus13-Dec-19 02:50 AM
Pinned a message.
Puzzle #1 Pinned(edited)
prize now up to 10 KMD!
Mylo13-Dec-19 04:36 AM
$5
4 open, 4 close.
They are all linked
Dr.Terminus13-Dec-19 04:43 AM
!kmdtip @Mylo 10
KMD TipBotBOT13-Dec-19 04:43 AM
TipBot
@Dr.Terminus (Dr.Terminus#3269)
You tipped @Mylo10 KMD
Dr.Terminus13-Dec-19 04:44 AM
Correct! Congrats on completing puzzle#1 !!!
Mylo13-Dec-19 04:45 AM
Awww shucks, I used to be a blacksmith
Dr.Terminus13-Dec-19 04:46 AM
Its really not apparent without experience perhaps
Mylo13-Dec-19 04:47 AM
I’ll use tips for pegs testing to create stablecoin. Cheers
& re tip
Dr.Terminus13-Dec-19 04:47 AM
getting wording right for puzzle #2 right now
spred the word!
puzzles could drop here in kmd cryptopuzzle any moment from now on
the longer they go unanswered, the greater the prize
Dr.Terminus13-Dec-19 04:55 AM
This next one might be a little easier
Dr.Terminus13-Dec-19 05:11 AM
FOR 10 KMD! [SOLVED](edited)
You've lost your wallet :(
But perhaps you are in luck as a wallet has been submitted to the local lost & found!
Of course you'll need to prove you are the true owner of this wallet.
To prove the wallet is really yours, you confirm there are 6 bills totaling USD$63.00 in the wallet.
Also, none of the 6 bills is a USD$1.00.
To simplify, provide what are the 6 bills in your lost/found wallet?(edited)
Only one (initial) answer will be accepted per user which must be posted right here in this channel.
Dr.Terminus13-Dec-19 06:02 AM
Pinned a message.
smk76213-Dec-19 07:57 AM
1. Power bill = $10
2. Gas bill = $9
3. Phone bill = $8
4. Hotel bill = $10
5. A photo of someone called Bill = Priceless (also, worthless)
6: A crisp USD$100 bill
100 - (10+9+8+10) = 100 - 37 = $63
Also, my name is Bill. its a photo of me. Gimme back my wallet.
ciumete13-Dec-19 10:39 AM
4x2$ + 5$ + 50$ =63$
Dr.Terminus13-Dec-19 01:23 PM
Correct @ciumete !
!kmdtip @ciumete 10
KMD TipBotBOT13-Dec-19 01:24 PM
TipBot
@Dr.Terminus (Dr.Terminus#3269)
You tipped @ciumete10 KMD
ciumete13-Dec-19 01:25 PM
thx dr
Dr.Terminus13-Dec-19 01:31 PM
Dr.Terminus13-Dec-19 02:45 PM
Puzzle #3 coming soon!
It's short and sweet. I anticipate someone will get the answer pretty quickly so be ready!
Dr.Terminus13-Dec-19 04:21 PM
For 5 KMD! [SOLVED]
How many triangles are in the figure below?(edited)
Only one (initial) answer will be accepted per user which must be posted right here in this channel.
mrlynch13-Dec-19 04:42 PM
44
1
might've missed a few
smk76213-Dec-19 04:42 PM
3
1
mrlynch13-Dec-19 04:42 PM
closest one wins?
sφldat13-Dec-19 04:43 PM
48
Dr.Terminus13-Dec-19 04:45 PM
!kmdtip @mrlynch 5
KMD TipBotBOT13-Dec-19 04:45 PM
TipBot
@Dr.Terminus (Dr.Terminus#3269)
You tipped @mrlynch5 KMD
Dr.Terminus13-Dec-19 04:45 PM
44 is correct
mrlynch13-Dec-19 04:46 PM
thank you
Dr.Terminus13-Dec-19 04:47 PM
Stay tuned for more! More puzzles could be posted at any time
Dr.Terminus13-Dec-19 06:01 PM
Pinned a message.
Puzzle #4 [SOLVED]
For 10 KMD!
We need to determine exactly how many coins are in our massive bag!
We know there is a mix of quarters (Each worth $0.25), half dollars (Each worth $0.50) and silver dollars (Each worth $1.00) in our bag.
We also know that the total dollar sum of all the coins in our bag is $700.
Lastly, we know that our bag contains the exact same number of each of the three coin denominations.
What is the number of each coin type found in our bag?(edited)


🔮 Object-detection in the browser!
Using TensorFlow.js (see here for our blog posts on the topic) we can use the camera on your device to detect objects and draw boxes around them! In order to do this, we need to request to access your camera.
When it's working, you will see something like the below (depending on what it's pointing at!)
Where we have black boxes drawn around what it thinks it sees; with the name of the thing above it, and in brackets, (roughly) an estimate of "how confident" the network is that what it's it is seeing. Note that the network itself is not perfect, and it will get confused and certianly won't detect everything (for example, it misses the second cup in this photo, as well as the book). But it gives a feeling for the kinds of things that cna be done!
Demo
Loading ...
Detectable things
Details
This code is a light-weight wrapper around coco-ssd from the TensorFlow.js examples page.


API reference¶
-
class
core.view.
View
(link=None, name=None, kwargs=None)¶ Methods
-
get_edit_params
()¶ Provides the View’s Link edit kwargs with fallbacks to default values.
Returns: edit_params : tuple
A tuple of kwargs controlling the following supported Link data edits: logic, calc, ...
-
get_std_params
()¶ Provides the View’s standard kwargs with fallbacks to default values.
Returns: std_parameters : tuple
A tuple of the common kwargs controlling the general View method behaviour: axis, relation, rel_to, weights, text
-
has_other_source
()¶ Tests if the View is generated with a swapped x-axis.
-
is_base
()¶ Tests if the View is a base size aggregation.
-
is_counts
()¶ Tests if the View is a count representation of a frequency.
-
is_meanstest
()¶ Tests if the View is a statistical test of differences in means.
-
is_net
()¶ Tests if the View is a code group/net aggregation.
-
is_pct
()¶ Tests if the View is a percentage representation of a frequency.
-
is_propstest
()¶ Tests if the View is a statistical test of differences in proportions.
-
is_stat
()¶ Tests if the View is a sample statistic.
-
is_sum
()¶ Tests if the View is a plain sum aggregation.
-
is_weighted
()¶ Tests if the View is performed on weighted data.
-
meta
()¶ Get a summary on a View’s meta information.
Returns: viewmeta: dict
A dictionary that contains global aggregation information.
-
missing
()¶ Returns any excluded value codes.
-
notation
(method, condition)¶ Generate the View’s Stack key notation string.
Parameters: aggname, shortname, relation : str
Strings for the aggregation name, the method’s shortname and the relation component of the View notation.
Returns: notation: str
The View notation.
-
rescaling
()¶ Returns the rescaling specification of value codes.
-
spec_condition
(link, conditionals=None, expand=None)¶ Updates the View notation’s condition component based on agg. details.
Parameters: link : Link
Returns: relation_string : str
The relation part of the View name notation.
-
weights
()¶ Returns the weight variable name used in the aggregation.
-


Methods
(inner) calcBeginMs(inTimeSpan) → {number}
Get the inclusive begin time of a TimeSpan in milliseconds. This is
the time elapsed since 00:00:00 (midnight) of the same day.
Parameters:
| Name | Type | Description |
|---|---|---|
inTimeSpan |
Object | A valid TimeSpan object. An error if thrown if the object is not an instance of TimeSpan. |
- Source:
Throws:
Error
Returns:
Start time in [milliseconds].
- Type
- number
(inner) calcEndMs(inTimeSpan) → {number}
Get the exclusive end time of a TimeSpan in milliseconds. This is
the time elapsed since 00:00:00 (midnight) of the same day.
Parameters:
| Name | Type | Description |
|---|---|---|
inTimeSpan |
Object | A valid TimeSpan object. An error if thrown if the object is not an instance of TimeSpan. |
- Source:
Throws:
Error
Returns:
End time in [milliseconds].
- Type
- number
(inner) mergeSpans(inSpans) → {Array}
Merge multiple, intersecting and non-intersecting timespans within an array.
Parameters:
| Name | Type | Description |
|---|---|---|
inSpans |
Array | Array of timespans. All of the timespans do not have to be intersecting but those which are will be merged together using a union operation. An Error is thrown if an array is not passed as the argument. |
- Source:
Throws:
-
TODO verify returned array is always sorted.
- Type
- Error
Returns:
Array containing the merged and unmerged timespans.
- Type
- Array
(inner) sortSpans(inSpans, inIsDescendingopt) → {Array}
Sort multiple date-spans within an array by their start time.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
inSpans |
Array | Array of date-spans. An Error is thrown if an array is not passed as the argument. | ||
inIsDescending |
boolean |
<optional> |
false | true if date-spans should be sorted in descending order. The default is true which means the date-spans should be sorted in ascending order. |
- Source:
Throws:
Error
Returns:
Array containing the sorted date-spans.
- Type
- Array
(inner) splitTime(inMilliseconds) → {Object}
Split the time of the day, when expressed in [milliseconds] into hours,
minutes, seconds and milliseconds.
Parameters:
| Name | Type | Description |
|---|---|---|
inMilliseconds |
number | Time of the day in milliseconds i.e. time elapsed since the previous midnight. |
- Source:
Returns:
An object with four data members, one each for the time
component in hours, minutes, seconds and milliseconds.
- Type
- Object
(inner) timeSpan(inHours, inMinutes, inSeconds, inMilliseconds, inDurationMins, inDurationSecsopt, inDurationMsopt) → {object}
Functional constructor which creates an instance of a TimeSpan.
Do not use with the 'new' operator.
Each TimeSpan object is immutable. The inclusive end time of a timespan
cannot exceed 23:59:59:999 i.e. the exclusive end time cannot exceed
12 midnight (00:00:00:000 of the following day).
The total duration of a timespan is equal to:
inDurationMins + inDurationSecs + inDurationMs
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
inHours |
number | Integer. Represents the 'hour of day' component of the start time of the timespan. Valid values are 0-23. An error is thrown if the integer is not specified or is not within the valid range. | ||
inMinutes |
number | Integer. Represents the minutes component of the start time of the timespan. Valid values are 0-59. An error is thrown if the integer is not specified or is not within the valid range. | ||
inSeconds |
number | Integer. Represents the seconds component of the start time of the timespan. Valid values are 0-59. An error is thrown if the integer is not specified or is not within the valid range. | ||
inMilliseconds |
number | Integer. Represents the milliseconds component of the start time of the timespan. Valid values are 0-999. An error is thrown if the integer is not specified or is not within the valid range. | ||
inDurationMins |
number | Positive integer representing the duration of the timespan in [minutes]. An error is thrown if this argument is not specified or it is not a valid, positive integer. Valid range is 0-1440. | ||
inDurationSecs |
number |
<optional> |
0 | Positive integer representing the [seconds] component of the duration. An error is thrown if this argument is not specified or it is not a valid, positive integer. Valid range is 0-59. |
inDurationMs |
number |
<optional> |
0 | Positive integer representing the [milliseconds] component of the duration. An error is thrown if this argument is not specified or it is not a valid, positive integer. Valid range is 0-999. |
- Source:
Returns:
A new instance of the TimeSpan object.
- Type
- object


A virtual chat system where you can hangout and discuss with friends
Get started by crafting a room nick!
There are 0 people in the chat. Say hi.


{% include all.html %}
{% include nav.html %}I am experienced in leveraging agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.


This plugin provides JSON tooling, including:
June 29, 2016
The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"), and the Eclipse Distribution License Version 1.0 ("EDL"). For purposes of the EPL and EDL, "Program" will mean the Content.
If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at http://www.eclipse.org.


|
SFML Game AI Demos
0.5.0
C++ intelligent agents for games, with demos using the SFML framework.
|
Subclass of Entity for live entities. Examples of live entities are NPCs, monsters and a player character. More...
#include <LiveEntity.hpp>
Public Member Functions | |
| LiveEntity (int health, sf::Vector2f size, sf::Vector2f position) | |
| Default constructor taking parameters for the entity's health, size and position. More... | |
| LiveEntity (int health, sf::Vector2f size, sf::Vector2f position, float speed) | |
| Overloaded constructor taking an additional parameter for the entity's speed. More... | |
| void | handleEvents (sf::Event sfEvent) override |
| Handles events specific to the live entity. More... | |
| void | update (float deltaTime) override |
| Updates the live entity. More... | |
| void | draw () override |
| Draws the live entity. More... | |
| void | setHealth (int health) |
| Sets the live entity's health points. More... | |
| int | getHealth () |
| Returns the entity's current health points. More... | |
| void | setSpeed (float speed) |
| Sets the entity's speed. More... | |
| void | setMaxSpeed (float maxSpeed) |
| Sets the entity's maximum speed. More... | |
| float | getSpeed () |
| Returns the entity's current speed. More... | |
| float | getMaxSpeed () |
| Returns the entity's maximum speed. More... | |
| void | onCollision (sf::Vector2f direction) |
| Handles live entity collision. TODO: Not yet (fully) implemented. More... | |
| bool | isAggressive () |
| Returns a value which specifies if the entity is aggressive. If a live entity is aggressive, it may attack other entities (such as the player). More... | |
| bool | isDead () |
| Returns a value which specifies if the live entity is dead. More... | |
| void | setDead (bool dead) |
| Sets the live entity's m_dead member variable, which specifies if the entity is dead. More... | |
| sf::Vector2f | getVelocity () |
| Gets the entity's current velocity vector. More... | |
| void | setVelocity (sf::Vector2f velocity) |
| Sets the entity's velocity vector. More... | |
| sf::Vector2f | getDirection () |
| Gets the entity's current direction. More... | |
| void | setDirection (sf::Vector2f direction) |
| Sets the entity's direction. More... | |
| Public Member Functions inherited from GameAIDemos::Entity | |
| Entity (sf::Vector2f size) | |
| Default constructor with an argument for the entity's size. More... | |
| Entity (sf::Vector2f size, sf::Vector2f position) | |
| Overloaded constructor with an additional argument for the entity's position in the game. More... | |
| Entity (sf::Vector2f size, std::string textureFilePath) | |
| Overloaded constructor with an argument for a file containing a texture for the entity. More... | |
| Entity (sf::Vector2f size, sf::Vector2f position, std::string textureFilePath) | |
| Overloaded constructor with an argument for position and texture file. More... | |
| void | setTexture (sf::Texture texture) |
| Sets the texture for the entity. More... | |
| void | setTexture (std::string textureFilePath) |
| Sets the texture for the entity after loading the texture from the given file path. More... | |
| void | setColor (sf::Color color) |
| Sets the entity's rectangle's color. Most likely temporary and for debugging purposes. More... | |
| void | setSpriteColor (sf::Color color) |
| Sets the entity's sprite's color tint. More... | |
| void | setPosition (sf::Vector2f &position) |
| Sets the position of the entity in the game scene. More... | |
| void | toggleInfoPanel () |
| Toggles the entity's information panel on or off, depending on its current state. More... | |
| float | getRectWidth () |
| Gets the width of the entity's rectangle. More... | |
| float | getRectHeight () |
| Gets the height of the entity's rectangle. More... | |
| sf::Vector2f | getPosition () |
| Gets the position of the entity in the game scene. More... | |
| sf::RectangleShape | getRect () |
| Gets the entity's rectangle. More... | |
| sf::Sprite | getSprite () |
| Gets the entity's sprite. More... | |
| GameAIDemos::InfoPanel & | getInfoPanel () |
| Gets the entity's InfoPanel object. More... | |
| bool | isInfoPanelEnabled () |
| Returns a boolean indicating if this entity's info panel UI element is enabled and being displayed in the UI. More... | |
| bool | isSelected () |
| Returns a boolean indicating if this entity has been selected by the user via a mouse click. More... | |
| void | toggleSelected () |
| Toggles the entity's selected state to true or false, depending on its current value. More... | |
| BaseEntityState * | getState () |
| Returns a pointer to a BaseEntityState object for this entity's current state. More... | |
| void | setState (BaseEntityState *state) |
| Sets the entity's current state. Exits the entity's current state, sets the state and enters the new state. More... | |
Protected Attributes | |
| int | m_health |
| Entity's health points. 0 = dead. More... | |
| float | m_speed |
| Entity's movement speed. More... | |
| float | m_maxSpeed |
| Entity's maximum movement speed. More... | |
| bool | m_aggressive |
| A boolean specifying if the live entity is aggressive. If a live entity is aggressive, it may attack other entities (such as the player). More... | |
| bool | m_dead = false |
| A boolean specifying if the live entity is dead. More... | |
| sf::Vector2f | m_velocity |
| A SFML Vector2f containing the entity's velocity. More... | |
| sf::Vector2f | m_direction |
| A SFML Vector2f containing the entity's direction. More... | |
| Protected Attributes inherited from GameAIDemos::Entity | |
| float | m_rectWidth |
| Returns a new instance of Collision for this entity, which can be used to handle and solve collisions between this entity and other entities in the game. More... | |
| float | m_rectHeight |
| Height of the entity's rectangle. More... | |
| sf::Vector2f | m_position |
| SFML Vector2f instance containing the position of the entity. More... | |
| sf::RectangleShape | m_rect |
| SFML RectangleShape instance for the entity's rectangle. More... | |
| sf::Sprite | m_sprite |
| SFML Sprite instance for the entity's sprite. More... | |
| sf::Texture | m_texture |
| SFML Texture instance for the entity's texture. More... | |
| sf::Color | m_color |
| SFML Color instance for the entity's rectangle color. More... | |
| InfoPanel | m_infoPanel |
| Instance of InfoPanel used for displaying entity information on screen. More... | |
| bool | m_displayInfoPanel = false |
| A boolean specifying if the entity's info panel should be displayed in the UI. An info panel displays useful information about an entity. More... | |
| bool | m_isSelected = false |
| A boolean specifying if the entity is currently selected by the user. More... | |
| BaseEntityState * | m_state |
| An pointer to a BaseEntityState object, representing the current state of this entity. More... | |
| Logger | m_logger |
| Instance of Logger for logging. More... | |
Subclass of Entity for live entities. Examples of live entities are NPCs, monsters and a player character.
| GameAIDemos::LiveEntity::LiveEntity | ( | int | health, |
| sf::Vector2f | size, | ||
| sf::Vector2f | position | ||
| ) |
Default constructor taking parameters for the entity's health, size and position.
Calls the superclass constructor and initializes member variables.
| health | The health points of the live entity. |
| size | A SFML Vector2f containing the live entity's size. |
| position | A SFML Vector2f containing the entity's position on the game scene. |
| GameAIDemos::LiveEntity::LiveEntity | ( | int | health, |
| sf::Vector2f | size, | ||
| sf::Vector2f | position, | ||
| float | speed | ||
| ) |
Overloaded constructor taking an additional parameter for the entity's speed.
| health | The health points of the live entity. |
| size | A SFML Vector2f containing the live entity's size. |
| position | A SFML Vector2f containing the entity's position on the game scene. |
| speed | The movement speed of the live entity. |
|
overridevirtual |
| sf::Vector2f GameAIDemos::LiveEntity::getDirection | ( | ) |
Gets the entity's current direction.
| int GameAIDemos::LiveEntity::getHealth | ( | ) |
Returns the entity's current health points.
| float GameAIDemos::LiveEntity::getMaxSpeed | ( | ) |
Returns the entity's maximum speed.
| float GameAIDemos::LiveEntity::getSpeed | ( | ) |
Returns the entity's current speed.
| sf::Vector2f GameAIDemos::LiveEntity::getVelocity | ( | ) |
Gets the entity's current velocity vector.
|
overridevirtual |
Handles events specific to the live entity.
| sfEvent | A SFML event (e.g. generated user input) object. |
Implements GameAIDemos::Entity.
Reimplemented in GameAIDemos::PlayerEntity.
| bool GameAIDemos::LiveEntity::isAggressive | ( | ) |
Returns a value which specifies if the entity is aggressive. If a live entity is aggressive, it may attack other entities (such as the player).
| bool GameAIDemos::LiveEntity::isDead | ( | ) |
Returns a value which specifies if the live entity is dead.
| void GameAIDemos::LiveEntity::onCollision | ( | sf::Vector2f | direction | ) |
Handles live entity collision. TODO: Not yet (fully) implemented.
Takes a direction vector. Adjusts the live entity's velocity based on the direction vector.
| direction | A SFML Vector2f object containing a direction vector. |
TODO: Incomplete and not in use
| void GameAIDemos::LiveEntity::setDead | ( | bool | dead | ) |
Sets the live entity's m_dead member variable, which specifies if the entity is dead.
| dead | A boolean specifying if the entity is dead. |
| void GameAIDemos::LiveEntity::setDirection | ( | sf::Vector2f | direction | ) |
Sets the entity's direction.
| direction | A SFML Vector2f containing the entity's new direction. |
| void GameAIDemos::LiveEntity::setHealth | ( | int | health | ) |
Sets the live entity's health points.
| health | An integer specifying the entity's new health points. |
| void GameAIDemos::LiveEntity::setMaxSpeed | ( | float | maxSpeed | ) |
Sets the entity's maximum speed.
| maxSpeed | Float specifying the entity's maximum speed. |
| void GameAIDemos::LiveEntity::setSpeed | ( | float | speed | ) |
Sets the entity's speed.
| speed | Float specifying the entity's speed. |
| void GameAIDemos::LiveEntity::setVelocity | ( | sf::Vector2f | velocity | ) |
Sets the entity's velocity vector.
| velocity | A SFML Vector2f containing the entity's new velocity. |
|
overridevirtual |
Updates the live entity.
| deltaTime | The delta time for the update frequency rate. |
Implements GameAIDemos::Entity.
Reimplemented in GameAIDemos::PlayerEntity.
|
protected |
A boolean specifying if the live entity is aggressive. If a live entity is aggressive, it may attack other entities (such as the player).
|
protected |
A boolean specifying if the live entity is dead.
|
protected |
A SFML Vector2f containing the entity's direction.
|
protected |
Entity's health points. 0 = dead.
|
protected |
Entity's maximum movement speed.
|
protected |
Entity's movement speed.
|
protected |
A SFML Vector2f containing the entity's velocity.


Content of this page is loaded only when valid authentication credentials are entered.


--- layout: default ---
As a Software Engineering team, DiverSE team produces a lot of code of various maturity. This goes from platform code to prototypes.
In order to keep track of such codes, this site lists the code repositories (or projects) and the related continuous integration servers.
Even if it is hard to maintain, this list is supposed to be exhaustive. So, if you are part of the Inria DiverSE team and your are working on a repository not listed here, please go to the github repository hosting this site and add a reference to your repository in the correct category.


Born and raised in El Salvador, I’m passionate for life, inspired by culture, socially
sensible, athletic enthusiast and food lover.
I am currently studying Advertising at the Academy of Art University in San Francisco,
California, and I am confident I am on the right track to become a successful Art Director. To
complement my passion for advertising I am an excellent communicator, problem solver and
inquirer.
During my years as a student at AAU, I've gained experience in creative strategy, copy
writing, design, and coding . I am skilled in the use of Photoshop, InDesign, Illustrator,
Sublime, Coda and Final Cut Pro.
My previous experiences have given me a broad understanding of the advertising field. From
UpMake in El Salvador, to Ogilvy & Mather in El Salvador to DDB Health in San Francisco. I've
been able to acquire a great set of communication and design skills.
I’m excited to see where my creative career will take me.


Todos
Press Enter to save this task
Mark all as complete
left.
Clear
completed
Double-click to edit a todo.
Created by
Jérôme Gravel-Niquet
Converted to use o_O by
weepy


|
Raytracer
1.0.0
|
#include <Tracer.h>
Public Member Functions | |
| Tracer (std::shared_ptr< World > world_ptr) | |
| virtual RGBColor | TraceRay (const Ray &ray) const |
Protected Attributes | |
| std::weak_ptr< World > | m_WorldPtr |
TODO.
| Tracer::Tracer | ( | std::shared_ptr< World > | world_ptr | ) |
Constructs a Tracer with a pointer to the world.
| world_ptr | Pointer to the world. |
Standard ray tracing method.
| ray | Ray traced. |
Reimplemented in RayCast, and MultipleObjects.


Deal with the cruise experts to find and book your next dream getaway for less. Exceptional savings and value await.
Sign up for our newsletter and receive our best deals in your inbox.


{% load bootstrap4 %} {% load crispy_forms_tags %} {% load static %}
| CONTENT |
| USABILITY |
| DESIGN |
| AVERAGE |
Thank you for your review
Total Votes: {{all|length}}
{%if all%}
Voters
Rating
{%for you in all%}
{{you.user}}
| DESIGN:{{you.design}}.0
| USABILITY:{{you.usability}}.0 |
CONTENT:{{you.content}}.0 |
{%endfor%}
{%else%}
- No votes Available
{%endif%}


Pull yourself together. Keep your chin up. Don't be so miserable. Today is a beautiful day.
Today is a beautiful day.


The Devil's Dictionary is the work of the American writer Ambrose Bierce, who also wrote the short story "An Occurrence at Owl Creek Bridge". Bierce began to write satirical dictionary definitions in 1875 and published them sporadically in his newspaper columns in the ensuing decades. The first bound volume of his dictionary appeared in 1906. While some of Bierce's allusions may be outmoded, his observations of human frailty remain sharp and true.


Xuan's Header(h1-h6)(h1)
This text in within paragraph of the body called "P"
This is header 2
This text is in the paragraph
2 of t called "p"
Second "p" pf of header "h2"
This is another header1 and so on...
Another paragraph "p" and so on..
Tags Examples using heading4
This here is a Link Tage that take you to yahoo.com
This is an Image Tag
| First Name |
Middle Name |
Last Name |
| Xuan |
Viet |
Ho |
| Alex |
Tie |
Quang |
- IT
- It stand for "Information Technology"
- PC
- It stand for "Personal Computer"
W3Schools.com


flipkart
Businessmodel of Flipkart
Customer Segments
Flipkart has a multi-sided business model, with two interdependent customer segments that are both needed in order to operate:
Suppliers: Manufacturers and retailers that make their merchandise available on the website.
Consumers: Individuals who visit the website and purchase available items.
Value Proposition
Flipkart offers five primary value propositions: accessibility, convenience, price, risk reduction, and brand/status.
The company increases accessibility by making it possible for merchants who do not have a website to sell their products through its channel. This is particularly essential for many small retailers.
The company creates convenience for consumers by offering a wide variety of items (over 30 million products) in numerous categories (70+) from multiple vendors (over 85,000) in a centralized channel. It also provides flexibility by enabling buyers to pay using a variety of methods, including credit cards, debit cards, gift cards, and cash on delivery. For merchants, Flipkart offers convenience by guaranteeing payments (deposited directly) within 5-7 business days of processing an order.
The company offers consumers a lower price than they would receive from physical outlets because it has lower operating expenses. It does not have to worry about many overhead costs, allowing it to pass savings onto customers. It also implements frequent promotions such as “Deals of the Day.”
The company reduces risk by providing the “Flipkart Advantage.” This is a label given to certain merchants that confirms that their products have been checked for quality by Flipkart. The items are also supported by a 30-day replacement guarantee and a same-day delivery option. For vendors, it offers the Seller Protection Program, which protects firms from losses due to failed payments.
The company has established a strong brand due to its success, and bills itself as India’s leading online retailer. It has 75 million registered customers who make 10 million visits to its website daily. Further, it makes 8 million shipments a month to more than 1,000 cities.
Channels
Flipkart’s main channel is its website, through which it acquires both merchants and buyers. The company also promotes its offerings through its mobile app.
Customer Relationships
Flipkart’s customer relationship is primarily of a self-service, automated nature for consumers. Customers utilize the website while having limited interaction with employees. The site has a “Help & FAQs” section with detailed answers to common questions. With merchants, Flipkart’s relationship is more of a personal assistance nature. The company offers a 24/7 customer service phone line for vendors. It also provides training that covers topics such as merchandising and order fulfillment.
Key Activities
Flipkart’s business model entails maintaining a robust platform between two parties: merchants and consumers. The platform includes its website and mobile app.
Key Partners
Flipkart maintains relationships with “eCommerce Service Providers”, third-party firms that offer the following services to suppliers:
Cataloging – The firms ensure sellers‘ product descriptions are clear and have pleasing photos.
Logistics – The firms offer order fulfilment through more than 120 pick-up hubs while using over 10,000 delivery employees.
Capital – Flipkart’s Growth Capital program features a network of partners who provide financial assistance to suppliers for their business needs. The funds are offered at competitive rates with a quick turnaround time.
Flipkart also maintains an affiliate program through which it tasks members with promoting the site on their platforms (websites, mobile apps, etc.). Traffic that results in purchases leads to a commission for the partners. Program members receive affiliate tools such as banners, widgets, and APIs for their sites. They also have access to real-time reports on customer referral traffic.
Key Resources
Flipkart’s main resource is its technology personnel who maintain and upgrade its website. Another important human resource is its service personnel who provide support to customers, as well as a 24/7 presence for sellers. There are important physical assets in the form of its state-of-the-art fulfillment centers, where products are stored. Lastly, as a start-up it has relied heavily on funding from investors, raising $3.15 billion from 16 companies as of July 2015.
Cost Structure
Flipkart has a cost-driven structure, aiming to minimize expenses through significant automation and low-price value propositions. Its biggest cost driver is likely transaction expenses, a fixed cost, as it has many different types of fees. Other major drivers are in the areas of customer support and administration, both fixed costs.
Revenue Streams
Flipkart has three revenue streams:
Transaction Fees – The company charges a “marketplace fee” for all successfully completed orders. This fee includes the following sub-fees:
- Shipping Fee – Based on shipping location and product weight
- Fixed Closing Fee – A small transaction fee for closed orders
- Selling Commission – Represents a percentage of the sales price (varies by category and subcategory) Sellers are charged a service tax that totals 14.5% of the marketplace fee.
Subscription Fees – The company operates “Flipkart First”, a promotional subscription program that costs Rs. 500 per year. Members receive the following benefits, among others:
- No minimum purchase price
- Free shipping on orders
- Discounted same-day delivery
- 24/7 customer service
- Exclusive product offers Advertising Fees – The company charges fees to third-parties that want to advertise their offerings through its website and in its mobile app.


Anonymous Bitcoin
Transcript By: Bryan Bishop
Category: Conference
Adam Ficzor (nopara73)
Building on Bitcoin 2018
Anonymous bitcoin
https://twitter.com/kanzure/status/1014128850765303808
https://github.com/zkSNACKs/WalletWasabi
One year ago I was standing here at this conference and Igave a talk. Today I am standing here and I titled my talk “Anonymous bitcoin”. One year ago at this conference, the conference was named “breaking bitcoin”. I did not break bitcoin. Someone else did, you might remember.
Today I want to present how I build on bitcoin. I have two goals with this presentation. I want to provide a case study of the bitcoin developer and his mistakes and successes. That bitcoin developer is me. The second goal is secret. I will only tell you the goal at the end of the talk.
I organized this talk into thre sections: joinmarket, tumblebit and zerolink. I just want to tell you the differences. These were the things that I pursued. This is something I wanted to achieve in different phases in my bticoin developer career. I will also speak some of the speakers. And hopefully you will want to– you will wait for their presentation just as much I will be waiting in anticipation.
So first slide. respect my authority. I worked on a few projects. I wanted to talk about zerolink and dotnettor. What I am most proud of is that I became one of the 100 most active contributors on github. Github only countsp eople with 1000 followers. So anyway, this is something that I am proud of, as a ersult of this project.
I am going to talk about what success looks like versus what people think it looks like. People think success is a straight line. But then you start looking into what you contribute to bitcoin. But very often, your goal changes. Success doesn’t look like a straight line. It looks like a complex line. In every part of my presentation, my goal changed.
I first looked into bitcoin but I didn’t see much for me to do. I was coding in python. There were no tools that I could have used. There were so many things to build. That made me– just hanging around in social media, or gambling on altcoins and things like that.
And then I was in Taiwan, it was 10pm at night, and I was out of money and I had this job interview as a blockchain developer. I was excited about it.  I was excited. I went to Thailand. The guy took me to The Vroots. There were some other developers and they were trying to come up with a blockchain product. The criteria was to come up with anything that was blockchain related. It did not succeed.
That’s when I realized that I have to stick to bitcoin. This thing came out called joinmarket and everyone was excited about it. I built a user interface. I wanted to call their python code from my C# code. It seemed like an easy thing to tackle. I was spending months on this. I was trying to solve this problem. But then I told myself that I was going to rewrite joinmarket in C#.
One of the developers and creator of joinmarket, Adam Gibson (waxwing), is also going to speak at this conference. That’s his face in the picture.
I said to myself that I was going to rewrite some parts of joinmarket in C#. For that, I had to learn how to develop in bitcoin and C#. I found that someone built a C# bitcoin library who is also here, NicolasDorier, working on Nbitcoin. I sent an email– how many messages did you send to Mark Zuckerberg? I sent a lot. I sent a message to this guy too. And he said come to Japan and let’s do something. So I found myself a few days later on a plane to Japan. The guy who wrote the dotnet bitcoin library, Nbitcoin, is NocolasDorier, who is also a speaker at this conference.
I went to Japan. He had already written a book called programming the blockchain in C#. At this time, blockchain was not a curse word. So I call it the C# bitcoin book now. I rewrote the book to my level. I wextended the concepts and ut it on github. That’s how I learned bitcoin programming.
I wanted Nicolas to come and do joinmarket with me. But he wasn’t interested in privacy. By the time that I– there was so much more going on in bitcoin, and a rewrite would not happen in a few months. And then I realized that I should just learn python.
I wanted to write an http communication system or daemon for joinmarket so that I can finally connect my code with it. But then NicolasDorier sent me a message that hey did you hear about this thing called joinmarket– no, called tumblebit. I told him yes, I’ve heard of it, it’s very complex. Why don’t you do joinmarket with me? And then he said no I’m going to code tumblebit. It’s much easier than joinmarket.
“I was wrong” - NicolasDorier (a comment from the audience)
Tumblebit is a uni-directional payment hub like the lightning network but without the network part. It’s anonymous. There’s two modes to tumblebit. One is the payment hub mode and the other is the other mode.
Joinmarket– the difference between joinmarket and tumblebit is the size of the anonymity set. Joinmarket is instant, though. I started to work on tumblebit but first I had to understand what tumblebit is. It’s not an easy job. There’s only the whitepaper.
I started writing a bog post called “understanding tumblebit” and it was a series. With these blog posts, I was starting to understand tumblebit. One of the things is that it needs tor.
Microsoft was already open-sourcing a cross-platform dot net at the time. The cross-platform for dot net is dot net Core. We decided to go with that, but ther ewas no Tor library for that. Tor is an anonymity network for those who don’t know. There was no tor library for dot net. So I wrote a tor library. It’s called dotNetTor and I am still maintaining that on github.
https://github.com/nopara73/DotNetTor
Now we have tor in dot net. We have tumblebit. I realized something else too. There is no litewallet that would not fail on the privacy level on the network at this level. Every lite wallet is vulnerable to network analysis. With most lite wallets, it’s easy to see because it’s querying a bitcoin API. It’s just conneted togethe. With SPV wallets, i’ts a little more subtle. Jonas Nick is also a speaker at this conference and he has de-anonymized a lot of SPV wallets. He said, give me one of your bitcoin addresses, and 70% of your wallet addresses. That’s pretty scary.
I was looking into, what can you do? Building tumblebit on Bitcoin Core would mean that you have no users, no anonymity set, it’s just not going to work like that.
I was looking at– a place to do it– and Jonas Schnelli had a pull request into Bitcoin Core, he is also a speaker at this conference- and he built a full block downloading SPV wallet which is kind of like a full node but it does SPV verification and it only downloads the blocks from the creation of the wallet. That pull request to Bitcoin Core is still there. I’d like to see some progress on that, you guys.
I built my own full block SPV downloading wallet in dot net. I called it… something wallet.. By the way, the idea of it, goes back to the joinmarket phase. I built that wallet, which was lite-ish. That was good enough.
One of the interesting things I realized while I was building the wallet was that fee estimation is non-deterministic.  You don’t know the transaction size until you calculate the fee. Think about that.
The lite wallet is ready. It does not expose your links between your addresses on the network. The tor library is ready. Tumblebit is ready. I was integrating tumblebit into the wallet. And then Itook a step back and I wrote a blog post.
https://medium.com/@nopara73/tumblebit-vs-coinjoin-15e5a7d58e3
I compared tumblebit and coinjoin. Joinmarket is coinjoin. Tumblebit’s classic tumble mode and joinmarket…. there was something that I didn’t know existed, called coinshuffle, which existed at the time. It didn’t click for me. I realized that … the classic tumbler mode.. the network fees were at the time were going up, like crazy, and tumblebit wruns were taking two hours, today it takes 6 hours, so it’s not getting better. The fees get higher and there’s this coinjoin … that… that might, that might perform much better in almost every way. So I was looking to see if this thing existed. I found coinshuffle, but it was so complex, that, I think it would take a lot of time for developers to get a good handle on it. So I was looking into something else.
Does anyone know who is gmaxwell? The other one is David Chaum, in the picture.
gmaxwell made a 2013 bitcointalk post where he wrote an idea about how can we do coinjoin as envisioned, with David Chaum’s blind signatures. It was just two lines of writing and he then inside a fragmented question section– nobody seemed to notice this– Iasked Ethan Heilman, one of the creators of tumblebit, look at this, you wrote something in the tumblebit whitepaper about coinjoin, but it seems to work properly this way. And he goes, “oh really? I read that blog post a thousand times and I never seemed to notice this”. So it seemed to be pretty hidden. Nobody was doing chaumian coinjoin. Yeah…
So I got into that. It was a pretty hard realization. When you spend… probably a year to work on tumblebit an then you find something that works probably better in every way, so… so for example, tumblebit rounds take hour, and chaumian coinjoin rounds take seconds at most minutes. Tumblebit rounds are 4x more expensive than the coinjoin rounds. So this kind of differences there are. It was really hard to realize that. There was this quote that– from Eugene T. Gendlin- what’s true is already so, owning up to it doesn’t make it worse.
If you think about this quote, in terms of the scaling debate, it works pretty well. People didn’t own up to the truth of the lack of scalability of the blockchain. So I owned up to the truth that chaumian coinjoin was better.
Zerolink
https://www.youtube.com/watch?v=RY-QQOjycgI
Zerolink is– even if you have a privacy technique on the blockchain- you have to look at what happens before and after the mix. Zerolink puts them together and says you have to look at how you broadcast your transactions, how do you set your fees, just all this linking metadata on the blockchain. I presented zerolink one year ago at Breaking Bitcoin 2017.
With the help of Matthew, we implemented zerolink into the wallet. And finally we were doing public testing in December.
It didn’t go that well.
We wanted 100 people to join the mix. We wanted an anonymity set of size 100. That’s something that even an altcoin would be doing. Maybe zcash but they don’t because nobody is actually using it. I like the privacy altcoins. I would prefer to not say bad things about people working on privacy. I like privacy. The biggest mix that we were able to achieve was 26 people.
I went to scalingbitcoin 2017 in the US. At the border, they asked me, why did I come to the US. I told them I came for a bitcoin conference. And they said, okay, come with me. Okay, why. They said just come with me. But why? Just come with me. They took me to a room. There were a couple of people in the room. I tweeted that they were taking me somewhere. They started shouting at me. Put down your phone, don’t get it out again. I was terrified. I couldn’t use technology. I had to stay down. I was asking why I was there. I had to sit there not doing anything just thinking for 12+ hours. I was terrified. Maybe they knew I was working on privacy in bitcoin? This resonated in me, that working on privacy in bitcoin, I don’t think I can go to the US anymore. I think I should not. Should I even release this software? Is it even a good idea? Anyway long story short, they had a shift change and they had no idea why I was there.
So then I figured I should delay the release a bit. WIth the help of Lucas Ontivero, we did as much as we could. We did regression tests, continuous integration cross platform, added 10x more unit tests, rewrote the tor library. It’s fun to rewrite an http protocol from scratch. You write something that is specified. It’s very rare that this is how you write software- already having the spec. It’s nice. Anyway.
And then we came to the idea that I should find some lawyers and team up with them. So Gergley Hajdu, Balint Harmat. They are here in this room. We work on zkSNACKs - unfairly private. This was after blockdigest series named after a blockdigest series. Thanks for that digest.
When I first went to Gergely- who was my university law teacher- they said, this is a crazy idea, this is– you can’t do this. You cannot build privacy on bitcoin. Something like that. But later they came back to me and said this could work. There are some very strong privacy laws in a lot of countries. We could make this work I think. So we founded a company.
We renamed HiddenWallet to Wasabi Wallet. Full block SPV became bip157-158. Wasabi is a snack food or something like that. Electron became Avalonia.
The lightning devs introduced bip157 and bip158, which is the replacement of bloom filters in SPV wallets. The original bloom stuff was terrible. You setup some filters and then from those filters you can figure out which blocks you are interested in. You can get those blocks from random nodes, and then nobody can figure out which blocks you’re interested in, and if you change tor circuits, it’s hard for anyone to know what you’re looking for. So this doesn’t harm your privacy. We implemented it. We are probably the first one to release it on the testnet. Bitcoin Core nodes don’t support it yet. We have our own backend that sends it… to the clients.. and that’s how it works.
And finally, we replaced electron with avalonia, with the help of Dan Walmsley. Avalonia is a native.. dot net.. user graphical interface framework and I succeeded to get one of the maintainers of Avalonia here to work with us. That’s an interesting story too.
He said that he doesn’t have time, but he’s going to … to this one, and come to this one and that’s what we did, and then they asked me about a conference to speak, and I said I don’t have time, I’m going to be in Lisbon, and then they said well the conference is in Lisbon too… and I said alright tht’s just great.
Wasabi Wallet is almost finished.
https://github.comzkSNACKs/WalletWasabi
The 10 year anniversary of the Satoshi whitepaper is coming up. It would be great to be able to use bitcoin in a fully anonymous way with wasabi wallet on that date. I want you to join your coin with mine. Thank you.
Q&A
Q: What is wasabi based on?
A: Coinjoin. Zerolink is a framework. Coinjoin is a mixing technique.
Q: Tumblebit, compared to coinjoin, you cannot link one input to one output. That’s one big difference. The other big difference is that there’s a server that allows different people to come togheter but doesn’t know where the coins go. It has a different security assumption. That said, I’m excited about it. The server doesn’t know where the coin comes from and where it goes.
A: That’s the same with chaumian coinjoin. Tumblebit transactions are recognizable on the blockchain, unfortunately.
Q: If we had good anonymity set, then it would be better Also, we should taproot and graftroot to hide the contracts, and that would make them indistinguishable. But yeah, right now, coinjoin seems like the way to go.
A: Are scriptless scripts going to enable that?
Q: I am not sure. We can hide the contracts. That would make me able to– people wont be able to identify these transactions. It would remove some of the stuff that deanonymizes me and links it to me and stuff like that.
Q: How does your work relate to confidential transactions and bulletproofs?
A: In every mixing technique except joinmarket, you have to do rounds. The amount has to match everyone else, otherwise you could deanonymize it quite easily. Confidential transactions would fix this. I hope we’re going to see confidential transactions in bitcoin when it gets secure enough.
Q: And then you can combine it with your framework for even more privacy
A: Yes. There’s time to figure out how to combine it.
Q: In joinmarket, ther’s an incentive structure to motivate people to provide their coins for the market. To provide more anonymity. Is there anything like that in wasabi wallet?
A: There is nothing like that in wasabi wallet. The only incentive is anonymity. Joinmarket has market makers and market takers.  That’s what joinmarket does. Some people are waiting, they join coins together, and I pay some fee for you guys to join your coins with mine. This is the thing about coinjoin.. you’re not going to pay 100 people to have an anonymity set of 100. And you’re not going to wait for other people to make a large coinjoin and schedule it.
Q: What about lightning?
A: Lightning and coinjoin is an interesting idea. This is pretty good. You don’t need a – you are okay with.. to open the channel.. that would be a good use case. There are a lot of things to fix about privacy and that’s what’s prioritized.


Namespace for common utility functions used by gesture modules.
- Source:
- core/util.js, line 6
Members
-
<static> closest
-
Gets the closest element that matches the tagToMatch
- Source:
- core/util.js, line 24
-
<static> isSVG
-
Checks if an element is any SVG
- Source:
- core/util.js, line 15
-
<static> touch
-
Determines if touch enabled
- Source:
- core/util.js, line 99
-
<static> transformPoint
-
Transforms a point if needed
- Source:
- core/util.js, line 53
Methods
-
<static> getAngle(startPoint, currentPoint) → {Number}
-
Get the angle between two points.
Parameters:
Name Type Description startPoint
T.Point The starting point (startPoint.x, startPoint.y) currentPoint
T.Point The end point (currentPoint.x, currentPoint.y) - Source:
- core/util.js, line 217
Returns:
The angle between the points- Type
- Number
-
<static> getDeltaAngle(startPoint, currentPoint) → {Number}
-
Get the delta angle between two points by removing `currentPoint` from `startPoint`.
Parameters:
Name Type Description startPoint
T.Point The starting point (startPoint.x, startPoint.y) currentPoint
T.Point The end point (currentPoint.x, currentPoint.y) - Source:
- core/util.js, line 234
Returns:
The delta angle between the points- Type
- Number
-
<static> getDirection(degrees) → {String}
-
Get the direction based on degrees.
Parameters:
Name Type Description degrees
Number The degrees to evaluate - Source:
- core/util.js, line 250
Returns:
A string description of the direction ('left', 'right', 'up', 'down'), returns 'invalid' if the degree is under 0 or over 360- Type
- String
-
<static> getEvents()
-
Gets which events that are used, touchstart, touchmove, touchend or mousedown, mousemove, mouseup or MSPointerDown, MSPointerMove, MSPointerUp
- Source:
- core/util.js, line 150
-
<static> getVelocity(startPoint, currentPoint, startTime, currentTime) → {Number}
-
Get the velocity using two points.
Parameters:
Name Type Description startPoint
T.Point The starting point (startPoint.x, startPoint.y) currentPoint
T.Point The end point (currentPoint.x, currentPoint.y) startTime
Number The start time currentTime
Number The end time - Source:
- core/util.js, line 272
Returns:
The velocity- Type
- Number
-
<static> isArray(a) → {Boolean}
-
Used to determine if an object is an array.
Parameters:
Name Type Description a
Array The object to test - Source:
- core/util.js, line 195
Returns:
Whether it is an array- Type
- Boolean
-
<static> isFunction(f) → {Boolean}
-
Used to determine if an object is a function.
Parameters:
Name Type Description f
Function The object to test - Source:
- core/util.js, line 184
Returns:
Whether it is a function- Type
- Boolean
-
<static> isObject(o) → {Boolean}
-
Used to determine if an object is a plain object.
Parameters:
Name Type Description o
Object The object to test - Source:
- core/util.js, line 206
Returns:
Whether it is a plain object- Type
- Boolean
-
<static> logger(event, touchList)
-
Helper function for logging touch events.
Parameters:
Name Type Description event
TouchEvent The event to log touchList
String The array name to log (i.e. 'touches', 'changedTouces' etc.) - Source:
- core/util.js, line 159


λ Punter FX
Connection settings
Game port:
Punter name:
Connect
Disconnect
Log
Replay Information
Full Replay
Start Replay
Next
Next 20
Canvas


Task Graph
Source
here
NOTE: This is in development, so right now there is NO PRIVACY
Hello #1
Hello #2


FreeSide is a student run project at the University of Hull (http://www.hull.ac.uk/) which offers free (in both free beer and free speech terms) Unix, Open and Alternative computing services to the student population of the University.
We offer: