Kernel Based Methods
Posted on Sat 21 January 2017 in Learning
KERNEL?
Do Read : http://www.eric-kim.net/eric-kim-net/posts/1/kernel_trick.html
A Kernel Function \(K(\vec{v},\vec{w})\) is a function \(K:\Re^N \times \Re^N \rightarrow \Re\) that obeys certain mathematical properties.
For an intermediate definition, think of the kernel function as one that computes a dot product between \(\vec{v}, \vec{w}\).
Linear SVM, Binary Classification
Suppose that we have a 2-class dataset \(D\), and wewish to train a classifier \(C\) to predict the class labels of future data points. This is known as binary classification
problem, and can be cast as Yes/No
questions such as :
-
Medicine :
Given a patient's vital data, does the patient have a cold?
-
Computer Vision :
Does the image contain a person?
A popular off-the-shelf classifier is the Support Vector Machine (SVM), so we will use this as our classification algorithm.
Binary vs. Multiclass Classification
Binary classifiers are often the focus due to their simpler presentation.
However, many problems inherently have more than 2 possible outcomes.
For instance,
To train a face verification system that can detect the identity of a photograph from a pool of \(N\) people (where $N \gt 2 $).
This sort of problem is known as a Multiclass
classification problem.
Most mathematical definitions are binary classifiers.
There are 2 main approaches to the Multiclass
problem :
- Directly add a multiclass extension to a binary classifier.
- Pros: Provides a principled way of solving the muticlass problem.
-
Cons : Multiclass extensions tend to be much more complicated than the original binary formulation. This may lead to significantly longer training and test procedures. Even worse, experimental results may not be that much better than ad-hoc methods like (2).
-
Combine multiple binary classifiers to create a 'mega' multi-multiclass classifier. 2 popular implementations of this idea are the
"One-versus-One" (OVO)
and"One-versus-All" (OVA)
scheme. -
Pros : Simple idea, easy to implement, can be much faster than multiclass extensions. Some people suggest that empirical results tend to be on par with (1).
- Cons : Ultimately, it is an ad-hoc method for solving the multiclass problem - there may exist datasets for which OVO?OVA will perform poorly on, but general multiclass classifiers (1) perform well on.
Recall that a Linear SVM finds a hyperplane \(\vec{w}\) that best separates the data points in the training set by class label.
\(\vec{w}\) is called the decision boundary, and cuts the space into 2 halves : one half for class '0', and the other half for class '1'.
To classify a point \(x_i \epsilon X\) (where \(X\) is the dataset), we simply see which 'side' of \(\vec{w}\) that \(x_i\) lies.
Note: This description only applies to binary classification problems.
A sample dataset :
Training and evaluating a linear SVM on this dataset yields the following decision boundary.
Because the data is easily linearly separable, the SVM is able to find a margin that perfectly separates the training data, which also generalizes very well to the test set. The hyperplane (a line in ) separates the space into two halves: points that live in the brownish region are classified as class '1', whereas points that live in the blueish region are classified as class '0'.
Unfortunately, in practice we will not always encounter such well-behaved datasets.
Let's take a look at a dataset that is not linearly separable.
A Linearly Nonseparable Dataset
The above dataset is a synthetically generated dataset.
==== Evaluating Random Classifier
== Accuracy: 0.45
precision recall f1-score support
0 0.74 0.42 0.53 151
1 0.23 0.55 0.33 49
avg / total 0.62 0.45 0.48 200
==== Finished Random Classifier (0.000 s)
==== Evaluating SVM (kernel='linear'), 2-fold cross validation
Parameters to be chosen through cross validation:
C: [1.0, 10.0, 100.0, 1000.0, 10000.0]
== Best Params: {'kernel': 'linear', 'C': 1.0}
== Best Score: 0.476666666667
== Accuracy: 0.445
precision recall f1-score support
0 0.78 0.37 0.50 151
1 0.26 0.67 0.37 49
avg / total 0.65 0.45 0.47 200
==== Finished Linear SVM (1.290 s)
As we can see, the RandomClassifier and Linear SVM both perform poorly. It's always a bummer when our classifier is as bad as random guessing!
To get a geometric sense of the SVM's failure to cope with this dataset, see the above figure for the decision boundary.
Dealing with Nonseparable Data
Obviously, we would like to handle linearly nonseparable data - otherwise, SVMs wouldn't be very useful.
In the SVM example, the primary obstacle is the constraint that the decision boundary be linear in the original feature space (here,\(\Re^2\) ).
However, this is not always the correct decision boundary to find. For instance, in Figure 4, a better decision boundary would be a circular decision boundary that separates the outer cyan ring from the inner red ring.
Could we generalize the SVM formulation to explicitly discover decision boundaries with arbitrary shape?
As it turns out, if you get into the nitty-gritty mathematical details of the SVM, the derivations assume that the decision boundary is a separating hyperplane \(\vec{w}\).
-
I imagine there is a way to recast the SVM optimization problem such that a more-general decision surface can be found, but I'd bet that the resulting optimization would carry a significant computational burden when compared to the linear SVM formulation.
-
So, it appears that we are stuck with an SVM that, for an N-dimensional dataset, finds an (N-1)-dimensional separating hyperplane.
What if we could play with N...?
IDEA !
Separable in a higher dimension
Let's think outside the box for a moment.
Consider the linearly nonseparable dataset in the above figure (left), with its two concentric rings.
Imagine that this dataset is merely a 2-D version of the 'true' dataset that lives in \(\Re^3\), the above figure (right).
The \(\Re^3\) dataset is easily linearly separable by a hyperplane. Thus, provided that we work in this \(\Re^3\) space, we can train a linear SVM classifier that successfully finds a good decision boundary.
However, we are given the dataset in \(\Re^2\).
The challenge is to find a transformation \(T:\Re^2\) -> \(\Re^3\), such that the transformed dataset is linearly separable in \(\Re^3\).
In the above figure, the \(T\) used is :
which after applied to every point on the left, yields the linearly separable dateset on the right.
Note : It is a convention to use the Greek letter 'phi' \(\phi\) for this transformation, so \(\phi\) will be used from hereon.
Assuming we have such a transformation \(\phi\), the new classification pipeline is as follows.
First transform the training set \(X\) to \(X'\) with \(\phi\). Train a linear SVM on \(X'\) to get classifier \(f_{svm}\). At test time, a new example \(\vec{x}\) will first be transformed to \(\vec{x'}=\phi(\vec{x})\). The output class label is then determined by :\(f_{svm}(\vec{x'})\)
Observation : This is exactly the same as the train/test procedure for regular linear SVMs, but with an added data transformation via \(\phi\).
In the next figure, note that the hyperplane learned in \(\Re^3\) is non-linear when projected back to \(\Re^2\). Thus, we have improved the expressiveness of the Linear SVM classifier by working in a higher-dimnensional space.
Recap :
A dataset \(D\) that is not linearly separable in \(\Re^N\) may be linearly separable in a higher-dimensional space \(\Re^M\) (where \(M \gt N\)). Thus, if we have a transformation \(\phi\) that lifts the dataset \(D\) to a higher-dimensional \(D'\) such that \(D'\) is linearly separable, then we can train a linear SVM on \(D'\) to find a decision boundary \(\vec{w}\) that separates the classes in \(D'\). Projecting the decision boundary \(\vec{w}\) found in \(\Re^M\) back to the original space \(R^N\) will yield a nonlinear decision boundary.
This means that we can learn nonlinear SVMs while still using the original Linear SVM formulation!
Caveat : Impractical for large dimensions
The scheme described so far is attractive due to its simplicity : we only modify the inputs to a 'vanilla' linear SVM. However, consider the computational consequences of increasing the dimensionality from \(R^N\) to \(R^M\) (with \(M \gt N\)). If \(M\) grows very quickly with respect to \(N\) (e.g. \(M\) \(\epsilon\) \(O (2^N)\)), then learning SVMs via dataset transformations will incur serious computational and memory problems!
Here is a concrete example : the Polynomial Kernel is a kernel often used with SVMs. For a dataset in \(\Re^2\) a two-degree polynomial kernel (implicitly) performs the transfromation \([x_1,x_2]=[x_1^2,x_2^2,\sqrt{2}\cdot x_1 \cdot x_2, \sqrt{2 \cdot c}\cdot x_2, c]\).
This transformation adds three additional dimensions \(\Re^2\) -> \(\Re^5\).
In general, a d-dimensional polynomial kernel maps from \(R^N\) to an \(\binom{N+d}{d}\)- dimensional space. Thus, for datasets with large dimensionality, naively performing such a transformation will quickly become intractable.
We only need the dot products!
It turns out that the SVM has no need to explicitly work in the higher-dimensional space at training or testing time.
One can show that during training, the optimization problem only uses the training examples to compute pair-wise dot products \(<\vec{x_i},\vec{x_j}>\), where \(\vec{x_i},\vec{x_j}\) \(\epsilon\) \(\Re^N\).
Why is this significant?
It turns out that there exist functions that, given 2 vectors \(\vec{v}\) and \(\vec{w}\) in \(\Re^N\), implicitly computes the dot product between \(\vec{v}\) and \(\vec{w}\) in \(\Re^M\) **without explicitly transforming \(\vec{v}\) and \(\vec{w}\) to \(\Re^M\).
Such functions are called kernel functions \(K(\vec{v},\vec{w})\).
The implications are:
-
By using a kernel \(K(\vec{x_i},\vec{x_j})\), we can implicitly transform datasets to a higher-dimensional \(\Re^M\) using no extra memory, and with a minimal effect on computation time.
-
The only effect on computation is the extra time required to compute \(K(\vec{x_i},\vec{x_j})\). Depending on \(K\), this can be minimal.
-
By virtue of (1), we can efficiently learn non-linear decision boundaries for SVMs simply by **replacing al dot products in the SVM computation with \(K(\vec{x_i},\vec{x_j})\).
The usage of kernel functions to achieve benefits (1) and (2) is the "Trick" in the "Kernel Trick"
Kernel functions,
In this context, a Kernel function is a function $ K : \Re^N \times \Re^N \rightarrow \Re $. There are some important mathematical properties that must be obeyed in order to be considered a proper kernel function.
Intuition
A kernel \(K\) effetively computes dot products in a higher-dimensional space \(R^M\) while remaining in \(R^N\).
In symbols :
For \(\vec{x_i},\vec{x_j}\) \(\epsilon\) \(\Re^N\), \(K(\vec{x_i},\vec{x_j})={<\Phi(\vec{x_i}),\Phi(\vec{x_j})>}_M\), where \({<\cdot,\cdot>}_M\) is an inner product of \(\Re^M\), \(M \gt N\), and \(\Phi(\vec{x})\) transforms \(\vec{x}\) to \(\Re^M(\Phi : \Re^N \rightarrow \Re^M)\)
The surprise here being the fact that the Kernel Function can compute dot products between \(\vec{v},\vec{w} \in \Re^N\) in \(\Re^M\) with a function \(K\) that works exclusively in \(R^N\).
Popular Kernels
Most off-the-shelf classifiers allow the user to specify one of three popular kernels: the polynomial,radial basis function, and sigmoid kernel.
For instance, sklearn's SVM implementation svm
. SVC has a kernel parameter which can take on linear
,poly
,rbf
or sigmoid
.
You can even pass a custom kernel.
For the following, let \(\vec{x_i},\vec{x_j} \in \Re^N\) be rows from the dataset \(X\).
-
Polynomial Kernel :
$${(\gamma \cdot <\vec{x_i},\vec{x_j}> + r)}^d$$ -
Radial Basis Function (RBF) Kernel:
$$exp(- \gamma \cdot {|\vec{x_i} - \vec{x_j}|}^2 )$$, where \(\gamma \gt 0\). -
Sigmoid Kernel :
Note : For some reason, sklearn's
svm.SVC
appears to use both thegamma
andcoef0
parameters for thekernel = sigmoid
, despite the above definition only having one parameterr
. Not cross-validating across bothgamma
andcoef0
resulted in degenerate decision boundaries.
Choosing the correct kernel
is a non-trivial
task.


