Starloop System
问题描述 :
Although the war ended, the affect of the war is far from over. Now the council is busy fixing the transportation system. Before the war, all the stars were connected with artificial wormholes which were destroyed during the war. At the same time, natural wormholes are breaking down with the growing traffic. A new traffic system is on the schedule.
As two civilizations combine, the technology integrates. Scientists find a new traffic system called the Starloop System.
This system is made up of several starloops. People build a starway to connect two stars. A startloop is a closed path with no repetitions of stars or starways allowed, other than the repetition of the starting and ending star. And a starloop contains at least two starts and two starways. A startloop’s cost is the sum of the length of all the starways in it. Length of a starway connecting two stars is floor(x), which x is the euclidean distance between two stars. You can build more than one starway between any two stars, but one starway can only belongs to one starloop.
As the picture above shows, there are two starloops. One is blue and the other one is brown.
As a starloop is set up, each star on the starloop will get a unit of star-energy. So the two blue stars can get one unit of star-energy, and at the same time the black two stars can get two units because they both belong to two starloops. When a star earns a certain number of energy units, the transporter on that star will be activated. One can easily travel between any two stars whose transporter is activated.
Now the council wants to know the minimal cost to build a starloop system on all the stars . In other words, every star’s transporter should be activated
输入:
For each test case:
There is a line with one integer n which is the number of stars.
The following n lines each describes a star by four integers xi, yi, zi and wi, defined as the spatial coordinate and the number of energy units the star needs to activate the transporter. Please NOTE that getting more than wi energy units will put the star in a dangerous situation, so it is not allowed.
The input ends with n = 0.
1<=n<=100
|xi|,|yi|,|zi|<=200
wi<=50
输出:
For each test case:
There is a line with one integer n which is the number of stars.
The following n lines each describes a star by four integers xi, yi, zi and wi, defined as the spatial coordinate and the number of energy units the star needs to activate the transporter. Please NOTE that getting more than wi energy units will put the star in a dangerous situation, so it is not allowed.
The input ends with n = 0.
1<=n<=100
|xi|,|yi|,|zi|<=200
wi<=50
样例输入:
3 0 0 2 1 0 2 0 1 2 0 0 1 3 0 0 2 2 0 2 0 1 2 0 0 1 3 0 0 2 3 0 2 0 1 2 0 0 1 0
样例输出:
6 8 -1
·题目
http://acm.hdu.edu.cn/showproblem.php?pid=4744
·分析
无源汇上下界网络流
每个点拆i和i’两个点，连i->i’上界和下届都为w[i]的边
那么对于a和b，设费用为cost[a][b]
1.连b’->a容量INF，费用cost[a][b]的边
2.连a’->b容量INF，费用cost[a][b]的边
求无源汇最小费用可行流即可
略坑要用zkw
·代码
/************************************************** * Problem: HDU 4744 * Author: clavichord93 * State: Accepted **************************************************/ #include <iostream> #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #define sqr(a) ((a) * (a)) using namespace std; const int INF = 0x3f3f3f3f; const double EPS = 1e-9; template <class T> inline void gmax(T &a, T b) { if (a < b) { a = b; } } template <class T> inline void gmin(T &a, T b) { if (a > b) { a = b; } } const int MAX_N = 105; const int MAX_E = 50005; struct Edge { int dest; int capa; int cost; Edge *next; Edge *pair; Edge() {} Edge(int _dest, int _capa, int _cost, Edge *_next) : dest(_dest), capa(_capa), cost(_cost), next(_next) {} }; Edge EdgePool[MAX_E]; Edge *EP; Edge *e[2 * MAX_N]; int s; int t; int maxflow; int mincost; int dist[2 * MAX_N]; bool vis[2 * MAX_N]; int n; int x[MAX_N]; int y[MAX_N]; int z[MAX_N]; int w[MAX_N]; int cost[MAX_N][MAX_N]; inline void addedge(int a, int b, int c, int d) { e[a] = new(EP++)Edge(b, c, d, e[a]); e[b] = new(EP++)Edge(a, 0, -d, e[b]); e[a]->pair = e[b]; e[b]->pair = e[a]; } int aug(int i, int delta) { if (i == t) { maxflow += delta; mincost += delta * dist[s]; return delta; } vis[i] = true; for (Edge *j = e[i]; j; j = j->next) { if (!vis[j->dest] && j->capa && dist[j->dest] + j->cost == dist[i]) { int flow = aug(j->dest, min(j->capa, delta)); if (flow) { j->capa -= flow; j->pair->capa += flow; return flow; } } } return 0; } bool modlabel() { int delta = INF; for (int i = s; i <= t; i++) { if (vis[i]) { for(Edge *j=e[i]; j; j = j->next) { if(j->capa && !vis[j->dest]) { gmin(delta,dist[j->dest] + j->cost - dist[i]); } } } } if (delta == INF) { return false; } for (int i = s; i <= t; i++) { if (vis[i]) { dist[i] += delta; vis[i] = false; } } return true; } void costflow() { maxflow = 0; mincost = 0; do { do { memset(vis, 0, sizeof(vis)); } while (aug(s, INF)); } while (modlabel()); } int main() { #ifdef LOCAL_JUDGE freopen("in.txt", "r", stdin); #endif while (scanf("%d", &n), n) { EP = EdgePool; memset(e, 0, sizeof(e)); memset(dist, 0, sizeof(dist)); int sumW = 0; for (int i = 1; i <= n; i++) { scanf("%d %d %d %d", &x[i], &y[i], &z[i], &w[i]); sumW += w[i]; } for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { double dist = sqrt(sqr(x[i] - x[j]) + sqr(y[i] - y[j]) + sqr(z[i] - z[j])); cost[i][j] = (int)(floor(dist) + 0.5); } } s = 0; t = n * 2 + 1; for (int i = 1; i <= n; i++) { addedge(s, 2 * i, w[i], 0); //addedge(2 * i - 1, 2 * i, INF, 0); for (int j = 1; j <= n; j++) { if (i != j) { addedge(2 * i, 2 * j - 1, INF, cost[i][j]); } } addedge(2 * i - 1, t, w[i], 0); } costflow(); if (maxflow == sumW) { printf("%d\n", mincost); } else { printf("-1\n"); } } return 0; }
参考：http://blog.csdn.net/alpc_neverfarewell/article/details/39066157
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
等了两年才更新的第五部，还没前四部好看！有点失望
奢侈品包包ੌMichael Kors(MK)JACK WOLFSKIN(狼爪)Ferragamo(菲拉格慕)ＶＸ：LoveMeJck
ﾐ瘦身美腿ﾐﾐ性感丝袜的诱惑ﾐﾐ90后丝袜ﾐﾐ丝袜性感ﾐﾐ丝袜走光ﾐwww.meitui1.com
ﬞﬞﬞﬞﬞﬞﬞﬞmm丝袜ﬞﬞﬞﬞﬞﬞﬞﬞhTtP://7370.518mei.com
ﬞﬞﬞﬞﬞﬞﬞﬞmm丝袜ﬞﬞﬞﬞﬞﬞﬞﬞhTtP://7370.518mei.com


