Module net
This module provides support for networking using
TCP and UDP sockets. A socket represents a connection between a
client and a server program over a network. The underlying native
binding is provided by the java.net
package.
Example
// A simple TCP server var io = require('io'); var net = require('net'); var server = new net.ServerSocket(); server.bind('<IP_ADDRESS>', 6789); var socket = server.accept(); var stream = new io.TextStream(socket.getStream(), { 'charset': 'US-ASCII' }); var line; do { // Read one line from the client line = stream.readLine(); console.log(line); // Write back to the client stream.writeLine("Received: " + line); } while (line.indexOf("END") < 0); stream.close(); socket.close(); server.close();
Class DatagramSocket
Instance Methods
- bind(host, port)
- close()
- connect(host, port)
- disconnect()
- getTimeout()
- isBound()
- isClosed()
- isConnected()
- localAddress()
- receive(length, buffer)
- receiveFrom(length, buffer)
- remoteAddress()
- send(data)
- sendTo(host, port, data)
- setTimeout(timeout)
Class ServerSocket
Instance Methods
- accept()
- bind(host, port)
- close()
- getTimeout()
- isBound()
- isClosed()
- localAddress()
- setTimeout(timeout)
Class Socket
Instance Methods
- bind(host, port)
- close()
- connect(host, port, [timeout])
- getStream()
- getTimeout()
- isBound()
- isClosed()
- isConnected()
- localAddress()
- remoteAddress()
- setTimeout(timeout)
DatagramSocket ()
The DatagramSocket class is used to create a UDP socket.
DatagramSocket.prototype.bind (host, port)
Binds the socket to a local address and port. If address or port are omitted the system will choose a local address and port to bind the socket.
Parameters
| String | host | address (interface) to which the socket will be bound. |
| Number | port | port number to bind the socket to. |
DatagramSocket.prototype.close ()
Close the socket immediately
DatagramSocket.prototype.connect (host, port)
Connect the socket to a remote address. If a DatagramSocket is connected, it may only send data to and receive data from the given address. By default DatagramSockets are not connected.
Parameters
| String | host | IP address or hostname |
| Number | port | port number or service name |
DatagramSocket.prototype.disconnect ()
Disconnects the socket.
DatagramSocket.prototype.getTimeout ()
Return the current timeout of this DatagramSocket. A value of zero implies that timeout is disabled, i.e. receive() will never time out.
Returns
| Number | the current timeout |
DatagramSocket.prototype.isBound ()
Returns whether this socket is bound to an address.
Returns
| Boolean | true if the socket has been bound to an address |
DatagramSocket.prototype.isClosed ()
Returns whether the socket is closed or not.
Returns
| Boolean | true if the socket has been closed |
DatagramSocket.prototype.isConnected ()
Returns whether the socket is connected or not.
Returns
| Boolean | true if the socket has been connected to a remote address |
DatagramSocket.prototype.localAddress ()
Get the local address to which this socket is bound. This returns an
object with a property address
containing the IP address as string
and a property port
containing the port number, e.g.
{address: '<IP_ADDRESS>', port: 8080}
.
Returns
| Object | an address descriptor |
DatagramSocket.prototype.receive (length, buffer)
Receive a datagram packet from this socket. This method does not return the sender's IP address, so it is meant to be in conjunction with connect().
Parameters
| Number | length | the maximum number of bytes to receive |
| ByteArray | buffer | optional buffer to store bytes in |
Returns
| ByteArray | the received data |
DatagramSocket.prototype.receiveFrom (length, buffer)
Receive a datagram packet from this socket. This method returns an object with the following properties:
- address: the sender's IP address as string
- port: the sender's port number
- data: the received data
Parameters
| Number | length | the maximum number of bytes to receive |
| ByteArray | buffer | optional buffer to store bytes in |
Returns
| Object | the received packet |
DatagramSocket.prototype.remoteAddress ()
Get the remote address to which this socket is connected. This returns an
object with a property address
containing the IP address as string
and a property port
containing the port number, e.g.
{address: '<IP_ADDRESS>', port: 8080}
.
Returns
| Object | an address descriptor |
DatagramSocket.prototype.send (data)
Send a datagram packet from this socket. This method does not allow the specify the recipient's IP address, so it is meant to be in conjunction with connect().
Parameters
| Binary | data | the data to send |
DatagramSocket.prototype.sendTo (host, port, data)
Send a datagram packet from this socket to the specified address.
Parameters
| String | host | the IP address of the recipient |
| Number | port | the port number |
| Binary | data | the data to send |
DatagramSocket.prototype.setTimeout (timeout)
Enable/disable timeout with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a call to receive() for this DatagramSocket will block for only this amount of time.
Parameters
| Number | timeout | timeout in milliseconds |
ServerSocket ()
This class implements a server socket. Server sockets wait for requests coming in over the network.
ServerSocket.prototype.accept ()
Listens for a connection to be made to this socket and returns a new Socket object. The method blocks until a connection is made.
Returns
| Socket | a newly connected socket object |
ServerSocket.prototype.bind (host, port)
Binds the socket to a local address and port. If address or port are omitted the system will choose a local address and port to bind the socket.
Parameters
| String | host | address (interface) to which the socket will be bound. |
| Number | port | port number to bind the socket to. |
ServerSocket.prototype.close ()
Close the socket immediately
ServerSocket.prototype.getTimeout ()
Return the current timeout of this ServerSocket. A value of zero implies that timeout is disabled, i.e. accept() will never time out.
Returns
| Number | the current timeout |
ServerSocket.prototype.isBound ()
Returns whether this socket is bound to an address.
Returns
| Boolean | true if the socket has been bound to an address |
ServerSocket.prototype.isClosed ()
Returns whether the socket is closed or not.
Returns
| Boolean | true if the socket has been closed |
ServerSocket.prototype.localAddress ()
Get the local address to which this socket is bound. This returns an
object with a property address
containing the IP address as string
and a property port
containing the port number, e.g.
{address: '<IP_ADDRESS>', port: 8080}
Returns
| Object | an address descriptor |
ServerSocket.prototype.setTimeout (timeout)
Enable/disable timeout with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a call to accept() for this ServerSocket will block for only this amount of time.
Parameters
| Number | timeout | timeout in milliseconds |
Socket ()
The Socket class is used to create a TCP socket. Newly created sockets must be connected to a remote address before being able to send and receive data.
Socket.prototype.bind (host, port)
Binds the socket to a local address and port. If address or port are omitted the system will choose a local address and port to bind the socket.
Parameters
| String | host | address (interface) to which the socket will be bound. |
| Number | port | port number to bind the socket to. |
Socket.prototype.close ()
Close the socket immediately
Socket.prototype.connect (host, port, [timeout])
Initiate a connection on a socket. Connect to a remote port on the specified host with a connection timeout. Throws an exception in case of failure.
Parameters
| String | host | IP address or hostname |
| Number | port | port number or service name |
| Number | [timeout] | optional timeout value in milliseconds |
Socket.prototype.getStream ()
Get the I/O stream for this socket.
Returns
| Stream | a binary stream |
See
Socket.prototype.getTimeout ()
Return the current timeout of this Socket. A value of zero implies that timeout is disabled, i.e. read() will never time out.
Returns
| Number | the current timeout |
Socket.prototype.isBound ()
Returns whether this socket is bound to an address.
Returns
| true if the socket has been bound to an address |
Socket.prototype.isClosed ()
Returns whether the socket is closed or not.
Returns
| true if the socket has been closed |
Socket.prototype.isConnected ()
Returns whether the socket is connected or not.
Returns
| true if the socket has been connected to a remote address |
Socket.prototype.localAddress ()
Get the local address to which this socket is bound. This returns an
object with a property address
containing the IP address as string
and a property port
containing the port number, e.g.
{address: '<IP_ADDRESS>', port: 8080}
.
Returns
| Object | an address descriptor |
Socket.prototype.remoteAddress ()
Get the remote address to which this socket is connected. This returns an
object with a property address
containing the IP address as string
and a property port
containing the port number, e.g.
{address: '<IP_ADDRESS>', port: 8080}
.
Returns
| Object | an address descriptor |
Socket.prototype.setTimeout (timeout)
Enable/disable timeout with the specified timeout, in milliseconds. With this option set to a non-zero timeout, a read() on this socket's stream will block for only this amount of time.
Parameters
| Number | timeout | timeout in milliseconds |


{title}
Build #{buildNumber} for commit {commitIDShort} has completed successfully and the resulting image has been deployed to the staging environment.
{commitMessage}


Enter the string to filter it:
Without a filter : {{userData}}
With a custom filter : {{userData | myFilter}}
With a custom filter in uppercase : {{userData | myFilter : true}}
With a custom filter in uppercase and Welcome as string : {{userData | myFilter : true : 'Welcome'}}


Toggle navigation
Logo bt2
Service
About
Contact
Shop name
Danh muc san pham 1
Danh muc san pham 2
Danh muc san pham 3
Title
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Po
Action
Action


The installation procedure should be very similar to the Installing binary tarball on Ubuntu page.
If your OS uses an init system other than Upstart, then instead of the Upstart job configuration file, use the example SysV init scripts in the examples directory:
sudo cp doc/examples/daemon/init.sh /etc/init.d/mireka sudo cp doc/examples/daemon/default.sh /etc/default/mireka sudo chmod 755 /etc/init.d/mireka
Configure your system to autostart the Mireka service at boot time.


JSON Utility
Use the JSON object to modify the flow of data / variables through an Alfred workflow, along with dynamically modifying the configuration of the attached objects.
JSON Format
The JSON format should be enclosed within an alfredworkflow
object, and contain a combination of arg
, config
or variables
.
{
"alfredworkflow" : {
"arg" : "{query}",
"config" : {
},
"variables" : {
}
}
}
"arg"
The arg
string sets the argument passed out of the JSON Utility which is used as the query for the attached objects. Leaving out the arg
string will clear the query, and setting arg
to {query}
will pass through the query.
"config"
The config
object enables dynamic (and overriding) configuration of the workflow objects connected to the output of the JSON Utility.
The easiest way to find out which configuration fields are available for an object is to copy the object configuration from the right-click popup menu for the selected workflow object on the canvas. For example, here is a copied configuration for the Open URL workflow object:
{
"alfredworkflow" : {
"config" : {
"browser" : "",
"spaces" : "",
"url" : "{query}",
"utf8" : true
}
}
}
Only the included fields will be overridden, allowing for partial dynamic configuration of a workflow object.
The fields are generally self-explanatory, but if you have trouble identifying a field, set it to a unique value in the object's configuration sheet and copy the configuration again. You'll see the value you set.
"variables"
The variables
object enables new variables to be set, and stream variables to be overridden.
Including dynamic placeholders
Fields within the JSON can use dynamic placeholders. Take a look at the Dynamic Placeholders page for more details.
Advanced JSON
Did you know that you can output the above JSON from a Script Action instead of the JSON Utility?
The JSON you see above is native to data passed internally through an Alfred workflow stream, so by creating it within a script and outputting it, you can have full control over the argument, configuration and variables passing through and out of your Script Action.