Because pictures speak more than words
We are efficient in handling every conceivable type of event, whether corporate, party, wedding, or any other event. Events range from small group meetings to arena-size conferences, concert sound systems, or anything else; nothing is difficult for us to handle.


940 NORTH GEORGIA, BLUE RIDGEMOUNTAIN RESORTS CABIN
+9-684-591-713 +1-305-449-0888
<EMAIL_ADDRESS>www.pension.com


--- layout: page title: "end of the line." subtitle: "404 Error - Page not found" permalink: /404.html comments: false share: false ---


Speech
Lord McNally’s speaking note for Westminster Legal Policy Forum event
Lord McNally's speaking note covers social mobility within the legal professions and judicial diversity.
Thank you for inviting me here today. I am also particularly pleased to see Lord Justice Goldring and Lady Justice Black here as well, as this demonstrates the importance that the government, the Judiciary and the JAC place on these issues.
This policy forum deals with 2 very important issues: social mobility within the legal professions and judicial diversity. I was delighted to see on the agenda discussions on work that either is or could be done to help increase social mobility, inclusivity and diversity within the legal professions. It is reassuring to know that these are recognised as real issues which need to be addressed.
I am also pleased to see on the agenda a discussion about the work being done with regards to legal education. With a changing legal services market, legal education and training must keep pace. This means building on the foundations already in place and taking the opportunity to look critically at how education and training is delivered now and in the future.
I very much welcome the current review of legal education and training, and support the legal profession’s collaborative approach to work in this important area. I look forward to seeing how the legal education and training review develops.
It is important that we collectively do all we can to encourage an independent, strong, diverse and effective legal profession indeed this is one of the regulatory objectives enshrined in the Legal Services Act 2007. It is therefore encouraging to see the profession actively taking forward initiatives in these areas.
The changing profile of the profession is encouraging. It is evolving into a more inclusive and diverse one. However, we are not quite there yet, and I feel we are still playing catch up with the realities of Britain in the 21st century. Despite seeing greater diversity at entry level, the picture looks less promising when you look at the more senior levels, an issue often compounded by retention and progression within the professions.
And what does this have to do with judicial diversity?
Well, we cannot expect to make significant progress in increasing the diversity of the judiciary unless we see a positive change in the diversity of the eligible pool, hence, the importance of all the work being done to increase mobility and diversity within the legal professions.
I am not just talking about diversity in ethnicity and gender terms; but also in terms of the representation of barristers, solicitors, fellows of the Chartered Institute of Legal Executives and members of the employed legal professions, who are all eligible to apply for certain judicial offices.
The judiciary play a critical role in the administration of justice. It is therefore essential, as with the legal professions, that the diverse society in which we live is represented by those who hold judicial offices.
Although some progress has been made in this area, such progress has been slow and the more visible progress has been confined to the lower courts. It is still the case that after eight years Baroness Hale remains the sole woman on the Supreme Court and we still do not have a single ethnic minority judge in the Court of Appeal or above. Of course judges must always be appointed on merit; however increasing the diversity of the judiciary is not incompatible with this principle. We need to ensure barriers to progression faced by underrepresented groups are removed that we have a sufficiently diverse pool of eligible candidates from which to pick our judges and that there are no catch 22 in the selection process.
We must ensure that opportunities for judicial office are seen in a more positive and progressive light, and that those eligible members of the legal professionals are actively encouraged to apply for a judicial office.
The government is doing its part in increasing the diversity of the judiciary, and we are committed to this. The Ministry of Justice recently published on 11th May its response to consultation on judicial appointments and diversity, outlining the policy changes taken forward in the Crime and Courts Bill, which was introduced in the House of Lords on 10th May. These changes include introducing part-time working into the senior courts and allowing the use of a ‘tipping point’ principle when 2 candidates are indistinguishable on merit so as to enhance the diversity of judicial office holders.
We strongly believe in the changes we are making and their potential to help with the problem of judicial diversity.
Appointments will continue to be made on merit, but the introduction of our changes could enable the diversity of the judiciary to increase.
Today I hope I have re-affirmed the government’s commitment to increasing diversity both within the judiciary and within the legal professions, and the government’s commitment to providing leadership in this area.
I am under no illusion that there is no single solution to the issue of increasing diversity. But, even though I started my career as a Fabian, I do not think this is a matter which will be solved by the inevitability of gradualness.
I believe that the reforms we are introducing will help to give momentum to the changes needed in this area. A concerted effort by all is needed to encourage people from underrepresented groups to apply for judicial office. We must dispel any myths surrounding the appointments process. It is the commitment shown by all involved in the process which will mean progress in this area, a progress I believe will enhance confidence in our justice system whilst retaining the rightful esteem in which our judiciary is held.