| EDUCATION |
| |
| 2011 - 2015 | Liberal Arts and Science Academy High School (LASA) | Austin, Texas |
| WORK EXPERIENCE |
| |
| 2013 - Present | University of Texas Austin, Dept. of Computer Science | |
| Intern | 4 hours/week | |
| Worked under Professor Calvin Lin over the summer of 2013 researching cache architecture related to irregular memory accesses. Continued over the summer of 2014 alongside Kiran Tomlinson, researching patterns in memory access streams and running simulations relating to memory level parallelism. | 10 weeks/yr | |
| 2013 - 2014 | For Fear the Glass May Shatter | |
| Animator | 2 hours/week | |
| Created digital animation for an opera about quantum physics that was performed at the Vortex Theatre and at the Fusebox Festival, Austin, TX, April 2014. (http://www.fuseboxfestival.com/2014-_festival/for-_fear-_the-_glass-_may-_shatter) | 8 weeks/yr | |
| 2012 | University of Texas Austin, Dept. of Computer Science | |
| Summer Intern | 8 hours/week | |
| Worked under Professor Calvin Lin alongside a team of high school developers developing Waterbear (http://waterbearlang.com/), a visual programming environment for use in undergraduate courses at UT. The code was open source HTML, CSS, and Javascript/JQuery, using Git for version control. | 10 weeks/yr | |
| ACTIVITIES |
| |
| 2012 − present | Various martial arts |
|
| 2013 − present | Tukong Moosul | 5 hours/week |
|
| 45 weeks/yr | |
| 2012 − 2013 | Tae Kwon Do | 2 hours/week |
|
| 44 weeks/yr | |
| 11th − 12th | LASA High School Math Tutor | 1 hour/week |
| Nominated by teachers to tutor other students in Algebra I through Linear Algebra and Multivariable Calculus. | 16 weeks/yr | |
| 11th − 12th | LASA High School Computer Science Club | 2 hours/week |
| Founder, Officer, and Tutor | 16 weeks/yr | |
| I give lectures and help fellow Computer Science students with their work. | ||
| 11th − 12th | LASAUIL Practice Website | 2 hours/week |
| Developer, Graphics Designer | 20 weeks/yr | |
| Developing the front-end of a Computer Science training website for beginning and advanced competitors. (http://lasauil.herokuapp.com/) | ||
| ACTIVITIES |
| |
| 11th | LASA High School Computer Competition Club | 1 hour/week |
| Member and competitor | 16 weeks/yr | |
| Gave lectures and competed in district, regional, and national competitions. | ||
| 10th − 12th | National Honor Society | |
| ∙ Volunteered at the Trail of Lights, patrolling and answering questions. | 9 hours | |
| ∙ Volunteered at the Blanton Art Museum as an exhibit docent. | 5 hours | |
| ∙ Volunteered at the Austin Wildflower Center doing landscaping work: planting, tilling, spreading gravel. | 4 hours | |
| HONORS & AWARDS |
| |
| 12th | 12th National Merit Scholar, Commended | |
| 11th | HSCTF placed 7th of 767 teams | |
| ∙ Team captain in High School CTF, a cooperative competition centered around hacking and algorithms. | ||
| USA Computing Olympiad Silver division | ||
| ∙ Prompted for efficiency and accuracy of algorithms. | ||
| AP Scholar with Distinction Award | ||
| 11th Trustees Award | ||
| 10th | Accepted to National Honors Society | |
| Top 20% National French Exam Level 3 | ||
| 9th | UIL State Team Competition 1st | |
| UIL Regional Team Competition 1st | ||
| UIL District Team Competition 1st | ||
| Viperwolf Invitational Individual 1st | ||
| Viperwolf Invitational Team 1st | ||
| SKILLS & TALENTS |
| |
| Languages | ||
| 5 years of french study. | ||
| Martial Arts | ||
| Practice Tukong Moosul and formerly Taekwondo, with a heavy emphasis on discipline and tradition. | ||
| Coding | ||
| Fluent in Java, C++, Javascript, HTML, CSS, Node.js, and Bash. | ||


This project has received funding from the European Union’s H2020 Research and Innovation Programme under grant agreement n.880895.
Module of Head Atlas app where you can explore, with AR, the brain anatomy.
Physical part required.


I am a dinosaur
I really love dinosaurs and cats and parties and the TV
I What else do I want to say in the internet??
do I not have to push my changes through for them to show up in html??
oh god that was a foolish and time consuming error
You should probs just hire me now


Currently it is use in DurandalJs
Application but it can easily used independently in any Web application that uses KnockoutJs
.
Error handler
Server side processing option is almost same as using ajax source. knockout-dataGrid will request to your web service with query parameters of draw, search, length and start.
Your web service need to return the same value of draw, recordsTotal no off all rows, and data an array containing 10 rows(depend on length).


We provide food catering services on the monthly basis.
We provide food devilery services
We know time is costliest thing which cannot be regained.Do the best in your field.You are not born to cook.We will support you by saving your time of cooking.
We are Eco friendly.We do not use a single plastic for any purpose in our services.
We donate 20% of our profit to the NGO's .We love to have a strong society.Motivate us by being a part of this venture.


It is divided into 2 categories
I used Photoshop as my graphics editor as my course requires us to use it. We normally do basic renderings like adding materials finishes and lightings to our CAD drawings, so editing on PS is not new to me. Here are the steps on how I edited a picture of myself into a seaside pic in Busan.
Yes, easiest step. Try to choose both pictures that has similar lighting in it, so it will look more natural without editing
Go to layers>click on unlock layer>quick actions>remove background
Oops!
However, there are some mistakes when removing, and that's normal, so I will use another method. Right click on Lasso tool> polygonal lasso tool, and trace the image
After tracing the overall slithouette it will appear in dotted lines, for the area that I wanna deselect hold down the Alt button and select the area. After that right click>layer via copy to copy the slithouette without the background out
Select on the layer1>ctrl +c and select the background tab and ctrl + v into the layers
If you hold down the shift key, image will be scaled dispropotionaly, to scale proportionally just drag up or down from the vertex.
Select the slithouette, Edit>transform>scale to scale the image.
Go to Image>image size and resize to width of 1024 pixels.
Open image resizer Pickpic. File>open and crop out the bottom text, and save as jpeg. Done!
I used Illustrator as my vector editor as my course requires us to use it. I do my CVs and Portfolios using this software, and layouts of my presentation boards and curating layout of sildes here.
Yes, easiest step. Try to choose both pictures that has similar lighting in it, so it will look more natural without editing
Go to layers>click on unlock layer>quick actions>remove background
Oops!
However, there are some mistakes when removing, and that's normal, so I will use another method. Right click on Lasso tool> polygonal lasso tool, and trace the image
After tracing the overall slithouette it will appear in dotted lines, for the area that I wanna deselect hold down the Alt button and select the area. After that right click>layer via copy to copy the slithouette without the background out
Select on the layer1>ctrl +c and select the background tab and ctrl + v into the layers
If you hold down the shift key, image will be scaled dispropotionaly, to scale proportionally just grag up or down from the vertex.
Select the slithouette, Edit>transform>scale to scale the image.
Go to Image>image size and resize to width of 1024 pixels.
Open image resizer Pickpic. File>open and crop out the bottom text, and save as jpeg. Done!


Enter your name and Age and lets see how old you'd be on other planets!


WITNESS LIST Agriculture & Livestock Committee August 18, 2000-9:30A interim charge On: Artho, Dale (Texas Grain Sorghum Assn.) Butler, Jim (Texas A&M System Agriculture Programs) Clark, James (WTAMU) Horton, Ken (Texas Pork Producers Assn.) Hubert, Martin (Texas Dept. of Agriculture) Long, Russell (WTAMU) Rhodes, Denise (Self) Sweeten, John (Texas Agricultural Experiment Station) Walters, Brian (Dumas Economic Development Corporation) Wilson, Ross (Texas Cattle Feeders Assn.)


Preparation time
1-2 hours
Cooking time
no cooking required
Serves
1 cake
Dietary
Place the cake on a foil board or cake plate.
Dust your hands and the work surface with a little icing sugar and knead the marzipan until soft.
Roll out half the marzipan to fit the top of the cake and roll out the rest in strips to fit around the sides of the cake.
Brush the cake all over with the warmed apricot jam and then place the marzipan on top and around the cake.
Cover the cake with a clean tea towel and then leave in a cool place for at least one day.
To make the icing, lightly whisk the egg whites adding the sugar at intervals. Beat well until the icing reaches soft peaks. Add the glycerine if using and the lemon juice.
Spread icing all over cake either flat iced using a clean ruler or by forming soft peaks. Decorate with Christmas ornaments.


var User = function(name){
var User = function(name){
User.name
is set to "Dave" by default
this.name = name || 'Dave';
};
Set the name
of the user. When choosing a name,
make it the best that you can think of. We don't
need anymore Users running around named "Benedict",
"Ackbar", or "The 12th Doctor".
User.prototype.setName = function(name){
this.name = name;
};
Get the name
of the user
User.prototype.getName = function(){
return this.name;
};


Author: Lucas Käldström (@luxas)
Status (25th of August 2016): Some parts are already implemented; but still there quite a lot of work to be done.
We obviously want Kubernetes to run on as many platforms as possible, in order to make Kubernetes an even more powerful system. This is a proposal that explains what should be done in order to achieve a true cross-platform container management system.
Kubernetes is written in Go, and Go code is portable across platforms. Docker and rkt are also written in Go, and it’s already possible to use them on various platforms. When it’s possible to run containers on a specific architecture, people also want to use Kubernetes to manage the containers.
In this proposal, a platform
is defined as operating system/architecture
or ${GOOS}/${GOARCH}
in Go terms.
The following platforms are proposed to be built for in a Kubernetes release: - linux/amd64 - linux/arm (GOARM=6 initially, but we probably have to bump this to GOARM=7 due to that the most of other ARM things are ARMv7) - linux/arm64 - linux/ppc64le
If there’s interest in running Kubernetes on linux/s390x
too, it won’t require many changes to the source now when we’ve laid the ground for a multi-platform Kubernetes already.
There is also work going on with porting Kubernetes to Windows (windows/amd64
). See this issue for more details.
But note that when porting to a new OS like windows, a lot of os-specific changes have to be implemented before cross-compiling, releasing and other concerns this document describes may apply.
Then the question probably is: Why?
In fact, making it possible to run Kubernetes on other platforms will enable people to create customized and highly-optimized solutions that exactly fits their hardware needs.
Example: Paypal validates arm64 for real-time data analysis
Also, by including other platforms to the Kubernetes party a healthy competition between platforms can/will take place.
Every platform obviously has both pros and cons. By adding the option to make clusters of mixed platforms, the end user may take advantage of the good sides of every platform.
For a large enterprise where computing power is the king, one may imagine the following combinations:
- linux/amd64
: For running most of the general-purpose computing tasks, cluster addons, etc.
- linux/ppc64le
: For running highly-optimized software; especially massive compute tasks
- windows/amd64
: For running services that are only compatible on windows; e.g. business applications written in C# .NET
For a mid-sized business where efficiency is most important, these could be combinations:
- linux/amd64
: For running most of the general-purpose computing tasks, plus tasks that require very high single-core performance.
- linux/arm64
: For running webservices and high-density tasks => the cluster could autoscale in a way that linux/amd64
machines could hibernate at night in order to minimize power usage.
For a small business or university, arm is often sufficient:
- linux/arm
: Draws very little power, and can run web sites and app backends efficiently on Scaleway for example.
And last but not least; Raspberry Pi’s should be used for education at universities and are great for demoing Kubernetes’ features at conferences.
First and foremost, binaries have to be released for all platforms. This affects the build-release tools. Fortunately, this is quite straightforward to implement, once you understand how Go cross-compilation works.
Since Kubernetes’ release and build jobs run on linux/amd64
, binaries have to be cross-compiled and Docker images should be cross-built.
Builds should be run in a Docker container in order to get reproducible builds; and gcc
should be installed for all platforms inside that image (kube-cross
)
All released binaries should be uploaded to https://storage.googleapis.com/kubernetes-release/release/${version}/bin/${os}/${arch}/${binary}
This is a fairly long topic. If you’re interested how to cross-compile, see details about cross-compilation
The easiest way of running Kubernetes on another architecture at the time of writing is probably by using the docker-multinode deployment. Of course, you may choose whatever deployment you want, the binaries are easily downloadable from the URL above.
docker-multinode is intended to be a “kick-the-tires” multi-platform solution with Docker as the only real dependency (but it’s not production ready)
But when we (sig-cluster-lifecycle
) have standardized the deployments to about three and made them production ready; at least one deployment should support all platforms.
Kubernetes should always enforce that all binaries are compiling.
On every PR, make release
have to be run in order to require the code proposed to be merged to be compatible for all architectures.
For more information, see conflicts
To ensure all functionality really is working on all other platforms, the community should be able to set up a CI. To be able to do that, all the test-specific images have to be ported to multiple architectures, and the test images should preferably be manifest lists. If the test images aren’t manifest lists, the test code should automatically choose the right image based on the image naming.
IBM volunteered to run continuously running e2e tests for linux/ppc64le
.
Still it’s hard to set up a such CI (even on linux/amd64
), but that work belongs to kubernetes/test-infra
proposals.
When it’s possible to test Kubernetes using Kubernetes; volunteers should be given access to publish their results on k8s-testgrid.appspot.com
.
When all e2e tests are passing for a given platform; the platform should be officially supported by the Kubernetes team.
At the time of writing, amd64
is in the officially supported category.
When a platform is building and it’s possible to set up a cluster with the core functionality, the platform is supported on a “best-effort” and experimental basis.
At the time of writing, arm
, arm64
and ppc64le
are in the experimental category; the e2e tests aren’t cross-platform yet.
Here’s a good article about how the “manifest list” in the Docker image manifest spec v2 works: A step towards multi-platform Docker images
A short summary: A manifest list is a list of Docker images with a single name (e.g. busybox
), that holds layers for multiple platforms when it’s stored in a registry.
When the image is pulled by a client (docker pull busybox
), only layers for the target platforms are downloaded.
Right now we have to write busybox-${ARCH}
for example instead, but that leads to extra scripting and unnecessary logic.
For reference see docker/docker#24739 and appc/docker2aci#193
This has been debated quite a lot about; how we should name non-amd64 docker images that are pushed to gcr.io
. See #23059 and #23009.
This means that the naming k8s.gcr.io/${binary}:${version}
should contain a manifest list for future tags.
The manifest list thereby becomes a wrapper that is pointing to the -${arch}
images.
This requires docker-1.10
or newer, which probably means Kubernetes v1.4 and higher.
TL;DR;
- ${binary}-${arch}:${version}
images should be pushed for all platforms
- ${binary}:${version}
images should point to the -${arch}
-specific ones, and docker will then download the right image.
It should be possible to run clusters with mixed platforms smoothly. After all, bringing heterogeneous machines together to a single unit (a cluster) is one of Kubernetes’ greatest strengths. And since the Kubernetes’ components communicate over HTTP, two binaries of different architectures may talk to each other normally.
The crucial thing here is that the components that handle platform-specific tasks (e.g. kubelet) should expose their platform. In the kubelet case, we’ve initially solved it by exposing the labels beta.kubernetes.io/{os,arch}
on every node. This way a user may run binaries for different platforms on a multi-platform cluster, but still it requires manual work to apply the label to every manifest.
Also, the apiserver now exposes it’s platform at GET /version
. But note that the value exposed at /version
only is the apiserver’s platform; there might be kubelets of various other platforms.
All Makefiles should push for all platforms when doing make push
, and build for all platforms when doing make build
.
Under the hood; they should compile binaries in a container for reproducibility, and use QEMU for emulating Dockerfile RUN
commands if necessary.
All places where linux/amd64
is hardcoded in the codebase should be rewritten.
The pause
is used for connecting containers into Pods. It’s a binary that just sleeps forever.
When Kubernetes starts up a Pod, it first starts a pause
container, and let’s all “real” containers join the same network by setting --net=${pause_container_id}
.
So in order to start Kubernetes Pods on any other architecture, an ever-sleeping image have to exist.
Fortunately, kubelet
has the --pod-infra-container-image
option, and it has been used when running Kubernetes on other platforms.
But relying on the deployment setup to specify the right image for the platform isn’t great, the kubelet should be smarter than that.
This specific problem has been fixed in #23059.
Here are two common problems that a vendored package might have when trying to add/update it: - Including constants combined with build tags
//+ build linux,amd64
const AnAmd64OnlyConstant = 123
syscall.Dup2
)If someone tries to add a dependency that doesn’t satisfy these requirements; the CI will catch it and block the PR until the author has updated the vendored repo and fixed the problem.
kubectl is released for more platforms than the proposed server platforms, if you want to check out an up-to-date list of them, see here.
kubectl is trivial to cross-compile, so if there’s interest in adding a new platform for it, it may be as easy as appending the platform to the list linked above.
Addons like dns, heapster and ingress play a big role in a working Kubernetes cluster, and we should aim to be able to deploy these addons on multiple platforms too.
kube-dns
, dashboard
and addon-manager
are the most important images, and they are already ported for multiple platforms.
These addons should also be converted to multiple platforms: - heapster, influxdb + grafana - nginx-ingress - elasticsearch, fluentd + kibana - registry
What should we do if there’s a conflict between keeping e.g. linux/ppc64le
builds vs. merging a release blocker?
In fact, we faced this problem while this proposal was being written; in #25243. It is quite obvious that the release blocker is of higher priority.
However, before temporarily deactivating builds, the author of the breaking PR should first try to fix the problem. If it turns out being really hard to solve, builds for the affected platform may be deactivated and a P1 issue should be made to activate them again.
Go 1.5 introduced many changes. To name a few that are relevant to Kubernetes:
- C was eliminated from the tree (it was earlier used for the bootstrap runtime).
- All processors are used by default, which means we should be able to remove lines like this one
- The garbage collector became more efficient (but also confused our latency test).
- linux/arm64
and linux/ppc64le
were added as new ports.
- The GO15VENDOREXPERIMENT
was started. We switched from Godeps/_workspace
to the native vendor/
in this PR.
- It’s not required to pre-build the whole standard library std
when cross-compliling. Details
- Builds are approximately twice as slow as earlier. That affects the CI. Details
- The native Go DNS resolver will suffice in the most situations. This makes static linking much easier.
All release notes for Go 1.5 are here
Go 1.6 didn’t introduce as many changes as Go 1.5 did, but here are some of notes:
- It should perform a little bit better than Go 1.5.
- linux/mips64
and linux/mips64le
were added as new ports.
- Go < 1.6.2 for ppc64le
had bugs in it.
All release notes for Go 1.6 are here
In Kubernetes 1.2, the only supported Go version was 1.4.2
, so linux/arm
was the only possible extra architecture: #19769.
In Kubernetes 1.3, we upgraded to Go 1.6, which made it possible to build Kubernetes for even more architectures #23931.
sync/atomic
bug on 32-bit platformsFrom https://golang.org/pkg/sync/atomic/#pkg-note-BUG: > On both ARM and x86-32, it is the caller’s responsibility to arrange for 64-bit alignment of 64-bit words accessed atomically. The first word in a global variable or in an allocated struct or slice can be relied upon to be 64-bit aligned.
etcd
have had issues with this. See how to fix it here
// 32-bit-atomic-bug.go
package main
import "sync/atomic"
type a struct {
b chan struct{}
c int64
}
func main(){
d := a{}
atomic.StoreInt64(&d.c, 10 * 1000 * 1000 * 1000)
}
$ GOARCH=386 go build 32-bit-atomic-bug.go
$ file 32-bit-atomic-bug
32-bit-atomic-bug: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
$ ./32-bit-atomic-bug
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x808cd9b]
goroutine 1 [running]:
panic(0x8098de0, 0x1830a038)
/usr/local/go/src/runtime/panic.go:481 +0x326
sync/atomic.StoreUint64(0x1830e0f4, 0x540be400, 0x2)
/usr/local/go/src/sync/atomic/asm_386.s:190 +0xb
main.main()
/tmp/32-bit-atomic-bug.go:11 +0x4b
This means that all structs should keep all int64
and uint64
fields at the top of the struct to be safe. If we would move a.c
to the top of the a
struct above, the operation would succeed.
The bug affects 32-bit
platforms when a (u)int64
field is accessed by an atomic
method.
It would be great to write a tool that checks so all atomic
accessed fields are aligned at the top of the struct, but it’s hard: coreos/etcd#5027.
std
)A great blog post that is describing this
Before Go 1.5, the whole Go project had to be cross-compiled from source for all platforms that might be used, and that was quite a slow process:
# From build/build-image/cross/Dockerfile when we used Go 1.4
$ cd /usr/src/go/src
$ for platform in ${PLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} ./make.bash --no-clean; done
With Go 1.5+, cross-compiling the Go repository isn’t required anymore. Go will automatically cross-compile the std
packages that are being used by the code that is being compiled, and throw it away after the compilation.

However, there is an easy way of cross-compiling all std
packages in advance with Go 1.5+:
# From build/build-image/cross/Dockerfile when we're using Go 1.5+
$ for platform in ${PLATFORMS}; do GOOS=${platform%/*} GOARCH=${platform##*/} go install std; done
Static compilation with Go 1.5+ is dead easy:
// main.go
package main
import "fmt"
func main() {
fmt.Println("Hello Kubernetes!")
}
$ go build main.go
$ file main
main: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
$ GOOS=linux GOARCH=arm go build main.go
$ file main
main: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
The only thing you have to do is change the GOARCH
and GOOS
variables. Here’s a list of valid values for GOOS/GOARCH
net
Consider this:
// main-with-net.go
package main
import "net"
import "fmt"
func main() {
fmt.Println(net.ParseIP("<IP_ADDRESS>").String())
}
$ go build main-with-net.go
$ file main-with-net
main-with-net: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked,
interpreter /lib64/ld-linux-x86-64.so.2, not stripped
$ GOOS=linux GOARCH=arm go build main-with-net.go
$ file main-with-net
main-with-net: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
Wait, what? Just because we included net
from the std
package, the binary defaults to being dynamically linked when the target platform equals to the host platform?
Let’s take a look at go env
to get a clue why this happens:
$ go env
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOROOT="/usr/local/go"
GO15VENDOREXPERIMENT="1"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
See the CGO_ENABLED=1
at the end? That’s where compilation for the host and cross-compilation differs. By default, Go will link statically if no cgo
code is involved. net
is one of the packages that prefers cgo
, but doesn’t depend on it.
When cross-compiling on the other hand, CGO_ENABLED
is set to 0
by default.
To always be safe, run this when compiling statically:
$ CGO_ENABLED=0 go build -a -installsuffix cgo main-with-net.go
$ file main-with-net
main-with-net: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
See golang/go#9344 for more details.
In order to dynamically compile a go binary with cgo
, we need gcc
installed at build time.
The only Kubernetes binary that is using C code is the kubelet
, or in fact cAdvisor
on which kubelet
depends. hyperkube
is also dynamically linked as long as kubelet
is. We should aim to make kubelet
statically linked.
The normal x86_64-linux-gnu
can’t cross-compile binaries, so we have to install gcc cross-compilers for every platform. We do this in the kube-cross
image,
and depend on the emdebian.org
repository. Depending on emdebian
isn’t ideal, so we should consider using the latest gcc
cross-compiler packages from the ubuntu
main repositories in the future.
Here’s an example when cross-compiling plain C code:
// main.c
#include <stdio.h>
main()
{
printf("Hello Kubernetes!\n");
}
$ arm-linux-gnueabi-gcc -o main-c main.c
$ file main-c
main-c: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked,
interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.32, not stripped
And here’s an example when cross-compiling go
and c
:
// main-cgo.go
package main
/*
char* sayhello(void) { return "Hello Kubernetes!"; }
*/
import "C"
import "fmt"
func main() {
fmt.Println(C.GoString(C.sayhello()))
}
$ CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm go build main-cgo.go
$ file main-cgo
./main-cgo: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked,
interpreter /lib/ld-linux.so.3, for GNU/Linux 2.6.32, not stripped
The bad thing with dynamic compilation is that it adds an unnecessary dependency on glibc
at runtime.
Lastly, it’s even possible to cross-compile cgo
code statically:
$ CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc GOARCH=arm go build -ldflags '-extldflags "-static"' main-cgo.go
$ file main-cgo
./main-cgo: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked,
for GNU/Linux 2.6.32, not stripped
This is especially useful if we want to include the binary in a container.
If the binary is statically compiled, we may use busybox
or even scratch
as the base image.
This should be the preferred way of compiling binaries that strictly require C code to be a part of it.
32-bit ARM comes in two main flavours: ARMv5 and ARMv7. Go has the GOARM
environment variable that controls which version of ARM Go should target. Here’s a table of all ARM versions and how they play together:
| ARM Version | GOARCH | GOARM | GCC package | No. of bits |
|---|---|---|---|---|
| ARMv5 | arm | 5 | armel | 32-bit |
| ARMv6 | arm | 6 | - | 32-bit |
| ARMv7 | arm | 7 | armhf | 32-bit |
| ARMv8 | arm64 | - | aarch64 | 64-bit |
The compatibility between the versions is pretty straightforward, ARMv5 binaries may run on ARMv7 hosts, but not vice versa.
After binaries have been cross-compiled, they should be distributed in some manner.
The default and maybe the most intuitive way of doing this is by packaging it in a docker image.
All Dockerfile
commands except for RUN
works for any architecture without any modification.
The base image has to be switched to an arch-specific one, but except from that, a cross-built image is only a docker build
away.
FROM armel/busybox
ENV kubernetes=true
COPY kube-apiserver /usr/local/bin/
CMD ["/usr/local/bin/kube-apiserver"]
$ file kube-apiserver
kube-apiserver: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, not stripped
$ docker build -t k8s.gcr.io/kube-apiserver-arm:v1.x.y .
Step 1 : FROM armel/busybox
---> 9bb1e6d4f824
Step 2 : ENV kubernetes true
---> Running in 8a1bfcb220ac
---> e4ef9f34236e
Removing intermediate container 8a1bfcb220ac
Step 3 : COPY kube-apiserver /usr/local/bin/
---> 3f0c4633e5ac
Removing intermediate container b75a054ab53c
Step 4 : CMD /usr/local/bin/kube-apiserver
---> Running in 4e6fe931a0a5
---> 28f50e58c909
Removing intermediate container 4e6fe931a0a5
Successfully built 28f50e58c909
However, in the most cases, RUN
statements are needed when building the image.
The RUN
statement invokes /bin/sh
inside the container, but in this example, /bin/sh
is an ARM binary, which can’t execute on an amd64
processor.
Here’s a way to run ARM Docker images on an amd64 host by using qemu
:
# Register other architectures` magic numbers in the binfmt_misc kernel module, so it`s possible to run foreign binaries
$ docker run --rm --privileged multiarch/qemu-user-static:register --reset
# Download qemu 2.5.0
$ curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/v2.5.0/x86_64_qemu-arm-static.tar.xz \
| tar -xJ
# Run a foreign docker image, and inject the amd64 qemu binary for translating all syscalls
$ docker run -it -v $(pwd)/qemu-arm-static:/usr/bin/qemu-arm-static armel/busybox /bin/sh
# Now we`re inside an ARM container although we`re running on an amd64 host
$ uname -a
Linux 0a7da80f1665 4.2.0-25-generic #30-Ubuntu SMP Mon Jan 18 12:31:50 UTC 2016 armv7l GNU/Linux
Here a linux module called binfmt_misc
registered the “magic numbers” in the kernel, so the kernel may detect which architecture a binary is, and prepend the call with /usr/bin/qemu-(arm|aarch64|ppc64le)-static
. For example, /usr/bin/qemu-arm-static
is a statically linked amd64
binary that translates all ARM syscalls to amd64
syscalls.
The multiarch guys have done a great job here, you may find the source for this and other images at GitHub
32-bit ARM (linux/arm
) was the first platform Kubernetes was ported to, and luxas’ project Kubernetes on ARM
(released on GitHub the 31st of September 2015)
served as a way of running Kubernetes on ARM devices easily.
The 30th of November 2015, a tracking issue about making Kubernetes run on ARM was opened: #17981. It later shifted focus to how to make Kubernetes a more platform-independent system.
The 27th of April 2016, Kubernetes v1.3.0-alpha.3
was released, and it became the first release that was able to run the docker getting started guide on linux/amd64
, linux/arm
, linux/arm64
and linux/ppc64le
without any modification.


The class OptionConverter provides functions to convert strings to property values.
More...
#include <optionconverter.h>
List of all members.
Static Public Member Functions |
| static QString | findAndSubst (const Properties &rProperties, const QString &rKey) |
| static QString | classNameJavaToCpp (const QString &rClassName) |
| static bool | toBoolean (const QString &rOption, bool *p_ok=0) |
| static bool | toBoolean (const QString &rOption, bool default_value) |
| static qint64 | toFileSize (const QString &rOption, bool *p_ok=0) |
| static int | toInt (const QString &rOption, bool *p_ok=0) |
| static Level | toLevel (const QString &rOption, bool *p_ok=0) |
| static Level | toLevel (const QString &rOption, const Level &rDefaultValue) |
| static int | toTarget (const QString &rOption, bool *p_ok=0) |
Detailed Description
The class OptionConverter provides functions to convert strings to property values.
Member Function Documentation
| static QString Log4Qt::OptionConverter::classNameJavaToCpp |
( |
const QString & |
rClassName |
) |
[static] |
Returns the JAVA class name rClassName as C++ class name by replacing all . characters with ::.
| static QString Log4Qt::OptionConverter::findAndSubst |
( |
const Properties & |
rProperties, |
|
|
const QString & |
rKey | |
|
) |
| | [static] |
| static bool Log4Qt::OptionConverter::toBoolean |
( |
const QString & |
rOption, |
|
|
bool |
default_value | |
|
) |
| | [static] |
| static bool Log4Qt::OptionConverter::toBoolean |
( |
const QString & |
rOption, |
|
|
bool * |
p_ok = 0 | |
|
) |
| | [static] |
Converts the option rOption to a boolean value. Valid strings for true are "true", "enabled" and "1". Valid strings for false are "false", "disabled" and "0". If the conversion is successful, the target is returned and p_ok is set to true. Otherwise an error is written to the log, p_ok is set to false and false is returned.
| static qint64 Log4Qt::OptionConverter::toFileSize |
( |
const QString & |
rOption, |
|
|
bool * |
p_ok = 0 | |
|
) |
| | [static] |
Converts the option string rOption to a file size. The string can be a positive integer followed by an optional unit suffix "KB", "MB" or "GB". If a unit suffix is specified the the integer is interpreted as kilobytes, megabytes or gigabytes. If the conversion is successful, the size is returned and p_ok is set to true. Otherwise an error is written to the log, p_ok is set to false and 0 is returned.
| static int Log4Qt::OptionConverter::toInt |
( |
const QString & |
rOption, |
|
|
bool * |
p_ok = 0 | |
|
) |
| | [static] |
Converts the option rOption to a integer value using QString::toInt(). If the conversion is successful, the integer is returned and p_ok is set to true. Otherwise an error is written to the log, p_ok is set to false and 0 is returned.
| static Level Log4Qt::OptionConverter::toLevel |
( |
const QString & |
rOption, |
|
|
const Level & |
rDefaultValue | |
|
) |
| | [static] |
| static Level Log4Qt::OptionConverter::toLevel |
( |
const QString & |
rOption, |
|
|
bool * |
p_ok = 0 | |
|
) |
| | [static] |
Converts the option rOption to a level value using Level::fromString(). If the conversion is successful, the level is returned and p_ok is set to true. Otherwise an error is written to the log, p_ok is set to false and a level with the value Level::NULL_INT is returned.
- See also:
- Level::fromString()
| static int Log4Qt::OptionConverter::toTarget |
( |
const QString & |
rOption, |
|
|
bool * |
p_ok = 0 | |
|
) |
| | [static] |
Converts the option rOption to a ConsoleAppender::Target value. Valid strings for rOption are "System.out", "STDOUT_TARGET", "System.err" and "STDERR_TARGET". If the conversion is successful, the target is returned and p_ok is set to true. Otherwise an error is written to the log, p_ok is set to false and ConsoleAppender::STDOUT_TARGET is returned.
The documentation for this class was generated from the following file:


Hi! I'm Denperidge, and this is where I store any resources I find for those looking to make some LGBTQIA2S+ designs, but also are broke.
Oh, note that I'm not a lawyer, not of this is legal advice. That being said, here's some advice that may look like legal advice:The original designer (who seems like a pretty cool person!) has very lenient usage terms written down, which - for non-commercial usage - *tend* to summarize to "hey tag me because I want to like your stuff". And there's even a contact for commercial usage! Read the terms here and get the assets here.
Every image - if I'm correct - on Wikipedia has a Wikimedia entry, and thus has a license written down. This license can tell you if it's public domain, or what other license it has. This is how I found out about Daniel Quasar, go figure!
Need some vectors? Need some clipart? Publicdomainvectors.org has public domain ones! No intrusive advertising or anything, just some nice art.
Here's a link to the example above!Sites like Unsplash and Pexels host a bunch of high-quality images, all allowed to be used in non-commercial and commercial purposes, simply asking for giving credit if/wherever possible! Of course (generally speaking, check the websites licensing) you can't outright sell the images on their own or use them to make a competitor to the website, but I'm assuming you weren't going to do that. Visit Unsplash here and/or Pexels here!


This program allows to test OpenCV stereo vision capabilities. You can rectify camera, create disparity map and test depth map creation from static stereo image or stereo camera pair directly. Program is controlled with config.properies file. See common section in below description how to configure global parameters. It runs with 4 modes, which can be combined with using bit OR (int this case just add mode numbers):
Default run mode set in config.properies (1+2) is good to create rectification matrices, which further modes don't work without
To use program you need stereo camera pair. I used two USB webcams that was glued to stable basic as it is visible in the image below. I used two Canon Live! Cam Sync HD VF0770 (about 15&euro / 20$ each one) mainly to be sure that Raspberry Pi supports it as a part of other project. Problem was pretty large noise what impacted disparity. More advanced hardware should give better results.
The distance between cameras was about 8cm. It is not necessary to put them ideally aligned, it is task for rectification stage
When you will start the program, two images from both cameras are visible and a little window with number counting to 0. When 0 is reached, then shapshots are taken from left and right camera. If the chessboard was detected successfully the circle next to the number will keep green, red if no chessboard was detected.
Take about 30 - 50 successful pairs (you can resume capturing when overwriteImages is set to 0) changing chessboard orientation, angle and distance. After that press escape to go to the next stage.
Using taken stereo image pairs the algorithm will try to make rectification transformations. It can take a couple of minutes.
After finish, the result is:
The console output contains also rectification error - the less the better.
Rectified
Before rectification
Mode 3 allows to test static image pair (see common configuration below), 4 captures images from the camera pair. For mode 3 these images should also be taken from this camera pair (rectification), it is useful to make initial tuning and see little details.
While running these modes you will see some windows
You have two alghoritms to test
When you find good configuration press ENTER to update the config
The center of image on "Depth" window is used to calculate minimal distance to objects in this area. Units used are the same as passed in fieldSize parametes (e.g if your chessboard tile is 2cm width and you set it to 2, you will get it in centimeters).
To observe 3D reconstruction use arrow and W,S,A,D keys
Example tuning
Example tuning
| Name | Default value | Description |
|---|---|---|
| logLevel | INFO | Logging verbosity: ERROR, INFO, DEBUG |
| overwriteImages | 1 | if true every checboard detection stage will overwrite previous run (it will be backuped) |
| runMode | 8 | bit OR of run modes: 1-chessboard detect, 2-calibration, 4-test with static image pair, 8-test with camera |
| leftTestImage | images/left_001.ppm | Left test image to create disparity map (run mode 4) |
| rightTestImage | images/right_001.ppm | Right test image to create disparity map (run mode 4) |
| Name | Default value | Description |
|---|---|---|
| boardWidth | 9 | Horizontal number of chessboard fields - 1, for 10x10 it is 9 |
| boardHeight | 6 | vertical number of chessboard fields - 1, for 10x10 it is 9 |
| fieldSize | 1.8 | chessboard field size (any unit, may be cm) |
| leftCamId | 1 | Index of left camera of stereo pair |
| rightCamId | 0 | Index of right camera of stereo pair |
| captureWidth | 0 | For chessboard detection, 0 - using current resolution, remember to update remapWidth and remapHeight properly |
| captureHeight | 0 | For chessboard detection |
| chessboardImagesDir | outimages/chessboards6 | Directory where are saved latest detected chessboards |
| chessboardSleep | 5 | Seconds between taking chessboard photo |
| remapWidth | 640 | Width of remap matrices - the same as image width to be used with |
| remapHeight | 480 | Remap height of final resolution |
| show3d | 1 | 1 to show remapped disparity map to 3d |
| Name | Default value | Description |
|---|---|---|
| algorithm | 0 | 0-SBM, 1-SGBM |
| nDispMult16 | 7 | nDispMult16*16 = num disparity [1,20] |
| blockSize | 7 | SADWIndowSize/block size [3, 79] |
| uniquenesRatio | 1 | sbm/sgbm [0, 45] |
| preFilterCap | 16 | sbm/sgbm [0, 63] |
| disparityFiltering | 1 | [0-off, 1-on], needs Contrib modules |
| disparityFilteringLambda | 8350 | [1, 15000], 8000 typically |
| disparityFilteringSigma | 1060 | [1, 5000], 800-2000 typically |
| smoothKernelSize | 21 | Gauss filter camera image, odd number |
| disp12MaxDiff | 22 | sbm/sgbm [0, 45] |
| minDisparity | 0 | sbm/sgbm [0, 151] |
| minDispeckleWindowSizesparity | 104 | sbm/sgbm [0, 600] |
| speckleRangeMult16 | 2 | sbm/sgbm speckleRangeMult16*16=specleRange [0, 10] |
| sbmPreFilterSize | 15 | [5,255] |
| sbmFilterType | 0 | 0-PREFILTER_NORMALIZED_RESPONSE, 1-PREFILTER_XSOBEL |
| sbmSmallerBlockSize | 1 | [0,151] |
| sbmTextureThreshold | 5 | [0,151] |
| sgbmP1 | 604 | [0, 3000], good approx.: 8*number_of_image_channels*SADWindowSize*SADWindowSize |
| sgbmP2 | 1967 | [0, 3000], good approx.: 32*number_of_image_channels*SADWindowSize*SADWindowSize |
| sgbmMode | 0 | 0-MODE_SGBM, 1-MODE_HH, 2-MODE_SGBM_3WAY |


The practice of articulation thus involves laying bare the contingent and heterogeneous elements that constitute conjunctural articulations for the purpose of intervening in them, and through disarticulating and
rearticulating...particularly important lines of force, reconstituting the conjuncture and changing the nature of the historical context itself. The theory and practice of articulation thus offers us a sophisticated way to both map and
intervene in power and its effects among and between the various levels of a social formation. Rearticulation does not represent a ‘step forward’ in a grand narrative of progress, but represents the disconnection and reconnection of
contingent and nonnecessary elements whose relation may be manipulated in the interests of certain positions of power. The goal of the critical work of the articulation theorist—the rearticulation of conjunctural relations—thus
represents the hope, but never the necessary guarantee, of greater social justice.


In this project, you'll use generative adversarial networks to generate new images of faces.
You'll be using two datasets in this project:
Since the celebA dataset is complex and you're doing GANs in a project for the first time, we want you to test your neural network on MNIST before CelebA. Running the GANs on MNIST will allow you to see how well your model trains sooner.
If you're using FloydHub, set data_dir
to "/input" and use the FloydHub data ID "R5KrjnANiKVhLWAkpXhNBe".
data_dir = './data'
# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
#data_dir = '/input'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
%matplotlib inline
import os
from glob import glob
from matplotlib import pyplot
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'mnist/*.jpg'))[:show_n_images], 28, 28, 'L')
pyplot.imshow(helper.images_square_grid(mnist_images, 'L'), cmap='gray')
The CelebFaces Attributes Dataset (CelebA) dataset contains over 200,000 celebrity images with annotations. Since you're going to be generating faces, you won't need the annotations. You can view the first number of examples by changing show_n_images
.
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'img_align_celeba/*.jpg'))[:show_n_images], 28, 28, 'RGB')
pyplot.imshow(helper.images_square_grid(mnist_images, 'RGB'))
Since the project's main focus is on building the GANs, we'll preprocess the data for you. The values of the MNIST and CelebA dataset will be in the range of -0.5 to 0.5 of 28x28 dimensional images. The CelebA images will be cropped to remove parts of the image that don't include a face, then resized down to 28x28.