A problem has been detected and ReactOS has been shut down to prevent damage to your computer.
If this is the first time you've seen this Stop error screen, restart your computer.
If this screen appears again, follow these steps:
Check to be sure you have adequate disk space.
If a driver is identified in the Stop message, disable the driver or check with the manufacturer for driver updates.
Try changing video adapters.
Check with your hardware vendor for any BIOS updates.
Disable BIOS memory options such as caching or shadowing.
If you need to use Safe Mode to remove or disable components, restart your computeer, press F8 to select Advanced Startup Options,
and then select Safe Mode.
Technical information:
*** STOP: 0x0000001E (0xHAC708ER, 0xF3570000, 0x20180000, 0x00000000)
*** HCKTBR.EXE - Address 0xHAC708ER base at 80000000, DateStamp<PHONE_NUMBER>958
*** HCKTBR.EXE - Address 0xF3570000 base at 80000000, DateStamp<PHONE_NUMBER>958
*** HCKTBR.EXE - Address 0x20180000 base at 80000000, DateStamp<PHONE_NUMBER>958


Time complexity of an algorithm quantifies the amount of time taken for a calculation as a function of the quantity of input. Naively speaking, most molecular dynamics algorithms are of quadratic time complexity, or O(n2) problems. This means that as the number of entities or particles, n, in the system increases, the time taken to complete the calculations increases quadratically.
Molecular dynamics algorithms are O(n2) because computing distances between particles, when dealt with naively, is of quadratic time complexity. This is also the bottle neck in most algorithms. By way of neighbour lists and cell lists, it is indeed possible to make this logarithmic, but for the purpose of this post, let’s look at tricks to optimise the simple approach using python.
This problem can be most efficiently solved by simply using the scipy.spatial.distance.pdist
function. But this post will help in understanding how to approach this type of problems using Python. For instance, the issue at hand might not always be computing the distance between particles. The problem could be computing the dot product of orientations of all combinations of particle pairs. With this in mind, let us begin!
Particles in open boundaries
Imagine that you have a system with open boundaries in two dimensions, with N=100 particles.
Our goal is to compute the forces (it doesn’t matter what sort of force) between all these particles at a given time step. With the forces, we can calculate their accelerations, from which we obtain velocities and then their displacements. The displacements will tell us their positions in the next time step. We use this to compute the forces and the cycle goes on, for some period of time.
Assuming that these forces are functions of distances, we need to compute the distance between all permutations of particles. We can construct a matrix of distances, which will look like this:
\[ \begin{pmatrix} d_{1,1} & d_{1,2} & .. & d_{1,N} \\ d_{2,1} & d_{2,2} & .. & d_{2,N} \\ .. & .. & .. & .. \\ d_{N,1} & d_{N,2} & .. & d_{N,N} \\ \end{pmatrix} \]
We must generate the initial positions of 100 particles, and construct the distance matrix:
import numpy as np
L = 100 # simulation box dimension
N = 100 # Number of particles
dim = 2 # Dimensions
# Generate random positions of particles
r = (np.random.random(size=(N,dim))-0.5)*L
# Compute distance matrix
D = np.zeros(shape=(N,N), dtype=float)
# This is the N-squared operation
for i in range(N):
for j in range(N):
dr = r[j]-r[i] # difference between 2 positions
D[i,j] = np.sqrt(sum(dr*dr)) # calculate distance and store
print(D[:3,:3]) # print small section of the matrix
>>> [[ 0. 14.47476649 68.4285819 ]
[ 14.47476649 0. 53.99224333]
[ 68.4285819 53.99224333 0. ]]
Upper Triangular Distance Matrix
For 100 particles, in this algorithm, we are making 10,000 distance calculations. We can do better. Firstly, notice that the diagonal values are zero. The distance of a particle with itself is always obviously zero. Secondly, the matrix is symmetric i.e. reversing the order of indices does not affect the calculated distance. So we are computing distances twice, when we can get away with half the number of calculations. We can halve the number of calculations by simply computing the upper triangular matrix of D. The N-squared operation will then become:
Code 1
# This is the N-squared operation
for i in range(N):
for j in range(i+1,N): # j>i (second index is always greater than first)
dr = r[j]-r[i] # difference between 2 positions
D[i,j] = np.sqrt(sum(dr*dr)) # calculate distance and store
We have now decreased the number of calculations to 4,950. In terms of the algorithm, there isn’t much more that we can do. However, we can do a lot better if we learn some pythonic tricks.
- Perform expensive numpy functions such as,
np.sqrt
, as few times as possible. For instance, the solution will be identical, if we take the square root of the matrix, after the squared distances are calculated. - As much as possible avoid explicit for loops. They are slow in Python. If you find a way to offload looping duties to Python implicity, you will generally get much more readable and faster code.
- Reduce data access. So far, we created an array of zeros, and updated their values by accessing them. This is inefficient.
With just these three things in mind, let’s do something better! For this we need to learn a neat numpy function called np.triu_indices
. This gives the upper triangular matrix indices i.e. exactly the same indices that we were generating using our range function in a for loop.
Code 2
import numpy as np
L = 100 # simulation box dimension
N = 100 # Number of particles
dim = 2 # Dimensions
# Generate random positions of particles
r = (np.random.random(size=(N,dim))-0.5)*L
# uti is a list of two (1-D) numpy arrays
# containing the indices of the upper triangular matrix
uti = np.triu_indices(100,k=1) # k=1 eliminates diagonal indices
# uti[0] is i, and uti[1] is j from the previous example
dr = r[uti[0]] - r[uti[1]] # computes differences between particle positions
D = np.sqrt(np.sum(dr*dr, axis=1)) # computes distances; D is a 4950 x 1 np array
We have done in three lines, what we previously achieved in five, and we have no more for loops. Timing them on my computer shows the gulf of performance that we have achieved for 1000 particles: Code 1 takes around 3.4 seconds, and Code 2 takes around 0.0005 seconds.  But even recasting the values using scipy.spatial.distance.squareform
into a NxN matrix does not slow the code significantly.
The easiest method to solve this problem, as I mentined earlier, is to use the scipy.spatial.distance.pdist
function. Its a one-liner:
Code 3
import numpy as np
from scipy.spatial.distance import pdist
L = 100 # simulation box dimension
N = 100 # Number of particles
dim = 2 # Dimensions
# Generate random positions of particles
r = (np.random.random(size=(N,dim))-0.5)*L
D = pdist(r)
However, to my surprise, I found that this was slower than Code 2.


[gecode-users] getting all solutions + interrupting gecode
Filip Konvička
filip.konvicka at logis.cz
Fri Dec 5 14:44:27 CET 2008
Hi,
> For the first question, one thing you must remember is to delete the
> original instance of the problem also. An easy way to write a loop
> that goes through all solutions is for example:
> MyProblem *root = new MyProblem();
> DFS<MyProblem> dfs(root);
> delete root;
> while (MyProblem *sol = dfs.next()) {
> // do something...
> delete sol;
> }
Just a technical note - this is quite error-prone, because throwing
exception or returning in "do something..." results in memory leaks.
A better way of doing this would be using auto_ptr (or shared_ptr), like
this:
typedef auto_ptr<MyProblem> APMyProblem;
APMyProblem root(new MyProblem());
DFS<MyProblem> dfs(root.get());
root.reset();
while(true) {
APMyProblem sol(dfs.next());
if ( !sol.get() )
break;
MyProblem& solution=*sol;
// do something...
}
Cheers,
Filip
More information about the gecode-users
mailing list


