--- title: Loss Functions layout: post date: 2020-02-29 18:34:00-0400 comments: true --- {% include mathjax-macros.html %}
This note will touch upon loss functions and their expected minimization. A much more rigorous discussion on this topic can be found in e.g. section 1.5 in bishop2006a.
While we here consider the minimization of loss functions there is another formulation of the same problem, namely the maximization of the utility function. However, the two formulations coincide, as the negative loss functions would be equal to a utility function we then maximize.
A loss function \(\gL(\cdot)\) takes as argument whatever defines our loss. For instance, for a classification problem (or regression problem with scalar predictions) \(\gL(\cdot)=\gL(\vx,y)\). Typically, we have control of the loss via some parameter (otherwise we have no problem to begin with as there is nothing we can do to minimize our loss…). We denote these “parameters” \(\theta\), and emphasize they they can represent anything from the set of decision regions (like in some classification problems) to parameters of a linear function (like in some specific regression problems). Often, however, these will be parameters in the sense that we can find them using some optimization algorithm. We find the optimal parameters \(\theta^*\) by minimizing the expected loss,
\begin{equation}\label{eq:opt} \theta^* = \argmin_{\theta}\E_{p(\cdot)}\br{\gL(\cdot;\theta)} \end{equation}Returning to the classification example, the loss function would allow for considering making some wrong predictions worse than others. To use a classical example: consider a scenario in the medical industry, where we try to classify certain medical tests as either indicating a condition that needs treatment or indicating a healthy subject. We probably would penalize predicting the indication of being healthy if the subject actually has a medical condition much more heavily than the opposite scenario. That is to say we want to be quite certain about deeming someone being healthy, because being wrong could be fatal.
As an example we can re-derive our previous result on how to classify \(\vx\) given that we know \(p(\vy|\vx)\).
Define \(i\in\tub{i,\dots,K}\) and \(k\in\tub{1,\dots,K}\) where \(K\) is the number of classes and consider the following loss function,
\[ \gL(\vy=k,\vx,i)=L_{ik} \]
where the “given” \(i\) is how we classify the “given” \(\vx\). This loss functions simply says that there is some cost associated with guessing class \(i\) but the real class was \(k\).
The minimization \eqref{eq:opt} now becomes
\[ \min\E{\br{\gL}} =\min\sum_{k=1}^K \sum_{i=1}^{K}\int_{\gR_{i}}L_{ik} p(y=k|\vx)p(\vx)\dm{\vx}. \]
Note that we wrote the expectation in terms of the classification regions \(\gR_{i}\). This because for any given \(\vx\) the loss incurred in only relative to the chosen predicted class. We minimize \(\E{\br{\gL}}\) by choosing each \(\gR_{i}\) such that we minimize \(\sum_{k=1}^K L_{ik}p(y=k|\vx)\) for all \(\vx\) (as \(p(\vx)\) is independent of our choice \(i\)).
In practice if we consider the loss matrix \(\mL_{\vx}\in\real^{K\times K}\) and class conditional probability \(\mP(\vx)\in\br{0,1}^{K}\) for a particular \(\vx\), we can look at the loss predictive vector \(\vl=\mL_{\vx}\mP(\vx)\in\real^{K}\). To minimize \(\E\br{\gL}\) we predict \(\vx\) to belong to region \(\gR_{i}\) (and therefore class \(i\)) such that
\[ i = \argmax_{i} l_{i}. \]
We may recover the result found in this note, where we seek to determine decision regions in classification problems, by setting,
\[ L_{ik}=\begin{cases} 0 & \mr{if}~i=k\\ a & \mr{otherwise} \end{cases} \]
Here we placed no loss contribution for correct classification whereas there is some loss \(a\) for being wrong (same loss for all classes). Because we penalize being wrong equally across all classes, we should choose to predict the class \(i=\argmax_{i}p(y=i|\vx)\), i.e. predict the class \(i\) with highest probability.
It should now be clear that through \(l_{ik}\) we can introduce different penalizing strategies for making erroneous decisions, like the medical example discussed earlier. This in turn would result in different classification strategies.
We may choose \(\gL\) freely in such a way that we incorporate desired properties associated with the optimization problem \eqref{eq:opt}. This is in contrast to, for instance, minimizing the divergence between two distribution which is principled and hold a very specific meaning. In general I wouldn’t consider the loss function as principled since any given arbitrary loss function need not be justified by any set of associated assumptions. For instance there is no particular reason why the squared error is better than the absolute error for a regression problem.
However, in some cases a specific choice of loss function \(\gL\) will coincide with a principled objective (if it is associated with a set of assumptions), such as certain maximum likelihood approaches - see table below for a small set of examples,
| Density \(p(\vy\vert\vx)\) | Loss function \(\gL\) |
|---|---|
| \(\vy\sim \mN(f(\vx),\cdot)\) | \(\gL=\norm{\vy-f(\vx)}^2\) |
| \(\vy\sim \mr{Laplace}(f(\vx),\cdot)\) | \(\gL=\abs{\vy-f(\vx)}\) |