{% include head.html %} {% include scripts/mathjax.html %}
{% if page.profile.image %}
{% endif %}
Manohar Kaul
Assistant Professor,
Department of Computer Science, IITH
Home
Publications
Research
Media
Resources
Teaching
contacts
{{content}}
Tweets by ManuKaul1
{% include footer.html %} {% include scripts/bootstrap.html %} {% include scripts/mansory.html %} {% include scripts/misc.html %}


texi2any - translate Texinfo documents
makeinfo [OPTION]... TEXINFO-FILE...
Translate Texinfo source documentation to various other formats, by default Info
files suitable for reading online with Emacs or standalone GNU Info.
This program is commonly installed as both `makeinfo' and
`texi2any'; the behavior is identical, and does not depend on the installed
name.
- --document-language=STR locale to use in translating Texinfo
keywords
- for the output document (default C).
- --error-limit=NUM
- quit after NUM errors (default 100).
- --force
- preserve output even if errors.
- --help
- display this help and exit.
- --no-validate
- suppress node cross-reference validation.
- --no-warn
- suppress warnings (but not errors).
- --conf-dir=DIR
- search also for initialization files in DIR.
- --init-file=FILE
- load FILE to modify the default behavior.
- -c, --set-customization-variable VAR=VAL
- set customization variable VAR to value VAL.
- -v, --verbose
- explain what is being done.
- --version
- display version information and exit.
- --docbook
- output Docbook XML rather than Info.
- --html
- output HTML rather than Info.
- --plaintext
- output plain text rather than Info.
- --xml
- output Texinfo XML rather than Info.
- --dvi, --dvipdf, --ps, --pdf
- call texi2dvi to generate given output, after checking validity of
TEXINFO-FILE.
- -E, --macro-expand=FILE
- output macro-expanded source to FILE, ignoring any @setfilename.
- --no-headers
- suppress node separators, Node: lines, and menus from Info output (thus
producing plain text) or from HTML (thus producing shorter output). Also,
if producing Info, write to standard output by default.
- --no-split
- suppress any splitting of the output; generate only one output file.
- --[no-]number-sections
- output chapter and sectioning numbers; default is on.
- -o, --output=DEST
- output to DEST. With split output, create DEST as a directory
- and put the output files there.
- With non-split output, if DEST is already
- a directory or ends with a /,
- put the output file there.
- Otherwise, DEST names the output file.
- --disable-encoding
- do not output accented and special characters in Info output based on
@documentencoding.
- --enable-encoding
- override --disable-encoding (default).
- --fill-column=NUM
- break Info lines at NUM characters (default 72).
- --footnote-style=STYLE
- output footnotes in Info according to STYLE: `separate' to put them in
their own node; `end' to put them at the end of the node, in which they
are defined (this is the default).
- --paragraph-indent=VAL
- indent Info paragraphs by VAL spaces (default 3). If VAL is `none', do not
indent; if VAL is `asis', preserve existing indentation.
- --split-size=NUM
- split Info files at size NUM (default 300000).
- --css-include=FILE
- include FILE in HTML <style> output; read stdin if FILE is -.
- --css-ref=URL
- generate CSS reference to URL.
- --internal-links=FILE
- produce list of internal links in FILE.
- --split=SPLIT
- split at SPLIT, where SPLIT may be `chapter', `section' or `node'.
- --transliterate-file-names
- use file names in ASCII transliteration.
- --node-files
- produce redirection files for nodes and anchors; default is set only if
split.
- --output-indent=VAL
- does nothing, retained for compatibility.
- --Xopt=OPT
- pass OPT to texi2dvi; can be repeated.
- --commands-in-node-names
- does nothing, retained for compatibility.
- -D VAR
- define the variable VAR, as with @set.
- -D 'VAR VAL'
- define VAR to VAL (one shell argument).
- -I DIR
- append DIR to the @include search path.
- -P DIR
- prepend DIR to the @include search path.
- -U VAR
- undefine the variable VAR, as with @clear.
- --ifdocbook
- process @ifdocbook and @docbook even if not generating Docbook.
- --ifhtml
- process @ifhtml and @html even if not generating HTML.
- --ifinfo
- process @ifinfo even if not generating Info.
- --ifplaintext
- process @ifplaintext even if not generating plain text.
- --iftex
- process @iftex and @tex.
- --ifxml
- process @ifxml and @xml.
- --no-ifdocbook
- do not process @ifdocbook and @docbook text.
- --no-ifhtml
- do not process @ifhtml and @html text.
- --no-ifinfo
- do not process @ifinfo text.
- --no-ifplaintext
- do not process @ifplaintext text.
- --no-iftex
- do not process @iftex and @tex text.
- --no-ifxml
- do not process @ifxml and @xml text.
Also, for the --no-ifFORMAT options, do process
@ifnotFORMAT text.
The defaults for the @if... conditionals depend on the output
format: if generating Docbook, --ifdocbook is on and the others are
off; if generating HTML, --ifhtml is on and the others are off; if
generating Info, --ifinfo is on and the others are off; if generating
plain text, --ifplaintext is on and the others are off; if generating
XML, --ifxml is on and the others are off.
- makeinfo foo.texi
- write Info to foo's @setfilename
- makeinfo --html foo.texi
- write HTML to @setfilename
- makeinfo --xml foo.texi
- write Texinfo XML to @setfilename
- makeinfo --docbook foo.texi
- write Docbook XML to @setfilename
- makeinfo --plaintext foo.texi
- write plain text to standard output
- makeinfo --pdf foo.texi
- write PDF using texi2dvi
- makeinfo --html --no-headers foo.texi
- write html without node lines, menus
- makeinfo --number-sections foo.texi
- write Info with numbered sections
- makeinfo --no-split foo.texi
- write one Info file however big
Email bug reports to<EMAIL_ADDRESS>general questions and discussion to
<EMAIL_ADDRESS>Texinfo home page: http://www.gnu.org/software/texinfo/
Copyright © 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL
version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO
WARRANTY, to the extent permitted by law.
The full documentation for texi2any is maintained as a Texinfo manual. If
the info and texi2any programs are properly installed at your
site, the command
- info texi2any
should give you access to the complete manual.