| 046:026 Khan | : |
And indeed We had firmly established them with that wherewith We have not established you (O Quraish)! And We had assigned them the (faculties of) hearing (ears), seeing (eyes), and hearts, but their hearing (ears), seeing (eyes), and their hearts availed them nothing since they used to deny the Ayat (Allah's Prophets and their Prophethood, proofs, evidences, verses, signs, revelations, etc.) of Allah, and they were completely encircled by that which they used to mock at! |
| 046:026 Maulana | : |
And certainly We had given them power in matters in which We have not empowered you, and We had given them ears and eyes and hearts, but neither their ears, nor their eyes, nor their hears availed them aught, since they denied the messages of Allah, and that which they mocked at encompassed them. |
| 046:026 Pickthal | : |
And verily We had empowered them with that wherewith We have not empowered you, and had assigned them ears and eyes and hearts; but their ears and eyes and hearts availed them naught since they denied the revelations of Allah; and what they used to mock befell them. |
| 046:026 Rashad | : |
We had established them in the same way as we established you, and provided them with hearing, eyes, and minds. But their hearing, eyes, and minds did not help them at all. This is because they decided to disregard GOD's revelations. Thus, the prophecies and warnings that they ridiculed have caused their doom. |
| 046:026 Sarwar | : |
We had established them more firmly in the land than you are. We had given them ears, eyes, and hearts but none of their ears, eyes, and hearts proved to be of any benefit to them; they rejected the revelations of God and the torment which they mocked brought upon them utter destruction. |
| 046:026 Shakir | : |
And certainly We had established them in what We have not established you in, and We had given-- them ears and eyes and hearts, but neither their ears, nor their eyes, nor their hearts availed them aught, since they denied the communications of Allah, and that which they mocked encompassed them. |
| 046:026 Sherali | : |
And WE had established them in that wherein WE have not established you; and WE gave them ears and eyes and hearts. But their ears and their eyes and their hearts availed them naught, since they denied the Signs of ALLAH; and that at which they used to mock encompassed them. |
| 046:026 Yusufali | : |
And We had firmly established them in a (prosperity and) power which We have not given to you (ye Quraish!) and We had endowed them with (faculties of) hearing, seeing, heart and intellect: but of no profit to them were their (faculties of) hearing, sight, and heart and intellect, when they went on rejecting the Signs of Allah; and they were (completely) encircled by that which they used to mock at! |
Concepts/Themes Covered: الإيمان > الغيب > الغيب النفسي > الفؤاد Faith> The Unseen World> The Psychological Secret> The Heart الإنسان والعلاقات الأخلاقية > الأخلاق الذميمة > السخرية Man and The Moral Relations>The Dispraised Morals>Sarcasm القصص والتاريخ > (عاد (قوم هود The Stories and the History>Ad(Hud's People)
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


Resume
About Me
Projects
Resume
GitHub
Linkedin
Email
Whatsapp
Resume
Projects
resume
About Me
© All Rights Reserved 2019.


We will be conducting a number of poetry workshops and symposiums throughout the year.
Please note that the following events are free to members:
| New York | Chicago | San Francisco | |
| A Poetic Perspective | Sat, 4 feb 2012 11 am-2 pm | Sat 3 Mar 2012 11 am - 2 pm | Sat, 17 Mar 2012 11am - 2 pm |
| Walt Whitmann at war | Sat 7 Apr 2012 11 am - 1pm | sat 5 may 2012 11 am- 1 pm | sat 19 may 2012 11 am - 2 pm |
| Found poems & Outsider Poetry | sat 9 jun 2012 11 am - 2 pm | sat 7 Jul 2012 11 am - 2 pm | sat 21 jul 2012 11 am - 2 pm |
| Natural death: An Explosion | sat 4 Aug 2012 11 am - 4 pm | sat 8 sep 2012 11 am - 4 pm | Sat 15 Sep 2012 11 am - 4 pm |


(.) (.–.) HIV STI N = adolescents young testing adults risk sexual data screening Xpert treatment (.–.; {border-style :–. STIs patients prevalence px;} sexually syndromic #ffffff;} infections women CT, NG, Reference []. transmitted Eswatini study using Health South population Sexually age care involved participants people positive enrolled vaginal years (.%) Age CT/NG Sexual associated comprehensive high identified need reported transmission urine (OR = .; (–) Baylor CI, Infect cohort detection infection new project provided px; {font-family Current HIV. Neisseria Yes cases clinic factors font-size gonorrhea health living rates specimen test (%) (Table Active Children’s Chlamydia Dis; ESAP Female HIV, Male STI, Trichomonas bivariate clinical condom diagnostic double; high-burden immunodeficiency indicating million needed negative older partner predictive results sensitivity trachomatis viral :e. Africa Africa. Africa: CI) College GeneXpert HIV-infected Mbabane, Ministry STIs, Sex TV, active analysis. border-color border-width confidence diagnosis genital human lower majority management months oropharyngeal performance populations prevention prior repeat reporting solid; support testing, treated use {font-style {font-weight (.–) (IQR, (male, (–), .%) .%; .–.) Abbreviations: CI, .–.), Disease Months, NPV PPV Risk Sensitivity Specificity Syndromic Table Transm World additional adverse and/or asymptomatic bold courier; cross-sectional current effective em; female, females higher included increased inflammation median national outcomes performed potential pt;} retested risk. settings suggest support. surveillance swabs tested testing. total used vaginalis


{% extends "base.html" %} {% block title %}
Medieval catalogues > UNIVERSITY AND COLLEGE LIBRARIES OF CAMBRIDGE > Donor documents > Will of Thomas Colyer, 1506; various
{% endif %}24 identified entries found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


Tutorial
Currently under development
Installation
Step 0 Set-up
Step 1:
Creating a database
Step
2: Opening the database
Step 3:
Checking out
Step 4:
Adding values
Step 5:
Committing
Step 6:
Getting snapshot
Step 7:
Getting values
Step 8:
Proof of value
Step 9:
Verification
Step
10: Closing the database


Original author: David Banas
Original date: June 16, 2017
Copyright (c) 2017 David Banas; all rights reserved World wide.
This Jupyter notebook contains my solution to the Final Project assignment in the Udacity Machine Learning Introduction course.
The general challenge is to build a classifier, which can reliably identify a "person of interest" within the Enron data set. The starter code for this assignment comes from the final_project/poi_id.py file, supplied as part of the code suite used for this course. And I have copied code/comments from that file throughout this notebook.
Why create this notebook, instead of just using the supplied starter code file? Three reasons:
Notes on using this notebook
%matplotlib inline
import matplotlib
matplotlib.rcParams['figure.figsize'] = (12, 12)
import numpy as np
import pickle
import sys
from matplotlib import pyplot as plt
from operator import itemgetter
sys.path.append("ud120-projects/tools/")
from feature_format import featureFormat, targetFeatureSplit
### features_list is a list of strings, each of which is a feature name.
### The first feature must be "poi".
features_list = ['poi',
'salary',
'deferral_payments',
'total_payments',
'bonus',
'total_stock_value',
'loan_advances',
] # You will need to use more features
### Load the dictionary containing the dataset
with open("ud120-projects/final_project/final_project_dataset.pkl", "r") as data_file:
data_dict = pickle.load(data_file)
# The data contains a TOTAL sample, which will confuse our classifier if we don't eliminate it.
data_dict.pop('TOTAL', 0)
I found this trick, for creating a helpful matrix plot, in the O'Reilly book Introduction to Machine Learning with Python, by Muller & Guido.
import pandas as pd
from matplotlib.colors import ListedColormap
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(data)
# Note: It appears that pandas.scatter_matrix doesn't quite work
# as advertised, in the documentation. If it did, this wouldn't
# be necessary. You could pass a colormap, instead.
palette = {0 : 'blue', 1 : 'red'}
labels_c = map(lambda x: palette[int(x)], labels)
data_frame = pd.DataFrame(features, columns=features_list[1:])
grr = pd.scatter_matrix(data_frame, alpha=0.8, c=labels_c)
from operator import itemgetter
for feature in features_list[1:]:
l = [(item[0], item[1][feature]) for item in data_dict.items() if not np.isnan(float(item[1][feature]))]
l.sort(key=itemgetter(1), reverse=True)
print "Top 3 values for feature, '{}': {}".format(feature, l[:3])
for feature in ['loan_advances', 'total_payments']:
features_list.remove(feature)
I decided to create a new feature, by multiplying the following 4 features together:
My reasoning for this is as follows: If there is someone, whom is in constant e-mail contact with POIs, and is also racking up large expenses, then perhaps that person is some sort of "dark lieutenant" out taking care of the dirty work that the executives need to keep a distance from.
I chose multiplication, as opposed to addition, for two reasons:
I check for correlation between any pair of constituent features, using the same scatter matrix plotting technique, as above, before committing to this new feature, because forging a new feature out of highly correlated constitutents is useless. (Consider multiplying a feature by itself. You wouldn't gain any information. In fact, if the original feature contains both positive and negative values, you'll lose information!)
constituent_features_list = ['poi',
'shared_receipt_with_poi',
'expenses',
'from_this_person_to_poi',
'from_poi_to_this_person',
]
new_data = featureFormat(data_dict, constituent_features_list)
new_labels, new_features = targetFeatureSplit(new_data)
new_labels_c = map(lambda x: palette[int(x)], new_labels)
new_data_frame = pd.DataFrame(new_features, columns=constituent_features_list[1:])
grr = pd.scatter_matrix(new_data_frame, alpha=0.8, c=new_labels_c)
And, seeing no highly correlated pairs, I press on with my new feature creation, and take a look at the final result.
for key in data_dict.keys():
features_dict = data_dict[key]
res = 1
for subkey in constituent_features_list[1:]:
x = features_dict[subkey]
if(np.isnan(float(x))):
res = 0
else:
res *= x
data_dict[key]['expenses_and_poi_contact'] = res
features_list.append('expenses_and_poi_contact')
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(data)
labels_c = map(lambda x: palette[int(x)], labels)
data_frame = pd.DataFrame(features, columns=features_list[1:])
grr = pd.scatter_matrix(data_frame, alpha=0.8, c=labels_c)
for feature in ['expenses_and_poi_contact']:
l = [(item[0], item[1][feature]) for item in data_dict.items() if not np.isnan(float(item[1][feature]))]
l.sort(key=itemgetter(1), reverse=True)
print "Top 3 values for feature, '{}': {}".format(feature, l[:3])
This John Lavorato is becoming an awfully curious character. He's the clear outlier in my newly created category, which is attempting to identify "dark lieutenants", and he received the largest bonus! (You can imagine Lay rewarding a guy handsomely for getting the messy field work done, while remaining discreet.) And then there's his name: Lavorato (lavatory?) "John Lavatory"?! Let's press on and see if the data reveal any additional clues about this guy.
I've decided to try the following 3 classifiers:
from sklearn import svm, tree
from sklearn.ensemble import AdaBoostClassifier
from sklearn.metrics import precision_score, recall_score
sys.path.append("ud120-projects/final_project/")
from tester import test_classifier
print "Trying the SVM classifier..."
clf = svm.SVC()
test_classifier(clf, data_dict, features_list)
print "\nTrying the Decision Tree classifier..."
clf = tree.DecisionTreeClassifier()
test_classifier(clf, data_dict, features_list)
print "Trying the AdaBoost classifier..."
clf = AdaBoostClassifier()
test_classifier(clf, data_dict, features_list)
Since the Decision Tree classifier is already meeting the target of precision and recall both greater than 0.3, I'll go with it and see if I can improve the results.
Here, I'm going to try to let the machine do the work, using the grid approach from the course.
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn.metrics import classification_report
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(data)
features_train, features_test, labels_train, labels_test = train_test_split(features, labels, stratify=labels)
# Set the parameters by cross-validation
tuned_parameters = [
{'criterion' : ['gini', 'entropy'],
'splitter' : ['best', 'random'],
},
]
scores = ['precision', 'recall']
for score in scores:
print("Tuning hyper-parameters for %s:" % score)
clf = GridSearchCV(tree.DecisionTreeClassifier(), tuned_parameters,
scoring='%s_macro' % score)
clf.fit(features_train, labels_train)
print("\tBest parameters set found on development set:"),
print(clf.best_params_)
print("\tGrid scores on development set:")
means = clf.cv_results_['mean_test_score']
stds = clf.cv_results_['std_test_score']
for mean, std, params in zip(means, stds, clf.cv_results_['params']):
print("\t\t%0.3f (+/-%0.03f) for %r" % (mean, std * 2, params))
print("\tDetailed classification report:")
y_true, y_pred = labels_test, clf.predict(features_test)
print(classification_report(y_true, y_pred))
I note the following, in the above results:
I'm awfully curious as to how my created feature stacks up.
Note: After running a much simplified version of the code, below, several times manually (I was debugging the print formatting.), I noticed the relative importance of the features varying quite wildly. This made me curious, and I wanted a clearer picture of what was happening. That's why the code, below, is so complicated.
NUM_TRIALS = 10
for (splitter, criterion) in [(splitter, criterion)
for splitter in ['random', 'best']
for criterion in ['gini', 'entropy']]:
feature_importances = []
for trial in xrange(NUM_TRIALS):
clf = tree.DecisionTreeClassifier(splitter=splitter, criterion=criterion)
clf.fit(features_train, labels_train)
feature_importances.append(clf.feature_importances_)
feature_importances = np.array(feature_importances)
means = feature_importances.mean(axis=0)
stdev = feature_importances.std(axis=0)
print "Results for '{}'/'{}'".format(splitter, criterion)
print "\t{:32s}{:8s}{:8s}".format('Feature', 'Mean', 'StdDev')
print "\t{:48s}".format("="*48)
i = 0
for feature in features_list[1:]: # 'poi' is the first element.
print "\t{:32s} {:05.3f} {:05.3f}".format(feature, means[i], stdev[i])
i += 1
print "\t{:48s}".format("_"*48)
print "\t{:32s} {:05.3f}".format('AVERAGE', stdev.mean())
print
After running the above code several times, I've noticed the following:
features_list.remove('deferral_payments')
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(data)
Alright, time for the moment of truth...
clf = tree.DecisionTreeClassifier(splitter='best', criterion='entropy')
test_classifier(clf, data_dict, features_list)
D'oh! It tests worse than the default DecisionTreeClassifier, which uses 'best'/'gini'. Oh well, so much for intuition. ;-)
Now, even for the 'best'/'gini' case, my new feature is still scoring a very high relative importance. Let's see how it correlates, by itself, to the POI flag...
# zip(*(...)) = transpose(...)
ys, xs = zip(*[(item[1]['poi'], item[1]['expenses_and_poi_contact']) for item in data_dict.items()])
plt.figure(figsize=(4, 4))
plt.scatter(xs, ys)
Hmm, my new feature doesn't appear to be a very good "slicer" between POIs and non-POIs. I wonder if all I've really shown is that it doesn't make a very good first branch in a decision tree.
Let's try something a little different: let's use color to make the "POI vs. non-POI" distinction, and plot the points according to: expenses_and_poi_contact and total_stock_value, which is also a very important feature in the decision tree.
from matplotlib.colors import ListedColormap
cmap = ListedColormap(['b', 'r'])
xs, ys, zs = zip(*[(item[1]['total_stock_value'], item[1]['expenses_and_poi_contact'], item[1]['poi'])
for item in data_dict.items()])
plt.figure(figsize=(4, 4))
plt.scatter(xs, ys, c=zs, cmap=cmap)
plt.xlabel("Total Stock Value")
plt.ylabel("Expenses & POI Contact")
plt.title("Red dots are POIs.")
Hmm, it's clear that the total_stock_value feature makes a good first branch in the decision tree, as 3 POIs can be identified using just this feature. However, it's still not obvious to me why my new expenses_and_poi_contact feature is scoring so high. Let's try something: let's remove the expenses_and_poi_contact feature and retest the classifier.
features_list.remove('expenses_and_poi_contact')
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(data)
clf = tree.DecisionTreeClassifier()
test_classifier(clf, data_dict, features_list)
Interesting. It looks like, while my new feature wasn't doing much for recall, it was helping significantly with precision. I think a little research into decision tree operation is in order...
Okay, I just stumbled across this: Decision Tree Visualization. Let's try it and see what we learn...
import pydotplus
from IPython.display import Image
features_train, features_test, labels_train, labels_test = train_test_split(features, labels, stratify=labels)
clf = tree.DecisionTreeClassifier()
clf.fit(features_train, labels_train)
dot_data = tree.export_graphviz(clf, out_file=None,
feature_names=features_list[1:],
class_names=['non-POI', 'POI'],
filled=True, rounded=True,
special_characters=True)
graph = pydotplus.graph_from_dot_data(dot_data)
Image(graph.create_png())
And, now, with my new feature added back...
features_list.append('expenses_and_poi_contact')
data = featureFormat(data_dict, features_list)
labels, features = targetFeatureSplit(data)
features_train, features_test, labels_train, labels_test = train_test_split(features, labels, stratify=labels)
clf = tree.DecisionTreeClassifier()
clf.fit(features_train, labels_train)
dot_data = tree.export_graphviz(clf, out_file=None,
feature_names=features_list[1:],
class_names=['non-POI', 'POI'],
filled=True, rounded=True,
special_characters=True)
graph = pydotplus.graph_from_dot_data(dot_data)
Image(graph.create_png())
And we see that, near the bottom of the tree, my new feature is being used to filter out a significant number (21) of non-POIs from the training set. This is, probably, helping to prevent some of the false positives in the test set, which are otherwise lowering the precision score. And that's why including this new feature improves precision.
There're two final questions I'd like to address, before concluding:
It looks like the scoring difference is attributable to the fact that the simple grid testing, here, splits the scoring between labels '0' and '1', while the code in final_projects/tester.py does not. Instead, it tallies:
over 1,000 trials and reports the average recall and precision accordingly.
Searching the Web for information about John Lavorato yielded several articles, which essentially tell the same story: several Enron executives, particularly those working in the trading division, were paid huge retention bonuses, just before the bankruptcy was declared. However, nothing really alludes to anything sinister, or suggests that, perhaps, John really should've been a POI. Perhaps, we'll never know the truth of John's involvement, or lack thereof, in the fraud that was committed. One thing I'm curious about: if John's poi feature is changed to '1', does my classifier perform any better? Let's find out...
data_dict['LAVORATO JOHN J']['poi'] = 1
test_classifier(clf, data_dict, features_list)
Wow! Look at that. In this case, our intuition is much more resonant with the classifier's behavior. That is, we aren't the only one's to whom it seems that John ought to be a POI. Interesting.
Now, one final sanity check to make sure I haven't fallen off track somewhere, before concluding...
data_dict['LAVORATO JOHN J']['poi'] = 0
test_classifier(clf, data_dict, features_list)
Okay, great, with John's poi feature restored to its correct value, '0', both the precision and recall scores are what we first saw, above. And, that's a wrap.
I've been able to meet the final project criteria: both recall and precision >0.3, by adding a new composite feature: expenses_and_poi_contact, formed by taking the product of the following existing features:
, only after ensuring that no two of them were correlated, since creating a new feature by multiplying together two existing and correlated features doesn't add any new information.
In preliminary testing, I found that my new feature ranked quite high in relative feature importance. And, in fact, without it I cannot pass the criteria, above.
My first attempts at visualizing the contribution of my new feature, using feature pair scatter plots, were disappointing. And it was only after generating the decision tree diagrams, above, that I was able to see where and how my new feature was elevating the precision score of my new classifier.
This was great fun. Thanks!


{include: ../plugins/kasir/view/admin/tindakan.html}
{include: ../plugins/kasir/view/admin/resep.html}
{include: ../plugins/kasir/view/admin/laboratorium.html}
{include: ../plugins/kasir/view/admin/radiologi.html}
{*include: ../plugins/kasir/view/admin/operasi.html*}
{*include: ../plugins/kasir/view/admin/biaya.html*}


I think he is right because I believe in him
Learnings from my transition from a Sales role to a Product role. A handy guide for all the aspiring Product Managers
‘I got an email that I won $100,000 lottery. Let me just fill this form now…’
‘Madam, take this life insurance. It will give the best cover.’
Nick is a bad boy; I saw him steal a chocolate yesterday.
I love what I’ve created; it’s better than others
You lost because you are lousy. I lost because life’s unfair
Things we believe because we like to believe
A must read for every aspiring product manager!
Be effective, start today!


ESC
:
w
q
!
↵
EXPERTS ONLY:
I managed to edit my file and want to save it first
I messed up my file and don't want to save it first
by
schmod


fulmo_setting_message_context_menu_help
fulmo_test_message_description_1
fulmo_test_message_description_2


Zoltan_Get_Obj_ListThese functions provide a uniform method of calling the query functions registered by an application. Their use simplifies new algorithm development and code maintenance. Usage examples are in rcb/shared.c.
Zoltan_Get_Coordinates
Zoltan_Get_Obj_List can be called from any Zoltan algorithm to obtain a list of object IDs, weights, and part assignments.
Given a list of object IDs, Zoltan_Get_Coordinates can be called from any Zoltan algorithm to obtain a list of coordinates for those IDs.
Note that, contrary to most Zoltan functions, these functions allocate memory for their return lists.
| Arguments: | |
| zz | A pointer to the Zoltan structure created by Zoltan_Create. |
| num_obj | Upon return, the number of objects. |
| global_ids | Upon return, an array of global IDs of objects on the current processor. |
| local_ids | Upon return, an array of local IDs of objects on the current processor. NULL is returned when NUM_LID_ENTRIES is zero. |
| wdim | The number of weights associated with an object (typically 1), or 0 if weights are not requested. |
| objwgts | Upon return, an array of object weights. Weights for object i are stored in objwgts[i*wdim:(i+1)*wdim-1], for i=0,1,...,num_obj-1. If wdim is zero, the return value of objwgts is undefined and may be NULL. |
| parts | Upon return, an array of part assignments. Object i is currently in part parts[i]. |
| Returned value: | |
| Error code. | |
| Required Query Functions: | |
| ZOLTAN_NUM_OBJ_FN | |
| ZOLTAN_OBJ_LIST_FN or ZOLTAN_FIRST_OBJ_FN/ZOLTAN_NEXT_OBJ_FN pair | |
| Optional Query Functions: | |
| ZOLTAN_PART_FN |
| Arguments: | |
| zz | A pointer to the Zoltan structure created by Zoltan_Create. |
| num_obj | The number of objects. |
| global_ids | An array of global IDs of objects on the current processor. |
| local_ids | An array of local IDs of objects on the current processor. local_ids is NULL when NUM_LID_ENTRIES is zero. |
| num_dim | Upon return, the number of coordinates for each object (typically 1, 2 or 3). |
| coords | Upon return, an array of coordinates for the objects. Coordinates for object i are stored in coords[i*num_dim:(i+1)*num_dim-1], for i=0,1,...,num_obj-1. |
| Returned value: | |
| Error code. | |
| Required Query Functions: | |
| ZOLTAN_NUM_GEOM_FN | |
| ZOLTAN_GEOM_MULTI_FN or ZOLTAN_GEOM_FN |


Average population attributable fractions are calculated for a set of risk factors (either binary or ordinal valued) for both prospective and case- control designs. Confidence intervals are found by Monte Carlo simulation. The method can be applied to either prospective or case control designs, provided an estimate of disease prevalence is provided. In addition to an exact calculation of AF, an approximate calculation, based on randomly sampling permutations has been implemented to ensure the calculation is computationally tractable when the number of risk factors is large.
| Version: | 1.0.3 |
| Imports: | MASS (≥ 7.3.0) |
| Published: | 2017-03-21 |
| Author: | John Ferguson [aut, cre] |
| Maintainer: | John Ferguson <john.ferguson at nuigalway.ie> |
| License: | CC0 |
| NeedsCompilation: | no |
| CRAN checks: | averisk results |
| Reference manual: | averisk.pdf |
| Package source: | averisk_1.0.3.tar.gz |
| Windows binaries: | r-devel: averisk_1.0.3.zip, r-release: averisk_1.0.3.zip, r-oldrel: averisk_1.0.3.zip |
| OS X binaries: | r-release: averisk_1.0.3.tgz, r-oldrel: averisk_1.0.3.tgz |
| Old sources: | averisk archive |
Please use the canonical form https://CRAN.R-project.org/package=averisk to link to this page.


Amount to be paid by defendant
Total amount payable by defendant
£195.00Amount payable by defendant is calculated based on the amount you're claiming and any other costs minus any payment received.
| Claim amount and costs | |
|---|---|
| Claim amount | £1500 |
| Claim fee | £75 |
| Legal Representative's costs on making claim (if any) |
|
| Legal Representative's costs on entering judgment (if any) |
Deduct amount paid already (if any)


A friend, who I'll refer to as S, and I purchased 10 doses of 2C-C-NBOMe from a reliable source. When we obtained the chemical all 10 doses were mixed with 1 mL of water. The method of consumption that we used was a needle-less syringe allowing us to shoot/snort the 1/10 mL up our nostril.
I arrived at S's house around 11PM and very soon after we took our doses (1 each because we were heavily advised to not exceed that amount). I was not expecting the burn and smell of the chemical; it smelled as if I just snorted ear drop solution (slightly alcoholic smelling). The burn went away after approximately 2 minutes, but throughout the night I would get the occasional whiff of the odor.
S and I sat down on some chairs in the living room and had Jon Stewart on the TV. Withing 5 minutes we both agreed that we felt it coming on fast. After another 2 to 5 minutes we were definitely starting to trip. The politics on the TV, even though J. Stewart was trying to make it funny, were way too intense for me, so I asked S to turn off the TV.
For the next who knows how long (our sense of time is completely warped already (approx. 10-15 minutes into the experience)), we sat in silence as the visuals began to become stronger and stronger.
I've always considered myself fairly experienced with psychedelics because I've taken LSD at least 5 times, mushroom about 4 times, DMT at least 4 times, DXM at least 6 times, 2C-B twice, MDMA approximately 4 times, and of course somewhat regularly consumed marijuana. But as this trip was coming on fast and strong my friend and I both began to feel overwhelmed.
The best way I can describe the visuals would to call everything in my vision 'light', whereas when sober my vision is 'heavy'. My vision being light allows the chemical to take control of my eyes much easier. Throughout the next two hours or so we put on some random music, sat in silence (we felt no need for communication as we were still getting used to the trip), and stared into space.
My favorite things to stare at were the wooden paneled floor (the boards would converge, tilt, expand, etc), the ceiling (which we both agreed look like it was made of the skeletal structure of bat wings)... at one point the pattern on the ceiling turned into a marble carving of Satan holding humans in his hands (which wasn't frightening, but definitely interesting), and also the charcoal pictures on his wall that multiple friends had worked on (the multiple layers and different shadings in the pictures fluctuated so much).
 My mouth would end up feeling tight/somewhat numb for much of the trip. And my least favorite of all the physical side effects was that the region of my private area would occasionally become numb (which was the scariest part of the experience, probably). Also, it was very hard to determine if I had to piss and when I did it was difficult to know if I was entirely finished (or if I had even made most of it into the toilet).
Eventually things began to mellow out after 3-4 hours. The visuals were still definitely there but not nearly as prominent. The entire night I had been wanting to go outside for a smoke, but never gathered the courage believing that it would make the trip even more overwhelming. But at this point in time I felt like I was capable, so we sat outside in the humid/chilly/rainy night and watched the super low clouds dart across the sky and I also enjoyed all of the city lights/car lights that I could see from where we were. We sat outside for maybe 15-20 minutes and I smoked 3 cigarettes; while outside neither of us could determine if it really wasn't cold or if it was our bodies playing tricks on us.
 On his computer we watched every Symphony of Science video on youtube (they're inspiring whether intoxicated for not), then afterwards we listened to a lot of post-rock such as pg.lost and If These Trees Could Talk. During the songs we felt as if we code analyze the pictures the were on the youtube videos to the fullest.
Feeling almost entirely done with the trip (I felt capable enough to drive, but I didn't because I'm not a fan of making stupid decisions) we went outside one last time for another smoke. Around 5:30AM we both headed to bed. It took me maybe 30 minutes to fall asleep, which isn't horrible; however, my friend said it took him about 2 hours. That night I did not have a deep sleep at all (I'm assuming because my mind was still very active from the drug), and I arose around 1PM still feeling fairly tired.
The day after the trip I remain feeling somewhat tired and I've had a very very minor headache coming and going, but nothing intolerable.
Now that I know (as well as possible, at least) what to expect, I would definitely do it again (and use my other doses). I found 2C-C-NBOMe to be a somewhat clear-minded, pretty visually active trip, and a good alternative if I don't have the 12 hours to drop acid.
BE CAREFUL AND ENJOY!
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


{% extends "layout.html" %} {% set menu_active = "" %} {% block htmltitle %}UWHT: Edit {{club.name}}{% endblock %} {% block headertitle %}Edit {{ club.name }}{% endblock %} {% block content %}
You are editing a club found in {% for p in club.parent.parents|reverse -%} {{ p.name }} > {% endfor -%} {{ club.parent.name }}
You are looking at the simple edit form. There is a complex admin edit interface.
{% endblock %}


2.3.3. Machine Learning 102: Practical Advice¶
In practice, much of the task of machine learning involves selecting algorithms, parameters, and sets of data to optimize the results of the method. All of these things can affect the quality of the results, but it’s not always clear which is best. For example, if your results have an error that’s larger than you hoped, you might imagine that increasing the training set size will always lead to better results. But this is not the case! Below, we’ll explore the reasons for this.
Note
much of the material in this section was adapted from Andrew Ng’s excellent set of machine learning video lectures. See http://www.ml-class.org.
In this section we’ll work with an extremely simple learning model: polynomial regression. This simply fits a polynomial of degree d to the data: if d = 1, then it is simple linear regression. Polynomial regression can be done with the functions polyfit and polyval, available in numpy. For example:
>>> import numpy as np
>>> np.random.seed(42)
>>> x = np.random.random(20)
>>> y = np.sin(2 * x)
>>> p = np.polyfit(x, y, 1) # fit a 1st-degree polynomial (i.e. a line) to the data
>>> print p
[ 0.97896174 0.20367395]
>>> x_new = np.random.random(3)
>>> y_new = np.polyval(p, x_new) # evaluate the polynomial at x_new
>>> print abs(np.sin(x_new) - y_new)
[ 0.22826933 0.20119119 0.20166572]
Using a 1st-degree polynomial fit (that is, fitting a straight line to x and y), we predicted the value of y for a new input. This prediction has an absolute error of about 0.2 for the few test points which we tried. We can visualize the fit this way:
>>> xfit = np.linspace(0, 1, 10)
>>> yfit = np.polyval(p, xfit)
>>> import pylab as pl
>>> pl.ion() # interactive mode on
>>> pl.scatter(x, y, c='k')
>>> pl.plot(xfit, yfit)
>>> pl.xlabel('x')
>>> pl.ylabel('y')
>>> pl.title('Linear Regression Example')
When the error of predicted results is larger than desired, there are a few courses of action that can be taken:
- Increase the number of training points N. This might give us a training set with more coverage, and lead to greater accuracy.
- Increase the degree d of the polynomial. This might allow us to more closely fit the training data, and lead to a better result
- Add more features. If we were to, for example, perform a linear regression using , , , or other functions, we might hit on a functional form which can better be mapped to the value of y.
The best course to take will vary from situation to situation, and from problem to problem. In this situation, number 2 and 3 may be useful, but number 1 will certainly not help: our model does not intrinsically fit the data very well. In machine learning terms, we say that it has high bias and that the data is under-fit. The ability to quickly figure out how to tune and improve your model is what separates good machine learning practitioners from the bad ones. In this section we’ll discuss some tools that can help determine which course is most likely to lead to good results.
<IP_ADDRESS>. Bias, Variance, Over-fitting, and Under-fitting¶
We’ll work with a simple example. Imagine that you would like to build an algorithm which will predict the price of a house given its size. Naively, we’d expect that the cost of a house grows as the size increases, but there are many other factors which can contribute. Imagine we approach this problem with the polynomial regression discussed above. We can tune the degree d to try to get the best fit.
In the above figure, we see fits for three different values of d. For d = 1, the data is under-fit. This means that the model is too simplistic: no straight line will ever be a good fit to this data. In this case, we say that the model suffers from high bias. The model itself is biased, and this will be reflected in the fact that the data is poorly fit. At the other extreme, for d = 6 the data is over-fit. This means that the model has too many free parameters (6 in this case) which can be adjusted to perfectly fit the training data. If we add a new point to this plot, though, chances are it will be very far from the curve representing the degree-6 fit. In this case, we say that the model suffers from high variance. The reason for this label is that if any of the input points are varied slightly, it could result in an extremely different model.
In the middle, for d = 2, we have found a good mid-point. It fits the data fairly well, and does not suffer from the bias and variance problems seen in the figures on either side. What we would like is a way to quantitatively identify bias and variance, and optimize the metaparameters (in this case, the polynomial degree d) in order to determine the best algorithm. This can be done through a process called cross-validation.
<IP_ADDRESS>. Cross-Validation and Testing¶
In order to quantify the effects of bias and variance and construct the best possible estimator, we will split our training data into three parts: a training set, a cross-validation set, and a test set. As a general rule, the training set should be about 60% of the samples, and the cross-validation and test sets should be about 20% each.
The general idea is as follows. The model parameters (in our case, the coefficients of the polynomials) are learned using the training set as above. The error is evaluated on the cross-validation set, and the meta-parameters (in our case, the degree of the polynomial) are adjusted so that this cross-validation error is minimized. Finally, the labels are predicted for the test set. These labels are used to evaluate how well the algorithm can be expected to perform on unlabeled data.
Note
Why do we need both a cross-validation set and a test set? Many machine learning practitioners use the same set of data as both a cross-validation set and a test set. This is not the best approach, for the same reasons we outlined above. Just as the parameters can be over-fit to the training data, the meta-parameters can be over-fit to the cross-validation data. For this reason, the minimal cross-validation error tends to under-estimate the error expected on a new set of data.
The cross-validation error of our polynomial classifier can be visualized by plotting the error as a function of the polynomial degree d. This plot is shown in the following figure:
This figure compactly shows the reason that cross-validation is important. On the left side of the plot, we have very low-degree polynomial, which under-fits the data. This leads to a very high error for both the training set and the cross-validation set. On the far right side of the plot, we have a very high degree polynomial, which over-fits the data. This can be seen in the fact that the training error is very low, while the cross-validation error is very high. Plotted for comparison is the intrinsic error (this is the scatter artificially added to the data: click on the above image to see the source code). For this toy dataset, error = 1.0 is the best we can hope to attain. Choosing `d`=6 in this case gets us very close to the optimal error.
The astute reader will realize that something is amiss here: in the above plot, d = 6 gives the best results. But in the previous plot, we found that d = 6 vastly over-fits the data. What’s going on here? The difference is the number of training points used. In the previous example, there were only eight training points. In this example, we have 100. As a general rule of thumb, the more training points used, the more complicated model can be used. But how can you determine for a given model whether more training points will be helpful? A useful diagnostic for this are learning curves
<IP_ADDRESS>. Learning Curves¶
A learning curve is a plot of the training and cross-validation error as a function of the number of training points. Note that when we train on a small subset of the training data, the training error is computed using this subset, not the full training set. These plots can give a quantitative view into how beneficial it will be to add training samples.
On the left plot, we have the learning curve for d = 1. From the above discussion, we know that d = 1 is a high-bias estimator which under-fits the data. This is indicated by the fact that both the training and cross-validation errors are very high. If this is the case, adding more training data will not help matters: both lines have converged to a relatively high error.
In the right plot, we have the learning curve for d = 20. From the above discussion, we know that d = 20 is a high-variance estimator which under-fits the data. This is indicated by the fact that the training error is much less than the cross-validation error. As we add more samples to this training set, the training error will continue to climb, while the cross-validation error will continue to decrease, until they meet in the middle. In this case, our intrinsic error is 1.0 (again, this is artificially set in the code: click on the image to browse the source code), and we can see that adding more data will allow the estimator to very closely match the best possible cross-validation error.
<IP_ADDRESS>. Summary¶
We’ve seen above that an under-performing algorithm can be due to two possible situations: high bias (under-fitting) and high variance (over-fitting). In order to evaluate our algorithm, we set aside a portion of our training data for cross-validation. Using the technique of learning curves, we can train on progressively larger subsets of the data, evaluating the training error and cross-validation error to determine whether our algorithm has high variance or high bias. But what do we do with this information?
<IP_ADDRESS>.1. High Bias¶
If our algorithm shows high bias, the following actions might help:
- Add more features. In our example of predicting home prices, it may be helpful to make use of information such as the neighborhood the house is in, the year the house was built, the size of the lot, etc. Adding these features to the training and test sets can improve a high-bias estimator
- Use a more sophisticated model. Adding complexity to the model can help improve on bias. For a polynomial fit, this can be accomplished by increasing the degree d. Each learning technique has its own methods of adding complexity.
- Use fewer samples. Though this will not improve the classification, a high-bias algorithm can attain nearly the same error with a smaller training sample. For algorithms which are computationally expensive, reducing the training sample size can lead to very large improvements in speed.
- Decrease regularization. Regularization is a technique used to impose simplicity in some machine learning models, by adding a penalty term that depends on the characteristics of the parameters. If a model has high bias, decreasing the effect of regularization can lead to better results.
<IP_ADDRESS>.2. High Variance¶
If our algorithm shows high variance, the following actions might help:
- Use fewer features. Using a feature selection technique may be useful, and decrease the over-fitting of the estimator.
- Use more training samples. Adding training samples can reduce the effect of over-fitting, and lead to improvements in a high variance estimator.
- Increase Regularization. Regularization is designed to prevent over-fitting. In a high-variance model, increasing regularization can lead to better results.
These choices become very important in real-world situations. For example, due to limited telescope time, astronomers must seek a balance between observing a large number of objects, and observing a large number of features for each object. Determining which is more important for a particular learning task can inform the observing strategy that the astronomer employs. In a later exercise, we will explore the use of learning curves for the photometric redshift problem.
Next section: Classification


This is the official AtomicDEX mobile beta program channel -
Android: https://play.google.com/store/apps/details?id=com.komodoplatform.atomicdex - iOS: https://testflight.apple.com/join/c2mOLEoC - Please use https://github.com/KomodoPlatform/atomicdex/issues for bug reports and feature requests. For critical security bug reports please do send us your encrypted (https://pgp.mit.edu/pks/lookup?op=get&search=0x379287998EE6CF47) report to<EMAIL_ADDRESS>and allow up to 24h for reply. For atomicDEX API (mm2) related issue reports or feature requests please do use https://github.com/KomodoPlatform/atomicDEX-API/issues
100 messages
Before 05-Dec-19 12:00 AM
Jimm B.31-Oct-19 01:15 PM
@ca333 sure that I should cancel the order as soon as the cancel button appears? the cancel button will be displayed immediately.
CryptoBrandon31-Oct-19 01:15 PM
I think we are more stress than the system
Dirty Moe31-Oct-19 01:15 PM
ok thanks mark
coingirl8731-Oct-19 01:15 PM
I doing it to help team
1
Mark8131-Oct-19 01:16 PM
too afraid to leave from swap window!
Dirty Moe31-Oct-19 01:16 PM
ahaha
dudezmobi31-Oct-19 01:16 PM
Lol
gigamesh31-Oct-19 01:16 PM
will anybody make 30 tho?
[deleted]31-Oct-19 01:16 PM
@Mark81 Same..
gigamesh31-Oct-19 01:16 PM
i got 1
ѕℓιм31-Oct-19 01:17 PM
all our phones will die before we make a swap lol
Dirty Moe31-Oct-19 01:17 PM
for shits and giggles today i had an autoclicker on the faucet to see how many rick and mortys i could get
dudezmobi31-Oct-19 01:17 PM
Bet 1 morty it fails
Hooftly31-Oct-19 01:17 PM
it's nice to help great even but if you're going to offer a prize to users to participate all the users should be able to participate just saying it's about principles not about the prize
Dirty Moe31-Oct-19 01:17 PM
i got up to 32k rick and 16k morty!
ѕℓιм31-Oct-19 01:17 PM
so it was you who was abusing the faucet
duskonaut31-Oct-19 01:17 PM
good luck everyone ... this is failed stress test.
Adios
Dirty Moe31-Oct-19 01:17 PM
should i not have been doing that?
Patrick Crypto31-Oct-19 01:17 PM
Stop whining @Hooftly
benzo36531-Oct-19 01:17 PM
Sent a bunch of kmd to myself but it's not even arriving
sorry everyone! didnt think it would have affected it
wasnt malicious!
ѕℓιм31-Oct-19 01:18 PM
thats why most faucets have captchas
Hooftly31-Oct-19 01:18 PM
interesting article material here
dudezmobi31-Oct-19 01:18 PM
@Dirty Moe read up . U are disqualified for the prize
ѕℓιм31-Oct-19 01:18 PM
so you cant do that
dudezmobi31-Oct-19 01:18 PM
Further up
Dirty Moe31-Oct-19 01:18 PM
how can i be disqualified if my name isnt with my address
gigamesh31-Oct-19 01:18 PM
pseudo anon
CrisF31-Oct-19 01:19 PM
The coins are in your address aren't they?
dudezmobi31-Oct-19 01:19 PM
They traced addy and to where u sent it too
Dirty Moe31-Oct-19 01:19 PM
i also received the email and read through it, nothing mentioned any rules
not like it was malicious!
gigamesh31-Oct-19 01:19 PM
im gonna make a ztxn, oh wait...
 Make that 30k worth it
Jimm B.31-Oct-19 01:22 PM
@Team Admin sure that I should cancel the order as soon as the cancel button appears? the cancel button will be displayed immediately.
dudezmobi31-Oct-19 01:22 PM
Read up @gigamesh
gigamesh31-Oct-19 01:22 PM
WTB 60K MORTY for 1KMD
1
Dirty Moe31-Oct-19 01:22 PM
Read up where?!?!?!
modereck31-Oct-19 01:22 PM
2 mortys for 1 rick fresh orders and the best rate of match fill it
dudezmobi31-Oct-19 01:22 PM
Its atarimae
ca33331-Oct-19 01:22 PM
@Jimm B. give it 10 - 20 secs
Jimm B.31-Oct-19 01:23 PM
Ty
NWhiskeyTango31-Oct-19 01:23 PM
i think i just got one....1/3
Patrick Crypto31-Oct-19 01:23 PM
@gigamesh sure. I requested a few times so that I could make orders bigger than 1 each, but setting up an autoclicker when there is a 2/3 minute cooldown period? That's asshole behavior at best.
dudezmobi31-Oct-19 01:23 PM
This channel
NWhiskeyTango31-Oct-19 01:23 PM
nope, went to 0/3 lol
gigamesh31-Oct-19 01:23 PM
so we are having troubles cuz of UTXO?
dudezmobi31-Oct-19 01:23 PM
Ita 4 hours ago
ѕℓιм31-Oct-19 01:23 PM
oh so we need to cancel every open order we make after 30 seconds???
farl31-Oct-19 01:24 PM
Tonight I will dream about 0/3’s
Dirty Moe31-Oct-19 01:24 PM
@dudezmobi because i totally sit here watching this chat all day long
ca33331-Oct-19 01:24 PM
no @gigamesh - utxo handling is automated.
ronyi31-Oct-19 01:24 PM
2hrs, 0 success....
gigamesh31-Oct-19 01:24 PM
Tonight I will dream about 0/3’s
she said
1
dudezmobi31-Oct-19 01:24 PM
Search your addy
Alright31-Oct-19 01:24 PM
him pounding the faucets doesn't matter in the slightest
Andersen31-Oct-19 01:24 PM
0/3 forever
gigamesh31-Oct-19 01:24 PM
sexxxy
Alright31-Oct-19 01:24 PM
if you need coins, just ask here, there is no scarcity to either
[deleted]31-Oct-19 01:25 PM
Does anybody else have bunch of unconfirmed transactions from the faucet?
dudezmobi31-Oct-19 01:25 PM
Yeah.
Alright31-Oct-19 01:25 PM
yes, working on fixing that now @[deleted]
1
Patrick Crypto31-Oct-19 01:25 PM
I have 3
smk762 - dracocanis ominator31-Oct-19 01:25 PM
I have plenty to spare, let me know if you need funds. Dont spam the faucet
dudezmobi31-Oct-19 01:26 PM
Marketmaker recoverring now?
benzo36531-Oct-19 01:26 PM
Can someone send me Rick
RMC3jKU4isvLTLkgEx8PbaACPNmQJKd6Ap


WinSwitch Crashes SystemUIServer Constantly
-
anonymous
Ever since I upgraded to OS X 10.3.5, the last three versions of Winswitch I have tried repeatedly crash the SystemUIServer upon trying to click on the WinSwitch icon. The entire Menubar Extras array will disappear (save PTH Clock), and the reappear as the SUIS restarts.
Suspecting a user-specific problem, I tried creating a new admin account; loggin and activated Winswitch; same problem.
Inspecting the crash log, as well as the slight hang after clicking the WS icon, I suspected it was having trouble reading either prefs or images to display, so I killed:
/Library/Caches/ /System/Library/Caches/ /Library/Preferences
-
Greg Hurrell
Please continute this discussion over here:
Reply
This topic is now closed.


User Name
User Password
Don’t have an account ? Sign Up
User Email
Add Some Description
this app helps you find people who like the same major as yours and see their cvs.


| write : fileNumber [:status ], writeItem {, writeItem} |
var employeeRecord :
record
name : string ( 30 )
pay : int
dept : 0 .. 9
end record
var fileNo : int
open : fileNo, "payroll", write
write : fileNo, employeeRecord
The optional status is an int variable that is set to implementation-dependent information about the write. If status is returned as zero, the write was successful. If status is not returned as zero, status gives information about the incomplete or failed write (which is not documented here). Programmers often use status when they are writing a record or array to a file and are not sure if there is enough room on the disk to hold the item. If there is not enough room, the write will fail part way through, but the program can continue and diagnose the problem by inspecting status.
A writeItem is:
Each writeItem is a variable or constant, to be written in internal form. The optional requestedSize is an integer expression giving the number of bytes of data to be written. The requestedSize should be less than or equal to the size of the item's internal form in memory (if it is not, a warning message is issued). If no requestedSize is given, the size of the item in memory is used. The optional actualSize is set to the number of bytes actually written.
reference [ : requestedSize [ : actualSize ] ]


|
Rendu
An OpenGL rendering engine for experimentations
|
Represent a 3D textured object. More...
#include <Object.hpp>
Public Types | |
| enum | Type : int { Common = 0, PBRRegular, PBRParallax, PBRNoUVs } |
| Type of shading/effects. More... | |
Public Member Functions | |
| Object ()=default | |
| Object (Type type, const Mesh *mesh, bool castShadows) | |
| void | addTexture (const Texture *infos) |
| void | addAnimation (const std::shared_ptr< Animation > &anim) |
| void | set (const glm::mat4 &model) |
| virtual void | update (double fullTime, double frameTime) |
| BoundingBox | boundingBox () const |
| const Mesh * | mesh () const |
| const std::vector< const Texture * > & | textures () const |
| const glm::mat4 & | model () const |
| const Type & | type () const |
| bool | castsShadow () const |
| bool | twoSided () const |
| bool | masked () const |
| virtual void | decode (const KeyValues ¶ms, Storage mode) |
| virtual KeyValues | encode () const |
| virtual | ~Object ()=default |
| Object (const Object &)=delete | |
| Object & | operator= (const Object &)=delete |
| Object (Object &&)=default | |
| Object & | operator= (Object &&)=delete |
Protected Attributes | |
| const Mesh * | _mesh = nullptr |
| Geometry of the object. | |
| std::vector< const Texture * > | _textures |
| Textures used by the object. | |
| std::vector< std::shared_ptr< Animation > > | _animations |
| Animations list (applied in order). | |
| Animated< glm::mat4 > | _model { glm::mat4(1.0f) } |
| The transformation matrix of the 3D model, updated by the animations. | |
| Type | _material = Type::Common |
| The material type. | |
| bool | _castShadow = true |
| Can the object casts shadows. | |
| bool | _twoSided = false |
| Should faces of the object be visible from the two sides. | |
| bool | _masked = false |
| The object RGB texture has a non-empty alpha channel. | |
Represent a 3D textured object.
Inherited by Sky.
| enum Object::Type : int |
|
default |
Constructor
Construct a new object.
| type | the type of shading and effects to use when rendering this object |
| mesh | the geometric mesh infos |
| castShadows | denote if the object should cast shadows |
|
virtualdefault |
Destructor.
|
delete |
Copy constructor.
|
default |
Move constructor.
| void Object::addAnimation | ( | const std::shared_ptr< Animation > & | anim | ) |
Add an animation to apply at each frame.
| anim | the animation to add |
| void Object::addTexture | ( | const Texture * | infos | ) |
Register a texture.
| infos | the texture infos to add |
| BoundingBox Object::boundingBox | ( | ) | const |
Query the bounding box of the object.
|
inline |
Is the object casting a shadow.
Setup an object parameters from a list of key-value tuples. The following keywords will be searched for:
type: objecttype mesh: meshname translation: X,Y,Z scaling: scale orientation: axisX,axisY,axisZ angle shadows: bool twosided: bool masked: bool textures: - texturetype: ... - ... animations: - animationtype: ... - ...
| params | the parameters tuple |
| mode | the storage mode (CPU, GPU, both) |
Reimplemented in Sky.
|
virtual |
Generate a key-values representation of the object. See decode for the keywords and layout.
Reimplemented in Sky.
|
inline |
Should an alpha clip mask be applied when rendering the object (for leaves or chains for instance).
|
inline |
Object pose getter.
Copy assignment.
Move assignment.
| void Object::set | ( | const glm::mat4 & | model | ) |
Update the object transformation matrix.
| model | the new model matrix |
|
inline |
Textures array getter.
|
inline |
Are the object faces visible from both sides.
|
inline |
Type getter.
|
virtual |
Apply the animations for a frame duration.
| fullTime | the time since the launch of the application |
| frameTime | the time elapsed since the last frame |
Reimplemented in Sky.


IFNAMES(1) User Commands IFNAMES(1) NAME ifnames - Extract CPP conditionals from a set of files SYNOPSIS ifnames [OPTION] ... [FILE] ... DESCRIPTION Scan all of the C source FILES (or the standard input, if none are given) and write to the standard output a sorted list of all the identifiers that appear in those files in `#if', `#elif', `#ifdef', or `#ifndef' directives. Print each identifier on a line, followed by a space-sepa‐ rated list of the files in which that identifier occurs. -h, --help print this help, then exit -V, --version print version number, then exit AUTHOR Written by David J. MacKenzie and Paul Eggert. REPORTING BUGS Report bugs to<EMAIL_ADDRESS>COPYRIGHT Copyright © 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO autoconf(1), automake(1), autoreconf(1), autoupdate(1), autoheader(1), autoscan(1), config.guess(1), config.sub(1), ifnames(1), libtool(1). The Debian project regards the full documentation for ifnames to be non- free, so it is not included in Debian. Nevertheless, the non-free dis‐ tribution that accompanies Debian includes the manual in its autoconf-doc package. Otherwise, you may be able to access the Autoconf manual online. ifnames 2.59 September 2005 IFNAMES(1)


cavnessHR delivers HR to Founders, new business owners and companies with less than 50 employees. cavnessHR adds value by taking care of the HR business function while continuing to maintain their own values.
HR Laws that small businesses need to know.
cavnessHR transforms the way HR is delivered in the small business market. cavnessHR will deliver great HR that is not cost averse to small business. cavnessHR will provide HR from after product/market fit until the small business hits the 50-employee mark.
cavnessHR delivers great HR to every company with less than 50 employees in the U.S to assist in growing their business and to assist in decreasing the percentage of business failures.


public class IRI extends java.lang.Object implements OWLAnnotationSubject, OWLAnnotationValue, SWRLPredicate, java.lang.CharSequence
| Modifier | Constructor and Description |
|---|---|
protected |
IRI(java.lang.String s) |
protected |
IRI(java.lang.String prefix,
java.lang.String fragment)
Constructs an IRI which is built from the concatenation of the specified prefix and suffix.
|
protected |
IRI(java.net.URI uri) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(OWLAnnotationSubjectVisitor visitor) |
<E> E |
accept(OWLAnnotationSubjectVisitorEx<E> visitor) |
void |
accept(OWLAnnotationValueVisitor visitor) |
<O> O |
accept(OWLAnnotationValueVisitorEx<O> visitor) |
void |
accept(OWLObjectVisitor visitor) |
<O> O |
accept(OWLObjectVisitorEx<O> visitor) |
char |
charAt(int index)
Returns the
char value at the specified index. |
int |
compareTo(OWLObject o) |
static IRI |
create(java.io.File file) |
static IRI |
create(java.lang.String str)
Creates an IRI from the specified String.
|
static IRI |
create(java.lang.String prefix,
java.lang.String suffix)
Creates an IRI by concatenating two strings.
|
static IRI |
create(java.net.URI uri) |
static IRI |
create(java.net.URL url) |
boolean |
equals(java.lang.Object obj) |
static IRI |
generateDocumentIRI()
Gets an auto-generated ontology document IRI.
|
java.util.Set<OWLAnonymousIndividual> |
getAnonymousIndividuals()
Gets the anonymous individuals occurring in this object, as collected by an
OWLEntityCollector.
|
java.util.Set<OWLClass> |
getClassesInSignature()
A convenience method that obtains the classes
that are in the signature of this object
|
java.util.Set<OWLDataProperty> |
getDataPropertiesInSignature()
A convenience method that obtains the data properties
that are in the signature of this object
|
java.util.Set<OWLDatatype> |
getDatatypesInSignature()
A convenience method that obtains the datatypes
that are in the signature of this object
|
java.lang.String |
getFragment()
Gets the fragment of the IRI.
|
java.util.Set<OWLNamedIndividual> |
getIndividualsInSignature()
A convenience method that obtains the individuals
that are in the signature of this object
|
java.util.Set<OWLClassExpression> |
getNestedClassExpressions()
Gets all of the nested (includes top level) class expressions that are used in this object
|
java.util.Set<OWLObjectProperty> |
getObjectPropertiesInSignature()
A convenience method that obtains the object properties
that are in the signature of this object
|
java.lang.String |
getScheme() |
java.util.Set<OWLEntity> |
getSignature()
Gets the signature of this object
|
java.lang.String |
getStart() |
int |
hashCode() |
boolean |
isAbsolute()
Determines if this IRI is absolute
|
boolean |
isBottomEntity()
Determines if this object is either, owl:Nothing (the bottom class), owl:bottomObjectProperty (the bottom object property)
, owl:bottomDataProperty (the bottom data property).
|
boolean |
isNothing()
Determines if this IRI is equal to the IRI that
owl:Nothing
is named with |
boolean |
isPlainLiteral()
Determines if this IRI is equal to the IRI that is named
rdf:PlainLiteral |
boolean |
isReservedVocabulary()
Determines if this IRI is in the reserved vocabulary.
|
boolean |
isThing()
Determines if this IRI is equal to the IRI that
owl:Thing is
named with |
boolean |
isTopEntity()
Determines if this object is either, owl:Thing (the top class), owl:topObjectProperty (the top object property)
, owl:topDataProperty (the top data property) or rdfs:Literal (the top datatype).
|
int |
length()
Returns the length of this character sequence.
|
IRI |
resolve(java.lang.String s) |
java.lang.CharSequence |
subSequence(int start,
int end)
Returns a new
CharSequence that is a subsequence of this sequence. |
java.lang.String |
toQuotedString()
Obtained this IRI surrounded by angled brackets
|
java.lang.String |
toString() |
java.net.URI |
toURI()
Obtains this IRI as a URI.
|
protected IRI(java.lang.String prefix, java.lang.String fragment)
prefix
- The prefix.fragment
- The suffix.protected IRI(java.lang.String s)
protected IRI(java.net.URI uri)
public java.net.URI toURI()
public boolean isAbsolute()
true
if this IRI is absolute or false
if this IRI is not absolutepublic java.lang.String getScheme()
public java.lang.String getStart()
public IRI resolve(java.lang.String s)
s
- the IRI stirng to be resolvedpublic boolean isReservedVocabulary()
true
if the IRI is in the reserved vocabulary,
otherwise false
.public boolean isThing()
owl:Thing
is
named withtrue
if this IRI is equal to
<http://www.w3.org/2002/07/owl#Thing> and otherwise
false
public boolean isNothing()
owl:Nothing
is named withtrue
if this IRI is equal to
<http://www.w3.org/2002/07/owl#Nothing> and otherwise
false
public boolean isPlainLiteral()
rdf:PlainLiteral
true
if this IRI is equal to
<http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral>,
otherwise false
public java.lang.String getFragment()
null
if the IRI does not have a
fragmentpublic java.lang.String toQuotedString()
public static IRI create(java.lang.String str)
str
- The String that specifies the IRI. Cannot be null.public static IRI create(java.lang.String prefix, java.lang.String suffix)
prefix
- The first string. May be null
.suffix
- The second string. May be null
.public static IRI create(java.io.File file)
file
- the file to create the IRI from. Cannot be null.public static IRI create(java.net.URI uri)
uri
- the uri to create the IRI from. Cannot be nullpublic static IRI create(java.net.URL url) throws java.net.URISyntaxException
url
- the url to create the IRI from. Cannot be null.java.net.URISyntaxException
- if the URL is ill formedpublic static IRI generateDocumentIRI()
owlapi:ontologyTIMESTAMP
public int length()
char
s in the sequence.length
in interface java.lang.CharSequence
char
s in this sequencepublic char charAt(int index)
char
value at the specified index. An index ranges from zero
to length() - 1. The first char
value of the sequence is at
index zero, the next at index one, and so on, as for array
indexing.
If the char
value specified by the index is a
surrogate, the surrogate
value is returned.
charAt
in interface java.lang.CharSequence
index
- the index of the char
value to be returnedchar
valuejava.lang.IndexOutOfBoundsException
- if the index argument is negative or not less than
length()public java.lang.CharSequence subSequence(int start, int end)
CharSequence
that is a subsequence of this sequence.
The subsequence starts with the char
value at the specified index and
ends with the char
value at index end - 1. The length
(in char
s) of the
returned sequence is end - start, so if start == end
then an empty sequence is returned. subSequence
in interface java.lang.CharSequence
start
- the start index, inclusiveend
- the end index, exclusivejava.lang.IndexOutOfBoundsException
- if start or end are negative,
if end is greater than length(),
or if start is greater than endpublic void accept(OWLObjectVisitor visitor)
public <O> O accept(OWLObjectVisitorEx<O> visitor)
public void accept(OWLAnnotationSubjectVisitor visitor)
accept
in interface OWLAnnotationSubject
public <E> E accept(OWLAnnotationSubjectVisitorEx<E> visitor)
accept
in interface OWLAnnotationSubject
public java.util.Set<OWLClass> getClassesInSignature()
OWLObject
getClassesInSignature
in interface OWLObject
public java.util.Set<OWLDataProperty> getDataPropertiesInSignature()
OWLObject
getDataPropertiesInSignature
in interface OWLObject
public java.util.Set<OWLNamedIndividual> getIndividualsInSignature()
OWLObject
getIndividualsInSignature
in interface OWLObject
public java.util.Set<OWLObjectProperty> getObjectPropertiesInSignature()
OWLObject
getObjectPropertiesInSignature
in interface OWLObject
public java.util.Set<OWLEntity> getSignature()
OWLObject
getSignature
in interface OWLObject
public java.util.Set<OWLAnonymousIndividual> getAnonymousIndividuals()
OWLObject
getAnonymousIndividuals
in interface OWLObject
public java.util.Set<OWLDatatype> getDatatypesInSignature()
OWLObject
getDatatypesInSignature
in interface OWLObject
public java.util.Set<OWLClassExpression> getNestedClassExpressions()
OWLObject
getNestedClassExpressions
in interface OWLObject
OWLClassExpression
s that represent the nested class
expressions used in this object.public int compareTo(OWLObject o)
compareTo
in interface java.lang.Comparable<OWLObject>
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void accept(OWLAnnotationValueVisitor visitor)
accept
in interface OWLAnnotationValue
public <O> O accept(OWLAnnotationValueVisitorEx<O> visitor)
accept
in interface OWLAnnotationValue
public boolean isTopEntity()
OWLObject
isTopEntity
in interface OWLObject
true
if this object corresponds to one of the above entities.public boolean isBottomEntity()
OWLObject
isBottomEntity
in interface OWLObject
true
if this object corresponds to one of the above entities.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object


'infix to postfix'
given the expression in infix form , conver it to postfix using stack
'Check for balanced parentheses in an expression'
Given an expression string exp , write a program to examine whether the pairs are in order or not'
'Expression Evaluation'
Evaluate an expression represented by a String. Expression can contain parentheses, you can assume parentheses are well-matched.


--- layout: default permalink: / ---
This is a Jekyll seed application.
Your index page content would show up here.


PrettyScribe is a simple single-page web application that renders BattleScribe roster files in a (hopefully) useful format for viewing on device or printing. The PrettyScribe application is inspired by the (poorly named but quite useful) ButtScribe application.
Currently PrettyScribe supports roster files for Warhammer 40k, Warhammer 40k Kill Team, Warhammer Age of Sigmar Warhammer Age of Sigmar Warcry and Horus Heresy - Warhammer 30k. Compressed (.rosz) and uncompressed (.ros) roster formats are accepted.
This work was started as an exercise in learning web-development (Javascript, Typescript, etc.) and a passion for the table-top wargamming hobby in general.
PrettyScribe is very much a work in progress. Suggestions, bugs, comments are welcomed. PrettyScribe is an open-source project and can be found on Github at, https://github.com/rweyrauch/PrettyScribe.
If you actually use this tool and find it useful let me know. If you tried this tool and did NOT find useful also let me know why.
Much credit for this work goes to the ButtScribe app by Goonhammer for the inspiration and the icons I shamelessly borrowed.
Credit also goes to the volunteer teams of BattleScribe catalog maintainers. These teams provide an invaluable service to the tabletop wargamming community.


Brighten your winter mood with this free 4K Beaches-themed Windows 10 wallpaper pack
by SururTo fight the depressing darkness of wintertime, Microsoft has released a new beach-themed premium wallpaper pack you can download for free from the Microsoft Store.
Titled Aerial Beaches , the description of the high-quality wallpaper selection reads as follows:
Get a lofty view of waves meeting land in these 15 premium 4k images, free for Windows 10 Theme.
After downloading the collection, go to Start > Settings > Personalization > Themes and click on the theme you prefer.
To apply and change to the most appropriate colour, based on the current wallpaper, go to Customize > Colors > Automatically select a primary colour from the background.
Find the collection in the Microsoft Store here.
|
|
Download | Aerial Beaches PREMIUM Developer: Microsoft Corporation Price: Free |
|
Via WalkingCat


vignettes/parallel.Rmd
parallel.Rmd
Running multiple chains is a good way of checking that our MCMC is working well. Each chain is completely independent of all others, and so this qualifies as an embarrassingly parallel problem.
This vignette will demonstrate how to run drjacoby with multiple chains, first in serial and then in parallel over multiple cores.
As always, we require some data, some parameters, and some functions to work with (see earlier examples). The underlying model is not our focus here, so we will use a very basic setup
# define data
data_list <- list(x = rnorm(10))
# define parameters dataframe
df_params <- data.frame(name = "mu", min = -10, max = 10, init = 0)
# define loglike function
r_loglike <- function(params, data, misc) {
sum(dnorm(data$x, mean = params["mu"], sd = 1.0, log = TRUE))
}
# define logprior function
r_logprior <- function(params, misc) {
dunif(params["mu"], min = -10, max = 10, log = TRUE)
}
Whenever the input argument cluster
is NULL
, chains will run in serial. This is true by default, so running multiple chains in serial is simply a case of specifying the chains
argument:
# run MCMC in serial
<- run_mcmc(data = data_list,
mcmc df_params = df_params,
loglike = r_loglike,
logprior = r_logprior,
burnin = 1e3,
samples = 1e3,
chains = 2,
pb_markdown = TRUE)
#> MCMC chain 1
#> burn-in
#>
|
|======================================================================| 100%
#> acceptance rate: 43%
#> sampling phase
#>
|
|======================================================================| 100%
#> acceptance rate: 44%
#> chain completed in 0.062929 seconds
#> MCMC chain 2
#> burn-in
#>
|
|======================================================================| 100%
#> acceptance rate: 43.8%
#> sampling phase
#>
|
|======================================================================| 100%
#> acceptance rate: 43.7%
#> chain completed in 0.068930 seconds
#> total MCMC run-time: 0.132 seconds
When we look at our MCMC output (using the plot_par()
function) we can see that there are 2 chains, each of which contains a series of draws from the posterior. If we used multiple temperature rungs then these would also be duplicated over chains.
# summarise output
mcmc
#> drjacoby output:
#> 2 chains
#> 1 rungs
#> 1000 burn-in iterations
#> 1000 sampling iterations
#> 1 parameters
# compare mu over both chains
plot_par(mcmc, "mu", phase = "both")
Running in parallel is only slightly more complex. Before running anything we need to know how many cores our machine has. You may know this number already, but if you don’t then the parallel
package has a handy function for detecting the number of cores for you:
cores <- parallel::detectCores()
Next we make a cluster object, which creates multiple copies of R running in parallel over different cores. Here we are using all available cores, but if you want to hold some back for other intensive tasks then simply use a smaller number of cores when specifying this cluster.
cl <- parallel::makeCluster(cores)
We then run the usual run_mcmc()
function, this time passing in the cluster object as an argument. This causes drjacoby to use a clusterApplyLB()
call rather than an ordinary lapply()
call over different chains. Each chain is added to a queue over the specified number of cores - when the first job completes, the next job is placed on the node that has become available and this continues until all jobs are complete.
Note that output is supressed when running in parallel to avoid sending print commands to multiple cores, so you will not see the usual progress bars.
# run MCMC in parallel
mcmc <- run_mcmc(data = data_list,
df_params = df_params,
loglike = r_loglike,
logprior = r_logprior,
burnin = 1e3,
samples = 1e3,
chains = 2,
cluster = cl,
pb_markdown = TRUE)
Finally, it is good practice to shut down the workers once we are finished:
parallel::stopCluster(cl)
To run the MCMC in parallel with C++ log-likelihood or log-prior functions there is on additional step to take when setting up the cluster. Each node must be able to access a version of the compiled C++ functions, so after initialising the cluster with:
cl <- parallel::makeCluster(cores)
we must also make the C++ functions accessible, by running the Rcpp::sourceCPP command for our C++ file for each node:
cl_cpp <- parallel::clusterEvalQ(cl, Rcpp::sourceCpp("my_cpp.cpp"))
After which we can run the mcmc in the same way:
# run MCMC in parallel
mcmc <- run_mcmc(data = data_list,
df_params = df_params,
loglike = "loglike",
logprior = "logprior",
burnin = 1e3,
samples = 1e3,
chains = 2,
cluster = cl,
pb_markdown = TRUE)
parallel::stopCluster(cl)


Overview
The IngParsing API attempts to process an ingredient phrase like "1/4 cup cooked shredded chicken" and categorize each word into quantities (QTY), units (UNIT), ingredient name (NAME) or comments (COM).
It uses a machine learning model to predict the probability of each word to be in a certain category.
Documentation
| Title |
Parse
|
| URL |
/parse
|
| Method |
GET
|
| URL Params |
Required:
q=[string] : ingredient phrase
example: q=1/4%20cup%20cooked%20shredded%20chicken to parse the phrase "1/4 cup cooked shredded chicken"
|
| Success Response |
The API will return an array. Each element in the array will contain a token (word), their POS tag and their predicted category (QTY, UNIT, NAME or COM).
For example:
Code: 200
Content:
[
[
"1/4",
"CD",
"QTY"
],
[
"cup",
"NN",
"UNIT"
],
[
"cooked",
"VBD",
"COM"
],
[
"shredded",
"JJ",
"COM"
],
[
"chicken",
"NN",
"NAME"
]
]
|
| Error Response |
An API call without the required q parameter will return a 400 status code
|
| Sample Call |
A sample call using jquery:
$.ajax({
type: "GET",
url: "/parse",
data: "q=1/4%20cup%20cooked%20shredded%20chicken",
contentType: 'text/plain',
success: function(data){
console.log(data)
}
});
|


{% extends "layout.html" %} {% block page_title %} Search results {% endblock %} {% block content %} {% include version + "/includes/phase_banner_alpha.html" %} Back to the previous question Search results No results for '{% if searchTerm %}{{searchTerm}}{% else %}{searchTerm}{% endif %}' This is because either: there are no provisional funding allocations for this organisation there is a misspelling Choose how to view provisional allocations {% endblock %}
This is because either:
Choose how to view provisional allocations


Z28
open class Z28 : ParsableCommand
-
Declaration
Swift
public lazy var cwd: String { get set }
-
Declaration
Swift
public lazy var source: String { get set }
-
Declaration
Swift
public lazy var lineMap: LineMap { get set }
-
Declaration
Swift
public lazy var filePath: String { get set }
-
Declaration
Swift
public lazy var tempPath: String { get set }
-
Declaration
Swift
@Option public var filename: String { get set }
-
Declaration
Swift
@Option public var tempDir: String { get set }
-
Declaration
Swift
@Flag public var buildMethod: BuildMethod { get set }
-
Declaration
Swift
@Argument public var buildArguments: [String] { get set }
-
Declaration
Swift
public required init()
-
Declaration
Swift
public func run() throws
-
Index a source file.
Throws
If an error occurs.Declaration
Swift
open func fileIndex(file: File, module: Module) throws -> [String : Any]
Parameters
file
The filename.
module
The module information.
Return Value
The index of the file.
-
Declaration
Swift
open func fileStructure(file: File, lineMap: LineMap) throws -> [String : Any]
-
Declaration
Swift
open func fileDocs(file: File, module: Module, lineMap: LineMap) throws -> [String : Any]
-
Declaration
Swift
open func fileSyntax(file: File, module: Module, lineMap: LineMap) throws -> [String : Any]
-
Declaration
-
Declaration
Swift
open func linesAndOffsets(filename: String) throws -> (source: String, lineMap: LineMap)
-
Declaration
Swift
open func linesAndOffsets(source: String) -> LineMap
-
Declaration
Swift
open func writePList(data: [String : Any], toFile path: String? = nil) throws
-
Declaration
Swift
open func printToStdout(_ str: String, terminator: String = "\n")
-
Declaration
Swift
open func printToStderr(_ str: String, terminator: String = "\n")
-
Declaration
Swift
open func printTo(filename: String, _ str: String, terminator: String = "\n") throws
-
Declaration
Swift
open func fromJSON(_ data: String) throws -> [String : Any]
-
Declaration
Swift
open func toArray(_ arr: [SourceKitRepresentable]) -> [Any]
-
Declaration
Swift
open func toDictionary(_ dict: [String : SourceKitRepresentable]) -> [String : Any]