BEFORE AND AFTER A film review by Steve Rhodes Copyright 1996 Steve Rhodes
RATING (0 TO ****): ***
BEFORE AND AFTER is a gripping story of a teenage boy in trouble. His girlfriend was murdered, and he was the last one seen with her before she died. He has disappeared, and everyone is searching for him. His family closes ranks to support him, and his father even hides what may be evidence to protect his son.
From the director of the even more chilling SINGLE WHITE FEMALE, Barbet Schroeder came up earlier this year with a thriller that will terrify parents, especially those with teenagers. The script by Ted Tally, based on Rosellen Brown's novel, is full of problems and flaws, but the stellar acting by Meryl Streep and Liam Neeson as the parents more than compensates for its deficiencies. They both give convincing and empathetic performances and raise an otherwise pedestrian movie into a compelling motion picture.
The movie deals as much with the tensions within the family as those surrounding the murder. Even the father's brave but potentially foolish evidence destruction is derided by the mother. The mother, Carolyn Ryan (Streep), tells the father, Ben (Neeson), "You can't just destroy evidence. What if you've destroyed evidence that proves him innocent?" When she gets tired of her husband's schemes, she cries out, "I just want my boy back. I just want to hold him again."
The dad blames himself since he had fought with his son the morning of the murder and thus "sent him out in a rage." He has the irrational hope that, "If we all keep quiet, maybe they've got no case."
In a good minor role is John Heard as their friend and initial lawyer Wendell Bye. Even better is Alfred Molina as the tough criminal lawyer Panos Demeris, who takes the case when "mortgage lawyer" Wendell begs out. Demeris explains to the mother his take-no-prisoners approach to beating the prosecution, and it infuriates her. She scolds him, "It's not the truth. You're talking about opposing ad campaigns."
Rarely believable are Edward Furlong as the son and possible murderer Jacob and Julia Weldon as his sister Judith. Both characters are underacted and miscast.
The constant music by Howard Shore is sweeping and sad. The cinematography by Luciano Tovoli makes you feel the cold snowy settings and the effect the weather must be having on the characters trying to cope with their misery.
As the story develops, the noose tightens around the son before he ever enters a courtroom. The director's pacing is excellent, and the tension ratchets up by the minute.
I was really moved by the show as I think any parent will be. Nevertheless, I would be remiss if I didn't give you a feel for some of the illogical problems in the script. Without giving away any of the twists in the story, let me just say that: 1) the one time the parents choose to make love in the story is ridiculous, 2) most aspects of the Grand Jury testimonies make little sense, and 3) then there is the show's conclusion. Notwithstanding these flaws, the film works because of the acting by Neeson and Streep and the well paced direction.
BEFORE AND AFTER runs 1:48. It is rated PG-13. There is a little sex, some non-gory violence, and a gory photograph. There is no nudity and the language is pretty mild. The film would be fine for teenagers, and maybe very mature kids a year or two younger. I recommend the picture to you and give it ***.
**** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEW WRITTEN ON: December 26, 1996
Opinions expressed are mine and not meant to reflect my employer's.
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


Layout example
Deaths from Cancer in USA 1900-2010
Thu Aug 15 2013
Deaths from Cancer in USA 1900-2010
Thu Aug 15 2013


| WinAPI Wrapper |
A window class or WNDCLASS in Windows keeps GDI objects for windows that use it.
The WinAPI Wrapper has a default window class for windows derived from the Window class. But you can override this class if you want to specify, for example, your own application icon or window background.
class SomeWindow: public Window { public: SomeWindow() { static WindowClass wc( LoadIcon( __MODULE_HANDLE, IDI_MYICON ), 0 ); Create( "Title", wc ); } };
In the above example a WNDCLASS is passed to the Create function while the window is being created. The WNDCLASS is created using an object of WindowClass class. The object's constructor takes in this case an icon loaded from a resource and background brush 0 (no background). WindowClass objects should be created statically in order to avoid them being initialized over and over - such objects has to be initialized only once.
Note that if you create an MDI child window derived from the MDIChildWindow class, you have to use the MDIChildWindowClass class instead.


Templates Archive
The TemplateFlow Archive aggregates all the templates for redistribution. The archive uses DataLad to maintain all templates under version control.
Accessing the Archive via the Python client ¶
The recommended way to use TemplateFlow is via the Python Client
Accessing the Archive via DataLad ¶
First, make sure you have a functional installation of DataLad.
The archive has a top-level data structure to maintain all templates.
This is the
super-dataset
, and it is maintained on
GitHub
.
The latest stable super-dataset can be referenced with
///templateflow
:
$ datalad install -r ///templateflow
The
-r
switch ensures all available templates are also
installed
.
Once the super-dataset and its siblings are installed, metadata will be already accessible. However, the different imaging data resources (NIfTI, GIFTI and transforms files) have to be pulled down.
For example, to download the complete
tpl-MNI152NLin2009cAsym
:
$ cd templateflow
$ datalad get -r tpl-MNI152NLin2009cAsym
TemplateFlow's data structure ¶
Browse the archive ¶
Naming conventions ¶
The TemplateFlow Archive is organized in a
BIDS-like structure
.
However, it deviates from the standard at times (e.g., the
tpl
key replaces
sub
).
Here we outline the most common names that are found in TemplateFlow.
Common key names using in TemplateFlow:
| Key | Entity | Description |
|---|---|---|
tpl
|
Template identifier | A unique name of the template, matching those of BIDS. |
res
|
Resolution |
See
template_description.json
within each template for more information about what the index specifies.
|
atlas
|
Atlas | Name of an atlas. |
desc
|
Description | Additional information about the file to differentiate it from other files. |
TemplateFlow uses all the valid suffices of BIDS, but the most commonly found in the Archive are:
| Suffix | Description |
|---|---|
dseg
|
discrete segmentation |
pseg
|
probability segmentation |
mask
|
binary mask |
xfm
|
transform file |
T2w
|
T2 weighted image |
T1w
|
T1 weighted image |
Common file-formats used in TemplateFlow:
| Extension | Description |
|---|---|
.nii.gz
|
Image |
.tsv
|
Tabular information |
.json
|
Meta-information |
.h5
|
Transform file |
Thus a template with the following name:
tpl-test_res-high_atlas-myatlas_desc-200nodes_dseg.nii.gz
would be a
NIfTI image containing the discrete segmentation of
myatlas
that
contains
200nodes
. The template identifier is
test
.
The resolution information will be found in the
template_description.json
file under the entry
high
.