error message in Exception
requested path:
/index.html
properties:
sourceName: sourceName
lineNumber: lineNumber
lineSource: lineSource
lineNumber: lineNumber
lineSource: lineSource
${ var trace = exception.stackTrace; }
[+] stackTrace: className
attribute
trace
trace
trace
trace
trace
trace
trace
trace
trace
trace
[+] name
attribute
name =
value


PAM_NAMESPACE
Section: Linux-PAM Manual (8)Updated: 06/16/2009
Index Return to Main Contents
pam_namespace - PAM module for configuring namespace for a session
Synopsis
- pam_namespace.so [debug] [unmnt_remnt] [unmnt_only] [require_selinux] [gen_hash] [ignore_config_error] [ignore_instance_parent_mode] [no_unmount_on_close] [use_current_context] [use_default_context]
DESCRIPTION
The pam_namespace module disassociates the session namespace from the parent namespace. Any mounts/unmounts performed in the parent namespace, such as mounting of devices, are not reflected in the session namespace. To propagate selected mount/unmount events from the parent namespace into the disassociated session namespace, an administrator may use the special shared-subtree feature. For additional information on shared-subtree feature, please refer to the mount(8) man page and the shared-subtree description at http://lwn.net/Articles/159077 and http://lwn.net/Articles/159092.
OPTIONS
debug
- A lot of debug information is logged using syslog
unmnt_remnt
- For programs such as su and newrole, the login session has already setup a polyinstantiated namespace. For these programs, polyinstantiation is performed based on new user id or security context, however the command first needs to undo the polyinstantiation performed by login. This argument instructs the command to first undo previous polyinstantiation before proceeding with new polyinstantiation based on new id/context
unmnt_only
- For trusted programs that want to undo any existing bind mounts and process instance directories on their own, this argument allows them to unmount currently mounted instance directories
require_selinux
- If selinux is not enabled, return failure
gen_hash
- Instead of using the security context string for the instance name, generate and use its md5 hash.
ignore_config_error
- If a line in the configuration file corresponding to a polyinstantiated directory contains format error, skip that line process the next line. Without this option, pam will return an error to the calling program resulting in termination of the session.
ignore_instance_parent_mode
- Instance parent directories by default are expected to have the restrictive mode of 000. Using this option, an administrator can choose to ignore the mode of the instance parent. This option should be used with caution as it will reduce security and isolation goals of the polyinstantiation mechanism.
no_unmount_on_close
- For certain trusted programs such as newrole, open session is called from a child process while the parent performs close session and pam end functions. For these commands use this option to instruct pam_close_session to not unmount the bind mounted polyinstantiated directory in the parent.
use_current_context
- Useful for services which do not change the SELinux context with setexeccon call. The module will use the current SELinux context of the calling process for the level and context polyinstantiation.
use_default_context
- Useful for services which do not use pam_selinux for changing the SELinux context with setexeccon call. The module will use the default SELinux context of the user for the level and context polyinstantiation.
MODULE TYPES PROVIDED
Only the session module type is provided. The module must not be called from multithreaded processes.
RETURN VALUES
PAM_SUCCESS
- Namespace setup was successful.
PAM_SERVICE_ERR
- Unexpected system error occurred while setting up namespace.
PAM_SESSION_ERR
- Unexpected namespace configuration error occurred.
FILES
FC/etc/security/namespace.confF[]
- Main configuration file
FC/etc/security/namespace.dF[]
- Directory for additional configuration files
FC/etc/security/namespace.initF[]
- Init script for instance directories
EXAMPLES
For the <service>s you need polyinstantiation (login for example) put the following line in /etc/pam.d/<service> as the last line for session group:
session required pam_namespace.so [arguments]
To use polyinstantiation with graphical display manager gdm, insert the following line, before exit 0, in /etc/gdm/PostSession/Default:
/usr/sbin/gdm-safe-restart
This allows gdm to restart after each session and appropriately adjust namespaces of display manager and the X server. If polyinstantiation of /tmp is desired along with the graphical environment, then additional configuration changes are needed to address the interaction of X server and font server namespaces with their use of /tmp to create communication sockets. Please use the initialization script FC/etc/security/namespace.initF[] to ensure that the X server and its clients can appropriately access the communication socket X0. Please refer to the sample instructions provided in the comment section of the instance initialization script FC/etc/security/namespace.initF[]. In addition, perform the following changes to use graphical environment with polyinstantiation of /tmp:
-
1. Disable the use of font server by commenting out "FontPath" line in /etc/X11/xorg.conf. If you do want to use the font server then you will have to augment the instance initialization script to appropriately provide /tmp/.font-unix from the polyinstantiated /tmp. 2. Ensure that the gdm service is setup to use pam_namespace, as described above, by modifying /etc/pam.d/gdm. 3. Ensure that the display manager is configured to restart X server with each new session. This default setup can be verified by making sure that /usr/share/gdm/defaults.conf contains "AlwaysRestartServer=true", and it is not overridden by /etc/gdm/custom.conf.
SEE ALSO
namespace.conf(5), pam.d(5), mount(8), pam(8).
AUTHORS
The namespace setup scheme was designed by Stephen Smalley, Janak Desai and Chad Sellers. The pam_namespace PAM module was developed by Janak Desai<EMAIL_ADDRESS>Chad Sellers<EMAIL_ADDRESS>and Steve Grubb<EMAIL_ADDRESS>Additional improvements by Xavier Toth<EMAIL_ADDRESS>and Tomas Mraz<EMAIL_ADDRESS>Index
This document was created by man2html, using the manual pages.
Time: 05:34:28 GMT, December 24, 2015