You'll build the components necessary to build a GANs by implementing the following functions below:
model_inputs
discriminator
generator
model_loss
model_opt
train
This will check to make sure you have the correct version of TensorFlow and access to a GPU
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
from distutils.version import LooseVersion
import warnings
import tensorflow as tf
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__)
print('TensorFlow Version: {}'.format(tf.__version__))
# Check for a GPU
if not tf.test.gpu_device_name():
warnings.warn('No GPU found. Please use a GPU to train your neural network.')
else:
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
Implement the model_inputs
function to create TF Placeholders for the Neural Network. It should create the following placeholders:
image_width
, image_height
, and image_channels
.z_dim
.Return the placeholders in the following the tuple (tensor of real input images, tensor of z data)
import problem_unittests as tests
def model_inputs(image_width, image_height, image_channels, z_dim):
"""
Create the model inputs
:param image_width: The input image width
:param image_height: The input image height
:param image_channels: The number of image channels
:param z_dim: The dimension of Z
:return: Tuple of (tensor of real input images, tensor of z data, learning rate)
"""
# TODO: Implement Function
real_image_tensor = tf.placeholder(tf.float32, (None, image_width, image_height, image_channels), name='real_image_tensor')
z_tensor = tf.placeholder(tf.float32, (None, z_dim), name='z_tensor')
learning_rate = tf.placeholder(tf.float32, [], name='learning_rage')
return real_image_tensor, z_tensor, learning_rate
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_inputs(model_inputs)
Implement discriminator
to create a discriminator neural network that discriminates on images
. This function should be able to reuse the variables in the neural network. Use tf.variable_scope
with a scope name of "discriminator" to allow the variables to be reused. The function should return a tuple of (tensor output of the discriminator, tensor logits of the discriminator).
def discriminator(images, reuse=False, alpha = 0.2):
"""
Create the discriminator network
:param images: Tensor of input image(s)
:param reuse: Boolean if the weights should be reused
:return: Tuple of (tensor output of the discriminator, tensor logits of the discriminator)
"""
# TODO: Implement Function
with tf.variable_scope('discriminator', reuse=reuse):
x1 = tf.layers.conv2d(images, 64, 5, strides=2, padding='same')
relu1 = tf.maximum(alpha * x1, x1)
x2 = tf.layers.conv2d(relu1, 128, 5, strides=2, padding='same')
bn2 = tf.layers.batch_normalization(x2, training=True)
relu2 = tf.maximum(alpha * bn2, bn2)
x3 = tf.layers.conv2d(relu2, 256, 5, strides=2, padding='same')
bn3 = tf.layers.batch_normalization(x3, training=True)
relu3 = tf.maximum(alpha * bn3, bn3)
flat = tf.reshape(relu3, (-1, 4 * 4 * 256))
logits = tf.layers.dense(flat, 1)
out = tf.sigmoid(logits)
return out, logits
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_discriminator(discriminator, tf)
Implement generator
to generate an image using z
. This function should be able to reuse the variables in the neural network. Use tf.variable_scope
with a scope name of "generator" to allow the variables to be reused. The function should return the generated 28 x 28 x out_channel_dim
images.
def generator(z, out_channel_dim, is_train=True, alpha = 0.2):
"""
Create the generator network
:param z: Input z
:param out_channel_dim: The number of channels in the output image
:param is_train: Boolean if generator is being used for training
:return: The tensor output of the generator
"""
# TODO: Implement Function
with tf.variable_scope('generator', reuse=not is_train):
# First fully connected layer
x1 = tf.layers.dense(z, 7*7*128)
# Reshape it to start the convolutional stack
x1 = tf.reshape(x1, (-1, 7, 7, 128))
x1 = tf.layers.batch_normalization(x1, training=is_train)
x1 = tf.maximum(alpha * x1, x1)
x2 = tf.layers.conv2d_transpose(x1, 64, 5, strides=2, padding='same')
x2 = tf.layers.batch_normalization(x2, training=is_train)
x2 = tf.maximum(alpha * x2, x2)
x3 = tf.layers.conv2d_transpose(x2, 32, 5, strides=2, padding='same')
x3 = tf.layers.batch_normalization(x3, training=is_train)
x3 = tf.maximum(alpha * x3, x3)
x4 = tf.layers.conv2d_transpose(x3, 16, 5, strides=1, padding='same')
x4 = tf.layers.batch_normalization(x4, training=is_train)
x4 = tf.maximum(alpha * x4, x4)
# Output layer
logits = tf.layers.conv2d_transpose(x4, out_channel_dim, 5, strides=1, padding='same')
out = tf.tanh(logits)
return out
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_generator(generator, tf)
Implement model_loss
to build the GANs for training and calculate the loss. The function should return a tuple of (discriminator loss, generator loss). Use the following functions you implemented:
discriminator(images, reuse=False)
generator(z, out_channel_dim, is_train=True)
def model_loss(input_real, input_z, out_channel_dim):
"""
Get the loss for the discriminator and generator
:param input_real: Images from the real dataset
:param input_z: Z input
:param out_channel_dim: The number of channels in the output image
:return: A tuple of (discriminator loss, generator loss)
"""
# TODO: Implement Function
g_model = generator(input_z, out_channel_dim)
d_model_real, d_logits_real = discriminator(input_real)
d_model_fake, d_logits_fake = discriminator(g_model, reuse=True)
# Calculate losses
d_loss_real = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real, labels=tf.ones_like(d_logits_real)*0.9))
d_loss_fake = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.zeros_like(d_logits_real)))
g_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake, labels=tf.ones_like(d_logits_fake)))
d_loss = d_loss_real + d_loss_fake
return d_loss, g_loss
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_loss(model_loss)
Implement model_opt
to create the optimization operations for the GANs. Use tf.trainable_variables
to get all the trainable variables. Filter the variables with names that are in the discriminator and generator scope names. The function should return a tuple of (discriminator training operation, generator training operation).
def model_opt(d_loss, g_loss, learning_rate, beta1):
"""
Get optimization operations
:param d_loss: Discriminator loss Tensor
:param g_loss: Generator loss Tensor
:param learning_rate: Learning Rate Placeholder
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:return: A tuple of (discriminator training operation, generator training operation)
"""
# TODO: Implement Function
# Get weights and bias to update
t_vars = tf.trainable_variables()
d_vars = [var for var in t_vars if var.name.startswith('discriminator')]
g_vars = [var for var in t_vars if var.name.startswith('generator')]
# Optimize
with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
d_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list=d_vars)
g_train_opt = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list=g_vars)
return d_train_opt, g_train_opt
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_opt(model_opt, tf)
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import numpy as np
def show_generator_output(sess, n_images, input_z, out_channel_dim, image_mode):
"""
Show example output for the generator
:param sess: TensorFlow session
:param n_images: Number of Images to display
:param input_z: Input Z Tensor
:param out_channel_dim: The number of channels in the output image
:param image_mode: The mode to use for images ("RGB" or "L")
"""
cmap = None if image_mode == 'RGB' else 'gray'
z_dim = input_z.get_shape().as_list()[-1]
example_z = np.random.uniform(-1, 1, size=[n_images, z_dim])
samples = sess.run(
generator(input_z, out_channel_dim, False),
feed_dict={input_z: example_z})
images_grid = helper.images_square_grid(samples, image_mode)
pyplot.imshow(images_grid, cmap=cmap)
pyplot.show()
Implement train
to build and train the GANs. Use the following functions you implemented:
model_inputs(image_width, image_height, image_channels, z_dim)
model_loss(input_real, input_z, out_channel_dim)
model_opt(d_loss, g_loss, learning_rate, beta1)
Use the show_generator_output
to show generator
output while you train. Running show_generator_output
for every batch will drastically increase training time and increase the size of the notebook. It's recommended to print the generator
output every 100 batches.
def train(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode):
"""
Train the GAN
:param epoch_count: Number of epochs
:param batch_size: Batch Size
:param z_dim: Z dimension
:param learning_rate: Learning Rate
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:param get_batches: Function to get batches
:param data_shape: Shape of the data
:param data_image_mode: The image mode to use for images ("RGB" or "L")
"""
# TODO: Build Model
input_real, input_z, l_rate = model_inputs(data_shape[1], data_shape[2], len(data_image_mode), z_dim)
d_loss, g_loss = model_loss(input_real, input_z, data_shape[3])
d_train_opt, g_train_opt = model_opt(d_loss, g_loss, l_rate, beta1)
batch_count = 0
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch_i in range(epoch_count):
for batch_images in get_batches(batch_size):
# TODO: Train Model
batch_images *= 2 # scale values from -0.5..0.5 to -1..1
batch_z = np.random.uniform(-1, 1, size=(batch_size, z_dim))
sess.run(d_train_opt, feed_dict={input_real: batch_images, input_z: batch_z, l_rate: learning_rate})
sess.run(g_train_opt, feed_dict={input_real: batch_images, input_z: batch_z, l_rate: learning_rate})
batch_count += 1
if batch_count % 100 == 1:
show_generator_output(sess, 25, input_z, data_shape[3], data_image_mode)
train_loss_d = d_loss.eval({input_z: batch_z, input_real: batch_images})
train_loss_g = g_loss.eval({input_z: batch_z})
print("Epoch {}/{}...".format(epoch_i+1, epoch_count),
"Discriminator Loss: {:.4f}...".format(train_loss_d),
"Generator Loss: {:.4f}".format(train_loss_g))
Test your GANs architecture on MNIST. After 2 epochs, the GANs should be able to generate images that look like handwritten digits. Make sure the loss of the generator is lower than the loss of the discriminator or close to 0.
batch_size = 50
z_dim = 20
learning_rate = 0.001
beta1 = 0.3
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 2
mnist_dataset = helper.Dataset('mnist', glob(os.path.join(data_dir, 'mnist/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, mnist_dataset.get_batches,
mnist_dataset.shape, mnist_dataset.image_mode)
Run your GANs on CelebA. It will take around 20 minutes on the average GPU to run one epoch. You can run the whole epoch or stop when it starts to generate realistic faces.
batch_size = 50
z_dim = 100
learning_rate = 0.001
beta1 = 0.3
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 1
celeba_dataset = helper.Dataset('celeba', glob(os.path.join(data_dir, 'img_align_celeba/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, celeba_dataset.get_batches,
celeba_dataset.shape, celeba_dataset.image_mode)
When submitting this project, make sure to run all the cells before saving the notebook. Save the notebook file as "dlnd_face_generation.ipynb" and save it as a HTML file under "File" -> "Download as". Include the "helper.py" and "problem_unittests.py" files in your submission.


The new API is totally different in detail, the names of all include files, functions, types, and constants have changed. Many of the changes though are fairly cosmetic and trivial to port. In most other cases the new API should be more convenient to use. The iteration/enumeration functions are the only ones with significant visible semantic change.
This guide does not describe all of the old XMP functions, only those which have some non-trivial aspect for porting. If something is not described here, look at the old and new function signatures. They should be similar enough to make the transition obvious.
This is particularly true for the old UtilityXAP functions, they all have obvious mappings. Some of the UtilityXAP functions have been moved to TXMPMeta, mainly the binary get/set functions (UtilityXAP::GetBoolean has become TXMPMeta::GetProperty_Bool). Low value functions like UtilityXAP::AnalyzeStep or UtilityXAP::FilterPropPath have been removed.
Classes
The client API is defined by 3 C++ template classes: TXMPMeta, TXMPIterator, and TXMPUtils. These correspond to the old MetaXAP, XAPPaths, and UtilityXAP classes. The templates are instantiated with a string class which is used for the return of UTF-8 strings. The XMP headers will declare instantiated classes with the names SXMPMeta, SXMPIterator, and SXMPUtils.
The associated string class must provide these member functions, identical to those of std::string:
assign ( const char * str, size_t len ) const char * c_str() size_t size()
The result of assign does not matter, it is only used in a "void" manner.
Clients should only include XMP.hpp to access XMP, and XMP.incl_cpp to compile the template instantiations and client-side glue. The template string class is specified by defining TXMP_STRING_TYPE before the #include of either. A simple example is:
#define TXMP_STRING_TYPE std::string #include "XMP.hpp" #include "XMP.incl_cpp"
Basic Property Access
The old functions MetaXAP::get and MetaXAP::set are replaced by TXMPMeta::GetProperty and TXMPMeta::SetProperty. The basic mapping for these is very simple.
The old way to set a simple property:
meta.set ( XAP_NS_XAP, "CreatorTool", "Adobe Illustrator" );
The new way to set a simple property:
meta.SetProperty ( kXMP_NS_XMP, "CreatorTool", "Adobe Illustrator" );
The old way to get a simple property:
bool found; std::string value; XAPFeatures features; found = meta.get ( XAP_NS_XAP, "CreatorTool", value, features );
The new way to get a simple property:
bool found; std::string value; XMP_OptionBits options; found = meta.GetProperty ( kXMP_NS_XMP, "CreatorTool", &value, &options );
As before, you can pass XPath expressions for the second parameter to access elements of arrays or fields of structs. But there are new routines to make that easier. In addition, the new API allows you to eliminate the annoying '/*' for array items, reducing "Array/*[1]" to "Array[1]".
The options parameter returns considerably more information than the old features parameter. See the enum constants in XMP_Const.h for details.
Accessing Array Items
There are now special get/set functions for array items that take the index as an integer. This relieves you of the burden of formatting a path expression with the index as a decimal string. The examples below for the first element generalizes to any index in the obvious ways.
meta.set ( XAP_NS_XAP, "Authors/*[1]", "Frank Zappa" ); found = meta.get ( XAP_NS_XAP, "Authors/*[1]", value, features );
The new way to access the first element of an array:
meta.SetArrayItem ( kXMP_NS_XMP, "Authors", 1, "Frank Zappa" ); meta.GetArrayItem ( kXMP_NS_XMP, "Authors", 1, &value, &options );
The old way to access the last element of an array:
meta.set ( XAP_NS_XAP, "Authors/*[last()]", "Frank Zappa" ); found = meta.get ( XAP_NS_XAP, "Authors/*[last()]", value, features );
The new way to access the last element of an array:
meta.SetArrayItem ( kXMP_NS_XMP, "Authors", kXMP_ArrayLastItem, "Frank Zappa" ); meta.GetArrayItem ( kXMP_NS_XMP, "Authors", kXMP_ArrayLastItem, &value, &options );
Creating Array Items
The old API had rather cumbersome createFirstItem and append functions to use when adding an item to an array. The new API has a more convenient AppendArrayItem function.
The old way to create an array item, appending to the end:
size_t count; try { count = meta.count ( XAP_NS_XAP, "Authors/*" ); } catch ( ... ) { count = 0 } if ( count == 0 ) { meta.createFirstItem ( XAP_NS_XAP, "Authors", "Frank Zappa", xap_seq ); } else { meta.append ( XAP_NS_XAP, "Authors/*[last()]", "Frank Zappa" ) }
The new way to create an array item, appending to the end:
meta.AppendArrayItem ( kXMP_NS_XMP, "Authors", kXMP_PropArrayIsOrdered, "Frank Zappa" );
Here's how to see if an array exists or how big it is:
bool exists = meta.DoesPropertyExist ( kXMP_NS_XMP, "Authors" ); size_t count = meta.CountArrayItems ( kXMP_NS_XMP, "Authors" );
Accessing Struct Fields
In the old API you accessed a field in a struct by writing an XPath expression of the general form "Struct/ns:Field". This has the subtle drawback that you must use the namespace prefix in the XPath expression. But prefixes are not guaranteed! The new API has functions that take the namespace URI.
The old way to access a field in a struct:
meta.set ( XAP_NS_XAP_T_PG, "MaxPageSize/stDim:unit", "inch" ); found = meta.get ( XAP_NS_XAP_T_PG, "MaxPageSize/stDim:unit", value, features );
The new way to access a field in a struct:
meta.SetStructField ( XAP_NS_XAP_T_PG, "MaxPageSize", kXMP_NS_ST_Dim, "unit" "inch" ); found = meta.GetStructField ( XAP_NS_XAP_T_PG, "MaxPageSize", kXMP_NS_ST_Dim, "unit", &value, &options );
Accessing Composite Data Structures
The old API forced you to write full XPath expressions for composite data structures with arrays or structs nested inside each other. This forced you to know the XPath syntax, and suffer the risks of using namespace prefixes for struct fields. The new API has path composition functions in XMPUtils to avoid both of these problems. You can compose the entire path then call Get/SetProperty, or compose all but the last portion then use Get/SetArrayItem or Get/SetStructField.
The examples here only show ComposeArrayItemPath, ComposeStructFieldPath is an obvious analog.
The old way to access a struct field within an array item:
found = meta.get ( XAP_NS_XAP, "Thumbnails/*[1]/xapGImg:format", value, features );
The new way to access a struct field within an array item:
std::string itemPath; XMPUtils::ComposeArrayItemPath ( kXMP_NS_XMP, "Thumbnails", 1, &itemPath ); found = meta.GetStructField ( kXMP_NS_XMP, itemPath.c_str(), kXMP_NS_XMP_G_IMG, "format", &value, &options );
The new API has the same construct-and-parse capability as the old API. This parses one buffer that must be a complete collection of XMP. Parsing multiple buffers where you do the I/O is similar to before, differing mainly in a reversal of the "I'm done" signal.
The old way to read and parse:
MetaXAP meta; char buffer [...]; size_t length; while ( true ) { -- read into buffer, setting length if ( length != 0 ) break; meta.parse ( buffer, length ); } meta.parse ( buffer, 0, true );
The new way to read and parse:
SXMPMeta meta ( 0, 0 ); char buffer [...]; size_t length; while ( true ) { -- read into buffer, setting length if ( length != 0 ) break; meta.ParseFromBuffer ( buffer, length, kXMP_ParseMoreBuffers ); } meta.ParseFromBuffer ( buffer, 0 );
Serialization in the old API was a multi-step process. You used MetaXAP::serialize to generate a hidden serialization, then used MetaXAP::extractSerialization to extract that, then used UtilityXAP::CreateXMLPacket to get the XMP packet wrapping. The New API combines all of this into TXMPMeta::SerializeToBuffer.
The old way to write a serialized packet:
size_t rdfLength = meta.serialize(); std::string header, trailer; char buffer [...]; UtilityXAP::CreateXMLPacket ( "", true, 4096, "\n", header, trailer ); -- write the header string while ( rdfLength > sizeof(buffer) ) { meta.extractSerialization ( buffer, sizeof(buffer) ); -- write this buffer rdfLength -= sizeof(buffer); } meta.extractSerialization ( buffer, rdfLength ); -- write this buffer (only rdfLength bytes) -- write the trailer string
The new way to write a serialized packet:
std::string packet; meta.SerializeToBuffer ( &packet ); -- write the packet string
Iteration
The functions to iterate over the XMP data tree have not changed a lot at first glance, but the way they operate has changed considerably.
The old API essentially offered two ways to do an iteration:
Simple, default iteration code in the new API:
std::string str1, str2, str3; XMP_OptionBits options; SXMPIterator iter ( meta ); while ( iter.Next ( &str1, &str2, &str3, &options ) ) { fprintf ( log, " %s %s = \"%s\", 0x%X\n", str1.c_str(), str2.c_str(), str3.c_str(), options ); }
For this RDF input:
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <rdf:Description rdf:about='' xmlns:ns1='ns:test1/' xmlns:ns2='ns:test2/'> <ns1:SimpleProp1>Simple1 value</ns1:SimpleProp1> <ns1:SimpleProp2 xml:lang='x-default'>Simple2 value</ns1:SimpleProp2> <ns1:ArrayProp1> <rdf:Bag> <rdf:li>Item1.1 value</rdf:li> <rdf:li>Item1.2 value</rdf:li> </rdf:Bag> </ns1:ArrayProp1> <ns1:ArrayProp2> <rdf:Alt> <rdf:li xml:lang='x-one'>Item2.1 value</rdf:li> <rdf:li xml:lang='x-two'>Item2.2 value</rdf:li> </rdf:Alt> </ns1:ArrayProp2> <ns1:StructProp rdf:parseType='Resource'> <ns2:Field1>Field1 value</ns2:Field1> <ns2:Field2>Field2 value</ns2:Field2> </ns1:StructProp> <ns1:QualProp1 rdf:parseType='Resource'> <rdf:value>Prop value</rdf:value> <ns2:Qual>Qual value</ns2:Qual> </ns1:QualProp1> <ns1:QualProp2 rdf:parseType='Resource'> <rdf:value xml:lang='x-default'>Prop value</rdf:value> <ns2:Qual>Qual value</ns2:Qual> </ns1:QualProp2> <ns1:NestedStructProp rdf:parseType='Resource'> <ns2:Outer rdf:parseType='Resource'> <ns2:Middle rdf:parseType='Resource'> <ns2:Inner rdf:parseType='Resource'> <ns2:Field1>Field1 value</ns2:Field1> <ns2:Field2>Field2 value</ns2:Field2> </ns2:Inner> </ns2:Middle> </ns2:Outer> </ns1:NestedStructProp> </rdf:Description> </rdf:RDF>
The iteration shown above would print (spacing added by hand for legibility):
ns:test1/ = "", 0x80000000 ns:test1/ SimpleProp1 = "Simple1 value", 0x0 ns:test1/ SimpleProp2 = "Simple2 value", 0x50 ns:test1/ SimpleProp2/?xml:lang = "x-default", 0x20 ns:test1/ ArrayProp1 = "", 0x200 ns:test1/ ArrayProp1[1] = "Item1.1 value", 0x0 ns:test1/ ArrayProp1[2] = "Item1.2 value", 0x0 ns:test1/ ArrayProp2 = "", 0xE00 ns:test1/ ArrayProp2[1] = "Item2.1 value", 0x50 ns:test1/ ArrayProp2[1]/?xml:lang = "x-one", 0x20 ns:test1/ ArrayProp2[2] = "Item2.2 value", 0x50 ns:test1/ ArrayProp2[2]/?xml:lang = "x-two", 0x20 ns:test1/ StructProp = "", 0x100 ns:test1/ StructProp/ns2:Field1 = "Field1 value", 0x0 ns:test1/ StructProp/ns2:Field2 = "Field2 value", 0x0 ns:test1/ QualProp1 = "Prop value", 0x10 ns:test1/ QualProp1/?ns2:Qual = "Qual value", 0x20 ns:test1/ QualProp2 = "Prop value", 0x50 ns:test1/ QualProp2/?xml:lang = "x-default", 0x20 ns:test1/ QualProp2/?ns2:Qual = "Qual value", 0x20 ns:test1/ NestedStructProp = "", 0x100 ns:test1/ NestedStructProp/ns2:Outer = "", 0x100 ns:test1/ NestedStructProp/ns2:Outer/ns2:Middle = "", 0x100 ns:test1/ NestedStructProp/ns2:Outer/ns2:Middle/ns2:Inner = "", 0x100 ns:test1/ NestedStructProp/ns2:Outer/ns2:Middle/ns2:Inner/ns2:Field1 = "Field1 value", 0x0 ns:test1/ NestedStructProp/ns2:Outer/ns2:Middle/ns2:Inner/ns2:Field2 = "Field2 value", 0x0


 When he woke up, though, the world was already more screwed up than he could have imagined and he instead decided to work on some film projects that he's been thinking about since college. He lives in the Marianas Trench with 2 dogs and a giant squid.
Nathan likes eggnog. He is also actually a Dragon disguised as a human, nefariously scheming his nefarious plans to eradicate Internet Explorer into oblivion. He can also turn invisible when he feels like it.


src.ops.female package¶
Submodules¶
src.ops.female.f_body module¶
-
class
src.ops.female.f_body.
FemaleBody
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female body parts to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_body_add'¶ str
- Type
type
-
bl_label
: str = 'Body'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
group
= <src.ops.body_group.BodyGroup object>¶
-
src.ops.female.f_feet module¶
-
class
src.ops.female.f_feet.
FemaleFeet
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female feet to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_feet_add'¶ str
- Type
type
-
bl_label
: str = 'Feet'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
part
= <src.ops.body_part.BodyPart object>¶
-
src.ops.female.f_hands module¶
-
class
src.ops.female.f_hands.
FemaleHands
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female hands to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_hands_add'¶ str
- Type
type
-
bl_label
: str = 'Hands'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
part
= <src.ops.body_part.BodyPart object>¶
-
src.ops.female.f_head module¶
-
class
src.ops.female.f_head.
FemaleHead
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female head to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_head_add'¶ str
- Type
type
-
bl_label
: str = 'Head'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
part
= <src.ops.body_part.BodyPart object>¶
-
src.ops.female.f_legs module¶
-
class
src.ops.female.f_legs.
FemaleLegs
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female legs to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_legs_add'¶ str
- Type
type
-
bl_label
: str = 'Legs'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
part
= <src.ops.body_part.BodyPart object>¶
-
src.ops.female.f_thighs module¶
-
class
src.ops.female.f_thighs.
FemaleThighs
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female thighs to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_thighs_add'¶ str
- Type
type
-
bl_label
: str = 'Thighs'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
part
= <src.ops.body_part.BodyPart object>¶
-
src.ops.female.f_torso module¶
-
class
src.ops.female.f_torso.
FemaleTorso
¶ Bases:
bpy.types.Operator
Adds imvu mesh primitive female torso to scene
-
bl_idname
: str = 'mesh.primitive_imvu_female_torso_add'¶ str
- Type
type
-
bl_label
: str = 'Torso'¶ str
- Type
type
-
bl_options
: Union[Set[str], Set[int]] = {'REGISTER', 'UNDO'}¶ Options for this operator type * REGISTER Register, Display in the info window and support the redo toolbar panel. * UNDO Undo, Push an undo event (needed for operator redo). * UNDO_GROUPED Grouped Undo, Push a single undo event for repeated instances of this operator. * BLOCKING Blocking, Block anything else from using the cursor. * MACRO Macro, Use to check if an operator is a macro. * GRAB_CURSOR Grab Pointer, Use so the operator grabs the mouse focus, enables wrapping when continuous grab is enabled. * GRAB_CURSOR_X Grab Pointer X, Grab, only warping the X axis. * GRAB_CURSOR_Y Grab Pointer Y, Grab, only warping the Y axis. * PRESET Preset, Display a preset button with the operators settings. * INTERNAL Internal, Removes the operator from search results.
- Type
typing.Union[typing.Set[str], typing.Set[int]]
-
execute
(context)¶ Specifies the behaviour for the operator method called by Blender.
- Parameters
() (context) – A bpy context containing data in the current 3d view.
Returns:
-
part
= <src.ops.body_part.BodyPart object>¶
-


Nonparametric estimation for right censored, left truncated time to event data in multistate models.
| Version: | 1.2-2 |
| Depends: | R (≥ 2.0), graph |
| Imports: | methods, class, lattice |
| Suggests: | KMsurv, Rgraphviz |
| Published: | 2015-04-11 |
| Author: | Nicole Ferguson, Somnath Datta, Guy Brock |
| Maintainer: | Guy Brock <guy.brock at louisville.edu> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| Citation: | msSurv citation info |
| Materials: | ChangeLog |
| In views: | Survival |
| CRAN checks: | msSurv results |
| Reference manual: | msSurv.pdf |
| Vignettes: |
Multistate Survival Models using msSurv |
| Package source: | msSurv_1.2-2.tar.gz |
| Windows binaries: | r-devel: msSurv_1.2-2.zip, r-release: msSurv_1.2-2.zip, r-oldrel: msSurv_1.2-2.zip |
| OS X binaries: | r-release: msSurv_1.2-2.tgz, r-oldrel: msSurv_1.2-2.tgz |
| Old sources: | msSurv archive |
Please use the canonical form https://CRAN.R-project.org/package=msSurv to link to this page.


Objective Design an ebook for the iPad that presents a place of your choice. The ebook should tell a story in several chapters, rather than be a sales brochure. Use typography in experimental, unusual ways throughout the ebook.
Concept Angel Island and Its Ghosts tells the history of Angel Island. It starts with the first European explorers in the Bay Area, who dropped anchor at Angel Island, and then the tragic fate of Native American tribes who used to hunt on the island. The ebook moves to the twentieth century and the struggles of Asian immigrants who were detained at the island’s Immigration Station. The final chapter is on the island’s current role as a California State Park. First-hand accounts are presented throughout, with the intention of making voices from the past come alive.
Visuals The visual approach conveys a sense of oppressive bureaucracy, wispy ghostliness and the natural world, which reflects the island’s history as well as its current state.
The ebook uses the old-fashioned sans serif Trade Gothic for its strict, bureaucratic feel. For a body font, the ebook uses the historical-looking characters of the serif Stempel Schneidler, and Mrs. Eaves italic as an accent. There are two styles of typographic embellishment—censored blocks of text in Trade Gothic, and excessively tracked out phrases in tiny Mrs. Eaves italic.
The color scheme alludes to the natural world and somber history of Angel Island using gray and a dark olive green, with accents of mustard, dark blue, burgundy and pale blue.
Photography of Angel Island is used for imagery. Each photograph has a blurred version layered semi-transparently over the original, which creates a haloed, somewhat surreal look for the ebook.
Designed and coded by Rebecca Pariser
© 2017 All Rights Reserved


Keywords defined in the ACCESS_KEYWORDS general lookup table that control access to particular iMIS components.
The systematic recording, reporting, and analysis of the financial transactions of an organization.
The date assigned to the journal entry (or journal entries) related to the upfront recording and posting of a commerce transaction or to subsequent processing of the commerce transaction related to the change in accounting status. The accounting date should always align with the invoice date for an accrual standard invoice or an accrual adjusting invoice. For a payment, the payment deposit date should be used to record the cash receipts journal entry.
Backorders indicate that insufficient inventory is available to fill an order. Orders that cannot be filled are held in a backorder status until inventory is received.
A badge is a nametag that is given to each attendee to wear at the event. Badge formats usually feature the individual's nickname or first name (enlarged for readability) and include other identifying information such as full name, title, company, city, and state. Sometimes, each badge is marked with a color-coded strip to differentiate groups of attendees: customers, guests, exhibitors, speakers, and staff.
The sum of debit and credit entries in an account:
■ If positive, it is a debit balance.
■ If negative, it is a credit balance.
A balance sheet is a report showing the assets, liabilities, and owner's equity of a business on a certain date.


This sample demonstrate a list with listbox aria role, single selection mode enabled and custom CSS to display a selection mark after the currently selected item(s).


Python API reference¶
Major commands¶
-
lm_zoo.
get_predictions
(model: lm_zoo.models.Model, sentences: List[str], backend=None)¶ Compute token-level predictive distributions from a language model for the given natural language sentences. Returns a h5py
File
object with the following structure:- /sentence/<i>/predictions: N_tokens_i * N_vocabulary numpy ndarray of
log-probabilities (rows are log-probability distributions)
- /sentence/<i>/tokens: sequence of integer token IDs corresponding to
indices in
/vocabulary
- /vocabulary: byte-encoded ndarray of vocabulary items (decode with
numpy.char.decode(vocabulary, "utf-8")
)
- Parameters
model – lm-zoo model reference
sentences – list of natural language sentence strings (not pre tokenized)
-
lm_zoo.
get_surprisals
(model: lm_zoo.models.Model, sentences: List[str], backend=None)¶ Compute word-level surprisals from a language model for the given natural language sentences. Returns a data frame with a MultiIndex
`(sentence_id, token_id)
(both one-indexed) and columnstoken
andsurprisal
.The surprisal of a token \(w_i\) is the negative logarithm of that token’s probability under a language model’s predictive distribution:
\[S(w_i) = -\log_2 p(w_i \mid w_1, w_2, \ldots, w_{i-1})\]Note that surprisals are computed on the level of tokens, not words. Models that insert extra tokens (e.g., an end-of-sentence token as above) or which tokenize on the sub-word level (e.g. GPT2) will not have a one-to-one mapping between rows of surprisal output from this command and words.
There is guaranteed to be a one-to-one mapping, however, between the rows of this file and the tokens produced by
lm-zoo tokenize
.
-
lm_zoo.
run_model_command
(model: lm_zoo.models.Model, command_str, backend=None, pull=False, mounts=None, stdin=None, stdout=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, stderr=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>, progress_stream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='UTF-8'>, raise_errors=True)¶ Run the given shell command inside a container instantiating the given model.
- Parameters
backend – Backend platform on which to execute the model. May be any of the string keys of lm_zoo.backends.BACKEND_DICT, or a Backend class.
mounts – List of bind mounts described as tuples (guest_path, host_path, mode), where mode is one of
ro
,rw
raise_errors – If
True
, monitor command status/output and raise errors when necessary.
- Returns
Docker API response as a Python dictionary. The key
StatusCode
may be of interest.
-
lm_zoo.
spec
(model: lm_zoo.models.Model, backend=None)¶ Get a language model specification as a dict.
-
lm_zoo.
tokenize
(model: lm_zoo.models.Model, sentences: List[str], backend=None)¶ Tokenize natural-language text according to a model’s preprocessing standards.
sentences should be a list of natural-language sentences.
This command returns a list of tokenized sentences, with each sentence a list of token strings. For each sentence, there is a one-to-one mapping between the tokens output by this command and the tokens used by the
get-surprisals
command.
-
lm_zoo.
unkify
(model: lm_zoo.models.Model, sentences: List[str], backend=None)¶ Detect unknown words for a language model for the given natural language text.
sentences should be a list of natural-language sentences.
- Returns
A list of sentence masks, each a list of
0
and1
values. These values correspond one-to-one with the model’s tokenization of the sentence (as returned bylm-zoo.tokenize
). The value0
indicates that the corresponding token is in the model’s vocabulary; the value1
indicates that the corresponding token is an unknown word for the model.
Models¶
-
class
lm_zoo.models.
DockerModel
(reference)¶ Represents a model reference stored on Docker Hub.
-
class
lm_zoo.models.
OfficialModel
(model_dict)¶ Represents a model stored in the official registry.
-
classmethod
from_dict
(model_dict)¶ Initialize a Model instance from a registry dict entry.
-
classmethod
-
class
lm_zoo.models.
SingularityModel
(repository, reference)¶ Represents a model reference stored in a Singularity repository.
Backends¶
-
class
lm_zoo.backends.
Backend
¶ Abstract class defining an interface between LM Zoo models and a containerization platform.
-
lm_zoo.backends.
get_backend
(backend_ref: Union[str, Type[lm_zoo.backends.Backend]])¶ Load a Backend instance for the given reference (string or class).
-
lm_zoo.backends.
get_compatible_backend
(model: lm_zoo.models.Model, preferred_backends: Union[Type[lm_zoo.backends.Backend], List[Type[lm_zoo.backends.Backend]], None] = None)¶ Get a compatible backend for the given model.
-
class
lm_zoo.backends.docker.
DockerBackend
¶
-
class
lm_zoo.backends.singularity.
SingularityBackend
¶


{% if kind == '🦄' %}
Just a Unicorn 🦄. Try Again
{% elif kind == '🌈' %}
Just a Rainbow 🌈. Try Again
{% elif kind == '🌈🦄' %}
A Rainbow Unicorn 🌈🦄! You won in {{ retries_num }} retries!
{% set retries_num = 0 %} {% else %}
There was an error: {{kind}}. What kind of animal is that?
{% endif %}


{% comment %} This widget works with the html in 'spell_list_with_search.html' Possible variables: - actions: a list of templates to include in the table - spellbook: the spellbook being displayed, if any {% endcomment %}


Will SerenityOS support $THING?
Maybe. Maybe not. There is no plan.
Will you implement $THING?
Maybe. Maybe not. But you can do it yourself!
Where are the ISO images?
There are no ISO images. This project does not cater to non-technical users.
I did a git pull
and now the build is broken! What do I do?
If it builds on CI, it should build for you too. You may need to rebuild the toolchain. If that doesn't help, try it with a clean repo.
Why don't you use $LIBRARY instead of implementing $FEATURE yourself?
The SerenityOS project tries to maximize hackability, accountability, and fun(!) by implementing everything ourselves.
Hey Andreas, have you thought about live-streaming?
Yes. I prefer the highly focused and uninterrupted format of videos.


Installation And Overview
Flyrb is a grab-bag of tricks, tools, techniques, trifles, and toys for IRB, including convenience methods, language patches, and useful extensions. It also includes a couple command-line widgets. Its primary inspirations were an awesome gem called Wirble and a blog post by Amy Hoy called "Secrets Of The Rails Console Ninjas".
INSTALL
sudo gem install flyrb
FEATURES
- Interactively edit IRB code in your preferred text editor
- Read from and write to OS X clipboard
- Post your code to Pastie with one command (OS X only)
- Kick-ass Unix-style history buffer
- Write command history to file or vi
- Grep classes and methods for strings
- Verbosity controls for regular IRB and Rails console
- Finder shortcuts for Rails console
- Upload shortcut for Amazon S3
- Command-line Amazon S3 upload script
- Command-line Google shortcut (OS X only)
- Auto-indentation
- _ special variable (like Unix shell var !!)
- Extremely basic themes for Wirble syntax coloring
- Pascal/JavaScript-style "with" statement
- String#to_proc
- Add and subtract Hashes with + and -
- Grammatically-correct is_an? method - no more "is_a? Array" statements
- One-character exit command
REQUIREMENTS
- ReadLine
- Wirble
- Amazon S3
- Platform
- Some features require OS X


|
Bond 0.9
C++ Bond Runtime Library API Documentation
|
#include <bond/vm/collector.h>
Public Types | |
| typedef T | ContentType |
Public Member Functions | |
| template<typename... Args> | |
| WrapperCollectable (Args &&... args) | |
| virtual | ~WrapperCollectable () |
| const T & | GetContent () const |
| T & | GetContent () |
| Public Member Functions inherited from Bond::Collectable | |
| virtual | ~Collectable () |
Additional Inherited Members | |
| Public Attributes inherited from Bond::Collectable | |
| CollectableHandle | mNext |
| typedef T Bond::WrapperCollectable< T >::ContentType |
|
inlineexplicit |
|
inlinevirtual |
|
inline |
|
inline |


Daddy Yankee to open reggaeton museum in Puerto Rico
The Daddy Yankee El Jefe Museum opens on Friday in Plaza de Las Americas in San Juan and will be free of charge.
Puerto Rico reggaeton star Daddy Yankee is opening a museum in the US Caribbean territory that will be dedicated to his life and the music that made him famous.
The Daddy Yankee El Jefe Museum opens on Friday in Plaza de Las Americas in San Juan and will be free of charge.
The space of 8,000 square feet will feature the history of reggaeton starting in 1991 as well as the artist’s clothes, awards and memorabilia.
Daddy Yankee made the announcement in an Instagram post. He recently set a record at the Coliseo of Puerto Rico with 10 shows scheduled in December.