How does
our platform
work?
Every Addictive Learning feature was designed so you can enhance your audience experience and grow your business for long term success.
Since everything is built together, it just works together, better. All that energy you've spent fixing tech problems? Now you can focus that same energy on growing your business.
Sign upSet Tasks
and Games
Don't let your customers lose interest!
- Set up Action-Based Tasks.
- Reward Learners for great results.
- Add and track Personal and Team Leaderboards.
Work with Teams
Build relations between your Learners:
- Invite new people.
- Set up team goals.
- Track teams & personal progress.
- Let people collaborate to solve tasks.
- Get video and photo as a proof.

- Track your Learners' progress.
- Lead and mentor your clients.
- Let people write to you about their expectations. Thus you will find out how to improve your tasks.
- Sell your new course programs.
- Send motivational messages to your Learners to increase engagement.
Track and Grow with Addictive Learning
Analyze the performance of your Learners and scale your business!
- It’s easy to check and analyze the activity of your users.
- It’s fast to check the number of new Learners and invite them to the game.
- It’s beneficial to share your experience and to interest people in further cooperation.


A simple and easy way to show your appreciation for people on github.
It allows you to send lumens to anyone with a github account. It monitors comments for any mention of @tipbot.
To interact with the tipbot simply type any of the following commands:
| @tipbot | Send the default tip of 200 lumens to the creator of the issue you are commenting on. |
| @tipbot <amount> | Send a custom amount of lumens to the creator of the issue you are commenting on. |
| @tipbot <github name> | Send the default tip of 200 lumens to the specified github user. |
| @tipbot <amount> <github name> | Send a custom amount of lumens to the specified github user. |
| @tipbot empty <payment address or account ID> | Clear your tipbot account and send all the lumens in it to some other account. |
| Funding your github account. | From any Stellar wallet just send lumens to <your_github_name>*codetip.io |
You can also send directly to any github account directly from your Stellar wallet by sending to: <github_name>*codetip.io.
For example you can send to: irisli*codetip.io
If you don't know what Stellar is check out Stellar.org
Brought to you by Cheesecake Labs. Enjoy!