The alert service builds on top of the collapse directive to provide a list of items, with collapsible bodies that are collapsed or expanded by clicking on the item's header.
We can control whether expanding an item will cause the other items to close, using the close-others
attribute on accordion.
The body of each accordion group is transcluded in to the body of the collapsible element.

ALERT

angular.module('ui.yt.demo').controller('$alertDemoCtrl', function ($scope, $alert) {
$scope.showAlert = function (argument) {
$alert.pop();
};
});
/* no css */


Dear Sir, I know you will be surprise to receive this letter but please consider it as a request from a suffering family in serious need of your assistance. My family had to bring before you this proposal because we sincerely hope you will be reliable to assist us. Anyway, my i am from Zimbabwe.My father was ordered to be killed by President Robert Mugabe because he supported the white farmers who refused to give up their lands in Zimbabwe during the land reform crisis in the country. After the death of my father,I am my family fled to South Africa, from where I was able to travel to the Netherland where I applied for asylum and I am currently living as a refugee. We need your assistance to claim $15 Million US Dollars from a security company in the Netherlands, which my father deposited there before he died.You will claim this fund from the Company and transfer it to your country, after which we will then come over to meet with you in your country. For your assistance you will get 10% of the total fund and 5% will be for expenses, while the balance 85% will be for my family. We are soliciting for your assistance due to my inability as a refugee to operate an account with huge amount of money. I genuinely solicit that you kindly help me and my family transfer this Fund to your country and we are relying heavily on you to help us. Note that you will also assist us to come over to your country as soon as you claim the fund. We also intend to invest part of our share into a profitable business in your country under your supervision. Also Keep this transaction secret and confidential as the lives of my family is at stake in south Africa. Kindly contact me immedaitely so that i can funish you with the necessary information before we proceed. Kind regards, Please treat this as urgent


