Returns a single tree using the SHA1 value for that tree.
If truncated
is true
in the response then the
number of items in the tree
array exceeded our maximum limit.
If you need to fetch more items, use the non-recursive method of fetching
trees, and fetch one sub-tree at a time.
GET /repos/:owner/:repo/git/trees/:tree_sha
| Name | Type | Description |
|---|---|---|
recursive |
string |
Setting this parameter to any value returns the objects or subtrees
referenced by the tree specified in :tree_sha . For example,
setting recursive to any of the following will enable
returning objects or subtrees: 0 , 1 ,
"true" , and "false" . Omit
this parameter to prevent recursively returning objects or subtrees.
|
Status: 200 OK
{
"sha": "9fb037999f264ba9a7fc6274d15fa3ae2ab98312",
"url": "https://api.github.com/repos/octocat/Hello-World/trees/9fb037999f264ba9a7fc6274d15fa3ae2ab98312",
"tree": [
{
"path": "file.rb",
"mode": "100644",
"type": "blob",
"size": 30,
"sha": "44b4fc6d56897b048c772eb4087f854f46256132",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132"
},
{
"path": "subdir",
"mode": "040000",
"type": "tree",
"sha": "f484d249c660418515fb01c2b9662073663c242e",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/f484d249c660418515fb01c2b9662073663c242e"
},
{
"path": "exec_file",
"mode": "100755",
"type": "blob",
"size": 75,
"sha": "45b983be36b73c0788dc9cbcb76cbb80fc7bb057",
"url": "https://api.github.com/repos/octocat/Hello-World/git/blobs/45b983be36b73c0788dc9cbcb76cbb80fc7bb057"
}
],
"truncated": false
}
Status: 200 OK
{
"sha": "fc6274d15fa3ae2ab983129fb037999f264ba9a7",
"url": "https://api.github.com/repos/octocat/Hello-World/trees/fc6274d15fa3ae2ab983129fb037999f264ba9a7",
"tree": [
{
"path": "subdir/file.txt",
"mode": "100644",
"type": "blob",
"size": 132,
"sha": "7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b",
"url": "https://api.github.com/repos/octocat/Hello-World/git/7c258a9869f33c1e1e1f74fbb32f07c86cb5a75b"
}
],
"truncated": false
}


Updated upstream <<<<<<< Updated upstream ======= >>>>>>> Stashed changes ======= >>>>>>> Stashed changes
Training courses and material related to Real World Data and the Teradata System
Information
Mandatory for access
Reccomended