Xmake is a lightweight cross-platform build utility based on Lua.
It is very lightweight and has no dependencies because it has a built-in Lua runtime.
It uses xmake.lua to maintain project builds and its configuration syntax is very simple and readable.
We can use it to build project directly like Make/Ninja, or generate project files like CMake/Meson, and it also has a built-in package management system to help users solve the integrated use of C/C++ dependent libraries.
Xmake = Build backend + Project Generator + Package Manager + [Remote|Distributed] Build + Cache
Although not very precise, we can still understand Xmake in the following way:
Xmake ~= Make/Ninja + CMake/Meson + Vcpkg/Conan + distcc + ccache/sccache
Introduction of new features
Building third party libraries more intelligently
In previous versions, Xmake provided a TryBuild mode that allowed you to use Xmake to try to build third-party projects maintained by autoconf/cmake/meson etc. directly without xmake.lua.
In effect, this means that Xmake detects the corresponding build system and invokes commands such as cmake to do so, but it will help the user to simplify the configuration operation, plus it will interface with xmake’s cross-compilation toolchain configuration.
However, this mode has a certain failure rate, which can lead to build failure if, for example
- the project code itself is flawed, resulting in a compilation error
- the project code does not support the current platform
- the build script is flawed
- specific configuration parameters are missing
- a missing dependency library that needs to be installed by the user
- the compiler version is too low and does not support some of the code
The TryBuild mode usually handles these cases, but in this new version we have introduced a new mechanism to the TryBuild mode to improve the build logic by reusing build scripts from the xmake-repo repository.
It roughly handles the process in the following way.
- execute the xmake command in the third-party source repository directory
- xmake gets the directory name and tries to resolve the project name and version
- try to match an existing package from the xmake-repo repository
- If the match is successful, build directly using the build logic in the package
- if no match is made, fall back to the original TryBuild logic
What is the benefit of this, if the match is successful, we can solve all the problems mentioned above.
Even if the current project source code does not support a given platform, or if the source code and build script are flawed in some way, Xmake will automatically patch in a specific patch to fix it and bring in the required dependencies to ensure that it will definitely compile in one click.
Let’s take a look at the libjpeg library as an example.
The first step is to download the corresponding source code package
$ wget https://jaist.dl.sourceforge.net/project/libjpeg-turbo/2.1.4/libjpeg-turbo-2.1.4.tar.gz
$ tar -xvf libjpeg-turbo-2.1.4.tar.gz
$ cd libjpeg-turbo-2.1.4
Enter the directory and execute the Xmake command
Xmake will prompt the user if it detects that it is the libjpeg library, and whether to build it as libjpeg 2.1.4.
ruki-2:libjpeg-turbo-2.1.4 ruki$ xmake
note: libjpeg-turbo 2.1.4 in xmake-repo found, try building it or you can run ``xmake f --trybuild=` to set buildsystem (pass -y or --confirm=y/n/d to skip confirm)?
please input: y (y/n)
We hit enter to confirm to continue the build.
checking for cmake ... /usr/local/bin/cmake
/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_ INSTALL_LIBDIR:PATH=lib -DCMAKE_INSTALL_PREFIX=/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2 -G "Unix Makefiles" -DCMAKE_POSITION_INDEPENDENT_CODE=ON /Users/ruki/Downloads/libjpeg-turbo-2.1.4
-- CMAKE_BUILD_TYPE = Release
-- VERSION = 2.1.4, BUILD = 20220923
-- 64-bit build (x86_64)
-- CMAKE_INSTALL_PREFIX = /Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2
-- CMAKE_INSTALL_BINDIR = bin (/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2/bin)
-- CMAKE_INSTALL_DATAROOTDIR = share (/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2/share)
-- CMAKE_INSTALL_DOCDIR = share/doc/libjpeg-turbo (/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2/ share/doc/libjpeg-turbo)
-- CMAKE_INSTALL_INCLUDEDIR = include (/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2/include)
-- CMAKE_INSTALL_LIBDIR = lib (/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2/lib)
-- CMAKE_INSTALL_MANDIR = share/man (/Users/ruki/.xmake/packages/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2/share/man)
-- Shared libraries disabled (ENABLE_SHARED = 0)
-- Static libraries enabled (ENABLE_STATIC = 1)
-- 12-bit JPEG support disabled (WITH_12BIT = 0)
-- Arithmetic decoding support enabled (WITH_ARITH_DEC = 1)
-- Arithmetic encoding support enabled (WITH_ARITH_ENC = 1)
-- TurboJPEG API library enabled (WITH_TURBOJPEG = 1)
-- TurboJPEG Java wrapper disabled (WITH_JAVA = 0)
-- In-memory source/destination managers enabled (WITH_MEM_SRCDST = 1)
-- Emulating libjpeg API/ABI v6.2 (WITH_JPEG7 = 0, WITH_JPEG8 = 0)
-- libjpeg API shared library version = 62.3.0
-- Compiler flags = -O3 -DNDEBUG
-- Linker flags =
-- INLINE = __inline__ __attribute__((always_inline)) (FORCE_INLINE = 1)
-- THREAD_LOCAL = __thread
-- CMAKE_EXECUTABLE_SUFFIX =
-- CMAKE_ASM_NASM_COMPILER = /usr/local/bin/nasm
-- CMAKE_ASM_NASM_OBJECT_FORMAT = macho64
-- CMAKE_ASM_NASM_FLAGS = -DMACHO -D__x86_64__ -DPIC
-- SIMD extensions: x86_64 (WITH_SIMD = 1)
-- FLOATTEST = sse
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/ruki/Downloads/libjpeg-turbo-2.1.4/build_646b7957
make -j10
[ 2%] Built target md5cmp
[ 19%] Built target wrjpgcom
[ 20%] Built target simd
[ 21%] Built target strtest
[ 22%] Built target rdjpgcom
[ 80%] Built target jpeg-static
[ 84%] Built target turbojpeg-static
[ 90%] Built target tjbench-static
[ 90%] Built target tjunittest-static
[ 91%] Built target jpegtran-static
[ 98%] Built target djpeg-static
[ 100%] Built target cjpeg-static
make install
[ 1%] Built target strtest
[ 3%] Built target wrjpgcom
[ 19%] Built target simd
[ 52%] Built target turbojpeg-static
[ 53%] Built target rdjpgcom
[ 82%] Built target jpeg-static
[ 85%] Built target jpegtran-static
[ 90%] Built target djpeg-static
[ 93%] Built target tjunittest-static
[ 97%] Built target cjpeg-static
[ 98%] Built target tjbench-static
[100%] Built target md5cmp
Install the project...
exporting libjpeg-turbo-2.1.4
-> /Users/ruki/Downloads/libjpeg-turbo-2.1.4/build/artifacts/l/libjpeg-turbo/2.1.4/646b795702e34be89c5745333d052aa2
output to /Users/ruki/Downloads/libjpeg-turbo-2.1.4/build/artifacts
build ok!
As long as the match is detected, the build will usually complete with a near 100% success rate, and Xmake will output the build product to the current directory under build/artifacts
.
Interfacing with cross-compilation toolchains
This smart build mode allows us to not only build native applications, but also to interface with the cross-compilation toolchain to support ios/android and any cross-compilation platform.
For example, to build on Android, we simply pass the --trybuild=xrepo
argument and switch to Android, and Xmake will pass all the ndk toolchain information.
``bash $ xmake f -p android –trybuild=xrepo –ndk=~/files/android-ndk-r20b -c $ xmake xmake f -c –require=n -v -p android -a armeabi-v7a -m release -k static –ndk=/Users/ruki/files/android-ndk-r20b checking for Android SDK directory … ~/Library/Android/sdk checking for Build Tools Version of Android SDK … 33.0.0 checking for NDK directory … /Users/ruki/files/android-ndk-r20b checking for SDK version of NDK … … 21 checking for clang++ … /Users/ruki/files/android-ndk-r20b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ checking for the shared library linker (sh) … clang++ checking for clang++ … /Users/ruki/files/android-ndk-r20b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ checking for the linker (ld) … clang++ … exporting libjpeg-turbo-2.1.4 -> /Users/ruki/Downloads/libjpeg-turbo-2.1.4/build/artifacts/l/libjpeg-turbo/2.1.4/79c2e21f436b4ab08a3c23a6cbae8c0e output to /Users/ruki/Downloads/libjpeg-turbo-2.1.4/build/artifacts build ok!
#### fallback to direct compilation
If we don't want to use the xmake-repo build scripts, we can fall back to cmake/autoconf and try to build them directly.
However, this may have a certain failure rate and may compile additional binary targets that are not needed. The build script in xmake-repo is optimised to streamline a lot of unnecessary build parameters, such as disabling the tests/examples build.
We just need to hit n to cancel the smart build mode based on package scripts, and Xmake will give a new prompt to let the user choose whether to continue with the cmake/autoconf build attempt.
```bash
$ xmake
note: libjpeg-turbo 2.1.4 in xmake-repo found, try building it or you can run ``xmake f --trybuild=` to set buildsystem (pass -y or --confirm=y/n/d to skip confirm)?
please input: y (y/n)
n
note: CMakeLists.txt found, try building it or you can run `xmake f --trybuild=` to set buildsystem (pass -y or --confirm=y/n/d to skip confirm)?
please input: y (y/n)
Support for Windows Arm64
We have also improved our Windows build support with the addition of Windows Arm64 platform support, simply by switching to the arm64 architecture.
$ xmake f -a arm64
$ xmake
Improved rule support for sequential execution of dependencies
Associated dependencies can be bound to a batch of rules, i.e. instead of having to add rules to target one by one using add_rules()
, just apply a rule that will take effect for it and all its dependencies.
For example
rule("foo")
add_deps("bar")
rule("bar")
...
We only need add_rules("foo")
to apply both foo and bar rules.
However, by default there is no order of execution between dependencies, and scripts such as on_build_file
for foo and bar are executed in parallel, in an undefined order.
To tightly control the order of execution, in newer versions we can configure add_deps("bar", {order = true})
to tell xmake that we need to execute scripts at the same level according to the order of dependencies.
Example.
rule("foo")
add_deps("bar", {order = true})
on_build_file(function (target, sourcefile)
end)
rule("bar")
on_build_file(function (target, sourcefile)
end)
bar’s on_build_file
will be executed first.
Better dynamic configuration of targets and rules
The above way of controlling rule dependencies only works if both foo and bar rules are custom rules, which doesn’t work if you want to insert your own rules to be executed before xmake’s built-in rules.
In this case, we need to use a more flexible dynamic rule creation and injection approach to modify the built-in rules.
For example, if we want to execute the on_build_file
script for a custom cppfront rule before the built-in c++.build
rule, we can do this in the following way.
rule("cppfront")
set_extensions(".cpp2")
on_load(function (target)
local rule = target:rule("c++.build"):clone()
rule:add("deps", "cppfront", {order = true})
target:rule_add(rule)
end)
on_build_file(function (target, sourcefile, opt)
print("build cppfront file")
end)
target("test")
set_kind("binary")
add_rules("cppfront")
add_files("src/*.cpp")
add_files("src/*.cpp2")
Support for introducing custom rules from packages
Now, we can also add custom build rule scripts to the package management repository to enable dynamic distribution and installation following the package.
We need to put the custom rules into the packages/x/xxx/rules
directory of the repository and it will follow the package as it is installed.
It does, of course, have some limitations.
- In package rules, we cannot add
on_load
,after_load
scripts, but we can usually useon_config
instead.
Adding package rules
We need to add the rules script to the rules fixed directory, for example: packages/z/zlib/rules/foo.lua
rule("foo")
on_config(function (target)
print("foo: on_config %s", target:name())
end)
Applying package rules
The rules are used in a similar way as before, the only difference being that we need to specify which package’s rules to access by prefixing them with @packagename/
.
The exact format: add_rules("@packagename/rulename")`, for example:
add_rules(“@zlib/foo”)`.
``lua add_requires(“zlib”, {system = false}) target(“test”) set_kind(“binary”) add_files(“src/*.cpp”) add_packages(“zlib”) add_rules(“@zlib/foo”)
#### Referencing rules by package alias
If a package alias exists, xmake will give preference to the package alias to get the rules.
``` lua
add_requires("zlib", {alias = "zlib2", system = false})
target("test")
set_kind("binary")
add_files("src/*.cpp")
add_packages("zlib2")
add_rules("@zlib2/foo")
Adding package rule dependencies
We can use add_deps("@bar")
to add additional rules relative to the current package directory.
However, we cannot add rule dependencies from other packages, they are completely isolated and we can only refer to rules from other packages imported by add_requires
in the user project.
packages/z/zlib/rules/foo.lua
rule("foo")
add_deps("@bar")
on_config(function (target)
print("foo: on_config %s", target:name())
end)
packages/z/zlib/rules/bar.lua
rule("bar")
on_config(function (target)
print("bar: on_config %s", target:name())
end)
Stricter package dependency compatibility support
Two new package related policies have been added to enable stricter package dependency compatibility control.
This is to address the fact that some packages may have abi incompatibilities or break other packages that depend on them every time they are updated, and by default Xmake will not recompile and install them unless their versions and configurations are also updated.
There is a chance that the compilation compatibility will be broken and the link will fail.
package.librarydeps.strict_compatibility
is disabled by default, if enabled then strict compatibility is maintained between the current package and all its library dependencies, and any version update of a dependent package will force a recompile install of the current package.
This ensures that all packages are binary compatible and that no linking and runtime errors occur when linking with other installed packages due to changes to the interface of a dependent package.
package("foo")
add_deps("bar", "zoo")
set_policy("package.librarydeps.strict_compatibility", true)
For example, if there is an updated version of bar or zoo, then foo will also be recompiled and installed.
package.strict_compatibility
is disabled by default, if it is enabled then strict compatibility is maintained between the current package and all other packages that depend on it, and any version update of this package will force a recompile and install of the other parent packages.
This ensures that all packages are binary compatible and that no linking and runtime errors occur when linking with other installed packages due to changes in the interface of a dependent package.
package("foo")
set_policy("package.strict_compatibility", true)
package("bar")
add_deps("foo")
package("zoo")
add_deps("foo")
For example, if there is an updated version of foo, then both bar and zoo will be forced to recompile and install.
package.install_always
This is useful for local integration of third-party source packages,
as the package will always be reinstalled each time xmake f -c
is run to reconfigure it.
As the user may at any time need to modify the third party source code and recompile it for integration.
Previously it was only possible to trigger a recompile by changing the package version number each time, but with this strategy it is possible to trigger a recompile each time.
add_rules("mode.debug", "mode.release")
package("foo")
add_deps("cmake")
set_sourcedir(path.join(os.scriptdir(), "foo"))
set_policy("package.install_always", true)
on_install(function (package)
local configs = {}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" . (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" ... (package:config("shared") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("add", {includes = "foo.h"}))
end)
package_end()
add_requires("foo")
target("demo")
set_kind("binary")
add_files("src/main.c")
add_packages("foo")
Adding the clang-cl toolchain
Although we did support switching to the clang-cl compiler in previous versions, the switch was cumbersome and had to be set up one by one.
$ xmake f --cxx=clang-cl --cc=clang-cl -c
$ xmake
And you have to add the directory where clang-cl.exe is located to %PATH% to make it work.
Now that vs comes with the clang-cl toolchain, Xmake is fully capable of detecting it and using it automatically.
So, in this new version, we have added the clang-cl toolchain, and all it takes is xmake f --toolchain=clang-cl
to quickly switch to the clang-cl toolchain without any PATH settings.
Changelog
New features
- #2140: Support Windows Arm64
- #2719: Add
package.librarydeps.strict_compatibility
to strict compatibility for package linkdeps - #2810: Support os.execv to run shell script file
- #2817: Improve rule to support dependence order
- #2824: Pass cross-file to meson.install and trybuild
- #2856: Improve to debug package using the debug source directory
- #2859: Improve trybuild to build 3rd source library using xmake-repo scripts
- #2879: Support for dynamic creation and injection of rules and targets in script scope
- #2374: Allow xmake package to embed rules and scripts
- Add clang-cl toolchain
Changes
- #2745: Improve os.cp to support symlink
- #2773: Improve vcpkg packages to support freebsd
- #2778: Improve Improve xrepo.env for target
- #2783: Add digest algorithm option for wdk signtool
- #2787: Improve json to support empty array
- #2782: Improve to find matlab and runtime
- #2793: Improve mconfdialog
- #2804: Support macOS arm64/x86_64 cross-compilation for installing packages
- #2809: Improve cl optimization option
- Improve trybuild for meson/cmake/autoconf
- #2846: Improve to generate config files
- #2866: Better control over the order of execution of rules