garden
will You forgive me
for trying to plant my heart
in another garden?
i tried growing some roses
but no veins wanted to root,
considered other flowers and fruits
but they were all doomed
for with the emission
of Your earth and nutrition
there can't be transmission
of seeds, from heart to heart
nothing can exist, from end to start
now that i am wiser
i'm begging You to reconsider
showing me Your garden, opening Your gates
allow me to sow my heart to grow
a bit bigger, a bit thicker
a lot closer to my fate


Chocolate Pizza
POSTED ON 15 DEC 2013 / DESSERTS
Delicious
THE BEST FOOD BLOG ON THE WEB
POSTED ON 15 DEC 2013 / DESSERTS
For the fig-swirl; melt butter over medium heat in the saucepan. Add brown sugar and stir to disolve. Halve all of the figs and toss in the saucepan with water and lemon juice. Cook over medium heat, stirring frequently, until you have a chunky-jammy mixture. Add salt with one or two stirs, set aside and let cool completely.
Ice cream: In a small pot over medium heat, combine milk, and granulated sugar until sugar is completely disolved and the milk is just barely lukewarm. Whisk in the egg yolks. Set mixture in fridge and wait until fig mixture is cooled.
Using an ice cream machine, pour liquids into the frozen basin and process according to manufacturer instructions, i.e., let spin and thicken for 20 minutes before adding mascarpone, fig jam mixture, and the nuts. Continue to process for +/- 10 minutes. Pour semi-frozen mixture into a pyrex dish or glass tupperware. Freeze for at least 2 hours before serving.


