| DOSE: |
|
oral |
DXM |
| |
|
oral |
Chlorpheniramine Maleate |
[Erowid Warning: Most Coricidin contains CPM (Chlorpheniramine Maleate) which can be dangerous in high doses. See DXM Brand Warnings for more info.]
Well,it all started on a Friday afternoon at my girlfriends house.We decided that we would go with her mom and younger siblings to wal-mart to buy a pair of shoes. We wandered over to the pharmacy and noticed as we always do, the Coricidin Cough & Cold Tablets. We decided that I would steal some. So I picked up 3 boxes as she did also. We proceeded to steal them. We got home and took 1 box each. We then split the rest evenly. On saturday I took another box. Then on Sunday when I woke up I still felt it pretty strong.
I dont really remember how we managed to get more but on that Sunday I took a box at about 11:00 a.m. We went to a local park and man was I hammered. Everything was moving even when I was standing still. I looked half-crazy and my pupils were about the size of pennies.
Now, I have a chemical imbalance in my brain known as bipolar disorder. So depression is always around. I started feeling depressed so when I got home I took another box. Bad Idea....I stayed up half the night laying on the floor listening to Voodoo by Godsmack, which I ordinarily wouldnt be listening to. The next day when I woke up I knew I had to chill out for a couple of days. My mother drove me and my brother to wal-mart to buy a fish for him. I stole 2 more boxes of Coricidin. I took one when we got home.
I was pretty sure that i was going to die. I called my girlfriend on the phone crying,sweating horribly,and not knowing what I was doing. I told her about it and she told me that it would be ok. Just not to take anymore. I told my mom good night,because she was going to sleep. We got into an argument. I then got really mad and took the other box. I called her again and she started crying and screaming because an overdose was in question we thought. She put her mom on the phone and she comforted me.
 I went to see my psychiatrist in the morning. Then when I got home I started feeling really depressed. I took a razorblade and slashed my wrist and forearm 12 times...blood galore, dripping all over the floor. My mom came out to the garage and saw me bleeding pretty bad and rushed me to the hospital. I spit it all out about all the pills. They then committed me to a mental hospital.
I spent 7 days in there. My blood pressure was high for 4 days. I slept for about 15-16 hours a day for the 1st 3 days. I just got out today and I'm trying to promise myself not to take them anymore...but who knows what will happen? I may take them again.
For any recreational Coricidin users out there..I'm not going to harass you about it..just be careful. I wish i would have been.
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.


Custom Distributions¶
You might want to model input uncertanty with a distribution not currenlty available in Golem. In this case you can create your own class implementing such distribution.
Here, we will reimplement a uniform distribution as a toy example.
[1]:
from golem import *
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib
%matplotlib inline
import seaborn as sns
sns.set(context='talk', style='ticks')
To create your own distribution class to be used in Golem, you need to create a class that:
Inherits from the
BaseDist
class;Implements a
cdf
method that returns the cumulative density for the distribution of interest. Thecdf
method needs to to take in two arguments,x
andloc
.loc
is the location of the distribution, e.g. the mean for a Gaussian, andx
is where the CDF needs to be evaluated at.
In addition, even though this is not required for the code to run, the __init__
method should allow to define the scale of the distribution. In the example below, we allow the user to define the range of the uniform. For a Gaussian distribution this would be the standard deviation, and so on.
[2]:
# Here is a custom, user-implemented, uniform distribution class
class MyDistribution(BaseDist):
def __init__(self, urange):
self.urange = urange
def cdf(self, x, loc):
"""Cumulative density function.
Parameters
----------
x : float
The point where to evaluate the cdf.
loc : float
The location of the Uniform distribution.
Returns
-------
cdf : float
Cumulative density evaluated at ``x``.
"""
a = loc - 0.5 * self.urange
b = loc + 0.5 * self.urange
# calc cdf
if x < a:
return 0.
elif x > b:
return 1.
else:
return (x - a) / (b - a)
To demonstrate how this can be used, we use a simple objective function and we will compute its robust counterpart using the Uniform
class available in Golem as well as the above, user-defined equivalent MyDistribution
.
[3]:
# a sample 1d objective function
def objective(x):
def sigmoid(x, l, k, x0):
return l / (1 + np.exp(-k*(x-x0)))
sigs = [sigmoid(x, 1, 100, 0.1),
sigmoid(x, -1, 100, 0.2),
sigmoid(x, 0.7, 80, 0.5),
sigmoid(x, -0.7, 80, 0.9)
]
return np.sum(sigs, axis=0)
First, using the Golem.Uniform
class…
[4]:
# take 1000 samples in x
x = np.linspace(0, 1, 1000)
# compute objective
y = objective(x)
# compute robust objective with Golem
golem = Golem(goal='max', random_state=42, nproc=1)
golem.fit(X=x.reshape(-1,1), y=y)
# use the Golem.Uniform class here
dists = [Uniform(0.2)]
y_robust = golem.predict(X=x.reshape(-1,1), distributions=dists)
# plot results
plt.plot(x, y, linewidth=5, label='Objective')
plt.plot(x, y_robust, linewidth=5, label='Robust Objective')
_ = plt.legend(loc='lower center', ncol=2, bbox_to_anchor=(0.5 ,1.), frameon=False)
_ = plt.xlabel('$x$')
_ = plt.ylabel('$f(x)$')
[INFO] Golem ... 1 tree(s) parsed in 53.26 ms ...
[INFO] Golem ... Convolution of 1000 samples performed in 6.25 ms ...
…then with our new custom MyDistribution
class:
[5]:
# use MyDistribution for the prediction/convolution
dists = [MyDistribution(0.2)]
y_robust = golem.predict(X=x.reshape(-1,1), distributions=dists)
# plot the results
plt.plot(x, y, linewidth=5, label='Objective')
plt.plot(x, y_robust, linewidth=5, label='Robust Objective')
_ = plt.legend(loc='lower center', ncol=2, bbox_to_anchor=(0.5 ,1.), frameon=False)
_ = plt.xlabel('$x$')
_ = plt.ylabel('$f(x)$')
[INFO] Golem ... Convolution of 1000 samples performed in 297.95 ms ...
As you can see, the result above (orange line) obtained with the user-defined uniform is the same to that obtained with Golem.Uniform
as expected.
However, note that while with Golem.Uniform
the 1000 samples were processed in less than 10 ms, with MyDistribution
it took almost 300 ms (~30 times slower). This is because the method cdf
is called many times (about 1 million times in this example) and Golem.Uniform
is implemented in Cython rather than Python. Therefore, if the execution time of the predict
method in Golem with your custom distribution is too slow, you shuold consider a Cython implementation.
[ ]:


CPack IFW Generator¶
See CPackIFW
for details on the CPackIFW module.
Overview¶
CPack IFW
generator helps you to create online and offline
binary cross-platform installers with a graphical user interface.
CPack IFW generator prepares project installation and generates configuration and meta information for QtIFW tools.
The QtIFW provides a set of tools and utilities to create installers for the supported desktop Qt platforms: Linux, Microsoft Windows, and macOS.
You should also install QtIFW to use CPack IFW
generator.
Hints¶
Generally, the CPack IFW
generator automatically finds QtIFW tools,
but if you don’t use a default path for installation of the QtIFW tools,
the path may be specified in either a CMake or an environment variable:
-
CPACK_IFW_ROOT
¶ An CMake variable which specifies the location of the QtIFW tool suite.
The variable will be cached in the
CPackConfig.cmake
file and used at CPack runtime.
Note
The specified path should not contain “bin” at the end (for example: “D:\DevTools\QtIFW2.0.5”).
The CPACK_IFW_ROOT
variable has a higher priority and overrides
the value of the QTIFWDIR
variable.
Internationalization¶
Some variables and command arguments support internationalization via CMake script. This is an optional feature.
Installers created by QtIFW tools have built-in support for internationalization and many phrases are localized to many languages, but this does not apply to the description of the your components and groups that will be distributed.
Localization of the description of your components and groups is useful for users of your installers.
A localized variable or argument can contain a single default value, and a set of pairs the name of the locale and the localized value.
For example:
set(LOCALIZABLE_VARIABLE "Default value"
en "English value"
en_US "American value"
en_GB "Great Britain value"
)
Variables¶
You can use the following variables to change behavior of CPack IFW
generator.
Package¶
-
CPACK_IFW_PACKAGE_TITLE
¶ Name of the installer as displayed on the title bar. By default used
CPACK_PACKAGE_DESCRIPTION_SUMMARY
.
-
CPACK_IFW_PACKAGE_PUBLISHER
¶ Publisher of the software (as shown in the Windows Control Panel). By default used
CPACK_PACKAGE_VENDOR
.
-
CPACK_IFW_PRODUCT_URL
¶ URL to a page that contains product information on your web site.
-
CPACK_IFW_PACKAGE_ICON
¶ Filename for a custom installer icon. The actual file is ‘.icns’ (macOS), ‘.ico’ (Windows). No functionality on Unix.
-
CPACK_IFW_PACKAGE_WINDOW_ICON
¶ Filename for a custom window icon in PNG format for the Installer application.
-
CPACK_IFW_PACKAGE_LOGO
¶ Filename for a logo is used as QWizard::LogoPixmap.
-
CPACK_IFW_PACKAGE_WATERMARK
¶ Filename for a watermark is used as QWizard::WatermarkPixmap.
-
CPACK_IFW_PACKAGE_BANNER
¶ Filename for a banner is used as QWizard::BannerPixmap.
-
CPACK_IFW_PACKAGE_BACKGROUND
¶ Filename for an image used as QWizard::BackgroundPixmap (only used by MacStyle).
-
CPACK_IFW_PACKAGE_WIZARD_STYLE
¶ Wizard style to be used (“Modern”, “Mac”, “Aero” or “Classic”).
-
CPACK_IFW_PACKAGE_STYLE_SHEET
¶ Filename for a stylesheet.
-
CPACK_IFW_PACKAGE_WIZARD_DEFAULT_WIDTH
¶ Default width of the wizard in pixels. Setting a banner image will override this.
-
CPACK_IFW_PACKAGE_WIZARD_DEFAULT_HEIGHT
¶ Default height of the wizard in pixels. Setting a watermark image will override this.
-
CPACK_IFW_PACKAGE_TITLE_COLOR
¶ Color of the titles and subtitles (takes an HTML color code, such as “#88FF33”).
-
CPACK_IFW_PACKAGE_START_MENU_DIRECTORY
¶ Name of the default program group for the product in the Windows Start menu.
By default used
CPACK_IFW_PACKAGE_NAME
.
-
CPACK_IFW_TARGET_DIRECTORY
¶ Default target directory for installation. By default used “@ApplicationsDir@/
CPACK_PACKAGE_INSTALL_DIRECTORY
”You can use predefined variables.
-
CPACK_IFW_ADMIN_TARGET_DIRECTORY
¶ Default target directory for installation with administrator rights.
You can use predefined variables.
-
CPACK_IFW_PACKAGE_GROUP
¶ The group, which will be used to configure the root package
-
CPACK_IFW_PACKAGE_NAME
¶ The root package name, which will be used if configuration group is not specified
-
CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_NAME
¶ Filename of the generated maintenance tool. The platform-specific executable file extension is appended.
By default used QtIFW defaults (
maintenancetool
).
-
CPACK_IFW_PACKAGE_REMOVE_TARGET_DIR
¶ Set to
OFF
if the target directory should not be deleted when uninstalling.Is
ON
by default
-
CPACK_IFW_PACKAGE_MAINTENANCE_TOOL_INI_FILE
¶ Filename for the configuration of the generated maintenance tool.
By default used QtIFW defaults (
maintenancetool.ini
).
-
CPACK_IFW_PACKAGE_ALLOW_NON_ASCII_CHARACTERS
¶ Set to
ON
if the installation path can contain non-ASCII characters.Is
ON
for QtIFW less 2.0 tools.
-
CPACK_IFW_PACKAGE_ALLOW_SPACE_IN_PATH
¶ Set to
OFF
if the installation path cannot contain space characters.Is
ON
for QtIFW less 2.0 tools.
-
CPACK_IFW_PACKAGE_CONTROL_SCRIPT
¶ Filename for a custom installer control script.
-
CPACK_IFW_PACKAGE_RESOURCES
¶ List of additional resources (‘.qrc’ files) to include in the installer binary.
You can use
cpack_ifw_add_package_resources()
command to resolve relative paths.
-
CPACK_IFW_PACKAGE_FILE_EXTENSION
¶ The target binary extension.
On Linux, the name of the target binary is automatically extended with ‘.run’, if you do not specify the extension.
On Windows, the target is created as an application with the extension ‘.exe’, which is automatically added, if not supplied.
On Mac, the target is created as an DMG disk image with the extension ‘.dmg’, which is automatically added, if not supplied.
-
CPACK_IFW_REPOSITORIES_ALL
¶ The list of remote repositories.
The default value of this variable is computed by CPack and contains all repositories added with command
cpack_ifw_add_repository()
or updated with commandcpack_ifw_update_repository()
.
-
CPACK_IFW_DOWNLOAD_ALL
¶ If this is
ON
all components will be downloaded. By default isOFF
or used value fromCPACK_DOWNLOAD_ALL
if set
Components¶
-
CPACK_IFW_RESOLVE_DUPLICATE_NAMES
¶ Resolve duplicate names when installing components with groups.
-
CPACK_IFW_PACKAGES_DIRECTORIES
¶ Additional prepared packages dirs that will be used to resolve dependent components.
Tools¶
-
CPACK_IFW_BINARYCREATOR_EXECUTABLE
¶ The path to “binarycreator” command line client.
This variable is cached and may be configured if needed.
-
CPACK_IFW_REPOGEN_EXECUTABLE
¶ The path to “repogen” command line client.
This variable is cached and may be configured if needed.
-
CPACK_IFW_INSTALLERBASE_EXECUTABLE
¶ The path to “installerbase” installer executable base.
This variable is cached and may be configured if needed.
-
CPACK_IFW_DEVTOOL_EXECUTABLE
¶ The path to “devtool” command line client.
This variable is cached and may be configured if needed.
Online installer¶
By default CPack IFW generator makes offline installer. This means that all components will be packaged into a binary file.
To make a component downloaded, you must set the DOWNLOADED
option in
cpack_add_component()
.
Then you would use the command cpack_configure_downloads()
.
If you set ALL
option all components will be downloaded.
You also can use command cpack_ifw_add_repository()
and
variable CPACK_IFW_DOWNLOAD_ALL
for more specific configuration.
CPack IFW generator creates “repository” dir in current binary dir. You
would copy content of this dir to specified site
(url
).
See Also¶
Qt Installer Framework Manual:
- Index page: http://doc.qt.io/qtinstallerframework/index.html
- Component Scripting: http://doc.qt.io/qtinstallerframework/scripting.html
- Predefined Variables: http://doc.qt.io/qtinstallerframework/scripting.html#predefined-variables
- Promoting Updates: http://doc.qt.io/qtinstallerframework/ifw-updates.html
- Download Qt Installer Framework for you platform from Qt site:
- http://download.qt.io/official_releases/qt-installer-framework


public class Country
extends java.lang.Object
Each Country stores a country-code, continent-code, owner-code, number of armies, and number of fortifyable armies. As well, each Country stores an array containing references to all adjoining Country's.
When first initialized by the game world, each Country will be given a permanent country-code, continent-code and adjoining-list. The owner-code and number of armies are set to -1.
The country-code is a unique number used to identify countries. The array returned by the Board.getCountries() will always be ordered by country-code.
| Constructor and Description |
|---|
Country(int newCountryCode,
int newContCode,
java.lang.Object passkey)
Create a new country.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addArmy(java.lang.Object passkey)
Adds one to the army count of the the Country, as long as the passkey object is the same as supplied in the constructor.
|
void |
addToAdjoiningList(Country destinationCountry,
java.lang.Object passkey)
Add a connection from this Country object to the destinationCountry object.
|
void |
addToAdjoiningListBoth(Country otherCountry,
java.lang.Object passkey)
Add a 2-way connection between this Country object and the otherCountry object.
|
boolean |
canGoto(Country country)
An adjacency test.
|
boolean |
canGoto(int countryCode)
An adjacency test.
|
void |
clearAdjoiningList(java.lang.Object passkey) |
int[] |
getAdjoiningCodeList()
Return an int array containing the country codes of all adjoining countries.
|
Country[] |
getAdjoiningList()
Returns an array containing all of the Country's that are touching this Country.
|
int |
getArmies()
Returns the number of armies in this Country.
|
int |
getCode()
Returns the country-code of this Country.
|
int |
getContinent()
Returns the continent-code of this Country.
|
int[] |
getFriendlyAdjoiningCodeList()
Return an int array containing the country codes of all the neigbors of this country that are owned by the same player.
|
int[] |
getHostileAdjoiningCodeList()
Return an int array containing the country codes of all the countries that this country can attack.
|
int |
getMoveableArmies()
Returns the number of armies in this Country that may be fortified somewhere else.
|
java.lang.String |
getName()
Return the name of the country.
|
int |
getNumberEnemyNeighbors()
Returns the number of neighbor countries owned by players that don't own this Country.
|
int |
getNumberNeighbors()
Returns the number of adjacent countries.
|
int |
getNumberNotPlayerNeighbors(int player)
Returns the number of adjacent countries not owned by player.
|
int |
getNumberPlayerNeighbors(int player)
Returns the number of adjacent countries owned by player.
|
int |
getNumberPlayerNotNamedNeighbors(java.lang.String agentName,
Board board)
Returns the number of adjacent countries not owned by an agent named agentName.
|
int |
getOwner()
Returns the current owner-code of this Country.
|
Country |
getStrongestNeighborOwnedBy(int player)
Returns a reference to the neighbor that is owned by 'player' with the most number of armies on it.
|
Country |
getWeakestEnemyNeighbor()
Returns a reference to the weakest neighbor that is owned by another player, or null if there are no enemy neighbors.
|
Country |
getWeakestEnemyNeighborInContinent(int cont)
Operates like getWeakestEnemyNeighbor but limits its search to the given continent.
|
boolean |
isNextTo(Country country)
Depreciated: use canGoto() instead.
|
boolean |
isNextTo(int countryCode)
Depreciated: use canGoto() instead.
|
void |
setArmies(int newArmies,
java.lang.Object passkey)
Sets the number of armies on the Country, as long as the passkey object is the same as supplied in the constructor.
|
void |
setContinentCode(int newContinentCode,
java.lang.Object passkey)
Sets the continent code of the Country, as long as the passkey object is the same as supplied in the constructor.
|
void |
setName(java.lang.String name,
java.lang.Object passkey)
Set the name of the Country.
|
void |
setOwner(int newOwner,
java.lang.Object passkey)
Sets the owner code of the Country, as long as the passkey object is the same as supplied in the constructor.
|
java.lang.String |
toString()
Returns a String representation of the country.
|
public Country(int newCountryCode, int newContCode, java.lang.Object passkey)
public void addArmy(java.lang.Object passkey)
public void addToAdjoiningList(Country destinationCountry, java.lang.Object passkey)
public void addToAdjoiningListBoth(Country otherCountry, java.lang.Object passkey)
public boolean canGoto(Country country)
public boolean canGoto(int countryCode)
public void clearAdjoiningList(java.lang.Object passkey)
public int[] getAdjoiningCodeList()
public Country[] getAdjoiningList()
public int getArmies()
public int getCode()
public int getContinent()
public int[] getFriendlyAdjoiningCodeList()
public int[] getHostileAdjoiningCodeList()
public int getMoveableArmies()
public java.lang.String getName()
public int getNumberEnemyNeighbors()
public int getNumberNeighbors()
public int getNumberNotPlayerNeighbors(int player)
public int getNumberPlayerNeighbors(int player)
public int getNumberPlayerNotNamedNeighbors(java.lang.String agentName, Board board)
public int getOwner()
public Country getStrongestNeighborOwnedBy(int player)
public Country getWeakestEnemyNeighbor()
public Country getWeakestEnemyNeighborInContinent(int cont)
public boolean isNextTo(Country country)
public boolean isNextTo(int countryCode)
public void setArmies(int newArmies, java.lang.Object passkey)
public void setContinentCode(int newContinentCode, java.lang.Object passkey)
public void setName(java.lang.String name, java.lang.Object passkey)
public void setOwner(int newOwner, java.lang.Object passkey)
public java.lang.String toString()
toString
in class java.lang.Object


The $sample_mpi()
method of a CmdStanModel
object is
identical to the $sample()
method but with support for
MPI. The target audience for MPI are
those with large computer clusters. For other users, the
$sample()
method provides both parallelization of
chains and threading support for within-chain parallelization.
In order to use MPI with Stan, an MPI implementation must be installed. For Unix systems the most commonly used implementations are MPICH and OpenMPI. The implementations provide an MPI C++ compiler wrapper (for example mpicxx), which is required to compile the model.
An example of compiling with MPI:
mpi_options = list(STAN_MPI=TRUE, CXX="mpicxx", TBB_CXX_TYPE="gcc") mod = cmdstan_model("model.stan", cpp_options = mpi_options)
The C++ options that must be supplied to the compile call are:
STAN_MPI
: Enables the use of MPI with Stan if TRUE
.
CXX
: The name of the MPI C++ compiler wrapper. Typically "mpicxx"
.
TBB_CXX_TYPE
: The C++ compiler the MPI wrapper wraps. Typically "gcc"
on Linux and "clang"
on macOS.
In the call to the $sample_mpi()
method it is also possible to provide
the name of the MPI launcher (mpi_cmd
, defaulting to "mpiexec"
) and any
other MPI launch arguments (mpi_args
). In most cases, it is enough to
only define the number of processes. To use n_procs
processes specify
mpi_args = list("n" = n_procs)
.
sample_mpi( data = NULL, mpi_cmd = "mpiexec", mpi_args = NULL, seed = NULL, refresh = NULL, init = NULL, save_latent_dynamics = FALSE, output_dir = NULL, output_basename = NULL, chains = 1, chain_ids = seq_len(chains), iter_warmup = NULL, iter_sampling = NULL, save_warmup = FALSE, thin = NULL, max_treedepth = NULL, adapt_engaged = TRUE, adapt_delta = NULL, step_size = NULL, metric = NULL, metric_file = NULL, inv_metric = NULL, init_buffer = NULL, term_buffer = NULL, window = NULL, fixed_param = FALSE, sig_figs = NULL, validate_csv = TRUE, show_messages = TRUE )
| data | (multiple options) The data to use for the variables specified in
the
|
|---|---|
| mpi_cmd | (character vector) The MPI launcher used for launching MPI
processes. The default launcher is |
| mpi_args | (list) A list of arguments to use when launching MPI
processes. For example, |
| seed | (positive integer(s)) A seed for the (P)RNG to pass to CmdStan.
In the case of multi-chain sampling the single |
| refresh | (non-negative integer) The number of iterations between
printed screen updates. If |
| init | (multiple options) The initialization method to use for the
variables declared in the
|
| save_latent_dynamics | (logical) Should auxiliary diagnostic information
about the latent dynamics be written to temporary diagnostic CSV files?
This argument replaces CmdStan's |
| output_dir | (string) A path to a directory where CmdStan should write
its output CSV files. For interactive use this can typically be left at
|
| output_basename | (string) A string to use as a prefix for the names of the output CSV files of CmdStan.
|
| chains | (positive integer) The number of Markov chains to run. The default is 4. |
| chain_ids | (vector) A vector of chain IDs. Must contain |
| iter_warmup | (positive integer) The number of warmup iterations to run
per chain. Note: in the CmdStan User's Guide this is referred to as
|
| iter_sampling | (positive integer) The number of post-warmup iterations
to run per chain. Note: in the CmdStan User's Guide this is referred to as
|
| save_warmup | (logical) Should warmup iterations be saved? The default
is |
| thin | (positive integer) The period between saved samples. This should typically be left at its default (no thinning) unless memory is a problem. |
| max_treedepth | (positive integer) The maximum allowed tree depth for the NUTS engine. See the Tree Depth section of the CmdStan User's Guide for more details. |
| adapt_engaged | (logical) Do warmup adaptation? The default is |
| adapt_delta | (real in |
| step_size | (positive real) The initial step size for the discrete approximation to continuous Hamiltonian dynamics. This is further tuned during warmup. |
| metric | (character) One of |
| metric_file | (character) A character vector containing paths to JSON or
Rdump files (one per chain) compatible with CmdStan that contain
precomputed inverse metrics. The |
| inv_metric | (vector, matrix) A vector (if |
| init_buffer | (nonnegative integer) Width of initial fast timestep adaptation interval during warmup. |
| term_buffer | (nonnegative integer) Width of final fast timestep adaptation interval during warmup. |
| window | (nonnegative integer) Initial width of slow timestep/metric adaptation interval. |
| fixed_param | (logical) When |
| sig_figs | (positive integer) The number of significant figures used
when storing the output values. By default, CmdStan represent the output
values with 6 significant figures. The upper limit for |
| validate_csv | (logical) When |
| show_messages | (logical) When |
A CmdStanMCMC
object.
The CmdStanR website (mc-stan.org/cmdstanr) for online documentation and tutorials.
The Stan and CmdStan documentation:
Stan documentation: mc-stan.org/users/documentation
CmdStan User’s Guide: mc-stan.org/docs/cmdstan-guide
The Stan Math Library's MPI documentation (mc-stan.org/math/mpi) for more details on MPI support in Stan.
Other CmdStanModel methods:
model-method-check_syntax
,
model-method-compile
,
model-method-generate-quantities
,
model-method-optimize
,
model-method-sample
,
model-method-variational
# \dontrun{ # mpi_options <- list(STAN_MPI=TRUE, CXX="mpicxx", TBB_CXX_TYPE="gcc") # mod <- cmdstan_model("model.stan", cpp_options = mpi_options) # fit <- mod$sample_mpi(..., mpi_args = list("n" = 4)) # }


 Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate.
Read moreSed ut perspiciatis unde omnis iste natus
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit.
Read moreBut I must explain to you how all this mistaken
But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids.
Read moreAt vero eos et accusamus et iusto odio
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum.
Read moreOn the other hand, we denounce with righteous
On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail.
Read more


You haven't bought any games on the site yet. Once you do, you'll be able to see all of your orders here and the details for each order.


| Geographic Data Set: | Oil, Gas, and Other Regulated Wells |
| Description: | This dataset contains locations of oil, gas, storage, solution salt, stratigraphic, and geothermal wells.
The Division of Mineral Resources maintains information and data on almost 40,000 wells,
categorized under New York State Article 23 Regulated wells. Additional information and data is
available online through the Oil and Gas Searchable Database at
http://www.dec.ny.gov/cfmx/extapps/GasOil/.
|
| Available: | Statewide |
| Completion or Most Recent Revision Date: | Shapefile updated nightly (Monday - Friday) |
| Accuracy: | |
| Type of Data: | Shapefile with a Point Attribute Table |
| Source of Information: | Information from the Oil and Gas Wells database is provided by the Division of Mineral Resources of New York State's Department of Environmental Conservation. |
| Projection and Map Units: | NYTM in meters, NAD83 horizontal datum. |
| Attribute Tables: | Items (or Fields) in the Point Attribute Table |
| Contact: | Division of Mineral Resources
625 Broadway, 3rd Floor Albany, NY 12233-6500<EMAIL_ADDRESS>http://www.dec.ny.gov/about/636.html |
| Documentation Date: |
Usage Notes:
| FIELD NAME | EXPLANATION |
|---|---|
| API_WELLNO | 14-Digit API number |
| CNTY | 3-Digit county code County Codes |
| HOLE | 5-Digit API number |
| SIDETRCK | 2-Digit sidetrack code |
| COMPLETION | 2-Digit company completion code |
| WELL_NAME | Well name |
| COMPANY_NAME | Well owner |
| OPERATOR_NUMBER | Well owner code |
| WELL_TYPE | Well type Well Type Codes |
| MAP_SYMBOL | Map flags for GIS mapping Map Flag Codes |
| WELL_STATUS | Well status Well Status Codes |
| DT_STATUS | Date of assigned well status code |
| DT_PERMIT_APPLICATION | Date permit application recieved |
| PERMIT_ISSUED | Date permit issued/approved |
| DATE_SPUDDED | Date drilling began |
| DATE_TOTAL_DEPTH | Date wellbore drilled to total depth |
| DATE_WELL_COMPLETED | Completion date |
| DATE_WELL_PLUGGED | Date of plugging |
| DATE_WELL_CONFIDENTIAL | Date confidential status expires (wells are confidential for 6 months from Spud Date, extended by subsequent approval of extension request) |
| CONFID | Confidential well data Confidential Information Codes |
| TOWN | Town |
| QUAD | USGS Quadrangle |
| QUADSEC | Letter designation of USGS quadrangle section |
| PRODUCING_NAME | Name of producing field |
| PRODUCING_FORMATION | Name of producing formation |
| FINANCIAL_SECURITY | Does operator have financial security? |
| SLANT | Orientation of borehole (Vertical/Horizontal/Directional) |
| COUNTY | County |
| REGION | Region |
| STATE_LEASE | Lease owned by the state (Y/N) |
| PROPOSED_DEPTH | Depth (ft) specified on permit application |
| SURFACE_LOCATION | Specifies type of location point |
| SURFACE_LONGITUDE | Longitude of surface hole point (decimal degrees) |
| SURFACE_LATITUDE | Latitude of surface hole point (decimal degrees) |
| BOTTOM_HOLE_LOCATION | Specifies type of location point(Bottom Hole - BH or Surface Hole SH) |
| BOTTOM_HOLE_LONGITUDE | Longitude of bottom hole (decimal degrees) point |
| BOTTOM_HOLE_LATITUDE | Latitude of bottom hole (decimal degrees) point |
| TRUE_VERTICAL_DEPTH | Total vertical depth (ft) to bottom of wellbore (TVD) |
| MEASURED_DEPTH | Total measured length (ft) of borehole (TMD) |
| KICKOFF | Depth (ft) of kickoff point |
| DRILLED_DEPTH | Length (ft) of borehole drilled past Kick Off Point (KOP) |
| ELEVATION | Elevation (ft) above sea level at the wellhead |
| ORIGINAL_WELL_TYPE | Well type specified on permit application |
| PERMIT_FEE | Amount paid for fee |
| OBJECTIVE_FORMATION | Formation targeted for production |
| DEPTH_FEE | Fee for drilling wellbore based on final depth of hole |
| SPACING | Spacing required or exempt |
| SPACING_ACRES | Acres specified in the spacing order |
| INTEGRATION | Integration codes Integration_Codes |
| DT_HEARING | Date of integration hearing |
| DT_MOD | Date record last updated |
| LINK | Link to DEC searchable online database record for individual well |
| COUNTY CODE | COUNTY NAME | COUNTY CODE | COUNTY NAME |
|---|---|---|---|
| 001 | Albany | 061 | New York |
| 003 | Allegany | 063 | Niagara |
| 005 | Bronx | 065 | Oneida |
| 007 | Broome | 067 | Onondaga |
| 009 | Cattaraugus | 069 | Ontario |
| 011 | Cayuga | 071 | Orange |
| 013 | Chautauqua | 073 | Orleans |
| 015 | Chemung | 075 | Oswego |
| 017 | Chenango | 077 | Otsego |
| 019 | Clinton | 079 | Putnam |
| 021 | Columbia | 081 | Queens |
| 023 | Cortland | 083 | Rensselaer |
| 025 | Delaware | 085 | Richmond |
| 027 | Dutchess | 087 | Rockland |
| 029 | Erie | 089 | St. Lawrence |
| 031 | Essex | 033 | Franklin |
| 093 | Schenectady | 035 | Fulton |
| 095 | Schoharie | 037 | Genesee |
| 097 | Schuyler | 039 | Greene |
| 099 | Seneca | 041 | Hamilton |
| 101 | Steuben | 043 | Herkimer |
| 103 | Suffolk | 045 | Jefferson |
| 105 | Sullivan | 047 | Kings |
| 107 | Tioga | 049 | Lewis |
| 109 | Tompkins | 051 | Livingston |
| 111 | Ulster | 053 | Madison |
| 113 | Warren | 055 | Monroe |
| 115 | Washington | 057 | Montgomery |
| 117 | Wayne | 059 | Nassau |
| 119 | Westchester | 121 | Wyoming |
| 123 | Yates | 091 | Saratoga |
| R | Confidential information has been Released |
| Y | Well information is held confidential for 6 months after spud date |
| E | Confidential status has been extended for an additional 18 months |
| N | Well does not have confidential information |
| AC | Active |
| AR | Application Received to Drill/Plug/Convert |
| CA | Cancelled |
| DC | Drilling Completed |
| DD | Drilled Deeper |
| DG | Drilling in Progress |
| EX | Expired Permit |
| IN | Inactive |
| NR | Not Reported on AWR |
| PA | Plugged and Abandoned |
| PI | Permit Issued |
| PB | Plugged Back |
| PM | Plugged Back Multilateral |
| RE | Refunded Fee |
| RW | Released - Water Well |
| SI | Shut-In |
| TA | Temporarily Abandoned |
| TR | Transferred Permit |
| UN | Unknown |
| UL | Unknown Located |
| UM | Unknown Not Found |
| VP | Voided Permit |
| BR | Brine |
| Confidential | Well Type Is Currently Listed As Confidential |
| DH | Dry Hole |
| DS | Disposal |
| DW | Dry Wildcat |
| GD | Gas Development |
| GE | Gas Extension |
| GW | Gas Wildcat |
| IG | Gas Injection Well |
| IW | Enhanced Oil Recovery - Injection |
| LP | Liquefied Petroleum Gas Storage |
| MB | Monitoring Brine |
| MM | Monitoring Miscellaneous |
| MS | Monitoring Storage |
| NL | Not Listed |
| OB | Observation Well |
| OD | Oil Development |
| OE | Oil Extension |
| OW | Oil Wildcat |
| SG | Stratigraphic |
| ST | Storage |
| TH | Geothermal |
| UN | Unknown |
| CON | Confidential |
| GW | Gas Well |
| GWP | Gas Well Plugged |
| OW | Oil Well |
| OWP | Oil Well Plugged |
| S | Storage Well |
| SP | Storage Well Plugged |
| SM | Solution Brine Well |
| SMP | Solution Brine Well Plugged |
| DH | Dry Hole |
| O | Other Well* |
| OP | Other Well Plugged* |
*Other includes: Injection, Stratigraphic, Geothermal, and Not Listed well
types.
Back to Attribute Tables
| NO | No integration order required |
| OI | Integration order issued |
| OP | Integration order pending |
| RE | Referred to Office of Hearings and Mediation Services |


{% extends 'layout.html' %} {% block pageTitle %} Check it works - NHS.UK prototype kit {% endblock %} {% block beforeContent %} {{ breadcrumb({ items: [ { href: "/docs", text: "Home" } ], href: "/docs/install", text: "Install" }) }} {% endblock %} {% block content %}
In your web browser, visit http://localhost:3000 opens in a new tab
You should see the prototype welcome page.
The kit is now installed. Congratulations!


With a wide array of experience across different professional industries, I turned to software development to satisfy my want to be a life-long learner.
Outside of software I enjoy reading, writing, playing video games, and swimming/running/biking. I like to keep a healthy body and a healthy mind!
This application holds a lot of personal significance as it allowed me to better control, manage, and maintain my blood sugars. I am a type 1 diabetic, and because I was going through the Flatiron Fullstack bootcamp, I did not have the greatest health insurance. This forced me to forgo insulin pump technology, an important factor being firmware preloaded on these devices that allowed for the allotment, conglomeration, and aggregation of different pieces of data that are analyzed to better improve insulin delivery and caloric/carbohydrate intake. The user can store record of blood sugars and analyze them on dynamically mapped graphs.
React and Redux were implemented on the front end of component organization and global state management in one location. State is not necessairly complicated in this applicaton but I wanted to learn a new technology that had practical and wide-spread industry usage so Redux.js was employed. Logic sorts and displays records of blood sugars which are displayed on VivoGraphs, which is a library that sits ontop of D3. Ruby on rails as well as PostgreSQL were employed on the backend to save, edit, update and delete blood sugar records; user authentication enabled through bcrypt.
I have a constant need/urge to satisfy my creative faculties, often occuring daily. Mostly what completes this urge is some form of creative writing and often enough I find myself browsing the subreddit https://www.reddit.com/r/writingprompts in order to find something suitable for getting all of these emotions out of my head. I decided to create an applciation that would populate the page with writing prompts scrapped from the subreddit and allow the user to save, edit, update, and delete responses to writing prompts initiated by the user.
React is employed on the front end and Ruby on Rails with a PostgreSQL database is used on the backend. Initially I was hoping to use a webscraper to get up to date and recent topics from the subreddit mentioned above but reddit blocks several web scraping libraries from accessing their site. Instead I just added .json the end of the subreddit URL and found thread titles to add to the database. Automation of this process incoming.
HabitAtk is a simple todo list application create to help you tackle your daily chorse, habits you want to complete, and todo activities that can be created on the fly. Pure vanilla JavaScript and BootStrap is used on the front end and a Ruby on Rails and Postgresql used on the backend. Graphics were created for tracking the frequency of repeated tasks and backend implementation logic is incoming
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.
Locked Safe
Simple chess game created with React.js. I mostly started this project to better hone and fine tune my algorithm creating and logic skills. It was a very fun project and I plan on creating either a Node.js/Django backend to implement web sockets and make the game two player. Videos to expain and describe logic in detail are also incoming.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.


View Source is a web-based interface that can be used to help work with static analysis tools. At present, we can view source using Dehydra and JSHydra. Paste source code in the textbox below and choose your analysis tool.


Hello-Books
3
Notification 1
4 days ago
Donec id elit non mi porta gravida at eget metus.
Notification 2
5 days ago
Donec id elit non mi porta gravida at eget metus.
Notification 3
6 days ago
Donec id elit non mi porta gravida at eget metus.
×
Dashboard
History
Book category
Books
Stock Manager
Profile
Search
Settings
Logout
© 2017. All rights reserved.
Stock Manager
Manage stock here
-- OR --
Filter by category
Category 1
Category 2
Category 3
Category 4
Category 5
Category 6
-- OR --
Filter by date
Today
7 days ago
2 weeks ago
a month ago
a while ago
Go!
Reset
Showing 8 of 10 results
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
Book title
Author 1
June 1st, 2017
See more
Username
You can search a book by author or category. You can also search for other users, etc


Mountain View motorcyclist, 49, dies after Laupahoehoe crash | Honolulu Star-Advertiser
A 49-year-old, Mountain View motorcycle rider died following a crash into a guard rail Saturday afternoon on Highway 19 in Laupahoehoe, Hawaii island police said Sunday.
Motorcyclist Vincent L. Pereira Jr. died following the crash located .01 mile north of the 26-mile marker, police said.
Following a call at 3:41 p.m., police determined that Pereira was driving a 2000 Harley Davidson motorcycle south on Highway 19 when he crossed over the double solid yellow line and struck a guard rail. Pereira sustained critical injuries from the collision and was taken to the Hilo Medical Center, where he was pronounced dead at 6:47 p.m. Saturday.
An autopsy has been ordered and the Traffic Enforcement Unit has initiated a Coroner’s Inquest investigation.
Witnesses are encouraged to call Officer Jared Cabatu at 961-2339.
The crash was the 20th traffic fatality this year compared to 27 at the same time last year.


Financial Information
Financial data in this report was compiled prior to the completion of the 2012-13 fiscal-year audit of the UC Santa Cruz Foundation. Copies of the Foundation's audited financial statement are available upon request.
Source of Private Funds: 2013
(Total: $28,100,248.72)
- All Alumni $6,965,283
- Parents $869,975.02
- Other Individuals $6,485,697
- Foundations $4,702,592
- Businesses $6,550,354
- Other Organizations $2,526,345
Use of Private Funds: 2013
(Total: $28,100,248.72)
- Faculty Research $10,373,682
- Instruction $1,488,647
- Campus Improvement $5,252,154
- Other Purposes* $7,671,803
- Student Support $2,354,253
- Department Support $662,975
- Unrestricted $296,729
- *Other purposes includes gifts to library operations or endowment, unrestricted campus endowment, and other non-academic units such as the campus art galleries, radio station, Arboretum, and Friends or campus support groups.


Based on Acts 1:11, Pastor Noel S. De Asis aims to equip and encourage the church with many biblical facts about the second coming of the Lord Jesus Christ. This is our blessed hope. This is the anchor that holds us so strong in our faith. This is the promise that brings us hope. Do not miss this series as we learn more of the signs and the purposes of His return.
Based on Acts 1:12-26, Pastor Noel S. De Asis aims to equip and encourage the church with this segment in Acts 1 on the replacement of Judas Iscariot as one of the original twelve apostles. This is a very dramatic yet life-changing series as Jesus prayed hard to choose the twelve and his extended grace to Judas Iscariot. Do not miss this series as we learn more from the story of Judas and how we can apply them to our own journey of faith and relationship with our Savior.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam scelerisque id nunc nec volutpat. Etiam pellentesque tristique arcu, non consequat magna fermentum ac. Cras ut ultricies eros. Maecenas eros justo, ullamcorper a sapien id, viverra ultrices eros. Morbi sem neque, posuere et pretium eget, bibendum sollicitudin lacus. Aliquam eleifend sollicitudin diam, eu mattis nisl maximus sed. Nulla imperdiet semper molestie. Morbi massa odio, condimentum sed ipsum ac, gravida ultrices erat. Nullam eget dignissim mauris, non tristique erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;


Web of things
The missing piece for interoperability
Philipp Blum
What is WoT (Web of Things)?
A set of standards to make interoperability in IoT possible. Like the World Wide Web, but for IoT devices.
Web of Things: Architecture
RIOT OS & Web of Things
It's all about Things Description (TD)
(Pseudocode)
```json
{
"@context": "https://www.w3.org/2019/wot/td/v1",
"id": "urn:dev:ops:32473-WoTLamp-1234",
"title": "MyLampThing",
"securityDefinitions": {
"basic_sc": {"scheme": "basic", "in":"header"}
},
"security": ["basic_sc"],
"properties": {
"status" : {
"type": "string",
"forms": [{"href": "https://mylamp.example.com/status"}]
}
},
"actions": {
"toggle" : {
"forms": [{"href": "https://mylamp.example.com/toggle"}]
}
},
"events":{
"overheating":{
"data": {"type": "string"},
"forms": [{
"href": "https://mylamp.example.com/oh",
"subprotocol": "longpoll"
}]
}
}
}
```
WoT Scripting API
A standard API to interact with Things
(Pseudocode)
```javascript
fetch("https://tds.mythings.org/sensor11")
.then(res => new ConsumedThing(res.json()))
.then(thing => {
thing
.subscribeProperty(
"temperature",
value => { console.log("Temperature changed to: "+ value); }
);
thing
.subscribeEvent(
"ready",
eventData => { console.log("Ready; index: "+ eventData }
);
thing
.invokeAction(
"startMeasurement",
{ units:"Celsius" }
);
console.log("Measurement started.");
});
```
WoT Binding Templates
"Binding Templates enable a Thing Description to be adapted to the
specific protocol or data payload usage across the different standards."
Binding can be defined in the context of a TD
(Pseudocode, invalid)
```json
{
"@context": [
"https://www.w3.org/2019/wot/td/v1",
{
"cov": "http://www.example.org/coap-binding#"
}
],
"id": "urn:dev:ops:32473-WoTLamp-1234",
"title": "MyLampThing"
}
```
And use it in an Interaction Affordance
(Pseudocode, invalid)
```json
{
"actions": {
"toggle": {
"description" : "Turn on or off the lamp",
"forms": [{
"href": "coaps://mylamp.example.com/toggle",
"cov:methodName" : "POST"
}]
}
}
}
```
Integration into RIOT OS
Modules: wot and wot_coap
Module: wot
Structure and API to manipulate it
```c
typedef struct {
json_ld_context_t *context;
wot_td_type_t *type;
wot_td_uri_t *id;
wot_td_multi_lang_t *titles;
wot_td_multi_lang_t *descriptions;
wot_td_version_info_t *version;
wot_td_date_time_t *created;
wot_td_date_time_t *modified;
wot_td_uri_t *support;
wot_td_uri_t *base;
wot_td_prop_affordance_t *properties;
wot_td_action_affordance_t *actions;
wot_td_event_affordance_t *events;
wot_td_link_t *links;
wot_td_form_t *forms;
wot_td_security_t *security;
char *default_language_tag;
} wot_td_thing_t;
int wot_td_thing_context_add(wot_td_thing_t *thing, json_ld_context_t *context);
int wot_td_thing_context_rm(wot_td_thing_t *thing, json_ld_context_t *context);
json_ld_context_t * wot_td_thing_context_find_nth(wot_td_thing_t *thing, uint8_t pos);
json_ld_context_t * wot_td_thing_context_find_key(wot_td_thing_t *thing, char *key);
json_ld_context_t * wot_td_thing_context_find_value(wot_td_thing_t *thing, char *value);
int wot_td_thing_prop_add(wot_td_thing_t *thing, wot_td_prop_affordance_t *property);
int wot_td_thing_prop_rm(wot_td_thing_t *thing, wot_td_prop_affordance_t *property);
wot_td_prop_affordance_t * wot_td_thing_prop_find_nth(wot_td_thing_t *thing, uint8_t pos);
wot_td_prop_affordance_t * wot_td_thing_prop_find_key(wot_td_thing_t *thing, char *key);
```
Module: wot_coap
WoT API on top of nanocoap
```c
typedef struct {
coap_resource_t *coap_resource;
wot_td_prop_affordance_t *affordance;
} wot_td_coap_prop_affordance_t;
typedef struct {
coap_resource_t *coap_resource;
wot_td_action_affordance_t *affordance;
} wot_td_coap_action_affordance_t;
typedef struct {
coap_resource_t *coap_resource;
wot_td_event_affordance_t *affordance;
} wot_td_coap_event_affordance_t;
int wot_td_coap_prop_add(wot_td_thing_t *thing, wot_td_coap_prop_affordance_t *property);
int wot_td_coap_action_add(wot_td_thing_t *thing, wot_td_action_affordance_t *action);
int wot_td_coap_event_add(wot_td_thing_t *thing, wot_td_coap_event_affordance_t *event);
```
Features for the future:
- WoT persistence: Module to cache the TD on a persistent storage.
- WoT SAUL/eSAUL: Module to generate a TD from SAUL/eSAUL


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/decidability.html ---
Are there things that are decidable but not yet proven?
@Mario Carneiro
Not sure I understand the meta level of the question
that means, things that should be decidable, but nobody has proved it in Lean yet
of course
could you list some
that's like asking if there are any not yet proven theorems
well there are only finitely many predicates that have been created in Lean
Hm, none comes to mind... I have a definition that I don't have on mathlib yet that is waiting for a proof of decidability
what is it
namely that level (in)equality in lean is decidable
hmm...
that is, for expressions made up of max
, imax
and variables, you can determine if for all values of the variables in nat
, one is <= the other or not
The proof uses case splitting on any imax
expressions that come up
oh, I should build a decidable version of finsupp
I think Johannes had a proposal for that on here, where you use a fintype
instead of finite
oh wait, I don't work with finite things
lol
@Mario Carneiro no examples from nat
and int
?
i.e. everything about them that should be decidable have been proven to be decidable?
yes, there aren't that many interesting predicate to start with
nice
@Kenny Lau out of curiousity what's up with your commutative algebra pr on mathlib
I just started reworking it a few minutes ago, what a coincidence
Kenny feel free to PR some of the comm alg stuff in stacks project. Did UMP get PR'd? That's a really important tool I see now.
I can't PR anything until mathlib builds
Oh I see.
Why don't you roll back?
I mean, the PR will have a cross
I know it's a bore.
I just never upgrade unless I have no red cross and also a thumbs up here
I think Sebastian is seriously looking at making this kind of thing easier with leanpkg.
I still don't know why the latest build fails
Hi, quick question! What tactic would allow me to show decidable equality of records? I need to show:
⊢ decidable ({o := x_o, m := x_m, τ := x_τ} = {o := y_o, m := y_m, τ := y_τ})
where I know decidable(x_o = y_o)
, ..., decidable(x_τ = y_τ)
.
@[derive decidable_eq]
when you define the structure.
Now, I get an unhelpful error message: failed to find a derive handler for ...
. What does this mean?
It is related to the fact that I have defined an inductive type value
. Is that somehow a protected name?
Is the inductive type value a field to your structure?
What does the ...
say?
Would be easier to say looking at the code and actual error message, but I think ...
is the class you want to derive, e.g., decidable_eq
failed to find a derive handler for 'choice decidable_eq value.decidable_eq'
Here, choice and decidable_eq are built-in, but value.decidable_eq seems to be related to the generated instance for the type value
that I defined earlier.
@[derive decidable_eq] inductive value (β : Type) [objects α β] : type α → Type 1 | object {c : class_name α} (o : β) (H : c = class_of α o) : value (ref c) | null (c : class_name α) : value (ref c) | term {γ : datatype} : γ → value (data α γ)
Now, I change the name value
to valu
. Then the error changes!
Hmmm, never mind. Unable to reproduce that now. It still is: failed to find a derive handler for 'choice decidable_eq valu.decidable_eq'
Is it confused by something you've defined called decidable_eq
? I replicated the error.
namespace foo def decidable_eq : Type := sorry @[derive decidable_eq] structure foo := (bar : ℕ) end foo
maybe a manually-written instance of decidable_eq
got a name like that?
Sure, but I have never defined any decidable_eq myself. The value.decidable_eq
is not defined by me, but derived.
What namespaces do you have open? Maybe the error is something you've imported.
If I remove @[derive decidable_eq]
from the value
definition, the error changes into something more sensible: mk_dec_eq_instance failed, failed to generate instance for
Π (a b : Π (p : param_name m), value β (param_type p)), decidable (a = b)
So it must be caused by the derived instance of value
.
Of course. I'm confused by choice
in the error message. Is this classical.choice
?
@Chris Hughes Indeed, I have opened the namespace value
in which the name decidable_eq
was defined by the derivation.
Maybe choice X.foo Y.foo
is how Lean represents "I haven't figured out whether you're talking about X.foo
or Y.foo
yet"?
I confirm that. You can see that here:
namespace foo def value.decidable_eq : Type := sorry open value @[derive decidable_eq] structure foo := (bar : ℕ) end foo
open
ing previous inductive types when defining new ones is a totally reasonable thing to do, it's annoying that it causes this derive decidable_eq
mechanism to break.
Well, it's a totally reasonable thing to want to do, at any rate.
Seems like value.decidable_eq
should have been protected
, then I guess this wouldn't have happened.
I agree; if you add protected
in the foo snippet above, the derive mechanism works as expected.
I'm surprised the lack of protected
doesn't break other things though. Seems like having open an inductive/structure type with derived decidable_eq
would be pretty common. Maybe Lean is able to resolve the ambiguity in most other situations
yes, choice
is how lean represents an overloaded name in pexprs
what better way to represent an overloaded name than by an overloaded name
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


[gecode-users] std::set to Gecode::IntVar conversion
Grégoire Dooms
dooms at info.ucl.ac.be
Thu May 11 09:20:12 CEST 2006
Martin Mann wrote:
> Moin Christian,
>
> mhh.. ok I ll have a look if I can write a worthy conversion! ;)
> Will have to have a deeper look into IntVar implementations..
>
You can find two in the contribs/graph/view/iter.icc
They are called StlToGecodeRangeIterator and StlToGecodeValIterator
See example below.
> Are there any predefined initialisation possibilities in addition to the
> "min-max" range init?
>
> Meanwhile, I am looking for set operations for IntSet variables like
> union
> or intersection.
> I am used to them by Mozart or Ilog. Are they available in Gecode?
>
They are available through iterator operations: union intersection,
difference (see example below)
Best,
--
Grégoire Dooms
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpgraph-set.cc
Type: text/x-c++src
Size: 952 bytes
Desc: not available
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20060511/e940a917/attachment.cc>
More information about the gecode-users
mailing list


Support Your Favorite Creator Or Platform
- These types of products include merchandise made from or geared towards streaming platforms, such as YouTube and Twitch, or if specific creators put out merchandise for their audience.
- Products in this category include, but are not limited to, platform clothing and merchandise, such as from YouTube and Twitch, clothing and merchandise put out from specific content creators and streamers, specialty streaming clothing and merchandise.
Shop Merchandise Products


char *getlogin(void);
int getlogin_r(char *buf, size_t bufsize);
#include <stdio.h>
char *cuserid(char *string);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
getlogin_r():
_REENTRANT || _POSIX_C_SOURCE >= 199506L
cuserid():
_XOPEN_SOURCE
getlogin_r() returns this same username in the array buf of size bufsize.
cuserid() returns a pointer to a string containing a username associated with the effective user ID of the process. If string is not a null pointer, it should be an array that can hold at least L_cuserid characters; the string is returned in this array. Otherwise, a pointer to a string in a static area is returned. This string is statically allocated and might be overwritten on subsequent calls to this function or to getlogin().
The macro L_cuserid is an integer constant that indicates how long an array you might need to store a username. L_cuserid is declared in <stdio.h>.
These functions let your program identify positively the user who is running (cuserid()) or the user who logged in this session (getlogin()). (These can differ when set-user-ID programs are involved.)
For most purposes, it is more useful to use the environment variable LOGNAME to find out who the user is. This is more flexible precisely because the user can set LOGNAME arbitrarily.
Linux/glibc also has
The getlogin_r() function is thread-safe.
The cuserid() function is thread-safe with exceptions. It is not thread-safe if called with a NULL parameter.
System V has a cuserid() function which uses the real user ID rather than the effective user ID. The cuserid() function was included in the 1988 version of POSIX, but removed from the 1990 version. It was present in SUSv2, but removed in POSIX.1-2001.
OpenBSD has getlogin() and setlogin(), and a username associated with a session, even if it has no controlling terminal.
Note that glibc does not follow the POSIX specification and uses stdin instead of /dev/tty. A bug. (Other recent systems, like SunOS 5.8 and HP-UX 11.11 and FreeBSD 4.8 all return the login name also when stdin is redirected.)
Nobody knows precisely what cuserid() does; avoid it in portable programs. Or avoid it altogether: use getpwuid(geteuid()) instead, if that is what you meant. Do not use cuserid().


{% extends "wrapper.html" %} {% block main %}
Name
City
To go to an event, I would -- choose -- {% for choice in distance_choices %} {{choice[0]|escape}} {% endfor %}
URL
Private


Thanks for installing PhoneGap!
Upgraders
- Add the existing framework "CoreMedia" to your project
- Set it to weak/optional in your Target
- Copy the new phonegap.*.js files in manually to your "www" folder (COPY from /Users/Shared/PhoneGap/Frameworks/PhoneGap.framework/www)
- Update your script references in your HTML files to point to the .js files in (3).
- Copy "Capture.bundle" from /Users/Shared/PhoneGap/Frameworks/PhoneGap.framework and add it to your project as well (or copy from a new project)
- Set the existing framework "UIKit" to "Weak/Optional" in your project
- Set the existing framework "AVFoundation" to "Weak/Optional" in your project
- You can remove "CoreTelephony.framework" if it exists (and none of your plugins use it), it is not used by PhoneGap anymore
Xcode 4
- Launch Xcode 4
- Select "New Project..." then under the File menu
- Select "Application", under the "iOS" section
- Select "PhoneGap-based Application" then in the right pane
- Select the "Next" button
- Name your project and bundle identifier
- Select the "Next" button
- Choose the location where you want the new project to be
*IMPORTANT*: On first run, it will create a sample "www" folder for you inside your project. After that, you MUST drag and drop the "www" folder into your project in Xcode, to create a folder reference for it.
*IMPORTANT*: For the "CoreMedia" framework, you MUST set the linkage as "Optional", if not iOS 3.x devices will crash. The linkage type could not be set in the template itself (undocumented).
*IMPORTANT*: For the "UIKit" framework, you MUST set the linkage as "Optional", if not iOS 3.x devices will crash. The linkage type could not be set in the template itself (undocumented).
*IMPORTANT*: For the "AVFoundation" framework, you MUST set the linkage as "Optional", if not iOS 3.x devices will crash. The linkage type could not be set in the template itself (undocumented).
That's it! Modify the contents of the "www" directory to add your HTML, CSS and Javascript.
Xcode 3
- Launch Xcode 3
- Select "New Project..." then under the File menu
- Select PhoneGap, under the "User Templates" section
- Select "PhoneGap-based Application" then in the right pane
- Select the "Choose..." button
- Name your project
- Choose the location where you want the new project to be.
That's it! Modify the contents of the "www" directory to add your HTML, CSS and Javascript.
Links


"STOICS "a sect of Greek philosophers at Athens, so called from the Greek word stoa i.e., a “porch” or “portico,” where they have been called“the Pharisees of Greek paganism.” The founder of the Stoics was Zeno, who flourished about B.C. 300. He taught his disciples that a man’s happiness consisted in bringing himself into harmony with the course of the universe. They were trained to bear evils with indifference, and so to be independent of externals. Materialism, pantheism, fatalism, and pride were the leading features of this philosophy.
"STOICS "a sect of Greek philosophers at Athens, so called from the Greek word stoa i.e., a “porch” or “portico,” where they have been called“the Pharisees of Greek paganism.” The founder of the Stoics was Zeno, who flourished about B.C. 300. He taught his disciples that a man’s happiness consisted in bringing himself into harmony with the course of the universe. They were trained to bear evils with indifference, and so to be independent of externals. Materialism, pantheism, fatalism, and pride were the leading features of this philosophy.


Hi all
I'm hoping someone can lend me a hand or point me in the right direction for the following issue.
I bought one of the preloaded SD cards on a new Pi B+ with the emonTX v3 all setup for 433Hz. Managed to get it all up and running on the preloaded builds, and sending data to emoncms. I haven't tried downloading latest SD card or emonTx images.
Problem now is that the feeds are only irregularly receiving data.
Below is an extract of the /var/log/emonhub/emonhub.log file after setting the config file to debug
2014-10-26 12:51:44,972 DEBUG SIGINT received.
2014-10-26 12:51:44,975 DEBUG Closing serial port
2014-10-26 12:51:44,978 INFO Exiting hub...
2014-10-26 12:51:46,653 INFO EmonHub Pre-Release Development Version (rc1.0)
2014-10-26 12:51:46,656 INFO Opening hub...
2014-10-26 12:51:46,658 INFO Logging level set to DEBUG
2014-10-26 12:51:46,661 INFO Creating EmonHubEmoncmsReporter 'emonCMS'
2014-10-26 12:51:46,666 INFO Set up reporter 'emonCMS' (buffer: memory | size: 1000)
2014-10-26 12:51:46,671 INFO Creating EmonHubJeeInterfacer 'RFM2Pi'
2014-10-26 12:51:46,675 DEBUG Opening serial port: /dev/ttyAMA0
2014-10-26 12:51:46,678 INFO Opened serial port: /dev/ttyAMA0 9600 bits/s
2014-10-26 12:51:46,681 DEBUG Setting RFM2Pi frequency: 433 (4b)
2014-10-26 12:51:47,684 DEBUG Setting RFM2Pi group: 210 (210g)
2014-10-26 12:51:48,688 DEBUG Setting RFM2Pi baseid: 15 (15i)
2014-10-26 12:51:49,708 DEBUG 1 NEW FRAME :<PHONE_NUMBER>.71 > 4b
2014-10-26 12:51:49,711 WARNING 1 Discard RX frame 'information' : ['>', '4b']
2014-10-26 12:51:49,914 DEBUG 2 NEW FRAME :<PHONE_NUMBER>.91 ^A
2014-10-26 12:51:49,917 INFO 2 Ignoring frame consisting of SOH character
2014-10-26 12:51:50,121 DEBUG 3 NEW FRAME :<PHONE_NUMBER>.12 > 210g
2014-10-26 12:51:50,124 WARNING 3 Discard RX frame 'information' : ['>', '210g']
2014-10-26 12:51:50,327 DEBUG 4 NEW FRAME :<PHONE_NUMBER>.33 ^A
2014-10-26 12:51:50,329 INFO 4 Ignoring frame consisting of SOH character
2014-10-26 12:51:50,534 DEBUG 5 NEW FRAME :<PHONE_NUMBER>.53 > 15i
2014-10-26 12:51:50,536 WARNING 5 Discard RX frame 'information' : ['>', '15i']
2014-10-26 12:51:50,753 DEBUG 6 NEW FRAME :<PHONE_NUMBER>.75 ^A
2014-10-26 12:51:50,755 INFO 6 Ignoring frame consisting of SOH character
2014-10-26 16:09:32,895 DEBUG 7 NEW FRAME :<PHONE_NUMBER>.89 10 166 255 18 2 0 0 0 0 186 102 0 0
2014-10-26 16:09:32,900 DEBUG 7 Timestamp :<PHONE_NUMBER>.89
2014-10-26 16:09:32,902 DEBUG 7 Node : 10
2014-10-26 16:09:32,904 DEBUG 7 Values : [-90, 530, 0, 0, 26298, 0]
2014-10-26 16:09:32,940 DEBUG 7 Append to 'emonCMS' buffer => time:<PHONE_NUMBER>.89, data: [10, -90, 530, 0, 0, 26298, 0], ref: 7
2014-10-26 16:09:33,044 INFO Sending: http://emoncms.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1414300172.89,10,-90,530,0,0,26298,0]]&sentat=14143001$
2014-10-26 16:09:34,176 DEBUG Receipt acknowledged with 'ok' from http://emoncms.org
This datasend then gets repeated at irregular intervals, ranging from ~5min out to 12 hours. Possible to see above that there was a major delay from 12:51 down to 16:09.
Any ideas or suggestions on how to diagnose ? Radio interference? I did initially have the Pi on WiFi, but is currently hard wired back to the router.
Thanks heaps in advance
Leigh
Re: Irregular updating of emonhub
Hi Leigh
The log suggests rfm2pi isn't receiving usable packets as in debug mode emonhub will log every valid packet.
Can you confirm the frequency that the led on the rfm2pi flashes? if that led is only flashing sporadically it's not receiving packets and you should check the emonTx v3's range by seeing if moving them closer together improves things.
Paul
Re: Irregular updating of emonhub
Thanks for the reply Paul.
LED on the rfm2pi is irregular to non existent. I didn't realise that this is supposed this was supposed to flash each time. Current range is ~10-15m with a single brick and a few cavity walls in between, but I'll have a go at moving it closer.
I've since found a couple of posts by you and others about also using the serial connection into the emonTx. I assume that this would be the next step?
cheers
leigh
Re: Irregular updating of emonhub
You should only need to resort to a direct serial connection if the range/signal is being reduced by RF interference. if its just a range issue maybe using wifi so the Pi can move alittle closer is easier.
PAul
Re: Irregular updating of emonhub
I've moved the Pi closer & is now all good.
Thanks heaps for sorting out such a rookie error!
Leigh


Welcome to CommandLine
- Copyright © 2005 Jim Freeze
- Author: Jim Freeze
- License
CommandLine is a library that greatly simplifies the repetitive
process of building a command line user interface for your applications.
It's 'ruby-like' usage style streamlines application development so that
even applications with numerous configuration options can be quickly put
together. CommandLine automatically builds friendly usage and help
screens that are nicely formatted for the user. No longer is starting
an application a pain where you have to copy boiler plate code (or a
previous application) and retype repetitive code to get an application started.
CommandLine smartly handles the arguments passed on the commandline.
For example, if your application accepts arguments, and none are given, it prints a usage
statement. If your application accepts no arguments, CommandLine will happily
run your application. CommandLine also handles a complex set of
options through the OptionParser library, which is described below.
In addition to these features, CommandLine also ships with the
ability to run system tests on your applications.
OptionParser is
designed to be a flexible command line parser with a Ruby look and feel to
it. OptionParser got
its birth from the need for a parser that is standards compliant, yet
flexible. OptionParser
supports the standard command line styles of Unix, Gnu
and X Toolkit, but also lets you break those rules.
OptionParser is
not a port of a traditional command line parser, but it is written to meet
the feature requirements of traditional command line parsers. When using it
as a library, you should notice that it is expressive, supports
Ruby’s blocks and lambda’s, and is sprinkled with a little bit
of magic.
While the library can be used by itself, it is also designed to work with
the CommandLine::Application class. These tools work together to
facilitate the generation of a sophisticated (batch oriented) application
user interface in a matter of minutes.
If you need a refresher on the traditional option parsing schemes, see
"Traditional Option Parsing Schemes" below.
CommandLine Usage
Getting Started
Installing
CommandLine is a gem and can be installed using the gem install command:
gem install -r CommandLine
Loading the library
When using the library, it is loaded as usual with:
require 'rubygems'
require 'commandline'
Example 1: A very simple application
When you want to test a new library, you usually aren't interested
in handling a vast array of options. You usually want just enough
of a user interface to make some specific calls into your library
too see how it responds. So, the simplist application is one that does
not go out of its way to identify itself and does not take any command
line arguments.
#!/usr/bin/env ruby
require 'rubygems'
require 'commandline'
class App < CommandLine::Application
def main
puts "call your library here"
end
end#class App
To run this app, we just change the mode and launch it:
% chmod 755 myapp
% ./myapp
"call your library here"
Notice that CommandLine does not complain about missing arguments.
It assumes that the number of expected arguments is zero, unless told otherwise.
Let's tell our application that it needs to accept a filename as an argument.
#!/usr/bin/env ruby
require 'rubygems'
require 'commandline'
class App < CommandLine::Application
def initialize
expected_args :file # will set instance variable @file to command line argument.
end
def main
puts "#{name} called with<EMAIL_ADDRESS>arguments<EMAIL_ADDRESS>puts "@file = #{@file}"
end
end#class App
You may notice that this application has a new method -- :initialize.
In this method, Since we've added some setup code to our application object, we created an
initialize (BTW, don't mispell initialize. It can cause real confusion.)
method and put our code inside it. This is where all the
setup takes place for and application. Of course you are free to add other
methods to delegate complex tasks, but it is best if those methods
begin with an underscore '_', as we will see later.
Replay
#!/usr/bin/env ruby
require 'rubygems'
require 'commandline'
class App < CommandLine::Application
use_replay
# If use_replay is given, and no arguments are supplied,
# then, instead of printing usage when no arguments are found,
# it checks for the existance of a .replay file. If such a file
# exists, the app will use those arguments when run.
# Also, every time the app is run with arguments, the replay file
# is updated.
def intialize
expected_args :file, :fred
end
def main
p "#{name} called with<EMAIL_ADDRESS>arguments<EMAIL_ADDRESS>end
end#class App
OptionParser Usage
The OptionParser
library consists of three classes, Option, OptionParser and
OptionData. For each option an Option object is created.
When you are ready to prepare for command line parsing, these options are
collected into an array and fed to OptionParser.
This OptionParser
object controls the type of option scheme that is implemented. When it
comes time to parse a command line, call the method Option#parse.
This will parse any array, but parses ARGV by default. The result is an
OptionData object. This object can be used from which to extract
values or it can be passed to another class as a fully encapsulated data
object.
Using Option Parser
An option is created with the following syntax:
opt = Option.new([options], <properties>)
The options can be :flag or :posix. :flag means
that the option is a mode flag and does not take any arguments.
:posix means that Option will validate the properties to
ensure they are posix compliant.
An option object has six properties. Four of these properties define
attributes of the object. The last two define actions that are
taken when a command line is parsed.
- :names
- :arity
- :opt_description
- :arg_description
- :opt_found
- :opt_not_found
It is not necessary to set values for all of these properties. Some are set
automatically, as we’ll see below.
Posix
The default Option object is non-posix.
op1 = OptionParser.new(:posix, opts)
op2 = OptionParser.new(opts)
op1.posix #=> true
op2.posix #=> false
Mode-Flag
To create a mode flag, that is, an option that is either true or false
depending if it is seen on the command line or not, we could write:
opt_debug = Option.new(
:names => %w(--debug -d), # the flag has two names
:arity => [0,0], # this says take no arugments
:opt_description => "Sets debug to true",
:arg_description => "",
:opt_found => true, # true if seen on command line
:opt_not_found => false # false if not seen on command line
)
Now, this is a lot of work just for a common mode-flag. However, there is a
shorter way:
opt = Option.new(:flag, :names => %w(--debug -d))
When Option sees the :flag option, it makes some assignments
behind the scenes and what you are left with is:
:names => ["--debug", "-d"]
:arity => [0, 0]
:opt_description => "Sets debug to true." # debug is taken from the first name
:arg_description => ""
:opt_found => true
:opt_not_found => false
For a common option like a mode-flag, Option will use the first
option ‘word’ it finds in the :names list and use that in the
automatic option text. Of course, if you don’t want any text, just
set the option description to an empty string:
:opt_description => "".
Option Arguments
If an option is not a mode flag, then it takes arguments. Most option
parsers only permit a single argument per option flag. If your application
needs multiple arguments, the standard method is just to repeat the option
multiple times, once for each required argument. For example, if I need to
pass two files to an application I would need something like:
myapp -f file1 -f file2
But, it would be cleaner if the command line could be expressed as:
myapp -f file1 file2
Well, no longer do you have to suffer with thirty-year old option parser
technology. OptionParser
permits multiple arguments per option flag and the number of arguments can
be defined to be variable.
To define an option that takes 1 or more arguments, the following can be
done:
opt = Option.new(:names => "--file", :arity => [1,-1])
Let’s say the option required at least two arguments, but not more
than five. This is defined with:
opt = Option.new(:names => "--file", :arity => [2,5])
OptionParser.new(opt).parse
% myapp --file file1 # exception raised
% myapp --file file1 file2 # ok
% myapp --file file1 file2 file3 # ok
% myapp --file f1 f2 f3 f4 f5 f6 # f6 remains on the command line
This ability is handy on occassions where an option argument is
‘optional’.
myapp --custom # no args, uses $HOME/.myapprc
myapp --custom my_custom_file # uses my_custom_file
This type of option is defined by:
opt = Option.new(:names => "--custom", :arity => [0,1])
If the :arity is not satisfied, an exception is raised.
Actions
The option properties :opt_found and :opt_not_found are
the source of the value returned for an option when it is parsed. These
properties can be either an object or a proc/lambda. If they are an object,
then the stored object is simply returned. If they are lambdas, then the
stored value is the return value of the proc/lambda. So, the following will
have the same result:
opt_debug = Option.new(:flag
:names => %w(--debug -d),
:opt_found => true,
:opt_not_found => false
)
opt_debug = Option.new(:flag
:names => %w(--debug -d),
:opt_found => lambda { true },
:opt_not_found => lambda { false }
)
Notice that there is no need to set an instance variable to a default
value. Normally one does:
@debug = false
# option setup
... parse the commandline
@debug = true if parse_results["--debug"]
But with OptionParser, one
has the capability of doing the following:
opt_debug = Option.new(:flag, :names => %w(--debug -d))
... parse the commandline
@debug = option_data[:debug] # value is set without need for default
# or
opt_debug = Option.new(:flag
:names => %w(--debug -d),
:opt_found => lambda { @debug = true },
:opt_not_found => lambda { @debug = false }
)
# do nothing, variable already set.
I find this much easier to manage than having to worry about setting
default behaviour. Now that we know how to create options, let’s move
on to the commandline parser.
OptionParser
Once the options are defined, we load them into an OptionParser and
parse the command line. The syntax for creating an OptionParser
object is:
OptionParser.new(prop_flags, option)
OptionParser.new(prop_flags, [options])
OptionParser.new(option)
OptionParser.new([options])
where the possible property flags are:
:posix
:unknown_options_action => :collect | :ignore | :raise
If you want to parse posix, you must specify so. OptionParser will
not assume posix mode just because all of the options are posix options.
This allows you to use posix only options but not require the strict
parsing rules.
Below are a few examples of creating an OptionParser
object:
opt = Option.new(:flag, :names => %w(-h))
op1 = OptionParser.new(:posix, opt)
op2 = OptionParser.new(opt)
or
opts = []
opts << Option.new(:flag, :names => %w(--help h))
opts << Option.new(:flag, :names => %w(--debug d))
Options may be added to an OptionParser by
three different methods:
# Options added as arguments during OptionParser construction
op = OptionParser.new(opt1, opt2)
op = OptionParser.new([opt1, opt2])
or
# Options added in a block constructor
op = OptionParser.new { |o| o << opts }
or
# Options added to an existing OptionParser object
op = OptionParser.new
op << opts
Parsing the Command Line
Parsing the command line is as simple as calling #parse:
option_data = op.parse
Printing an Option Summary
A OptionParser with
a complete set of options added to it defines the human interface that your
application presents to a user. Therefore, the parser should be able to
provide a nicely formatted summary for the user.
An example is shown below with its corresponding output:
require 'rubygems'
require 'commandline/optionparser'
include CommandLine
puts OptionParser.new { |o|
o << Option.new(:flag, :names => %w[--debug -d])
o << Option.new(:flag, :names => %w[--help -h],
:opt_description => "Prints this page.")
o << Option.new(:names => %w[--ouput -o],
:opt_description => "Defines the output file.",
:arg_description => "output_file")
o << Option.new(:names => %w[--a-long-opt --with-many-names -a -A],
:arity => [2,-1],
:opt_description => "Your really long description here.",
:arg_description => "file1 file2 [file3 ...]")
}.to_s
Generates the output:
OPTIONS
--debug,-d
Sets debug to true.
--help,-h
Prints this page.
--ouput,-o output_file
Defines the output file.
--a-long-opt,--with-many-names,-a,-A file1 file2 [file3 ...]
Your really long description here.
Option Data
The OptionData is the return value of OptionParser#parse.
The parsing results for each option are accessed with the bracket notation
#[].
opt = Option.new(:posix,
:names => %w(-r),
:opt_found => OptionParser::GET_ARGS)
od = OptionParser.new(:posix, opt).parse(["-rubygems"])
od["-r"] #=> "ubygems"
od = OptionParser.new(:posix, opt).parse(["-r", "ubygems"])
od["-r"] #=> "ubygems"
OptionData behaves similar to a hash object in that the parsed
option data is accessed with #[] where the key is the first item in the
:names array of each option. An option cannot access its parsed values
using just any of its names.
od = OptionParser.new { |o|
o << Option.new(:flag, :names => %w(--valid --notvalid))
o << Option.new(:flag, :names => %w(--first --second))
}.parse(%w(--notvalid --second))
od["--valid"] #=> true
od["--first"] #=> true
od["--notvalid"] #=> CommandLine::OptionData::UnknownOptionError
od["--second"] #=> CommandLine::OptionData::UnknownOptionError
Built-in Data Handlers
OptionParser has
built-in data handlers for handling common scenarios. These lambdas can
save a lot of typing.
GET_ARG_ARRAY
This is useful for options that take a variable number of arguments. It
returns all the arguments in an array.
# GET_ARG_ARRAY returns all arguments in an array, even if no
# arguments are present. This is not to be confused with the option
# occuring multiple times on the command line.
opt = Option.new(:names => %w(--file),
:argument_arity => [0,-1],
:opt_found => OptionParser::GET_ARG_ARRAY)
#:opt_found => :collect) # would this be better?
od = OptionParser.new(opt).parse(%w(--file))
od["--file"] #=> []
od = OptionParser.new(opt).parse(%w(--file=file))
od["--file"] #=> ["file"]
od = OptionParser.new(opt).parse(%w(--file=file1 --file file2))
od["--file"] #=> ["file2"]
od = OptionParser.new(opt).parse(%w(--file=file1 file2))
od["--file"] #=> ["file1", "file2"]
od = OptionParser.new(opt).parse(%w(--file file1 file2))
od["--file"] #=> ["file1", "file2"]
GET_ARGS
This is a ‘smart’ option getter. If no arguments are found, it
returns true. If a single argument is found, it returns that argument. If
more than one argument is found, it returns an array of those arguments.
opt = Option.new(:names => %w(--file),
:argument_arity => [0,-1],
:opt_found => OptionParser::GET_ARGS)
#:opt_found => :smart_collect) # would this be better?
od = OptionParser.new(opt).parse(%w(--file))
od["--file"] #=> true
od = OptionParser.new(opt).parse(%w(--file=file))
od["--file"] #=> "file"
od = OptionParser.new(opt).parse(%w(--file=file1 --file file2))
od["--file"] #=> "file2"
od = OptionParser.new(opt).parse(%w(--file=file1 file2))
od["--file"] #=> ["file1", "file2"]
od = OptionParser.new(opt).parse(%w(--file file1 file2))
od["--file"] #=> ["file1", "file2"]
And, for those oxymoronic non-optional options:
opt = Option.new(:names => %w(--not-really-an-option),
:opt_not_found => OptionParser::OPT_NOT_FOUND_BUT_REQUIRED
)
OptionParser.new(opt).parse([]) #=> OptionParser::MissingRequiredOptionError
OptionData
We have just shown that after parsing a command line, the result of each
option is found from OptionData. The values that remain on the command line
are assigned to args. Other attributes of OptionData are:
od.argv # the original command line
od.unknown_options # If OptionParser was told to :collect unknown options
od.args # arguments not claimed by any option
od.not_parsed # arguments following a '--' on the command line
od.cmd # not yet implemented - but a cvs like command
Traditional Option Parsing Schemes
This section is a brief overview of traditional command line parsing.
Command line options traditionally occur in three flavors:
- Unix (or POSIX.2)
- Gnu
- X Toolkit
Below is a summary of these schemes. (Note: I did not invent these
traditional parsing conventions. Most of the information contained below
was pulled from internet resources and I have quoted these resources where
possible.)
Unix Style (POSIX)
The Unix style command line options are a single character preceded by a
single dash (hyphen character). In general, lowercase options are preferred
with their uppercase counterparts being the special case variant.
Mode Flag
If an option does not take an argument, then it is a mode-flag.
Optional Separation Between the Option Flag and Its Argument
If the option takes an argument, the argument follows it with optional
white space separating the two. For example, the following forms are both
valid:
sort -k 5
sort -k5
Grouping
A mode-flag can be grouped together with other mode-flags behind a single
dash. For example:
tar -c -v -f
is equivalent to:
tar -cvf
If grouping is done, the last option in a group can be an option that takes
an argument. For example
sort -r -n -k 5
can be written as
sort -rnk 5
but not
sort -rkn 5
because the ‘5’ argument belongs to the ‘k’ option
flag.
Option Parsing Termination
It is convention that a double hyphen is a signal to stop option
interpretation and to read the remaining statements on the command line
literally. So, a command such as:
app -- -x -y -z
will not ‘see’ the three mode-flags. Instead, they will be
treated as arguments to the application:
#args = ["-x", "-y", "-z"]
POSIX Summary
- An option is a hyphen followed by a single alphanumeric character.
- An option may require an argument which must follow the option with an
optional space in between.
-r ubygems
-rubygems
-r=ubygems # not ok. '=' is Gnu style
- Options that do not require arguments can be grouped after a hyphen.
- Options can appear in any order.
- Options can appear multiple times.
- Options precede other nonoption arguments. TODO: Test for this
- The — argument terminates options.
- The - option is used to represent the standard input stream.
References
www.mkssoftware.com/docs/man1/getopts.1.asp
Gnu Style
The Gnu style command line options provide support for option words (or
keywords), yet still maintain compatibility with the Unix style options.
The options in this style are sometimes referred to as
long_options and the Unix style options as short_options.
The compatibility is maintained by preceding the long_options with
two dashes. The option word must be two or more characters.
Separation Between the Option Flag and Its Argument
Gnu style options cannot be grouped. For options that have an argument, the
argument follows the option with either whitespace or an ’=’.
For example, the following are equivalent:
app --with-optimizer yes
app --with-optimizer=yes
Option Parsing Termination
Similar to the Unix style double-hyphen ’- -’, the
Gnu style has a triple-hyphen ’- - -’ to signal that
option parsing be halted and to treat the remaining text as arguments (that
is, read literally from the command line)
app --- -x -y -z
args = ["-x", "-y", "-z"]
Mixing Gnu and Unix Styles
The Gnu and the Unix option types can be mixed on the
same commandline. The following are equivalent:
app -a -b --with-c
app -ab --with-c
app -ba --with-c
app --with-c -ab
X Toolkit Style
The X Toolkit style uses the single hyphen followed by a keyword option.
This style is not compatible with the Unix or the Gnu
option types. In most situations this is OK since these options will be
filtered from the command line before passing them to an application.
’-’ and STDIN
It is convention that a bare hypen indicates to read from stdin.
The OptionParser Style
The CommandLine::OptionParser does not
care what style you use. It is designed for maximum flexiblity so it may be
used within any organiziation to meet their standards.
Multiple Option Names
OptionParser does
not place restrictions on the number of options. The only restriction is
that an option name begin with a hyphen ’-’. A definitely
conjured example of this freedom is:
:names => %w(
--file --File --f --F -file -File -f -F
)
Prefix Matching
Although not encouraged, some prefer the ability to truncate option words
to their first unique match. For example, an application that support this
style and accepts the following two option words:
["--foos", "--fbars"]
will accept any of the following as valid options
app --fo
app --foo
app --foos
for the "—foos" option flag since it can be determined that
"—fo" will only match "—foos" and not
"—fbars".
Repeated Arguments
A common question is how an option parser should respond when an option is
specified on the command line multiple times. This is true for mode flags,
but especially true for options that require an argument, For example, what
should happen when the following is given:
app -f file1 -f file2
Should the parser flag this as an error or should it accept both arguments.
OptionParser gives
you the choice of whether it raises an exception when an option is seen
more than once, or it just passes the data onto the user.
How the data is handled is up to the user, but it typically boils down to
either Append, Replace or Raise. This is described in more detail in the
usage section.
CVS Mode
CVS is a common application with a unique command line structure. The cvs
application commandline can be given options, but requires a command. This
command can also be given options. This means that there are two sets of
options, one set for the cvs application and one set for the cvs-command.
Some example formats are:
cvs [cvs-options]
cvs [cvs-options] command [command-options-and-arguments]
cvs -r update
cvs -r update .
cvs edit -p file
To handle this, the first unclaimed argument is treated as a command and
the options and option-arguments that follow belong to that command. More
on how this is handled in the usage section.
Option Grouping
A conflict can occur where a grouping of single letter Unix options has the
value as a word option preceded by a single dash. For this reason, it is
customary to use the double-dash notation for word options. Unless
double-dashes are enforced for word options, OptionParser will
check for possible name conflicts and raise an exception if it finds one.
|


Paola in South Africa: an unreal experience
July 13 2017
My first time in Africa
So here I am, for the first time in my life I am visiting Africa. On June 27th the plane landed in Cape Town, and as I step in this new, unknown country I feel a sense of thrill in me! After such a long trip I am not only ready to explore the city and its surroundings areas, but I am also super excited to kick off with my new learning experience in Data Science and coding.
My first impressions
I will not lie, my first impressions on Cape Town has been of a socially complex city. As I drive to my accommodation I see from far some townships, while I approach the richer areas. This is certainly something I will never forget. Everyone seems to be extremely friendly here, from my colleagues at iXperience to the locals.
First few shots of the city


7.2 Interface for Sets
void set_init(Set *set, int (*match)(const void *key1, const void *key2),
void (*destroy)(void *data));
Return Value
None.
Description
Initializes the set specified by
set. This operation must be called for a set
before the set can be used with any other operation. The
match argument is a function used by various
set operations to determine if two members match. It should
return 1 if key1 is equal to
key2, and otherwise. The
destroy argument provides a way to free
dynamically allocated data when set_destroy is called. For example,
if the set contains data dynamically allocated using malloc, destroy
should be set to free to free
the data as the set is destroyed. For structured data
containing several dynamically allocated members,
destroy should be set to a user-defined
function that calls free for
each dynamically allocated member as well as for the structure
itself. For a set containing data that should not be freed,
destroy should be set to NULL.
Complexity
O (1)
void set_destroy(Set *set);
Return Value
None.
Description
Destroys the set specified by
set. No other operations are permitted after
calling set_destroy unless
set_init is called again. The
set_destroy operation removes
all members from a set and calls the function passed as
destroy to set_init once for each member as it
is removed, provided destroy was not set to
NULL.
Complexity
O (n), where n is the number of members in the
set.
int set_insert(Set *set, const void *data);
Return Value
0if inserting the member is successful, 1 if
the member is already in the set, or -1 otherwise.
Description
Inserts a member into the set specified by
set. The new member contains a pointer to
data, so the memory referenced by
data should remain valid as long as the member
remains in the set. It is the responsibility of the caller to
manage the storage associated with data.
Complexity
O (n), where n is the number of members in the
set.
int set_remove(Set *set, void **data);
Return Value
0if removing the member is successful, or -1
otherwise.
Description
Removes the member matching
data from the set specified by
set. Upon return, data points
to the data stored in the member that was removed. It is the
responsibility of the caller to manage the storage associated
with the data.
Complexity
O (n), where n is the number of members in the
set.
int set_union(Set *setu, const Set *set1, const Set *set2);
Return Value
0if computing the union is successful, or -1
otherwise.
Description
Builds a set that is the union of
set1 and set2. Upon return,
setu contains the union. Because
setu points to data in set1
and set2, the data in set1 and
set2 must remain valid until
setu is destroyed with set_destroy.
Complexity
O (mn), where m and n are the number of members in
set1 and set2,
respectively.
int set_intersection(Set *seti, const Set *set1, const Set *set2);
Return Value
0if computing the intersection is successful,
or -1 otherwise.
Description
Builds a set that is the intersection of
set1 and set2. Upon return,
seti contains the intersection. Because
seti points to data in set1,
the data in set1 must remain valid until
seti is destroyed with set_destroy.
Complexity
O (mn), where m and n are the number of members in
set1 and set2,
respectively.
int set_difference(Set *setd, const Set *set1, const Set *set2);
Return Value
0if computing the difference is successful,
or -1 otherwise.
Description
Builds a set that is the difference of
set1 and set2. Upon return,
setd contains the difference. Because
setd points to data in set1,
the data in set1 must remain valid until
setd is destroyed with set_destroy.
Complexity
O (mn), where m and n are the number of members in
set1 and set2,
respectively.
int set_is_member(const Set *set, const void *data);
Return Value
1 if the member is found, or otherwise.
Description
Determines whether the data specified by
data matches that of a member in the set
specified by set.
Complexity
O (n), where n is the number of members in the
set.
int set_is_subset(const Set *set1, const Set *set2);
Return Value
1 if the set is a subset, or otherwise.
Description
Determines whether the set specified by
set1 is a subset of the set specified by
set2.
Complexity
O (mn), where m and n are the number of members in
set1 and set2,
respectively.
int set_is_equal(const Set *set1, const Set *set2);
Return Value
1 if the two sets are equal, or otherwise.
Description
Determines whether the set specified by
set1 is equal to the set specified by
set2.
Complexity
O (mn), where m and n are the number of members in
set1 and set2,
respectively.
int set_size(const Set *set);
Return Value
Number of members in the set.
Description
Macro that evaluates to the number of members
in the set specified by set.
Complexity
O (1) |


--- layout: post title: Sharepoint vs Oracle UCM - The Battle continues.... date: 2010-02-10 16:26:21.000000000 -02:00 type: post published: true status: publish categories: - Sharepoint - UCM tags: - microsoft - Oracle - Sharepoint - UCM meta: _edit_last: '8405276' tagazine-media: a:7:{s:7:"primary";s:0:"";s:6:"images";a:0:{}s:6:"videos";a:0:{}s:11:"image_count";s:1:"0";s:6:"author";s:7:"8405276";s:7:"blog_id";s:7:"8107380";s:9:"mod_stamp";s:19:"2010-02-11 18:01:14";} author: login: andrealmar email<EMAIL_ADDRESS>display_name: andrealmar first_name: '' last_name: '' ---
Download this Document that contains a Linkedin Topic discussion of Sharepoint vs UCM.
Credits to sharepointgovernance.org


Class: LockFile Private
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A lock file.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
private
Instance Method Summary collapse
-
#initialize(name) ⇒ LockFile
constructor
private
A new instance of LockFile.
-
#lock ⇒ Object
private
-
#unlock ⇒ Object
private
-
#with_lock ⇒ Object
private
Constructor Details
#initialize(name) ⇒ LockFile
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
Returns a new instance of LockFile.
12 13 14 15 16 |
# File 'lock_file.rb', line 12 def initialize(name) @name = name.to_s @path =<EMAIL_ADDRESS>@lockfile = nil end |
Instance Attribute Details
#path ⇒ Object (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
10 11 12 |
# File 'lock_file.rb', line 10 def path @path end |
Instance Method Details
#lock ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
18 19 20 21 22 23 24 |
# File 'lock_file.rb', line 18 def lock @path.parent.mkpath create_lockfile return if @lockfile.flock(File::LOCK_EX | File::LOCK_NB) raise OperationInProgressError, @name end |
#unlock ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
26 27 28 29 30 31 |
# File 'lock_file.rb', line 26 def unlock return if @lockfile.nil? || @lockfile.closed? @lockfile.flock(File::LOCK_UN) @lockfile.close end |
#with_lock ⇒ Object
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
33 34 35 36 37 38 |
# File 'lock_file.rb', line 33 def with_lock lock yield ensure unlock end |


Welcome.
Please login.
UserName
Invalid Email
Password
Invalid Password
Forgot Password?
or
Register


YARA mode rule silent_banker : banker { meta: description = "This is just an example" thread_level = 3 in_the_wild = true strings: $a = {6A 40 68 00 30 00 00 6A 14 8D 91} $b = {8D 4D B0 2B C1 83 C0 27 99 6A 4E 59 F7 F9} $c = "UVODFRYSIHLNWPEJXQZAKCBGMT" condition: $a or $b or $c } MIME types defined: text/yara (YARA code)


Your browser doesn't support the features required by impress.js, so you are presented with a simplified
version of this presentation.
For the best experience please use the latest Chrome, Safari or Firefox browser.
xcbuild
Cross container building utilities.
🎉Go Hackathon 2017 Shanghai🎉
Made by Huitse Tai & Ace Tang
What's this?
-
A toolset which aim to replace docker build in CI.
-
First, it can pull docker image.
-
Second, it can generate top layer for a new image.
-
Third, it can commit to generate a new image.
-
And push back to registry.
Why?
-
Digging deeper what does docker build do:
Pull down image.
Add asset files or use some command to generate some.
Tar the whole static folder to an image layer.
-
I though docker daemon is so heavy for CI.
...and more reasons
docker build is a monolithic command, it does everything in one command.
docker build is not design for CI integration, will make user confortable but will make CI platform integrating work much more trouble.
Like, if you peek into how does registry work, can we parallel generate each image layer which are not depending each other?!
Prototype Tasting
# start tasting environment
docker-compose up --build -d
docker exec -it ketos_ketos_1
# begin
mkdir -p /taste/.ketos/{layers,tags}
cd /taste
xcb pull alpine:3.6
echo "this is a static asset file" \
> ./blabla_little_magical_spirit
xcb chroot --tag 3.6 -- \
bach -c 'echo wizr is watching this > /hello.txt'
xcb commit --tag 3.6
xcb push
The Core
Integration with docker registry
- thanks to the design of docker registry service, we can do more.
Imitate a fake rootfs
- LD_PRELOAD to hook into libc calling
- ptrace with SYS_PTRACE cap, may cause some kernel bugs, bug theoretically it's safe
- chroot, a long history
- runc, huge and so suitable for CI
libc hook
- after digging some documents. golang's syscall design cause us a lot of trouble, but worth.
- thanks to the mess of POSIX, the kernel interact is not as easy as we expected.
but we made it!
some valuable features will be added
keeping tearing down docker image push command
- for: parallel building each independent layer and combine to one
supporting more chroot replacing solution
thanks!