The geology of the region
The geology of the region, the path rain takes under the earth, the black areas of nitrate. The geology of the region, the path rain takes under the earth, the black areas of nitrate.The geology of the region, the path rain takes under the earth, the black areas of nitrate.


MDW Workflow Notification: "Something has happened which is very important and necessitates sending you a notice."
To view or act on this notification, click on the following link: #{mdwWebUrl}.
Please do not reply to this automatically-generated e-mail.


Cardiff City appoint Neil Harris as new manager
by FSA EditorNeil Harris has replaced Neil Warnock as manager of Championship club Cardiff City.
Cardiff City have appointed former Millwall boss Neil Harris as the club’s new manager on a two-and-a-half-year contract following the departure of Neil Warnock.
Harris takes over with the Bluebirds 14th in the Championship after winning just one of their past six matches – a run that culminated in Warnock leaving the club by mutual consent.
During a four-year spell in charge of Millwall, Harris helped the club to promotion from League One via the play-offs in 2016-17, but he resigned on October 3 following a run of seven winless matches.
Cardiff said in a statement on Saturday: “Cardiff City FC can confirm the appointment of Neil Harris as the club’s first-team manager.
“The 42-year-old has signed a deal at Cardiff City Stadium running until the summer of 2022.
“David Livermore joins Neil in the dugout as assistant manager, while James Rowberry and Andy Dibble continue in the back-room team as first-team coach and goalkeeping coach, respectively.
“Kevin Blackwell and Ronnie Jepson depart the Welsh capital with the club’s sincere thanks and best wishes.
“Neil will oversee training at the Vale Resort on Monday ahead of his first City match away to Charlton Athletic on Saturday, November 23.”