"An object is a software bundle of related variables and methods. Software objects are often used to model real-world objects you find in everyday life." (Campione, 2000). In the exhibitor's project, the main software objects are computer-simulated mice.
"Software objects interact and communicate with each other using messages." (Campione, 2000). Each Mouse defines it's own makeAMove method which returns a direction to move in a maze. The maze-solving engine calls this method. There are several methods that are used by the Mouse. For example, passagewayOpenAt to see if a direction is open, and distanceToGoal that returns the distance to the maze end.
"Inheritance is a mechanism whereby one class of objects can be defined as a special case of a more general class, automatically including the method and variable definitions of the general class." (Taylor, 1993, p. 16). In the exhibitor's case, all of the mice inherit from the base class Mouse.
The makeAMove method is defined at the base class Mouse level. Each Mouse type defines it's own makeAMove method with it's own strategy. Subclasses "can define a method that has exactly the same method signature (arguments and return type) as a method in its superclass. In that case, the method in the subclass overrides the method in the superclass and effectively replaces its implementation. Overriding methods to change the behavior of objects is another form of polymorphism: the one most people think of when they talk about the power of object-oriented languages." (Niemeyer, 1996, p. 134). Because of this, the maze-solving engine (written by the exhibitor's Father) knows how to interact with all objects, because they are all a type of Mouse, and have a makeAMove method.
Smarty is a special type of Mouse that has a brain. It remembers where it has been. Therefore all derivations of Smarty have a brain too, just because they are derived from Smarty.


The national percentage of respiratory specimens testing positive for SARS-CoV-2 at public health, clinical and commercial laboratories decreased from week 18 to week 19.
Click here for more information
One main thing to keep in mind while reading news is the proper source.So Please make sure you follow the news from a reliable source.
Here is a Live News, Straight from CNN news for accurate information
There are Over 4Million confirmed cases, Over 300,000 deaths as of today 05/19/2020
Daily update on CoronaVirus cases


Detailed Description
Static(array) hash-table implementation.
qhasharr implements a hash-table which maps keys to values and stores into fixed size static memory like shared-memory and memory-mapped file. The creator qhasharr() initializes static memory to makes small slots in it. The default slot size factors are defined in _Q_HASHARR_KEYSIZE and _Q_HASHARR_VALUESIZE. And they are applied at compile time.
The value part of an element will be stored across several slots if it's size exceeds the slot size. But the key part of an element will be truncated if the size exceeds and it's length and more complex MD5 hash value will be stored with the key. So to look up a particular key, first we find an element which has same hash value. If the key was not truncated, we just do key comparison. But if the key was truncated because it's length exceeds, we do both md5 and key comparison(only stored size) to verify that the key is same. So please be aware of that, theoretically there is a possibility we pick wrong element in case a key exceeds the limit, has same length and MD5 hash with lookup key. But this possibility is extreamly low and almost never happen in practice. If you happpen to want to make sure everything, you set _Q_HASHARR_KEYSIZE big enough at compile time to make sure all keys fits in it.
qhasharr hash-table does not support thread-safe. So users should handle race conditions on application side by raising user lock before calling functions which modify the table data.
[Data Structure Diagram]
+--[Static Flat Memory Area]-----------------------------------------------+
| +-[Header]---------+ +-[Slot 0]---+ +-[Slot 1]---+ +-[Slot N]---+ |
| |Private table data| |KEY A|DATA A| |KEY B|DATA B| .... |KEY N|DATA N| |
| +------------------+ +------------+ +------------+ +------------+ |
+--------------------------------------------------------------------------+
Below diagram shows how a big value is stored.
+--[Static Flat Memory Area------------------------------------------------+
| +--------+ +-[Slot 0]---+ +-[Slot 1]---+ +-[Slot 2]---+ +-[Slot 3]-----+ |
| |TBL INFO| |KEY A|DATA A| |DATA A cont.| |KEY B|DATA B| |DATA A cont. | |
| +--------+ +------------+ +------------+ +------------+ +--------------+ |
| ^~~link~~^ ^~~~~~~~~~link~~~~~~~~~^ |
+--------------------------------------------------------------------------+
char memory[1000 * 10];
qhasharr_t *tbl = qhasharr(memory, sizeof(memory));
if(tbl == NULL) return;
tbl->putstr(tbl, "e1", "a");
tbl->putstr(tbl, "e2", "b");
tbl->putstr(tbl, "e3", "c");
tbl->debug(tbl, stdout);
char *e2 = tbl->getstr(tbl, "e2");
if(e2 != NULL) {
printf("getstr('e2') : %s\n", e2);
free(e2);
}
An example for using hash table over shared memory.
[CREATOR SIDE]
int maxslots = 1000;
int memsize = qhasharr_calculate_memsize(maxslots);
int shmid = qShmInit("/tmp/some_id_file", 'q', memsize, true);
if(shmid < 0) return -1;
void *memory = qShmGet(shmid);
qhasharr_t *tbl = qhasharr(memory, memsize);
if(hasharr == NULL) return -1;
(...your codes with your own locking mechanism...)
qShmFree(shmid);
[USER SIDE]
int shmid = qShmGetId("/tmp/some_id_file", 'q');
qhasharr_t *tbl = (qhasharr_t*)qShmGet(shmid);
(...your codes with your own locking mechanism...)
Functions |
| size_t | qhasharr_calculate_memsize (int max) |
| | Get how much memory is needed for N slots.
|
| qhasharr_t * | qhasharr (void *memory, size_t memsize) |
| | Initialize static hash table.
|
| static bool | put (qhasharr_t *tbl, const char *key, const void *value, size_t size) |
| | qhasharr->put(): Put an object into this table.
|
| static bool | putstr (qhasharr_t *tbl, const char *key, const char *str) |
| | qhasharr->putstr(): Put a string into this table
|
| static bool | putstrf (qhasharr_t *tbl, const char *key, const char *format,...) |
| | qhasharr->putstrf(): Put a formatted string into this table.
|
| static bool | putint (qhasharr_t *tbl, const char *key, int64_t num) |
| | qhasharr->putint(): Put an integer into this table as string type.
|
| static void * | get (qhasharr_t *tbl, const char *key, size_t *size) |
| | qhasharr->get(): Get an object from this table
|
| static char * | getstr (qhasharr_t *tbl, const char *key) |
| | qhasharr->getstr(): Finds an object with given name and returns as string type.
|
| static int64_t | getint (qhasharr_t *tbl, const char *key) |
| | qhasharr->getint(): Finds an object with given name and returns as integer type.
|
| static bool | getnext (qhasharr_t *tbl, qnobj_t *obj, int *idx) |
| | qhasharr->getnext(): Get next element.
|
| static bool | remove_ (qhasharr_t *tbl, const char *key) |
| | qhasharr->remove(): Remove an object from this table.
|
| static int | size (qhasharr_t *tbl, int *maxslots, int *usedslots) |
| | qhasharr->size(): Returns the number of objects in this table.
|
| static void | clear (qhasharr_t *tbl) |
| | qhasharr->clear(): Clears this table so that it contains no keys.
|
| static bool | debug (qhasharr_t *tbl, FILE *out) |
| | qhasharr->debug(): Print hash table for debugging purpose
|
Function Documentation
| size_t qhasharr_calculate_memsize |
( |
int |
max |
) |
|
Get how much memory is needed for N slots.
- Parameters:
-
| max | a number of maximum internal slots |
- Returns:
- memory size needed
- Note:
- This can be used for calculating minimum memory size for N slots.
| qhasharr_t* qhasharr |
( |
void * |
memory, |
|
|
size_t |
memsize | |
|
) |
| | |
Initialize static hash table.
- Parameters:
-
| memory | a pointer of buffer memory. |
| memsize | a size of buffer memory. |
- Returns:
- qhasharr_t container pointer. structure(same as buffer pointer), otherwise returns NULL.
- Return values:
-
| errno | will be set in error condition.
- EINVAL : Assigned memory is too small. It must bigger enough to allocate at least 1 slot.
|
char memory[112 * 100];
qhasharr_t *tbl = qhasharr(memory, sizeof(memory));
- Note:
- Every information is stored in user memory. So the returning container pointer exactly same as memory pointer.
| static bool put |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key, |
|
|
const void * |
value, |
|
|
size_t |
size | |
|
) |
| | [static] |
qhasharr->put(): Put an object into this table.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string |
| value | value object data |
| size | size of value |
- Returns:
- true if successful, otherwise returns false
- Return values:
-
| errno | will be set in error condition.
- ENOBUFS : Table doesn't have enough space to store the object.
- EINVAL : Invalid argument.
- EFAULT : Unexpected error. Data structure is not constant.
|
| static bool putstr |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key, |
|
|
const char * |
str | |
|
) |
| | [static] |
qhasharr->putstr(): Put a string into this table
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string. |
| value | string data. |
- Returns:
- true if successful, otherwise returns false
- Return values:
-
| errno | will be set in error condition.
- ENOBUFS : Table doesn't have enough space to store the object.
- EINVAL : Invalid argument.
- EFAULT : Unexpected error. Data structure is not constant.
|
| static bool putstrf |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key, |
|
|
const char * |
format, |
|
|
|
... | |
|
) |
| | [static] |
qhasharr->putstrf(): Put a formatted string into this table.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key name. |
| format | formatted string data. |
- Returns:
- true if successful, otherwise returns false.
- Return values:
-
| errno | will be set in error condition.
- ENOBUFS : Table doesn't have enough space to store the object.
- ENOMEM : System memory allocation failure.
- EINVAL : Invalid argument.
- EFAULT : Unexpected error. Data structure is not constant.
|
| static bool putint |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key, |
|
|
int64_t |
num | |
|
) |
| | [static] |
qhasharr->putint(): Put an integer into this table as string type.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string |
| value | value integer |
- Returns:
- true if successful, otherwise returns false
- Return values:
-
| errno | will be set in error condition.
- ENOBUFS : Table doesn't have enough space to store the object.
- EINVAL : Invalid argument.
- EFAULT : Unexpected error. Data structure is not constant.
|
- Note:
- The integer will be converted to a string object and stored as string object.
| static void* get |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key, |
|
|
size_t * |
size | |
|
) |
| | [static] |
qhasharr->get(): Get an object from this table
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string |
| size | if not NULL, oject size will be stored |
- Returns:
- malloced object pointer if successful, otherwise(not found) returns NULL
- Return values:
-
| errno | will be set in error condition.
- ENOENT : No such key found.
- EINVAL : Invalid argument.
- ENOMEM : Memory allocation failed.
|
- Note:
- returned object must be freed after done using.
| static char* getstr |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key | |
|
) |
| | [static] |
qhasharr->getstr(): Finds an object with given name and returns as string type.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string |
- Returns:
- string pointer if successful, otherwise(not found) returns NULL
- Return values:
-
| errno | will be set in error condition.
- ENOENT : No such key found.
- EINVAL : Invalid argument.
- ENOMEM : Memory allocation failed.
|
- Note:
- returned object must be freed after done using.
| static int64_t getint |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key | |
|
) |
| | [static] |
qhasharr->getint(): Finds an object with given name and returns as integer type.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string |
- Returns:
- value integer if successful, otherwise(not found) returns 0
- Return values:
-
| errno | will be set in error condition.
- ENOENT : No such key found.
- EINVAL : Invalid argument.
- ENOMEM : Memory allocation failed.
|
| static bool getnext |
( |
qhasharr_t * |
tbl, |
|
|
qnobj_t * |
obj, |
|
|
int * |
idx | |
|
) |
| | [static] |
qhasharr->getnext(): Get next element.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| idx | index pointer |
- Returns:
- key name string if successful, otherwise(end of table) returns NULL
- Return values:
-
| errno | will be set in error condition.
- ENOENT : No next element.
- EINVAL : Invald argument.
- ENOMEM : Memory allocation failed.
|
int idx = 0;
qnobj_t obj;
while(tbl->getnext(tbl, &obj, &idx) == true) {
printf("NAME=%s, DATA=%s, SIZE=%zu\n",
obj.name, (char*)obj.data, obj.size);
free(obj.name);
free(obj.data);
}
- Note:
- Please be aware a key name will be returned with truncated length because key name is truncated when it put into the table if it's length is longer than _Q_HASHARR_KEYSIZE.
| static bool remove_ |
( |
qhasharr_t * |
tbl, |
|
|
const char * |
key | |
|
) |
| | [static] |
qhasharr->remove(): Remove an object from this table.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| key | key string |
- Returns:
- true if successful, otherwise(not found) returns false
- Return values:
-
| errno | will be set in error condition.
- ENOENT : No such key found.
- EINVAL : Invald argument.
- EFAULT : Unexpected error. Data structure is not constant.
|
| static int size |
( |
qhasharr_t * |
tbl, |
|
|
int * |
maxslots, |
|
|
int * |
usedslots | |
|
) |
| | [static] |
qhasharr->size(): Returns the number of objects in this table.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
- Returns:
- a number of elements stored
| static void clear |
( |
qhasharr_t * |
tbl |
) |
[static] |
qhasharr->clear(): Clears this table so that it contains no keys.
- Parameters:
-
| tbl | qhasharr_t container pointer. |
- Returns:
- true if successful, otherwise returns false
| static bool debug |
( |
qhasharr_t * |
tbl, |
|
|
FILE * |
out | |
|
) |
| | [static] |
qhasharr->debug(): Print hash table for debugging purpose
- Parameters:
-
| tbl | qhasharr_t container pointer. |
| out | output stream |
- Returns:
- true if successful, otherwise returns false
- Return values:
-
| errno | will be set in error condition.
- EIO : Invalid output stream.
|