Image-Based Meta-Analysis
Contents
Image-Based Meta-Analysis¶
# First, import the necessary modules and functions
import os
import matplotlib.pyplot as plt
from myst_nb import glue
from nilearn import plotting
from repo2data.repo2data import Repo2Data
# Install the data if running locally, or points to cached data if running on neurolibre
DATA_REQ_FILE = os.path.abspath("../binder/data_requirement.json")
repo2data = Repo2Data(DATA_REQ_FILE)
data_path = repo2data.install()
data_path = os.path.join(data_path[0], "data")
---- repo2data starting ----
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/repo2data
Config from file :
/Users/taylor/Documents/nbc/nimare-paper/binder/data_requirement.json
Destination:
./../data/nimare-paper
Info : ./../data/nimare-paper already downloaded
Image-based meta-analysis (IBMA) methods perform a meta-analysis directly on brain images (either whole-brain or partial) rather than on extracted peaks. On paper, IBMA is superior to CBMA in virtually all respects, as the availability of analysis-level parameter and variance estimates at all analyzed voxels allows researchers to use the full complement of standard meta-analysis techniques, instead of having to resort to kernel-based or other methods that require additional spatial assumptions. In principle, given a set of maps that contains no missing values (i.e., where there are k valid pairs of parameter and variance estimates at each voxel), one can simply conduct a voxel-wise version of any standard meta-analysis or meta-regression method commonly used in other biomedical or social science fields.
In practice, the utility of IBMA methods has historically been quite limited, as unthresholded statistical maps have been unavailable for the vast majority of neuroimaging studies. However, the introduction and rapid adoption of NeuroVault [Gorgolewski et al., 2015], a database for unthresholded statistical images, has made image-based meta-analysis increasingly viable. Although coverage of the literature remains limited, and IBMAs of maps drawn from the NeuroVault database are likely to omit at least some (and in some cases most) relevant studies due to limited metadata, we believe the time is ripe for researchers to start including both CBMAs and IBMAs in published meta-analyses, with the aspirational goal of eventually transitioning exclusively to the latter. To this end, NiMARE supports a range of different IBMA methods, including a number of estimators of the gold standard mixed-effects meta-regression model, as well as several alternative estimators suitable for use when some of the traditional inputs are unavailable.
Note
NiMARE’s IBMA Estimator
s are light wrappers around classes from PyMARE, a library for standard (i.e., non-neuroimaging) meta-analyses developed by the same team as NiMARE.
In the optimal situation, meta-analysts have access to both contrast (i.e., parameter estimate) maps and their associated standard error maps for a number of studies. With these data, researchers can fit the traditional random-effects meta-regression model using one of several methods that vary in the way they estimate the between-study variance (\(\tau^{2}\)). Currently supported estimators include the DerSimonian-Laird method [DerSimonian and Laird, 1986], the Hedges method [Hedges et al., 1985], and maximum-likelihood (ML) and restricted maximum-likelihood (REML) approaches. NiMARE can also perform fixed-effects meta-regression via weighted least-squares, though there are few IBMA scenarios where a fixed-effects analysis would be indicated. It is worth noting that the non-likelihood-based estimators (i.e., DerSimonian-Laird and Hedges) have a closed-form solution, and are implemented in an extremely efficient way in NiMARE (i.e., computation is performed on all voxels in parallel). However, these estimators also produce more biased estimates under typical conditions (e.g., when sample sizes are very small), implying a tradeoff from the user’s perspective.
Alternatively, when users only have access to contrast maps and associated sample sizes, they can use the supported Sample Size-Based Likelihood estimator, which assumes that within-study variance is constant across studies, and uses maximum-likelihood or restricted maximum-likelihood to estimate between-study variance, as described in Sangnawakij et al. [2019]. When users have access only to contrast maps, they can use the Permuted OLS estimator, which uses ordinary least squares and employs a max-type permutation scheme for family-wise error correction [Freedman and Lane, 1983, Anderson and Robinson, 2001] that has been validated on neuroimaging data [Winkler et al., 2014] and relies on the nilearn library.
Finally, when users only have access to z-score maps, they can use either the Fisher’s [Fisher, 1925] or the Stouffer’s [Riley et al., 1949] estimators. When sample size information is available, users may incorporate that information into the Stouffer’s method, via the method described in Zaykin [2011].
Given the paucity of image-based meta-analytic datasets, we have included the tools to build a Dataset from a NeuroVault collection of 21 pain studies, originally described in Maumet and Nichols [2016].
from nimare import dataset, extract, utils
dset_dir = extract.download_nidm_pain(data_dir=data_path, overwrite=False)
dset_file = os.path.join(utils.get_resource_path(), "nidm_pain_dset.json")
img_dset = dataset.Dataset(dset_file)
# Point the Dataset toward the images we've downloaded
img_dset.update_path(dset_dir)
INFO:nimare.extract.utils:Dataset found in ./../data/nimare-paper/data/nidm_21pain
INFO:nimare.utils:Shared path detected: '/Users/taylor/Documents/nbc/nimare-paper/data/nimare-paper/data/nidm_21pain/'
Transforming images¶
Researchers may share their statistical maps in many forms, some of which are direct transformations of one another.
For example, researchers may share test statistic maps with z-statistics or t-statistics, and, as long as we know the degrees of freedom associated with the t-test, we can convert between the two easily. To that end, NiMARE includes a class, ImageTransformer
, which will calculate target image types from available ones, as long as the available images are compatible with said transformation.
Here, we use ImageTransformer
to calculate z-statistic and variance maps for all studies with compatible images.
This allows us to apply more image-based meta-analysis algorithms to the Dataset
.
import warnings
from nimare import transforms
# The images used in this example have NaNs in any voxels outside the brain.
# Generally, we recommend having zeros in masked-out areas,
# but the data are what they are in this case.
# Nilearn will raise warnings when users resample images with NaNs.
# This will not cause any problems for this example, so we will simply filter
# those warnings out.
warnings.filterwarnings(action="ignore", category=RuntimeWarning, module="nilearn")
img_transformer = transforms.ImageTransformer(target=["z", "varcope"], overwrite=False)
img_dset = img_transformer.transform(img_dset)
INFO:nimare.utils:Shared path detected: '/Users/taylor/Documents/nbc/nimare-paper/data/nimare-paper/data/nidm_21pain/'
# Here we delete the recent variables for the sake of reducing memory usage
del img_transformer
Now that we have filled in as many gaps in the Dataset
as possible, we can start running meta-analyses.
We will start with a DerSimonian-Laird meta-analysis (DerSimonianLaird
).
from nimare import meta
dsl_meta = meta.ibma.DerSimonianLaird(resample=True)
dsl_results = dsl_meta.fit(img_dset)
# Retain the z-statistic map for later use
dsl_img = dsl_results.get_map("z", return_type="image")
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
# Here we delete the recent variables for the sake of reducing memory usage
del dsl_meta, dsl_results
Now we will apply other available IBMA Estimator
s to the same Dataset
, and save their results to files for comparison.
# Stouffer's
stouffers_meta = meta.ibma.Stouffers(use_sample_size=False, resample=True)
stouffers_results = stouffers_meta.fit(img_dset)
stouffers_img = stouffers_results.get_map("z", return_type="image")
del stouffers_meta, stouffers_results
# Stouffer's with weighting based on sample size
wstouffers_meta = meta.ibma.Stouffers(use_sample_size=True, resample=True)
wstouffers_results = wstouffers_meta.fit(img_dset)
wstouffers_img = wstouffers_results.get_map("z", return_type="image")
del wstouffers_meta, wstouffers_results
# Fisher's
fishers_meta = meta.ibma.Fishers(resample=True)
fishers_results = fishers_meta.fit(img_dset)
fishers_img = fishers_results.get_map("z", return_type="image")
del fishers_meta, fishers_results
# Permuted Ordinary Least Squares
ols_meta = meta.ibma.PermutedOLS(resample=True)
ols_results = ols_meta.fit(img_dset)
ols_img = ols_results.get_map("z", return_type="image")
del ols_meta, ols_results
# Weighted Least Squares
wls_meta = meta.ibma.WeightedLeastSquares(resample=True)
wls_results = wls_meta.fit(img_dset)
wls_img = wls_results.get_map("z", return_type="image")
del wls_meta, wls_results
# Hedges'
hedges_meta = meta.ibma.Hedges(resample=True)
hedges_results = hedges_meta.fit(img_dset)
hedges_img = hedges_results.get_map("z", return_type="image")
del hedges_meta, hedges_results
# Use atlas for likelihood-based estimators
from nilearn import datasets, image, input_data
atlas = datasets.fetch_atlas_harvard_oxford("cort-maxprob-thr25-2mm")
# nilearn's NiftiLabelsMasker cannot handle NaNs at the moment,
# and some of the NIDM-Results packs' beta images have NaNs at the edge of the brain.
# So, we will create a reduced version of the atlas for this analysis.
nan_mask = image.math_img("~np.any(np.isnan(img), axis=3)", img=img_dset.images["beta"].tolist())
atlas = image.resample_to_img(atlas["maps"], nan_mask)
nanmasked_atlas = image.math_img("mask * atlas", mask=nan_mask, atlas=atlas)
masker = input_data.NiftiLabelsMasker(nanmasked_atlas)
del atlas, nan_mask, nanmasked_atlas
# Variance-Based Likelihood
vbl_meta = meta.ibma.VarianceBasedLikelihood(method="reml", mask=masker, resample=True)
vbl_results = vbl_meta.fit(img_dset)
vbl_img = vbl_results.get_map("z", return_type="image")
del vbl_meta, vbl_results
# Sample Size-Based Likelihood
ssbl_meta = meta.ibma.SampleSizeBasedLikelihood(method="reml", mask=masker, resample=True)
ssbl_results = ssbl_meta.fit(img_dset)
ssbl_img = ssbl_results.get_map("z", return_type="image")
del ssbl_meta, ssbl_results, masker
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
WARNING:nimare.base:Masking out 39113 additional voxels. The updated masker is available in the Estimator.masker attribute.
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/nilearn/_utils/niimg.py:63: UserWarning: Non-finite values detected. These values will be replaced with zeros.
warn(
WARNING:nimare.meta.ibma:A <class 'nilearn.maskers.nifti_labels_masker.NiftiLabelsMasker'> mask has been detected. Masks which average across voxels will likely produce biased results when used with this Estimator.
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/pymare/estimators/estimators.py:24: UserWarning: Input contains 48 parallel datasets (in 2nd dim of y and v). The selected estimator will loop over datasets naively, and this may be slow for large numbers of datasets. Consider using the DL, HE, or WLS estimators, which handle parallel datasets more efficiently.
warn(
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/nilearn/_utils/niimg.py:63: UserWarning: Non-finite values detected. These values will be replaced with zeros.
warn(
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/pymare/estimators/estimators.py:24: UserWarning: Input contains 48 parallel datasets (in 2nd dim of y and v). The selected estimator will loop over datasets naively, and this may be slow for large numbers of datasets. Consider using the DL, HE, or WLS estimators, which handle parallel datasets more efficiently.
warn(
Comparing algorithms¶
Here we load the z-statistic map from each of the IBMA Estimators we’ve used throughout this chapter and plot them all side by side.
meta_results = {
"DerSimonian-Laird": dsl_img,
"Stouffer's": stouffers_img,
"Weighted Stouffer's": wstouffers_img,
"Fisher's": fishers_img,
"Ordinary Least Squares": ols_img,
"Weighted Least Squares": wls_img,
"Hedges'": hedges_img,
"Variance-Based Likelihood": vbl_img,
"Sample Size-Based Likelihood": ssbl_img,
}
order = [
["Fisher's", "Stouffer's", "Weighted Stouffer's"],
["DerSimonian-Laird", "Hedges'", "Weighted Least Squares"],
["Ordinary Least Squares", "Variance-Based Likelihood", "Sample Size-Based Likelihood"],
]
fig, axes = plt.subplots(figsize=(18, 6), nrows=3, ncols=3)
for i_row, row_names in enumerate(order):
for j_col, name in enumerate(row_names):
file_ = meta_results[name]
display = plotting.plot_stat_map(
file_,
annotate=False,
axes=axes[i_row, j_col],
cmap="RdBu_r",
cut_coords=[5, -15, 10],
draw_cross=False,
figure=fig,
)
axes[i_row, j_col].set_title(name)
colorbar = display._cbar
colorbar_ticks = colorbar.get_ticks()
if colorbar_ticks[0] < 0:
new_ticks = [colorbar_ticks[0], 0, colorbar_ticks[-1]]
else:
new_ticks = [colorbar_ticks[0], colorbar_ticks[-1]]
colorbar.set_ticks(new_ticks, update_ticks=True)
glue("figure_uncorr_ibma", fig, display=False)
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/nilearn/plotting/img_plotting.py:300: FutureWarning: Default resolution of the MNI template will change from 2mm to 1mm in version 0.10.0
anat_img = load_mni152_template()
/Users/taylor/Documents/nbc/nimare-paper/conda_env/lib/python3.8/site-packages/nilearn/_utils/niimg.py:63: UserWarning: Non-finite values detected. These values will be replaced with zeros.
warn(


Listeos
Github
Please Wait. Connecting to the Blockchain.
Topic:
Show Link to External Site
Loading...
Submit Comment
Comments and Replies Displayed Below
Sort Discussion By:
Votes
Date
Users
Choose Order to Display:
Most Votes First
Least Votes First
Go
Choose Order to Display:
Most Recent First
Oldest First
Go
Choose Order to Display:
Alphabetical
Reverse Alphabetical
Go
Reset. Remove all Filters.
Please Wait. Reseting...
There are no comments for this topic. Be the first to write something!
Write Comment
Additional Replies:
Use an EOS Wallet (e.g. Greymass) to send:
Loading...
EOS to account:
Loading...
Enter your comment in the "memo" field.
* Refresh this page once transfer is sent to view your comment.
Use an EOS Wallet (e.g. Greymass) to send:
Loading...
EOS to account:
Loading...
Start the memo field with the text:
Loading...
and then include your reply.
Example memo field:
Loading...
This is your comment. Write whatever you want here.
* Refresh this page once transfer is sent to view your reply.
Option #1 - Use an EOS Wallet (Greymass) to send:
Loading...
EOS to account:
Loading...
Put the following text in the "memo" field:
Loading...
Option #2 - Use an EOS Wallet (Greymass) to send:
Loading...
EOS to account:
Loading...
Put the following text in the "memo" field:
Loading...
Close and Return
Use an EOS Wallet (e.g. Greymass) to send:
Loading...
EOS to account:
Loading...
Put the following text in the "memo" field:
Loading...


If permissions aren't yet set, display error and exit.....
Permissions for this folder/file aren't set up to record and save audio files yet! Please set the correct permissions.
If database connection is unsuccessful, display error and exit....
Your database connection was unsuccessful. Edit the details in this file and retry the connection.
If no researchers exist in database yet, display this and exit....
Welcome to the Simulated Conversations software package. To get started, first create a researcher account. This account will be the super-user, so you will be able to create and delete other researchers.
If all of the above conditions are already met, display this.....


Toggle navigation
Bank Of Money
Request Help
Transaction Successfully Completed
Account:
New Balance:
Deposit Amount:
Transaction Number:
Print Receipt
Main Menu
Exit


--- title: "Nested index page" description: "Should process a nested index.html page correctly" layout: false --- {% extends "layouts/_layout" %} {% block content %}
{{description}}


To develop something, having a proper environment setup is key. This post explains how you can set up a development environment to contribute to OpenStack. I’m going to use DevStack which is a shell script that builds OpenStack completely in a developer friendly environment.
Virtual Machine
Firstly, set up a virtual machine running any of the supported distro/release of DevStack. Ubuntu 12.04, Fedora 20, CentOS/RHEL 6.5 are supported. Any type of virtualisation software should be fine, I use Vagrant because it is easier to manage the instances. After a VM is up and running, install a Linux distribution. I have installed Ubuntu 14.04 (it is not officially supported, but it works just fine).
Setup user
At this point, we have a VM running a Linux OS. We need to create a user called stack. For Red Hat and the like, stack should be a non-root user, this does not matter in Ubuntu.
1 2 |
|
Setup the VM
We need to install git and clone the DevStack repository
1 2 3 4 |
|
Now is the fun part, well almost
Working with OpenStack means you got to remember passwords for admin, database, rabbit etc. Your life is a lot simpler with a bit of configuration. Edit the local.conf file in the repository’s root to look like this.
1 2 3 4 5 6 |
|
Ok, the fun part
Simply run stack.sh and keep your eyes peeled
1
|
|
Using DevStack
stack.sh takes a long time to execute. After it has completed successfully, it displays information about your newly chromed OpenStack install. You can log in to Horizon, which is the web UI dashboard to manage your VMs. Be careful when you reboot your VM. If you ever need to reboot, you have to run unstack.sh and then reboot. After the reboot you need to run rejoin-stack.sh to get the services running again.
Other stuff
Let’s face it. It is impossible to keep up with the output that stack.sh throws at you. We’ll need to edit the local.conf
file to log it by setting LOGFILE
. DevStack runs all OpenStack services on a screen session. To log this screen we can set the SCREEN_LOGDIR
variable.
1 2 3 4 |
|
Enjoy your OpenStack and please contribute to the OpenSource community.


If you have already checked-in (committed) changes to a branch, you can add additional files to the same 'commit'.
If you have already checked-in (committed) changes to a branch, you can add additional files to the same 'commit'.
| Action | Command | |
|---|---|---|
| Switch to <branch> | git checkout <branch> | |
| Stage changes to <branch> | git add . | |
| Commit changes to <branch> | git commit --ammend --no-edit |


---
title: "April Showers"
date: "2019-04-03 00:00:00 -06:00"
categories:
- whats-blooming
layout: "post"
blog-banner: "whats-blooming-now-spring.jpg"
post-date: "April 3, 2019"
post-time: "12:00 PM"
blog-image: "2019-04-03-wbn.jpg"
published: true
---
We're only a few days into April and it is already showing its true color... Spring color!
Come see what the April showers are bringing to the Garden!
Here is one of the most unique daffodils in our collection.
This is one of my personal springtime favorites.
Usually one of the first shrubs to bloom here in the Garden.
These tiny, but eye catching flowers can be seen throughout the Garden.
Don't let the gloom deter you from visiting the Garden, with our bulb display already poppin, it is sure to brighten your day.


Scroll to get started!
MOLA MOLA OCEAN SUN FISH
For many hours a day, the ocean sunfish spends his time basking in the sun!
SUNBATHING MOLA MOLA
Mommy Mola can give birth to 300 million eggs at once!
BABY MOLA MOLA
The mola fish is not the most evasive.
HEADACHE MOLA MOLA
Mola fish are very curious! Say hi!
FRIENDLY MOLA MOLA
Please don't ride the mola fish!
UNHAPPY MOLA MOLA
The mola mola is the largest bony fish, weighing up to 5 tons!
BONY MOLA MOLA
You can find up to 50 types of parasites living on the mola.
HOST MOLA MOLA
Mola molas will swim to reefs, allowing fish and birds to feed on parasites.
HELP! MOLA MOLA
Want to play as a Mola Mola? Download this app!
SURVIVE! MOLA MOLA!


Follow Eyeoneyez On Spotify and
Be The First To Hear
Polar Bear The Remixes
Be The First To Hear
Polar Bear The Remixes
Follow Eyeoneyez On Spotify and
Be The First To Hear
Polar Bear The Remixes
Be The First To Hear
Polar Bear The Remixes
(It’s Easy! Just Click Agree On The Next Page)
POWERED BY
FOLLOWFAST
FOLLOWFAST


Red Deer man facing 13 charges after late night pursuit
Leduc RCMP with assistance from Edmonton Police make arrest
by Stu SalkeldA Red Deer man is facing 13 charges after a late night pursuit involving Leduc and Edmonton police.
According to Leduc RCMP spokesperson Cst. Cheri-Lee Smith, “On November 18, 2019 at approximately 10:20 p.m., Leduc RCMP stopped a vehicle for a traffic offence on Highway 2 near Highway 625. The vehicle pulled to a stop, but failed to remain stopped and fled from police at a high rate of speed.
“Circumstances during the traffic stop caused the officer to have a concern for public safety, and a pursuit was initiated.
“The vehicle continued to drive at a high rate of speed into Edmonton, nearly colliding with a civilian vehicle. The vehicle was abandoned by the driver in Edmonton and the driver fled on foot. The female passenger was located in the vehicle and later arrested for Failure to comply with conditions of Recognizance.
“Edmonton Police along with support helicopter Air 1 and canine unit assisted in locating and arresting the male driver.
“The 25-year-old male from Red Deer has been charged with:
• Flight from Peace Officer
• Obstruct Peace Officer
• Dangerous Operation of Motor Vehicle
• 8 counts of Failure to Comply with Conditions of Recognizance
• 2 counts of Failure to Comply with Probation Order
“He is being held in custody awaiting a Judicial Interim Release hearing.
“No injuries were sustained as a result of this incident.
“If you see something suspicious, report it to your local police. If you see a crime in progress, call 911. If you wish to remain anonymous, contact Crime Stoppers at 1-800-222-8477 (TIPS), online at www.p3Tips.com or by using the “P3 Tips” app available through the Apple App or Google Play Store.”


index
| up
| prev
| next
Mutex Class
Definition at line 48
of Mutex.hpp
Constructors
Member Functions
Member Variables
Constructor Details
Mutex Constructor
cmajor::util::Mutex::Mutex(char
id_)
Definition at line 61
of Mutex.cpp
:
61 : id(id_)
62 {
63 }
Declaration at line 51
of Mutex.hpp
Member Function Details
Id Member Function
char
cmajor::util::Mutex::Id() const
Definition at line 52
of Mutex.hpp
:
52 { return id; }
Called by: cmajor::util::LockGuard::Lock
Lock Member Function
void
cmajor::util::Mutex::Lock()
Definition at line 53
of Mutex.hpp
:
53 { mtx.lock(); }
Called by: cmajor::util::LockGuard::Lock
Mtx Member Function
std::mutex& cmajor::util::Mutex::Mtx()
Definition at line 55
of Mutex.hpp
:
55 { return mtx; }
Unlock Member Function
void
cmajor::util::Mutex::Unlock()
Definition at line 54
of Mutex.hpp
:
54 { mtx.unlock(); }
Called by: cmajor::util::LockGuard::Unlock
index
| up
| prev
| next


--- layout: archive title: Zulip Chat Archive permalink: /stream/116395-maths/topic/bundled.20bases.html ---
I pushed the results of yesterdays painful efforts to https://github.com/leanprover-community/mathlib/blob/open_set/category_theory/examples/topological_spaces.lean. This wouldn't have been possible without the great help of @Johannes Hölzl
I guess that some of the proofs need to be minimised. I obfuscated them as much as possible, and don't see how to squeeze out more. If someone wants to take a look, please go ahead.
The motivation for these changes is that we want to be able to talk about "sheaves on a basis".
I think open_set
should be unbundled in the topology argument
@Mario Carneiro What do you mean with that?
You want an unbundled version in analysis/topology/blah.lean
?
I think we also want the bundled version. But maybe I should first prove things with it, to show that it is useful.
I mean that for a fixed topological space, @open_set X top_X
is a category
On top of that there is an open_set
functor from Top
to Type
, but that needs its own definition anyway
er, I think I mean lattice not category, I see you haven't given it a category structure
so in that case it could indeed move to analysis/topology
. I would suggest the name opens
for this lattice
It is... every preorder is a category (in mathlib)
right, but you haven't made any explicit reference to categories in the definition
Hmmm... I don't follow exactly. Do you want to change the definition of open_set
? Or do you want to define opens
and if so, what should it be?
Also, should we change the definition of open_set X
to open_set X := X.str
? That is equivalent, and might simplify a lot of the stuff that follows...
def opens (X : Type*) [topological_space X] : Type* := {s // is_open s}
I don't understand the idea behind the X.str
definition. The point is that open_set X
is a type, not a structure
my proposal is opens
as above, and category.opens : Top ⥤ Cat
(or some other prefix?) has that as its object part
although maybe we need more functors than just that because it's properly a 2-functor
@Mario Carneiro So open_set
should go asway, and be replaced by opens
?
What is wrong with:
def opens (X : Type*) [t : topological_space X] : Type* := subtype t.is_open
That is what I meant with the X.str
definition.
That doesn't typecheck?
Ok, fair enough. I meant subtype t.is_open
. I fixed this above.
that's the same as I wrote modulo eta expansion
Right. So it doesn't matter.
well, you are also using a different is_open
Aah, and maybe mine is more painful?
there are fewer lemmas about it
@Mario Carneiro Do you mean you would like to see something like this in analysis/topology/topological_space.lean
?
section opens variable (α) def opens := {s : set α // _root_.is_open s} variables {α} instance : has_coe (opens α) (set α) := { coe := λ U, U.val } instance : has_subset (opens α) := { subset := λ U V, U.val ⊆ V.val } instance : has_mem α (opens α) := { mem := λ a U, a ∈ U.val } @[extensionality] lemma ext {U V : opens α} (h : U.val = V.val) : U = V := by cases U; cases V; congr; exact h instance topological_space.opens.partial_order : partial_order (opens α) := by refine { le := (⊆), .. } ; tidy end opens
Note that I am using tidy
in the last line. I don't know if this is too early in the mathlib-tree?
If this is the direction you had in mind, I can continue moving stuff from the category folder into this file; and then PR it.
We have functions for transfering a partial order
partial_order.lift
I hope you aren't so attached to using blasty tactics that you are reproving theorems that we already have
in fact, subtype.partial_order
is just what you need
ext
is subtype.eq
Ok, that's fine with me. But about the general direction? Is this what you want?
yes
But subtype.ext
is not an ext-lemma
Should I phrase mine as an ext-lemma, or as an iff?
I'm not saying you shouldn't state it, but it is a proof by reference to subtype.eq
Right. But which version should I state? Or both?
extensionality
requires the one-directional form
I don't know if it would be better to use set extensionality as well though
so it says forall a, a \in U \lr a \in V
ext
can chain those together. So I think I'll only do the first step.
Done. See #427.
But
subtype.ext
is not an ext-lemma
I've been wondering about this one --- can we make attribute [extensionality] subtype.eq
?
ext can chain them, but you will get x \in U.val
instead of x \in U
Last updated: Apr 24 2020 at 19:02 UTC


Welcome to Crane! You can either:
If you already have an existing project, it is easy to use Crane instead of docker-compose to get fast bind-mounts! In general, you only need to add a small snippet to tell Crane which folders should be accelerated.
In this example, we'll assume a Rails project with the following docker-compose.yml
:
services:
postgres:
image: postgres:9.6.2
env:
- "POSTGRES_USER=example"
- "POSTGRES_PASSWORD=secret"
- "POSTGRES_DB=example_development"
web:
depends_on:
- "postgres"
build:
context: .
tty: true
stdin_open: true
ports:
- "3000:3000"
volumes:
- ".:/web"
command: "bin/rails s -b <IP_ADDRESS>"
All you need to do is create a separate crane.yml
in the same folder. Crane will automatically merge both config files together. The file should look like this:
accelerated-mounts:
web:
uid: 1000
gid: 1000
That's it. Next time you start the "web" service, it'll be fast! Try it out now: crane run example
.
We're going to walk through all steps required to setup a new Rails project, but if you use another language / framework, most things should be very similar and you can adapt as needed. For the purposes of this guide, let's assume we name our project "example", so we create a new folder example
, which is where all files mentioned below are to be placed.
After you have installed Crane, let's start by creating a configuration file. Following is the Crane format (which strictly follows the flag names of docker run
), but you can also use the docker-compose format. An example of that can be seen in the section about using an existing project with Crane.
This is how the crane.yml
looks like:
services:
postgres:
image: postgres:9.6.2
env:
- "POSTGRES_USER=example"
- "POSTGRES_PASSWORD=secret"
- "POSTGRES_DB=example_development"
example:
requires: ["postgres"]
build:
context: .
publish: ["3000:3000"]
volume: [".:/example"]
tty: true
interactive: true
command: "bin/rails s -b <IP_ADDRESS>"
accelerated-mounts:
example:
uid: 1000
gid: 1000
We are using the official PostgreSQL image for the database and will build our own image for the example app. Let's write the Dockerfile
for it:
FROM ruby:2.3.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN useradd -m -s /bin/bash example; \
chgrp -R example /usr/local; \
find /usr/local -type d | xargs chmod g+w; \
mkdir -p /etc/sudoers.d; \
echo "example ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/example; \
chmod 0440 /etc/sudoers.d/example
ENV HOME /home/example
USER example
RUN gem install rails --no-ri --no-rdoc
WORKDIR /example
ENV BUNDLE_PATH /example/vendor/bundle
Now we are ready to build this image and create a new Rails project. Crane's up
command can do both at the same time for us:
crane up example rails new . --force --database=postgresql --skip bundle
To configure our app to talk to the Postgres container, edit config/database.yml
and uncomment password: secret
and host: postgres
under the development
section. One last step is to install the dependencies:
crane run example bundle install
Finally, start the server with crane run example
and check out the result at http://localhost:3000
.


Title: SS_Log, FAST Program logging and tracing class. Author: Steve Schaneville Email<EMAIL_ADDRESS>Environment: VC++ 6.0, NT 4.0, Win2000, WinXP Keywords: log, logging, trace, tracing, program flow Level: Intermediate" Description: Easily trace and log program flow. Allows multiple filters, multiple destinations (file, nt event log, etc), and it's VERY FAST! Section Free Tools SubSection General
The Complete class documentation can be found at http://sslog.webhop.net.
Often times we want to create a log of what steps a program takes during run-time. Maybe our program works fine on all of our computers in house, but it is crashing at a customer's site. Or maybe we are developing on WinNT, but are testing on Win98 without a development environment on the Win98 machine. Since we can't debug in these cases, it would be nice to have a log of all the steps a program took before it crashed.
This set of projects perform program logging and offer numerous features:
This is version 3 of the code. Version 3 has undergone a major re-write, and many of the functions that once were part of the SS_Log class have now been deprecated. All deprecated functions are still supported, so your older code should still work with this version, but for those who've use this code in the past, please make yourself familiar with the new calls.
In the first version of this code, if writing to a file, we would write and flush each message immediately when the message was logged. This caused a good bit of slowdown. The reason for the immediate flush was, if your program crashed, you'd be guaranteed to have all messages that were logged before the crash.
The new design still guarantees that all messages will be logged, but we won't force the overhead of flushing to file every time. Instead, all messages get sent to a server in a separate process that is launched and terminated on the fly, and the server will flush the contents out when it gets the chance.
I want to thank Graven for this suggestion. That and the "dynamically filter after the fact" suggestions are the basis of the new design, and they were his ideas. Several other people made suggestions too, and I appreciate all of them. I implemented many of them, and those that I did not, I will definitely keep on the list for the future.
Integration into your project is easy. The following steps are necessary:
That should about do it. The SS_Log code will handle the rest. If you downloaded the sources rather than the binaries, compile the projects in the following order:
#include "SS_Log.h" main() { Log("Hello World!"); }
... and as long as you've not forgotten to #define _SS_LOG_ACTIVE in your precompiler, this code will produce a log with the filename, line number, date/time, default filter, message ID, and your message text.
Before reading this whole article (as it is quite long), you might want to just look in the sample program (SS_Log_Test.cpp) that is included in the sources. There are extensive comments, and it might take less time to pick up the jist of things there. That project will not show everything available to you, but should get you started. As some point you should read the article if you want to learn the full functionality from SS_Log.
The global log is a single instance of the SS_Log class that is available to all files that include SS_Log.h. You can begin using the global log immediately just by including that file, using the following macros:
1. INT Log(TCHAR* pMsg, ...); 2. INT Log(DWORD dwFilter, TCHAR* pMsg, ...); 3. INT LogID(UINT nResourceID, ...); 4. INT LogID(DWORD dwFilter, UINT nResourceID, ...);
The simplest form (the first macro above) takes an sprintf-style format string and a variable number of parameters that will be formatted into the final message.
The second macro allows you to include message flags that override the default flags (more on flags later). The third and fourth macros are duplicated of the first two, except that they take a resource ID as the format string.You can access configuration options for the global log with the following macros (we will discuss each in turn):
5. DWORD LogSetFlags(DWORD dwFlags); 6. DWORD LogGetFlags(); 7. DWORD LogRemoveFlags(DWORD dwFlags); 8. DWORD LogAddFlags(DWORD dwFlags); 9. INT LogSetDestinationName(LPCTSTR szName); 10. INT LogEraseLog(); 11. INT LogLimitOutputSize(DWORD dwSizeLimit); 12. INT LogGetLastError(); 13. INT LogSetRegistryKey(LPCTSTR szRegKey); 14. VOID LogUseServer(BOOL bUseServer); 15. BOOL LogSucceeded(); 16. VOID LogInstanceHandle(HANDLE hInstance); 17. VOID LogEnterFunction(LPCTSTR szFunctionName); 18. DWORD LogGetRegistryFilters(); 19. BOOL LogSetRegistryFilters(DWORD dwRegFilters);
The first configuration function we need to talk about is the LogUseServer()
function. By default, the SS_Log class will launch a separate process, the SS_Log_Server
application (which must be in the %SYSTEMROOT% directory), to capture all messages.
There is one main reason for using a separate process: Speed. If we logged everything
straight to a file (as the first version of SS_Log did), we would need to flush
each and every message to disk immediately after it was logged to ensure that,
in the event of a program crash, we didn't drop any messages. Flushing every
message is VERY inefficient though, and can easily cause performance problems.
The SS_Log_Server class will be launched on demand and will prepare a named pipe to receive all messages. Then it will flush these messages out when it gets a chance, never hindering your application, which has long since moved on to other things. During testing, I logged over 100,000 messages in under 10 seconds (AMD 1700+) using the server, and only 1,000 in more than 10 seconds without the server. The server will even terminate itself when the instance of the SS_Log class that started it is destructed.
If for some reason you still don't want to use the server, the SS_Log class
still supports flushing every message straight out to a file. Call the LogUseServer(FALSE)
to use this behavior.
Macros 5-8 above allow the user to specify the default flags that will be sent with every message (unless overridden in the message). All flags are grouped into 3 categories:
LOGTYPE_CRITICAL
LOGTYPE_WARNING
LOGTYPE_NORMAL
LOGTYPE_TRACE
(default)LOGTYPE_TRACE_FAIL
LOGTYPE_INOUT
LOGTYPE_DEBUG
(default in debug builds)LOGTYPE_RELEASE
(default in release builds)LOGTYPE_LOGTOWINDOW
(default)LOGTYPE_LOGTOFILE
(default)LOGTYPE_LOGTOEVENTLOG
Call the LogAddFlags(...)
and LogRemoveFlags(...)
functions to add or remove any combination of flags using the bitwise OR operator
("|"). These two functions work just as expected in that the flags
you pass in will be added or removed from the default list.
Use the LogSetFlags(...)
to overwrite flags in
the same group as those flags that you are passing in. This functionality may
be a little different than expected. For example, if you were
to call LogSetFlags(LOGTYPE_CRITICAL | LOGTYPE_LOGTOEVENTLOG)
,
any currently set flags in the Level/User group will be overwritten by the LOGTYPE_CRITICAL
flag, and any current ones in the destinations groups will be replaced with
the LOGTYPE_LOGTOEVENTLOG
. You can also ask for which flags are
currently set as the defaults by calling LogGetFlags(...)
.
There are no restrictions on the combination of flags that can be set. Any number of flags from any group can be set at any time (ex. while it might not make much sense to set critical and warning flags, both can be set at the same time. On the other hand, it may well make sense to set multiple destinations, such as to file and to window).
All messages will be sent with the flags that are currently set, but you can
override the current flags on a per-message-basis with macros #2 and #4 described
above. When overriding the current flags, only those in the group passed in
will be overridden (just as when calling the LogSetFlags(...)
function).
For each flag mentioned above, there is an equivilent "filter" that is placed into
the registry (placed at the location specified by the
LogSetRegistryKey()
function). These
filters are turned on (0) or off (1) and are read in by the server
application. As messages are received by the server, it throws away messages based
on these filters (it is also possible to save all messages and then dynamically filter
them after the run is complete... see Using the Viewer).
The LogGetRegistryFilters
and LogSetRegistryFilters
macros
are included so that your application can provide your users with a UI that will
turn on and off these filters. The Get version will read the registry and return
all filter flags that are currently "on" in a DWORD. The Set version will
take a DWORD and write those flags to the registry. Be careful with the Set function,
as it will overwrite every filter currently stored in the registry.  This will probably cause all messages
to be filtered out of the server, creating an empty log.
Both of these functions notify the server that the registry has been updated and it should re-read those filters into memory.
Currently there are three destinations available, though you can make your
own (derive a class from the SSLogDestination
class). Messages are
"dispatched" to each destination for which one of the destination flags is set
(see the destination flags listed above).
The With the LOGTYPE_LOGTOFILE
flag set, all messages will be sent to
the filename specified in the LogSetDestinationName(...)
function. The file
will be placed in the local directory of the calling application unless you
specify otherwise in the destination name.
The LOGTYPE_LOGTOEVENTLOG
flag will send all messages to the NT
event log. Note that Win9x can be configured to send these messages to a file
(see the MSDN ReportEvent() and RegisterEventSource() functions for details).
The LOGTYPE_LOGTOWINDOW
flag is more unique. The "window"
(which we will call the "viewer") is actually an MFC single document application
that is part of the SS_Log_Server.exe. All messages will be sent to the server,
and the server will display this single document window, placing the messages
in a list view. More details on the viewer below.
Call LogGetLastError()
to get one of the SS_Log defined errors, found
here.
Use LogSucceeded()
to get a BOOL value stating whether or not the
last call was a success.
The LogEraseLog()
macro will cause the viewer and file destinations
to erase their logs. The NT event log is unaffected by this call.
The LogLimitOutputSize()
macro currently only affects the file
destination. Pass in the number of kilobytes that you do not want your log file
to exceed. The file destination will monitor the file size, and when a message
will cause it to exceed this size, the file will be trimmed in half, throwing
away the oldest 50% of the messages and making room for new ones.
The LogSetRegistryKey()
macro controls
where in the registry SS_Log will keep its settings. This allows you to use the
SS_Log in multiple projects and not have them bump heads. Note that currently you
only get to specify a portion of the key. If you pass in "MyCompany\MyApp" as
your registry key, the SS_Log will store its settings in
HKEY_LOCAL_MACHINE\Software\MyCompany\MyApp\SS_Log.
The LogInstanceHandle()
macro will give the SS_Log class your
application's instance handle, which is necessary when using the LogID(...)
macros. If you don't set the instance handle first, calls to LogID(...)
will fail.
The LogEnterFunction()
macro actually logs two messages. Call this
function when entering a function and pass in the function's name. An "Entering MyFunction" message will
be created when this line of code is run AND an "Exiting MyFunction" message will be
sent when the function exits.
You can compile out all logging to the global log by simply not #defining _SS_LOG_ACTIVE. This will also compile out all logging for local logs ONLY IF you compile the SS_Log.cpp and SS_Log_Defines.cpp files with your project rather than linking to the SS_Log.lib and SS_LogD.lib files.
Regardless of whether or not you #define _SS_LOG_ACTIVE, you can still eliminate ALL logging by setting the "LoggingDisabled" value in the registry to 1 (or anything other than 0). Each instance of the SS_Log will read this value in during construction and obey it's value. The registry will be re-read when the user specify's a different registry key in a call to the SetRegistryKey function described above. Currently I have not provided a way to programmatically set this value. You must set this value in the registry manually (i.e. open regedit).
The Complete class documentation can be found at http://sslog.webhop.net.
Up to now, everything you've learned has been centered around the Global Log.  You are not limited to using this log, however. You can create as many "local logs" as you need. This will help you to keep different information separate (such as logging to separate logs per thread, per module, or however you'd like to organize it).
To create your own instance of the SS_Log class and log two messages to it, use the following code:
SS_Log myLog("MyServerName"); Log(&myLog, "This is my value: %d.", nMyValue); LogID(&myLog, nResourceID);
The first time you log a message, your instance will launch a new server (even if one has already been launched from the global log). All messages from this instance will be sent to that server. The server will close itself once this instance of the SS_Log is destructed.
You can access all the configuration functions just like in the global log, except that you don't use the macros:
20. DWORD myLog.SetFlags(DWORD dwFlags); 21. DWORD myLog.GetFlags(); 22. DWORD myLog.RemoveFlags(DWORD dwFlags); 23. DWORD myLog.AddFlags(DWORD dwFlags); 24. INT myLog.SetDestinationName(LPCTSTR szName); 25. INT myLog.ErasemyLog.(); 26. INT myLog.LimitOutputSize(DWORD dwSizeLimit); 27. INT myLog.GetLastError(); 28. INT myLog.SetRegistryKey(LPCTSTR szRegKey); 29. VOID myLog.UseServer(BOOL bUseServer); 30. BOOL myLog.Succeeded(); 31. VOID myLog.InstanceHandle(HANDLE hInstance); 32. DWORD myLog.GetRegistryFilters(); 33. BOOL myLog.SetRegistryFilters(DWORD dwRegFilters); 34. VOID LocalLogEnterFunction(SS_Log* pLog, LPCTSTR szFunctionName);
A couple things to note:
The viewer (or "window") and the server are both one app (SS_Log_Server.exe).
As described earlier, the
SS_Log class will
start an instance of the server when needed, and terminate that server when it
is done. What wasn't mentioned is that if you had the LOGTYPE_LOGTOWINDOW
flag set on any of the messages that were sent to the server and if the
filter in the registry is allowing LOGTYPE_LOGTOWINDOW
messages to be processed,
that instance of the SS_Log_Server will remain open and display its window even after the
SS_Log that started it
is destructed. This is so you can view the messages that were logged to the
window.
You can also start the SS_Log_Server.exe yourself and open logs saved for
sorting/filtering/printing/jumping to code (the print output
is weak at best... if anyone wants to have a go at improving it, I'll integrate
your code ;-). Files that have been written out with the file destination (the
LOGTYPE_LOGTOFILE
flag) and files that were saved by the viewer
itself can both be opened.
You can filter messages in two ways. The first is by filtering out messages as they come into the server. When using this method of filtering, the messages are simply thrown away, leave no way to retrieve them in the future (hence the "destructive" term).
You can turn these filters on and off by clicking on "Edit->Filter Incoming Server Messages (destructive)" in the server window (options that are grayed out are not supported in this filter mode). A dialog will pop up will checkboxes for each flag type (including user defined flag types, discussed in the Create You Own Filters section). For a message to arrive at its destination(s), at least 1 flag IN EACH GROUP must be set and the corresponding filter must be turned on.
You can also turn the filters on and off directly in the registry. They will
be located where you specified with a call to the SetRegistryKey(...)
function. If you never call that function, the SS_Log class defaults to
behaving as if you had called it and passed in "SS_Log" (see
SetRegistryKey(...)
).
Note that because these filters are maintained in the registry, they will remain active across separate "runs" of your program.
Rather than doing destructive filtering, you can leave all the Incoming Server Messages filters on and then do dynamic filtering in the viewer after your app has terminated. Click on "Edit->Filter Listview (non-destructive)" to see your options. In addition to turning on and off the flag type filters, you can filter by message text, filename, and message ID. You can also specify if all flags or only 1 flag must be set for the message to appear in the view.
Note that because these filters are maintained in the registry, they will remain active across separate "runs" of your program. This can be confusing if, for example, you forget that you left a message text filter on and none of your new messages seem to be showing up. Just turn off the filter and they will re-appear. Also note that when saving, ALL messages in the server will be saved to file, even if they are filtered out of the view by the view filters. Printing, however, prints only what is currently in the view, properly obeying the view filters.
Probably the neatest feature about the viewer is it's ability make Visual Studio jump to a file and line number. Just double-click on a logged message and Visual Studio will open that file and move to the line that produced the log (if there is not an instance of Visual Studio running, one will be launched). Note that the first time you do that, the viewer will need to install the SS_Log_AddIn.dll as a plug-in to VC++. Make sure you have that file in your %SYSTEMROOT% folder, and that there are no instances of VC++ running during the install.
It is very easy to expand the flags with the SS_Log class. The steps to do so are as follows:
SS_LogFilterType
,
defined as typedef enum SS_LogFilterType{...}
. Add a LOGTYPE_* entry to that
enum list (i.e. LOGTYPE_XYZ
) and just assign it the next bit available in line
(ex. LOGTYPE_XYZ = (1<<9)
).LOGTYPE_USERS
#define just below the
SS_LogFilterType
enum. Use the bitwise OR ("|") operator (ex.
#define LOGTYPEGROUP_USERS ( LOGTYPE_ADD_YOUR_TYPE_HERE | LOGTYPE_XYZ )
).SSLogFilter g_Filters[]
object and add
an entry to that array. The entry should include 3 items:LOGTYPE_XYZ
enum value you just added to the
SS_LogFilterType
enum.That's all! One you run your app for the first time (so the new registry entry can be written to the registry), the new filter will appear in the viewer's filter menus, and everything should work as expected. Note that all user flags are part of the levels/user group of flags (creating a destination flag is an exception, but requires much more effort).
You can create your own log destination by deriving a class from the
SSLogDestination
class. There are several overrides that you can implement
to receive notification of messages and configuration options sent from an SS_Log instance.
 It can be found in the stdafx.h file in the SS_Log_Server project, and
has the following accessor methods:
// Get INT MessageID (); INT ProcessingID (); DWORD Flags (); LPSTR Message (); LPSTR DateTime (); LPSTR Filename (); INT LineNumber (); MSGTYPE MessageType (); // Set VOID MessageID (INT nID); VOID ProcessingID (INT nID); VOID Flags (DWORD nFlags); VOID Message (LPSTR szMsg); VOID DateTime (LPSTR szDT); VOID Filename (LPSTR szFile); VOID LineNumber (INT nLine); VOID MessageType (MSGTYPE nType);
The message dispatching routine in the server (see the SSLogOutput.cpp file) will check
every 5 seconds to see whether or not the server has received new messages for dispatch. If there
are new messages, each destination will get an OnBeginUpdate
notification. Then, for
each new message, the server will call each destination's WillProcessMessage
function
to determine whether or not we will be logging the message. This function should return TRUE or FALSE
after checking the flags for the message passed in and comparing them against the currently
set filters. Note that the default implementation of WillProcessMessage
will handle most
destinations' needs.
If the WillProcessMessage
returns TRUE, the OnWriteMessage
function will be called for that message. Your class MUST override this function
and do with the message as you will at that point.
Once all new messages have been dispatched, the OnFinishUpdate
function
will be called as a notification that all messages are processed. If the server has
received a shutdown request from the SS_Log class, and if no other instances of the
SS_Log class are still bound to the server, then your derived class will then receive
the OnShutDownServer
message in case you need to do some cleanup.
All other override functions contain configuration data. You can retrieve the configuration
data from the LOGMESSAGE
's Message()
function (passed into the function
as the only parameter). The info will be returned in ANSI text format. Note that even though
the OnEraseLog
function has a LOGMESSAGE
parameter, no information
is currently stored in it.
Of course, you will need to add a flag to the SS_Log_Defines.h file as described in the
Creating Your Own Filters section. Note however, that you
should associate the flag with the Destinations group rather than with the Users group. You
will also need to create a new instance of your destination type during start up of the
server. This can be done in the SSLogOutput::CreateDestination
function
in the SSLogOutput.cpp file.
SetRegistryKey
function) is now stored in the registry at HKCU\Software\SS_Log\SS_Log. This
key is read in by the SS_Log_Server during startup, allowing it to access the
proper registry location (i.e. it's filters) even when the user launches the
app manually.Please feel free to ask questions, offer comments/suggestions, etc. I'm glad to listen and help.


{{ partial "header.html" . }} {{ partial "body_top.html" . }} {{ .Title }} Materials for class on {{ .Date.Format "Monday, January 2, 2006" }} {{ .Content }} {{ partial "footer.html" . }} {{ partial "body_bottom.html" . }}
Materials for class on {{ .Date.Format "Monday, January 2, 2006" }}


Schematic
In this circuit, A potentiometer is used in a potential divider to vary the analog input into the arduino. Since the pot was at a maximum of 10KΩ, I decided to use a smaller resistor (which was 1KΩ) so that I can read a greater range of values (which is between 0 to 930).
Sketch.js File
The sketch file from the hcde439-example repo is used. The graphData function is used to display the values of the potentiometer overtime. The portName variable is changed to suit the port used by the Arduino.
Console
The value is printed onto the browser console using the "console.log()" function in the sketch.js file.


A puppy mill is a dog breeding facility that focuses on profit with little cost and little care to the health to the dogs and the welfare of the animal not being their main priority.
￼Female dogs are bred at every opportunity with little to no recovery time between litters.After a few years, when they are physically depleted to the point that they can no longer reproduce they will be killed.Breeding dogs may not even get the chance to see sunlight before they die.
￼The food and water provided for the puppies is contaminated, crawling with bugs.Puppies can be malnourished and can get infections and diseases.
￼In the puppy mills dogs are often caged in a tight space, living in their own faeces and urine.Also since sick dogs are not removed from the caged area, meaning more dogs can become ill.
￼As their is no veterinary care in puppy mills, dogs are often riddle with disease, because of this the puppy will most likely have an medical issue ranging from heart worm to kidney disease.
￼Puppies in mills are often found with bleeding pawsas their feet falling through the wire cages, severe tooth decay, ear infections, dehydration and lesions on their eyes, which will most likley lead to blindness as they dont get treated correctly.
￼As the puppies are taken away from their mother at such a young age with no chance to bond during the first weeks, which is a crucial stage of their life it may lead to aggression,anxiety or shyness in the adult stage of their life.
￼On the unfortunate and rare occasion when an innocent person purchases a dog from a pet store, the dog becomes ill and in a worst case scenerio will die, this is because pet shops will sometimes get their stock from puppy mills for cost benefits.
￼The current law means that local authorities are licensed and are allowed to inspect dog breeding establishments within their jurisdiction, which should have gone some way to tackle puppy mills.Their is also a law that means the puppy can not be sold before its 8 weeks old, which is the age that it is ok to leave its mother.
￼The sad truth is that many puppies do die in the puppy mills this can be from illness and medical problmes or because the puppy mills are too full so they get rid off some dogs or that there are no adoptive homes menaing their are some left over.
￼This Charity helps raise awareness for puppy mills. Pup Aid also has great links to many animal charities whilst also hosting a charitable event mainly during the summer in which people turn up with the dogs to show support. Pup Aid also has some celebrity faces which should hopefully increase the chance of people gathering togther to help to support the cause.
Please visit their website to understand how you can help out


Dept Name:
Physics
Chemistry
History
Mathematics
Bengali
English
Botany
Zoology
Philosophy
Geography
Political Science
Sanskrit
Hindi
Accountancy
Economics
Password


| ddmatrix-norm {pbdDMAT} | R Documentation |
Computes the norm of a distributed matrix.
## S4 method for signature 'ddmatrix,ANY' norm(x, type = c("O", "I", "F", "M", "2"))
x |
numeric distributed matrices. |
type |
character. Determines which matrix norm is to be used. |
Returns a number.
## Not run: # Save code in a file "demo.r" and run with 2 processors by # > mpiexec -np 2 Rscript demo.r library(pbdDMAT, quiet = TRUE) init.grid() comm.set.seed(diff=T) x <- ddmatrix("rnorm", 10, 10) nrm <- norm(x) comm.print(nrm) finalize() ## End(Not run)


shopping_cart Shop
Using our convenient web app, you'll get all the power of gFood without having to call your order in. Order in your pajamas, order 24 hours a day, order on Christmas, we're here to serve you.
local_shipping Fast Delivery
You've never seen ordering this quick.  We'd ask what that is, but gFood respects your privacy.
attach_money Great Deals
Money: You've got it, we want it. But let it never be said we're not incredibly fair! Burger sales? Check. Pizza sales? Check. Burger and pizza sales?? Check, check, check! We seriously can't stop making deals.


V Beauty
Home
Products
Cart
About
Cart
Rose Cream
$15.99
1
2
3
4
Honey Cream
$29.99
1
2
3
4
Moisturizing Eyecream
$29.99
1
2
3
4
Cart Total
Subtotal:
$ 75.97
Tax:
$ 6.84
Total:
$ 82.81
Proceed to Check Out


jquery.dys
Example:
One
Two
Three
Four
Cascading Stylesheet
Hyper Text Markup Language
Javascript
Syntactically Awesome Stylesheet
Ruby on Rails
©
effone
, 2018


| Test Suite |
| 1a User can not login with unexisted username |
| 1b User can not login with correct username and incorrect password |
| 1c User can not login with correct username and without password |
| 1d User can login with correct username and password |
| 2a User can see my world page after logged in |
| 3a User can read messages from own wall |


Lorem ipsum dolor sit amet consectetur adipisicing elit. Aperiam neque eligendi magnam itaque, tempora reprehenderit. Dolore ex at necessitatibus quia.
Hello Everyone Welcome to my page. Lorem ipsum dolor sit amet consectetur adipisicing elit. Laudantium, praesentium.Lets Start the Tour!!
HTML Element:
An HTML element is a type of HTML document component, one of several types of HTML nodes. HTML document is composed of a tree of simple HTML nodes, such as text nodes, and HTML elements, which add semantics and formatting to parts of document. Each element can have HTML attributes specified.
HTML-Tags:
HTML tags are like keywords which defines that how web browser will format and display the content. With the help of tags, a web browser can distinguish between an HTML content and a simple content. HTML tags contain three main parts: opening tag, content and closing tag. ... Each HTML tags have different properties.
HTML-Element Attributes:
HTML attributes provide additional information about HTML elements.
HTML: Attributes


Which types of Timeline events would you like to be displayed?
How many results would you like to see when viewing lists?
Would you like to receive email notifications of changes to things you are subscribed to?
Would you like to receive notifications from worklists you are subscribed to?


So I've done mushrooms before, but in a different way, I smoked them with a few of my friends not knowing till after I did that, that it was a real bad idea. I didn't really have that bad of an affect, especially since I smoked weed along with the mush and ended up burning out real fast. Last night I decided with my friend that we would eat all the much we bought. We bought 8 grams and went to my room to begin eating them.
We put on a movie and waited for the trip to begin, we ate them at about 9:15, and the magic started to begin around 10:00. I was staring at my light and it started beaming off rainbow lines, I looked over to my friend and started laughing so hard, and I couldnt stop. Everything around me was so funny, even my friends face, her pupils were enlarged to the max, and I wanted to take a picture of it so bad, but couldn't focus on anything but laughing.
We decided to go on the computer to talk to people and tell them what we were doing. I signed on to msn, and went on webcam for one of my friends and the computer screen expanded sideways and all I could see was my face melting, and my body turn to liquid. I felt like my body was evaporating and that there was nothing I could do, or anyone else either. I turned off the computer and started to call people so I could get out of my house and experience the outdoors. No one would stay on the phone with me for longer than 5 minutes, everyone was hanging up, I felt as if the world hated me, and that the house was capturing me and telling me to stay inside and not socialize. I became depressed and scared and didn't know what to do.
We ended up deciding to go out for a walk for some air (not a good idea). There were so many people out walking, and I somehow felt bigger and stronger than everyone else. The houses looked like doll houses and I felt giant, and that I didn't fit in. I saw a man walking by me and he had the face of a zombie, a scary zombie with a black hollow face. I was so scared, I couldn't continue the walk, I had to turn around and get home.
We stayed in my room most of the night, where the trip became horrifying, I was laying on my bed paralyzed, I couldn't move, and no one could help me. I was melting into the sheets, and I couldn't breathe. I just wanted it all to end, I kept closing me eyes, but every time I did voices would talk to me and I'd see scary pictures, such as people puking everywhere, and people slitting each other throats. I couldn't take it anymore, and there was nothing I could do to make it stop. My friend told me water will help calm me down, and so the next thing I know I'm standing in my shower. I had no idea why or what I was supposed to be doing, so I started shampooing and conditioning my hair. I kept talking to the shower cap as if it were my friend.
The hot temperature of the water was so friendly to me, I didn't want to leave the bathroom, but I realized my friend was all alone and I didn't want to be alone anymore. I got out and didn't even bother drying myself off with a towel, I felt so free! I walked into my room and threw on clothes even though I was drenched, and I layed down beside my friend, and molded to my bed. I couldn't even think straight, everything I said made no sense but she understood me so well. She was the only thing I had, I felt as though my life was in her hands.
The room started changing shape around me and I felt as if everything was shrinking and I was getting bigger and bigger. I kept trying to make everything end by sleeping, my body was exhausted but my mind was so alive, and I wanted to keep talking. I couldn't stop moving my legs, every time I'd stop moving I thought I was going to collapse and be taken away into a black hole that was in the corner of my room, it was calling me into it, and I was paranoid that I'd never be the same way I was ever again.
I had to pee so bad, but my room was the only place I could be, I was paralyzed, and the washroom was the enemy and I felt as if it would keep me in there and never let me out if I went into it. My friend made me get up to go pee, and I came back into the room and felt so much better, my trip was a completely different situation now. Everything in my room had a meaning, and was special to me in every way.  My room was the place I was meant to be, I felt so safe, and nothing outside of my room never existed, it was all a memory. I looked at the clock and realized the clock wasn't moving, the hands weren't moving at all, I had accomplished so many things in all of 3 minutes, I was living for the moment. Everything I had done before I was happy never happened.
I was starting to come back to normal, things were starting to wear off, and as it did I felt so much better about myself, my life had meaning and I felt as if I should share with people and make them happy to. I still couldn't fall asleep, my mind was still wired and wanted to keep looking at everything in the room changing shapes and sizes.
I finally ended up coming off the trip, which I was so happy about. My body was tired, and so was I now. I leaned over to my friend and the both of us both just couldn't believe what had happened to us.
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.


Lobster Facts
How to prepare a Lobster for Boiling
Most people cook lobsters by simply throwing them into a pot of boiling water. While this method may get the job done, it certainly leaves a lot to be desired as far as quality goes. Boiling flushes much of the flavor out of the lobster and the resulting stock will most likely be too weak in its unreduced state to offer any kind of sauce making ability.
It is far more desirable to steam a lobster in a flavored broth of herbs and wine. Steaming will lock in much of the flavor of the lobster while the juices that manage to escape will be caught in a highly reduced stock. This stock can later be used to create a variety of sauces to accent the boiled lobster.
Rinse the lobsters with cold running water then kill them by inserting a knife where the tail and body meet. Find a stockpot that is big enough to hold the lobsters and has a tight fitting lid. Add about 2 cups of water, wine, or clam juice or any combination of liquid you desire to the stockpot with whatever herbs you like and bring the stock to a boil. Shallots, parsley, peppercorns, or bay leaves are all components of a court bouillon and will give a nice flavor to the stock. Avoid ground peppers or salt at this point. These are enhancing or finishing spices and are not easy to control when added early.
Once the stock is boiling, add the lobsters and replace the cover. Steam the lobsters for about 12 minutes or until they are bright red and the tails spring back when straightened then released. Remove the lobsters and place in an oven set to warm until you are ready to serve them. Use the lobster stock to make a sauce of your own design or try our recipe for Steamed Lobster with Parsley Wine Sauce.
Once the stock is boiling, add the lobsters and replace the cover. Steam the lobsters for about 12 minutes or until they are bright red and the tails spring back when straightened then released. Remove the lobsters and place in an oven set to warm until you are ready to serve them. Use the lobster stock to make a sauce of your own design or try our recipe for Steamed Lobster with Parsley Wine Sauce.
How to prepare a Lobster for Broiling
There really is no way to prepare a lobster for broiling that is completely humane. Our advice is that you move quickly but carefully as you prepare your lobsters for broiling.
Place the lobster on its stomach on a cutting board and while firmly holding its body use a cleaver or a heavy French knife to remove the claws and legs. The lobster will instinctively curl its tail when you remove its claws.
Next, place the lobster on its back and firmly grasp the tail. Insert a sharp boning knife into the abdomen where it meets the tail and draw the knife towards the head.
Next, reverse the procedure, this time holding the lobster by the body while drawing the knife from the cut in the abdomen along the tail. Take special care not to cut through the shell along the back of the lobster.
The next step is to split the lobster. This is best done by simply pressing down with the fingers and thumbs on each side of the lobster until the shell cracks open and the interior of the tail and body cavity are exposed. All of the lobster is edible except for the stomach, which is the hard sac near the head, and the intestinal vein. Remove and discard these parts.
The greenish liver or tomalley and coral are edible and can be prepared in a stuffing or left in the lobster during cooking. In all of our recipes we will remove and discard everything within the body cavity. The reason we don’t use the tomalley and coral is tomalley can be bitter in flavor at times and most people today just do not find the coral to be as appealing as past generations have.
We suggest that the lobster be thoroughly washed under cold running water before proceeding with a recipe. The claws may be boiled or steamed and shelled to provide lobster meat for a stuffing or they may be broiled and served as a garnish with the lobster.


THE HIGH CRUSADE (1994) A Film Review Copyright Dragan Antulov 2001
Roland Emmerich might be criticised of many things, but lacking enthusiasm for his films is not one of them. Unfortunately, although enthusiasm often happens to be one of the major ingredients of success, it is never the only one. In case of Emmerich, his constant efforts to realise childhood dream of toping STAR WARS and making the best science fiction film of all times never produced desired results. Emmerich failed even when satisfying with the role of producer, like in the case of THE HIGH CRUSADE, 1994 German science fiction directed by Klaus Knoesel and Holger Neuh"user.
Failure of this film was especially painful for the fans of Poul Anderson, whose popular 1960 novel was the basis for the script. The plot begins in the year 1345 in England, when the group of English noblemen led by Sir Roger of Jernyngham (played by Rick Overton) just begins to prepare to go on the crusade and liberate Holy Land from the Muslims. In the midst of their preparations, an alien spaceship lands and attacks their castle. However, it turns out that even the technologically superior aliens aren't good match for the sheer brutality of medieval knights - Sir Roger and his men manage not only to repeal the attack but also to take control of the ship. Crusaders, equipped with this miracle of alien technology, want to go to Jerusalem and fulfil their mission but the crusade they are going to take part would lead them much further.
The basic concept of the original novel - first contact between medieval knights and extraterrestrials - probably looked quite silly to the filmmakers, so they decided to make film into comedy. Unfortunately, they also believed that the concept would be not only silly but also funny enough to make audience laugh throughout the whole movie. This was not the case, partly because the whole concept had one important flaw - humour based on cultural clash didn't connect with the modern audiences. For them both the extraterrestrials and the medieval knights were equally alien. So THE HIGH CRUSADE ended like a disorganised and not very funny mix of MONTY PYTHON AND HOLY GRAIL, LES VISITEURS, at times very impressive special effects and not very convincing aliens. The general impression of film is somewhat improved thanks to the very good cast (although at times underused, like in the case of MTV's host Jay Cokes) led by John Rhys-Davies who is very good in the role of Brother Parvus. However, THE HIGH CRUSADE is nevertheless hardly anything more than often boring and incredibly unfunny farce and another proof that good literature seldom results in good films.
RATING: 3/10 (+)
Review written on September 22nd 2001
Dragan Antulov a.k.a. Drax E-mail<EMAIL_ADDRESS>http://www.film.purger.com - Filmske recenzije na hrvatskom/Movie Reviews in Croatian
========== X-RAMR-ID: 29567 X-Language: en X-RT-ReviewID: 251150 X-RT-TitleID: 1076745 X-RT-AuthorID: 1307 X-RT-RatingText: 3/10
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Specify the language with hljs-language directive.
hljs-language
Highlight.js auto-detection.
The same piece of code highlight with perl syntax.
perl


| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | package org.apache.commons.math3.optim.nonlinear.scalar; | |
| 18 | ||
| 19 | import java.util.Collections; | |
| 20 | import java.util.List; | |
| 21 | import java.util.ArrayList; | |
| 22 | import java.util.Comparator; | |
| 23 | import org.apache.commons.math3.exception.NotStrictlyPositiveException; | |
| 24 | import org.apache.commons.math3.exception.NullArgumentException; | |
| 25 | import org.apache.commons.math3.random.RandomVectorGenerator; | |
| 26 | import org.apache.commons.math3.optim.BaseMultiStartMultivariateOptimizer; | |
| 27 | import org.apache.commons.math3.optim.PointValuePair; | |
| 28 | ||
| 29 | /** | |
| 30 | * Multi-start optimizer. | |
| 31 | * | |
| 32 | * This class wraps an optimizer in order to use it several times in | |
| 33 | * turn with different starting points (trying to avoid being trapped | |
| 34 | * in a local extremum when looking for a global one). | |
| 35 | * | |
| 36 | * @version $Id$ | |
| 37 | * @since 3.0 | |
| 38 | */ | |
| 39 | public class MultiStartMultivariateOptimizer | |
| 40 | extends BaseMultiStartMultivariateOptimizer<PointValuePair> { | |
| 41 | /** Underlying optimizer. */ | |
| 42 | private final MultivariateOptimizer optimizer; | |
| 43 | /** Found optima. */ | |
| 44 | private final List<PointValuePair> optima = new ArrayList<PointValuePair>(); | |
| 45 | ||
| 46 | /** | |
| 47 | * Create a multi-start optimizer from a single-start optimizer. | |
| 48 | * | |
| 49 | * @param optimizer Single-start optimizer to wrap. | |
| 50 | * @param starts Number of starts to perform. | |
| 51 | * If {@code starts == 1}, the result will be same as if {@code optimizer} | |
| 52 | * is called directly. | |
| 53 | * @param generator Random vector generator to use for restarts. | |
| 54 | * @throws NullArgumentException if {@code optimizer} or {@code generator} | |
| 55 | * is {@code null}. | |
| 56 | * @throws NotStrictlyPositiveException if {@code starts < 1}. | |
| 57 | */ | |
| 58 | public MultiStartMultivariateOptimizer(final MultivariateOptimizer optimizer, | |
| 59 | final int starts, | |
| 60 | final RandomVectorGenerator generator) | |
| 61 | throws NullArgumentException, | |
| 62 | NotStrictlyPositiveException { | |
| 63 | super(optimizer, starts, generator); | |
| 64 | this.optimizer = optimizer; | |
| 65 | } | |
| 66 | ||
| 67 | /** | |
| 68 | * {@inheritDoc} | |
| 69 | */ | |
| 70 | @Override | |
| 71 | public PointValuePair[] getOptima() { | |
| 72 |
1
1. getOptima : removed call to java/util/Collections::sort → SURVIVED |
Collections.sort(optima, getPairComparator()); |
| 73 |
1
1. getOptima : mutated return of Object value for org/apache/commons/math3/optim/nonlinear/scalar/MultiStartMultivariateOptimizer::getOptima to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return optima.toArray(new PointValuePair[0]); |
| 74 | } | |
| 75 | ||
| 76 | /** | |
| 77 | * {@inheritDoc} | |
| 78 | */ | |
| 79 | @Override | |
| 80 | protected void store(PointValuePair optimum) { | |
| 81 | optima.add(optimum); | |
| 82 | } | |
| 83 | ||
| 84 | /** | |
| 85 | * {@inheritDoc} | |
| 86 | */ | |
| 87 | @Override | |
| 88 | protected void clear() { | |
| 89 |
1
1. clear : removed call to java/util/List::clear → SURVIVED |
optima.clear(); |
| 90 | } | |
| 91 | ||
| 92 | /** | |
| 93 | * @return a comparator for sorting the optima. | |
| 94 | */ | |
| 95 | private Comparator<PointValuePair> getPairComparator() { | |
| 96 |
1
1. getPairComparator : mutated return of Object value for org/apache/commons/math3/optim/nonlinear/scalar/MultiStartMultivariateOptimizer::getPairComparator to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return new Comparator<PointValuePair>() { |
| 97 | public int compare(final PointValuePair o1, | |
| 98 | final PointValuePair o2) { | |
| 99 |
1
1. compare : negated conditional → SURVIVED |
if (o1 == null) { |
| 100 |
2
1. compare : negated conditional → NO_COVERAGE 2. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return (o2 == null) ? 0 : 1; |
| 101 |
1
1. compare : negated conditional → SURVIVED |
} else if (o2 == null) { |
| 102 |
1
1. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return -1; |
| 103 | } | |
| 104 | final double v1 = o1.getValue(); | |
| 105 | final double v2 = o2.getValue(); | |
| 106 |
2
1. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → SURVIVED 2. compare : negated conditional → KILLED |
return (optimizer.getGoalType() == GoalType.MINIMIZE) ? |
| 107 | Double.compare(v1, v2) : Double.compare(v2, v1); | |
| 108 | } | |
| 109 | }; | |
| 110 | } | |
| 111 | } | |
Mutations | ||
| 72 |
1.1 |
|
| 73 |
1.1 |
|
| 89 |
1.1 |
|
| 96 |
1.1 |
|
| 99 |
1.1 |
|
| 100 |
1.1 2.2 |
|
| 101 |
1.1 |
|
| 102 |
1.1 |
|
| 106 |
1.1 2.2 |


General
Analyze private images
Automatic page language recognition
Default labeling language
German
English
Spanish
Italian
Image labeling
Insert your Clarifai key
Accuracy threshold
Text recognition
Enable text recognition
Insert your OCR.Space key
Apply
Restore defaults


Telethon API
This documentation was generated straight from the scheme.tl
provided by Telegram. However, there is no official documentation per se
on what the methods, constructors and types mean. Nevertheless, this
page aims to provide easy access to all the available methods, their
definition and parameters.
Although this documentation was generated for Telethon, it may be useful for any other Telegram library out there.
Index
Methods
Currently there are {method_count} methods available for the layer
{layer}. The complete list can be seen here.
Methods, also known as requests, are used to interact with
the Telegram API itself and are invoked with a call to .invoke()
.
Only these can be passed to .invoke()
! You cannot
.invoke()
types or constructors, only requests. After this,
Telegram will return a result
, which may be, for instance,
a bunch of messages, some dialogs, users, etc.
Types
Currently there are {type_count} types. You can see the full list here.
The Telegram types are the abstract results that you receive
after invoking a request. They are "abstract" because they can have
multiple constructors. For instance, the abstract type User
can be either UserEmpty
or User
. You should,
most of the time, make sure you received the desired type by using
the isinstance(result, Constructor)
Python function.
When a request needs a Telegram type as argument, you should create
an instance of it by using one of its, possibly multiple, constructors.
Constructors
Currently there are {constructor_count} constructors. You can see the full list here.
Constructors are the way you can create instances of the abstract types described above, and also the instances which are actually returned from the functions although they all share a common abstract type.
Core types
Core types are types from which the rest of Telegram types build upon:
- int:
The value should be an integer type, like 42.
It should have 32 bits or less. You can check the bit length by
calling
a.bit_length()
, wherea
is an integer variable. - long: Different name for an integer type. The numbers given should have 64 bits or less.
- int128: Another integer type, should have 128 bits or less.
- int256: The largest integer type, allowing 256 bits or less.
- double: The value should be a floating point value, such as 123.456.
- Vector<T>:
If a type
T
is wrapped aroundVector<T>
, then it means that the argument should be a list of it. For instance, a valid value forVector<int>
would be[1, 2, 3]
. - string: A valid UTF-8 string should be supplied. This is right how Python strings work, no further encoding is required.
- Bool:
Either
True
orFalse
. - true:
These arguments aren't actually sent but rather encoded as flags.
Any truthy value (
True
,7
) will enable this flag, although it's recommended to useTrue
orNone
to symbolize that it's not present. - bytes:
A sequence of bytes, like
b'hello'
, should be supplied. - date:
Although this type is internally used as an
int
, you can pass adatetime
object instead to work with date parameters.
Full example
The following example demonstrates:
- How to create a
TelegramClient
. - Connecting to the Telegram servers and authorizing an user.
- Retrieving a list of chats (dialogs).
- Invoking a request without the built-in methods.
#!/usr/bin/python3 from telethon import TelegramClient from telethon.tl.functions.messages import GetHistoryRequest from telethon.utils import get_input_peer # (1) Use your own values here api_id = 12345 api_hash = '0123456789abcdef0123456789abcdef' phone_number = '+34600000000' # (2) Create the client and connect client = TelegramClient('username', api_id, api_hash) client.connect() # Ensure you're authorized if not client.is_user_authorized(): client.send_code_request(phone) client.sign_in(phone, input('Enter the code: ')) # (3) Using built-in methods dialogs, entities = client.get_dialogs(10) entity = entities[0] # (4) !! Invoking a request manually !! result = client.invoke( GetHistoryRequest( get_input_peer(entity), limit=20, offset_date=None, offset_id=0, max_id=0, min_id=0, add_offset=0)) # Now you have access to the first 20 messages messages = result.messages
As it can be seen, manually invoking requests with
client.invoke()
is way more verbose than using the built-in
methods (such as client.get_dialogs()
. However, and given
that there are so many methods available, it's impossible to provide a nice
interface to things that may change over time. To get full access, however,
you're still able to invoke these methods manually.