Want to check out our non-legalese, human readable privacy overview? Click here.
{{'privacy.last_updated'|translate}}


Preparation time
1-2 hours
Cooking time
30 mins to 1 hour
Serves
Serves 4-6
For the goat and sweetcorn curry, mix together the goat meat, yoghurt, coriander, turmeric and salt in a large bowl. Cover and set aside to marinate for one hour.
Meanwhile, for the chickpea bread, mix together the gram flour and plain flour in a large bowl until well combined.
Add the salt, ginger, chillies, coriander, ajwain seeds, black onion seeds and ground turmeric and mix until well combined.
Make a well in the centre of the dry ingredients. Gradually add the oil and water, stirring well, until the mixture comes together as a dough (you may not need to use all of the water). Cover the dough with a damp tea towel and set aside to rest for 15-20 minutes.
When the goat meat has marinated, continue with the goat and sweetcorn curry. Blend the onion, garlic and chillies to a smooth paste in a food processor, then set aside.
When the goat meat has marinated, heat the ghee in a heavy-based frying pan over a medium heat. Add the cumin seeds, green and black cardamom pods, cloves and bay leaves and fry until the spices begin to crackle and pop and smell fragrant. (CAUTION: Popping seeds can be dangerous. Cover the pan with a lid and keep away from your eyes and face.)
Add the marinated goat meat to the pan and fry for 3-4 minutes, or until browned on all sides. Add the onion, garlic and chilli paste, stir well and continue to cook for 2-3 minutes.
Reduce the heat slightly and pour in the lamb stock. Bring the liquid to the boil, then reduce the heat until the mixture is simmering. Continue to simmer for 30 minutes, or until the goat is tender.
Add the chopped sweetcorn and continue to simmer gently for 8-10 minutes, stirring continuously, until the sweetcorn starts to break down.
Meanwhile, divide the dough for the chickpea bread into 8 pieces and roll each into a ball. Flatten each ball slightly between the palms of your hands, and top with some of the chopped red onion and spring onion.

Heat a large frying pan over a medium to high heat. When the pan is hot, add one of the chickpea bread discs and cook for 3-4 minutes, then brush the uncooked uppermost side with a little ghee. Turn the flatbread over and continue to cook for a further 3-4 minutes, or until golden-brown on both sides. Brush the cooked uppermost side of the bread with a little more ghee. Repeat the process with the remaining chickpea breads. Keep the cooked chickpea breads warm while you cook the remaining bread discs.
To serve, divide the goat and sweetcorn curry equally among four to six serving plates. Squeeze over a little lemon juice and sprinkle with fresh coriander. Serve with the warm chickpea bread.


Author: Dorin-Mirel Popescu
Description: This is a tool used for generating color mappings. The output can be saved as a csv file that maps colours to categories.
Instructions:
- Enter a number in the text area right to "Number of categories:"
- Press the button "Make". This will generate coloured dots on the plot at right. For each dot there is a corresponding control panel in the column at left
- Each dot and its menu are linked by name. At generation names have the format "Name indes" (e.g. "Name 0", "Name 1")
- Names can be edited. Any change will update the colour area
- The colour of each category can be change by the 3 sliders in each colour menu
- The sliders are "H" (for hue), "S" (for saturation) and L ('light')
- The colour key can be saved to a csv file by pressing the button "Save color key as csv file"


{% extends 'layouts/layout-nhsuk.html' %} {% block pageTitle %} NHS login prototypes {% endblock %} {% from 'header/macro.njk' import header %} {% block beforeContent %} {{ breadcrumb({ items: [ { href: "https://www.nhs.uk/", text: "Home" }, { href: "https://www.nhs.uk/using-the-nhs/", text: "Services" } ], href: "https://www.nhs.uk/using-the-nhs/nhs-services/", text: "NHS services" }) }} {% endblock %} {% block content %}
NHS login makes it easier and quicker for you to securely access digital health and care services with 1 username and password.
The first time you set up your NHS login, you will need to prove who you are. This is so we can connect you to your NHS record and protect your health information.
When you have proved who you are, you will be able to use your NHS login to access websites and apps wherever you see 'NHS login'.
You can set up your NHS login (username and password) using your email address and mobile phone number.
If you have signed up for your GP surgery's online services, you can prove who you are using the 3 registration details you were given.
If you have not signed up for your GP surgery's online services (or you do not have the registration details) you can prove who you are using 1 of the following:
You will need to send a photo of your I.D. and record a short video of your face while you say 4 numbers.
You do not need your NHS number, but it helps us connect you to your NHS record if you do have it.
We are working on other ways you can prove who you are.
You can use your NHS login to create an account for the NHS App, and anywhere you see 'NHS login'.
NHS login follows the UK government's data storage standards PDF, 2.25mb to keep your information secure.
Any website or app that allows you to use your NHS login must meet NHS Digital's standard on proving identity.
Media last reviewed: 15 October 2018
Media review due: 15 October 2021
Page last reviewed: 4 July 2019
Next review due: 23 October 2021


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
A
B
C
E
F
G
I
M
N
O
P
R
S
T
U
W
A
arity
- Variable in class org.nats.
MsgHandler
B
bind(SocketAddress)
- Method in class org.nats.
SecureSocketChannel
C
caller
- Variable in class org.nats.
MsgHandler
close()
- Method in class org.nats.
Connection
Close the channel with flushing buffer and stop the background thread.
close(boolean)
- Method in class org.nats.
Connection
Close the channel and stop the background thread.
connect(Properties)
- Static method in class org.nats.
Connection
Create and return a Connection with various attributes.
connect(Properties, MsgHandler)
- Static method in class org.nats.
Connection
Create and return a Connection with various attributes.
connect(Properties, MsgHandler, MsgHandler)
- Static method in class org.nats.
Connection
Create and return a Connection with various attributes.
connect(SocketAddress)
- Method in class org.nats.
SecureSocketChannel
Connection
- Class in
org.nats
Connection represents a bidirectional channel to NATS server.
Connection(Properties, MsgHandler, MsgHandler)
- Constructor for class org.nats.
Connection
Connection.Subscription
- Class in
org.nats
Internal data structure to hold subscription meta data
createInbox()
- Method in class org.nats.
Connection
Create a properly formatted inbox subject.
E
execute()
- Method in class org.nats.
MsgHandler
execute(String)
- Method in class org.nats.
MsgHandler
execute(String, String)
- Method in class org.nats.
MsgHandler
execute(String, String, String)
- Method in class org.nats.
MsgHandler
execute(Object)
- Method in class org.nats.
MsgHandler
execute(byte[])
- Method in class org.nats.
MsgHandler
execute(byte[], String)
- Method in class org.nats.
MsgHandler
execute(byte[], String, String)
- Method in class org.nats.
MsgHandler
F
finishConnect()
- Method in class org.nats.
SecureSocketChannel
flush()
- Method in class org.nats.
Connection
Flush buffered messages with no event handler.
flush(MsgHandler)
- Method in class org.nats.
Connection
Flush buffered messages with a specified event handler.
G
get(String)
- Static method in class org.nats.server.
NatsEmbeddedServer
getAppBufferSize()
- Method in class org.nats.
SecureSocketChannel
getLocalAddress()
- Method in class org.nats.
SecureSocketChannel
getOption(SocketOption<T>)
- Method in class org.nats.
SecureSocketChannel
getRemoteAddress()
- Method in class org.nats.
SecureSocketChannel
getResourceId()
- Method in class org.nats.
Connection
getSubscriptionCount()
- Method in class org.nats.
Connection
Return the active subscription count.
getVersion()
- Method in class org.nats.
Connection
Return version String.
I
implCloseSelectableChannel()
- Method in class org.nats.
SecureSocketChannel
implConfigureBlocking(boolean)
- Method in class org.nats.
SecureSocketChannel
init(Properties)
- Static method in class org.nats.
Connection
isConnected()
- Method in class org.nats.
Connection
Return status (true or false) of a connection to the server.
isConnected()
- Method in class org.nats.
SecureSocketChannel
isConnectionPending()
- Method in class org.nats.
SecureSocketChannel
M
main(String[])
- Static method in class org.nats.server.
NatsEmbeddedServer
MsgHandler
- Class in
org.nats
Message handler can be passed to various operations and invoked when the operation is processed by the server.
MsgHandler()
- Constructor for class org.nats.
MsgHandler
N
NatsEmbeddedServer
- Class in
org.nats.server
NatsEmbeddedServer is compatible with NATS protocol and emulates behavior of
gnatsd server
.
NatsEmbeddedServer(Properties)
- Constructor for class org.nats.server.
NatsEmbeddedServer
Create an instance of NatsEmbeddedServer, with various properties.
O
org.nats
- package org.nats
org.nats.server
- package org.nats.server
P
publish(String, String)
- Method in class org.nats.
Connection
Publish a text message to the given subject.
publish(String, String, MsgHandler)
- Method in class org.nats.
Connection
Publish a text message to the given subject.
publish(String, String, String, MsgHandler)
- Method in class org.nats.
Connection
Publish a text message to the given subject, with optional reply and event handler.
publish(String, byte[])
- Method in class org.nats.
Connection
Publish a binary message to the given subject.
publish(String, byte[], MsgHandler)
- Method in class org.nats.
Connection
Publish a binary message to the given subject.
publish(String, String, byte[], MsgHandler)
- Method in class org.nats.
Connection
Publish a binary message to the given subject, with optional reply and event handler.
R
read(ByteBuffer)
- Method in class org.nats.
SecureSocketChannel
read(ByteBuffer[], int, int)
- Method in class org.nats.
SecureSocketChannel
request(String, MsgHandler)
- Method in class org.nats.
Connection
Send a request and have the response delivered to the supplied handler.
request(String, String, Properties, MsgHandler)
- Method in class org.nats.
Connection
Send a request and have the response delivered to the supplied handler.
request(String, byte[], Properties, MsgHandler)
- Method in class org.nats.
Connection
Send a request and have the response delivered to the supplied handler.
run()
- Method in class org.nats.server.
NatsEmbeddedServer
S
SecureSocketChannel
- Class in
org.nats
SecureSocketChannel provides TLS channel to Connection class when gnatsd is configured to use TLS.
SecureSocketChannel(SocketChannel, Properties)
- Constructor for class org.nats.
SecureSocketChannel
sendPing(MsgHandler)
- Method in class org.nats.
Connection
Ping a server and invoke a handler when PONG is returned.
setOption(SocketOption<T>, T)
- Method in class org.nats.
SecureSocketChannel
shutdown()
- Method in class org.nats.server.
NatsEmbeddedServer
Shutdown NatsEmbeddedServer.
shutdownInput()
- Method in class org.nats.
SecureSocketChannel
shutdownOutput()
- Method in class org.nats.
SecureSocketChannel
socket()
- Method in class org.nats.
SecureSocketChannel
subscribe(String, MsgHandler)
- Method in class org.nats.
Connection
Subscribe to a subject with optional wildcards.
subscribe(String, Properties, MsgHandler)
- Method in class org.nats.
Connection
Subscribe to a subject with optional wildcards.
Subscription(Integer, String, MsgHandler)
- Constructor for class org.nats.
Connection.Subscription
supportedOptions()
- Method in class org.nats.
SecureSocketChannel
T
terminate()
- Method in class org.nats.
SecureSocketChannel
timeout(Integer, long, Properties, MsgHandler)
- Method in class org.nats.
Connection
Set a timeout on a subscription.
U
unsubscribe(Integer)
- Method in class org.nats.
Connection
Cancel a subscription.
unsubscribe(Integer, int)
- Method in class org.nats.
Connection
Cancel a subscription.
W
write(ByteBuffer)
- Method in class org.nats.
SecureSocketChannel
write(ByteBuffer[], int, int)
- Method in class org.nats.
SecureSocketChannel
A
B
C
E
F
G
I
M
N
O
P
R
S
T
U
W
Skip navigation links
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
Prev
Next
Frames
No Frames
All Classes
Copyright © 2016. All rights reserved.


Director
Producer
Director Of Photography
Production Manager
VFX Supervisor
SFX Supervisor
3D Artist
2D Artist
Digital Artist
Concept Artist
Film Composer
Digital Designer
Web Developer


{{ define "main"}} Bad day, huh? Enjoy Gangnam Style and then start from the homepage.
Enjoy Gangnam Style and then start from the homepage.


PHP REST API CRUD
Search :
Name :
Age :
City :
Id
Name
Age
City
Edit
Delete
Edit Form
First Name
Age
City
X