“Computing may someday be organized as a public utility just as the telephone system is a public utility, each subscriber needs to pay only for the capacity he actually uses, but he has access to all programming languages characteristic of a very large system”
“The computer utility could become the basis of a new and important industry.”
John McCarthy
1961
The year of John McCarthy's speech.
29 October, 1969
The date two nodes of what would go on to become APRANET were connected.
1997
Professor Ramnath Chellappa
Characteristics
On demand self service
Broad network access
Resource pooling
Rapid elasticity
Measured service
Using the NIST definition of cloud computing
Resources?
Compute
Storage
Network
Telephony
Queueing
Caching, Database, etc...
Service Models
IaaS: Google Compute Cloud, Amazon EC2, Microsoft Azure, Rackspace Cloud, GoGrid
PaaS: VMWare CloudFoundry, Google App Engine, Amazon Elastic Beanstalk, Force.com, Redhat Openshift, Heroku, Cloud Services for Windows Azure
SaaS: Google Apps, Zendesk, Twilio, GitHub
Why is cloud computing popular?
Reduces costs
No need to purchase hardware prior to a project.
You don't need to know how much capacity you need up front.
May reduce staff, admin, and licensing costs.
Spot and reserve instances.
Agility
Enables rapid prototyping and experimentation
You want to benchmark a ten node cluster? Go for it. $20 an hour or less.
Acquire resources as you need them.
Elasticity
Scale to cope with variable workloads
No need to spend money on resources that are only there to handle peak loads
Autoscaling - avoid the slashdot effect without human intervention.
Instant Resources!
Have an idea you want to test? Go for it.
Automatable
Cloud services tend to have good APIs.
As simple as git push - you will do this in the demo.
Chef & Opscode
Not just services which are automatable.
Examples of infrastructure automation tool. Not cloud only.
Puppet is an alternative.
$ knife st env start -E test -r us-west-2 -z us-west-2a
This is all it takes to start the entire test environment of 3 app servers and 3 datastore servers, as well as copy the latest backup from production, and run the latest configuration on each node.
Vagrant
Create a vm from a box file and a configuration.
Useful for building a local cluster for testing.
Integrates with puppet and chef. Can use VMWare or VirtualBox.
Free usage
Many providers (eg AWS, Heroku) have free tiers or initial credit you can experiment with.
Students can sometimes get educational credit. If you are doing a project and want to try, email support and ask!
Report bugs for fun and profit! Eg $20 twilio credit for reporting a doc mistake.
Unexpected features
Often worth exploring features as there can be some interesting side benefits. For example, you can host a static website on both GitHub and S3.
Architecting for the Cloud
Cloud != Desktop
Very different way of thinking.
Individual components fail!
Expect this and design for it!
If your design is good, your response will be "Meh."
Redundancy
Things fail. Have spares that take over automatically.
You have unlimited* resources, use them. On demand even.
Fault Tolerance
What happens when a service goes down?
When a node dies?
Example is Cassandra datastore. Gossip protocol - bad node backoff. Can be re-added later with no issues.
SPOF
Think carefully about the things that can go wrong between clients and you.
Can turn up in some unexpected places.
What can break between you and the consumer? How can you mitigate the risk or deal with it when it happens?
eg GoDaddy DNS issue - spidertracks.com did not resolve. Website was working fine. Customer doesnt care - they know they cant access your site but they can access google - therefore internet is fine and it is a problem with you.
Your cloud provider == SPOF?
If your provider fails, what are you going to do about it? Generally, nothing.
Cloud providers will fail. Split your resources usage between data centers and providers if appropriate.
* AWS, AppEngine, and Gmail have all had outages.
* Megaupload - established 2005, seized Jan 2012, allegedly dedicated to copyright infringement. Still unresolved. Paying customers lost data.
* Lavabit - An encrypted mail service shut down by operator last week, because they did not want to "become complicit in crimes against the American people". Cannot legally say why.
Scalability
Your design needs to be scalable horizontally to take full advantage of the cloud.
Add and remove resources as required without having to restart / redeploy.
State is bad, cluster aware are good.
m1.xlarge
to
m2.4xlarge
AWS EC2 allows scaling vertically by changing the node type. If your infrastructure is automated, this is easy!
vCPU, ECU, Memory (GiB), Instance Storage (GB)
General purpose m1.xlarge 64-bit
4 8 15 4 x 420
Memory optimized m2.4xlarge 64-bit
8 26 68.4 2 x 840
State is bad!
The next request from a client may not be serviced by the same machine.
Partition and Cache data
"Cloud scale" data does not fit on one node. It might at the start, but it wont forever. Design for this.
Eg cassandra. redundancy in database storage.
Webhooks
API = pull. Webhook = push.
Basically a callback URL. Many web services use them. Allow integrations between systems.
Provide event support.
Eg Twilio SMS receive - how you respond controls what Twilio does.
Http Request
SmsSid
AccountSid
From
To
Body
Makes POST or GET request ot your server.
Http Response
Thanks for the message!
Transient errors
Things fail. Sometimes for no apparent reason.
Vendor lock in
Ensure that you can extract your data from the provider.
Remember, cloud providers are not forever.
“If you dont own it, abstract away the details.”
@ammeep at Code Mania After Dark
There are libraries that will abstract away a particular cloud provider. Eg Fog, a Ruby gem.
Abstraction not always easy when different feature sets are involved.
Interface for your system to use + provider specific implementations. Many cloud service providers provide their client jars for different languages.
Example: Abstraction of messaging provider in GO.
Configuration
Developers may end up doing operations tasks. Installing and configuring software. How do you know you are doing it right and not leaving gaping holes in your infrastructure or creating performance problems?
Cutting Edge
You may not have a full understanding of your dependencies before it goes live.
Be careful with cutting edge technology. You will most likely get cut at some point. What if it gets abandoned by everyone else or a competitor becomes more popular?
Chose an appropriate tool/service for the task, not the latest fad. Be able to justify your choice against similar tools/services.
Backups and Recovery
Have a plan and test it regularly. How do you know all your nodes are being backed up?
Security
Does your industry have any requirements about how data can be stored? HIPAA, etc. Do you have to provide an audit trail?
Are you allowed to store it offshore / in an unknown place?
Govt clouds - dif to normal clouds how?
Do you trust the cloud service provider to get it right? Encrypt data?
Privacy
USA Patriot act allows us govt to request data from US based companies.
PRISM - cooperation of google, microsoft, yahoo, etc in making data available to US govt. Metadata != data?
Testing in the Cloud
Some clound services offer test credentials - authenticate but dont perform operations.
Test / Staging Environments
This will make your life better. Have them.
Simian Army
Simian army is a set of programs that can be run against your AWS infrastructure.
Doctor checks health of nodes.
Janitor - removes unused resources.
Conformity - ensures best practices are used
Latency - simlates latency on services
Security - violations or vulnerabilities
Chaos Monkey randomly terminates instances.
Chaos Gorilla kills an entire availability zone.
Netflix has opensourced a lot of software, much of it related to AWS and java.
Exposing Your Server
Localtunnel
ssh port forwarding to internet addressable server - handy to know
Can also use ssh to set up proxies - useful for testing also.
Running an application on your local machine means it is easier to debug and monitor what is happening.
Proxies - eg Fiddler, Wiretap
Monitoring
Now your cloud application is up and running, how do you keep an eye on its health?
Many providers also provide there own monitoring systems.
Real time alerts - catch issues before they become more serious.
PagerDuty, etc.
Dashboard
Show the health of the application.
Graphs and metrics - see at a glance what is going on.
Log Aggregation
Cloud means that many different machines may be involved in the handling of a request / action. It pays to be able to follow the processing through.
Design with logging in mind. What information do you need?
Having the ability to search logs is incredibly useful.
Different priorities of logging. Some entries only relevant for a short time, some relevant forever, eg audit trail of user actions. Great help to support when you can say exactly what a user did and when.
Spidertracks uses log4j + graylog. Provides searching and real time monitoring of logs. Logs are also archived long term in Amazon S3.
Remote monitoring
Not the same as logging.
Not the same as a dashboard.
Provides remote access to core platform management functionality.
JMX. Can be very useful to be able to remote debug.


DeckCheck
DeckCheck is a quick way to evaluate your deck's mana base
and get a recommendation based on statistics and research.
| # | Card Name | Mana Cost |
|---|---|---|
| {{card.count}} | {{card.name}} | {{card.manaCost}} |


Welcome to the JavaMoney financial library.
JavaMoney-lib is a financial library that is built upon JSR 354 (or compatible libraries). Whereas the JSR 354 API and reference implementation provides the fundamentals like monetary amounts, customizable currencies and interfaces for interoperation this library adds additional powerful APIs and SPIs that were implemented during JSR development as a proof of concept:
- calc finally provides a set of monetary calculations and formulas. The idea here is to provide a comprehensive set of algorithms and tools to perform complex financial mathematics.
-
bundles finally provides the library in different flavors, targeting different execution environments:
- se loading SPIs only using the JDK
ServiceLoader
. - se-cdi loading SPIs based on a Weld SE container.
- ee loading SPIs based on CDI in a Java EE environment >= EE6.
- se loading SPIs only using the JDK
Authors and Contributors
Different people have contributed to this project. During the development of JSR 354, @atsticks and @keilw founded this project and were also the main contributors. Nevertheless everybody is really welcome to help us, to make this library more feasible and add features.
javamoney-shelter
The JavaMoney Shelter module is for testing out new features or modules before they may enter the official JavaMoney library.


The core provides basic utility functions and properties that are used by the rest of the library.
These are the public properties available under the UsefulJS namespace:
The global context; may be one of window
or global
.
The name of the global context; may be one of "window"
or "global"
.
Regular expression object to test for whitespace. In most modern browsers this will be equivalent to /\s/
However, not all browsers correctly make \s Unicode-aware. RE_WS is Unicode-aware and may be used to correctly test for whitespace in all browsers:
UsefulJS.RE_WS.test("\u00a0"); // true
Portable regular expression object that matches whitespace at the start of a string.
Portable regular expression object that matches whitespace at the end of a string.
A map of detected features. This is intended primarily for internal use and currently exposes the following properties that your application code can test for:
Object.defineProperty
is available.
Object.create
is available.
"use strict";
has any effect.Additional modules (such as ClassList) may add additional properties.
The detected list separator (such as ',' or ';') in use on the system.
These are the public methods available under the UsefulJS namespace:
Tests to see whether its argument is defined, that is not null or undefined
UsefulJS.defined(obj)
// Optional boolean parameter defaults to true var f = function(strParam, boolParam) { if (!UsefulJS.defined(boolParam)) { boolParam = true; } ... };
Returns somewhat more reliable run-time type information for its argument than the built-in
typeof
operator.
UsefulJS._typeof(obj)
Poor RTTI is one of JavaScript's core weaknesses and makes generic programming painful and error prone. Almost everything is identified as an "object":
typeof("a") // "string"; OK typeof([]) // "array"; Good // Pre-allocate typeof(new Array(1000)) // "object"; Huh? typeof(null) // "object"; You're kidding, right? typeof(document) // "object"; A pattern emerges
_typeof uses introspection (not duck-typing, other than as a last resort) to identify the type of its argument:
_typeof(new Array(1000)) // "array" _typeof(null) // "null" _typeof(document) // "document"
A list of inputs and return values is shown below:
| Input | Return value | Input | Return value |
|---|---|---|---|
| undefined | "undefined" | User-defined class | "object" |
| null | "null" | Date | "date" |
| Boolean | "boolean" | RegExp | "regexp" |
| new Boolean() | "boolean" | ArrayBuffer | "arraybuffer" |
| Number | "number" | Element (any) | "element" |
| new Number() | "number" | Element attribute | "attr" |
| String | "string" | Text node | "text" |
| new String() | "string" | document | "document" |
| Array | "array" | Event (any) | "event" |
| new Array() | "array" | Error (any) | "error" |
| Function | "function" | window | "window" |
| new Function() | "function" | Math | "math" |
| Object | "object" | JSON | "json" |
var addClass = function(elem, clName) { // Inputs must be an element and a string var _u = UsefulJS; if (!(_u._typeof(elem) === "element" && _u._typeof(clName) === "string")) { throw new TypeError("Bad arguments"); } ... };
Returns an object that is equal but not identical to its argument
UsefulJS.clone(obj)
JavaScript Array and Object variables are pointers. Not keeping this in mind can lead to hard-to-track-down bugs:
var a = [1, 2, 3, 4], b = a; ... Many lines later ... b[0] = 5; // Changed a; is this intended?
clone creates, in effect, a bitwise copy of its argument, resulting in an independent copy that can safely be modified without unexpected side-effects:
var a = [1, 2, 3, 4], b = UsefulJS.clone(a); ... Many lines later ... b[0] = 5; // a[0] is still 1
Only objects for which cloning makes sense are cloned; other types are returned as-is. Cloneable object types are:
Arrays and Objects are cloned recursively, that is any cloneable items that they contain are also cloned.
clone
keeps track of how many times it has been called recursively in a single clone
operation. If the recursion depth exceeds 100, it will raise an Error. This is
better than a browser crash. Basically, if your Objects contain circular references by design,
(this may be legitimate in a tree structure, for example) do not attempt to clone
them. If your Objects contain circular references by accident, give yourself a smack
on the head!
Object.create
, cloning an instance
of a user-defined class will cause the returned value to lose its identity: the properties
will be copied, but it will no longer be an instance of the class. You can test
UsefulJS.featureSupport.createObject
to see whether instances of a
user-defined class can be successfully cloned.
To clarify the results of a clone operation, examine the following snippet:
var a = { a : 1, b : [1] }, b = UsefulJS.clone(a); a.a === b.a; // scalar, true a.b === b.b; // array, false a.b[0] === b.b[0]; // true a === b; // false
var StaticList = function(arr) { // Hide the initial data in a closure this.data = (function() { var _data = UsefulJS.clone(arr); return { get : function() { // Don't give out private data return UsefulJS.clone(_data); } }; })(); }; var sl = new StaticList([1, 2, 3, 4]), arr = sl.data.get(); arr[0] = 2; var k = sl.data.get()[0]; // k = 1;
defined
, _typeof
and clone
are exported to the global namespace by
default. _typeof
is intended as a drop-in replacement for the built-in
typeof
operator. Apart from UsefulJS itself, these are the only additions to the global
namespace.
Pads a string to a specified length using a specified character; padding is either left or right
UsefulJS.pad(s, padTo, padWith, right)
s
StringpadTo
NumberpadWith
Stringright
BooleanReturns: String
// Turn a string into a series of \uxxxx sequences var uLit = Array.from("한국어").reduce(function(s, c) { return s + "\\u" + UsefulJS.pad(c.charCodeAt(0).toString(16), 4, '0'); }, "");
padLeft
and padRight
methods of String.prototype
Merges properties from one object into another.
UsefulJS.mix(o1, o2, prefer1)
o1
Objecto2
Objectprefer1
BooleanReturns: Object
Copies the properties that are in o2 into o1 and returns o1. o2 is unaffected.
To avoid inadvertent bugs with shared references, properties are cloned rather than copied.
If both o2 and o1 have identically named properties that are also Objects, the two values will be mixed recursively.
The prefer1 parameter controls how conflicts are handled. If o1 already contains a property and prefer1 is true, it will be left alone (unless it is an Object - see above). Otherwise it will be overwritten.
var a = { a : 1, b : { p1 : "a" }, d : null }, b = { a : 2, b : { p1 : "b", p2 : "c" }, c : 3, d : 4 }; UsefulJS.mix(a, b, true); // a is now // { // a : 1, // b : { // p1 : "a", // p2 : "c" // }, // c : 3, // d : null // }
mix
function is used when defining locale properties. Each locale definition contains
only the attributes that are different from another locale and these are mixed with the properties of the
parent locale.
Returns the property names (or keys) of an Object
UsefulJS.keys(obj)
obj
ObjectReturns: Array of property names. If the object has no enumerable properties, the array will be empty.
This will be the same function as Object.keys
if that function
is implemented. The return value only contains property names for which
hasOwnProperty
returns true.
Iterates over an object, calling a callback function for each enumerable property until either the keys are exhausted or the callback function returns false.
UsefulJS.every(obj, callback, ctx)
obj
Objectcallback
Functionf(value, key, obj)
ctx
Objectthis
context for the callbackReturns: Boolean true unless the callback returns false.
Throws: TypeError if the callback is not a function.
Iterates over an object, calling a callback function for each enumerable property which should return true for the properties that are to be copied into the return value.
UsefulJS.filter(obj, callback, ctx)
All iteration functions take the same parameters
Returns: Object A shallow copy of the input with a subset of the properties of the original.
Iterates over an object, calling a callback function for each enumerable property which should return true if the required value has been found.
UsefulJS.find(obj, callback, ctx)
All iteration functions take the same parameters
Returns: Object The item that satisfies the callback or undefined.
Iterates over an object, calling a callback function for each enumerable property which should return true if the required key has been found.
UsefulJS.findKey(obj, callback, ctx)
All iteration functions take the same parameters
Returns: Object The key that satisfies the callback or undefined.
Iterates over an object, calling a callback function for each enumerable property.
UsefulJS.forEach(obj, callback, ctx)
All iteration functions take the same parameters
Returns: undefined.
Iterates over an object, calling a callback function for each enumerable property which should return a value be set in the return value. The property name set will be the same one passed to the callback
UsefulJS.map(obj, callback, ctx)
All iteration functions take the same parameters
Returns: Object A shallow copy of the input with the same property names as the original but with values transformed by the mapping function.
Iterates over an object, calling a callback function for each enumerable property until either the keys are exhausted or the callback function returns true.
UsefulJS.some(obj, callback, ctx)
All iteration functions take the same parameters
Returns: Boolean false unless the callback returns true.
var _u = UsefulJS, obj = { ... }; // Does the object have any undefined values var isGood = _u.every(obj, function(item, key) { return _u.defined(item); }); // Filter out undefined values obj = isGood ? obj : _u.filter(obj, function(item, key) { return _u.defined(item); }); // Transform the values remaining obj = _u.map(obj, function(item, key) { return String(item).toLocaleUpperCase(); });
Many objects, such as strings and instances of Date or RegExp, have no enumerable properties.
The properties that will be enumerated over are frozen when you call an iterator. This means that you can
modify the input (it's passed as the obj
parameter to the callback) as it's iterated over. The
callback will not be called for properties that are no longer in the input.
You can pass Array objects to the iteration functions and the return value from filter and map will be arrays. However, since Array objects have their own iteration methods which, likely as not, will run at native speed, there is little point.
Array-like objects are better served with generic Array methods. For example, Array.prototype.forEach
will iterate over the characters in a string while UsefulJS.forEach will not.
filter creates a shallow copy of the input. Be careful with shared references. Depending on how values are transformed, the return value from map may have shared references as well.
If the system supports Object.create
, the returns from filter and
map will be the instances of the same class as the input. Otherwise they will be plain
objects.
Generates a UUID (universally unique identifier).
UsefulJS.uuid()
Generates an RFC 4122-compliant UUID. The version field is 4 (randomly generated).
Applies fixes provided by the various UsefulJS modules
UsefulJS.fix(opts)
Each UsefulJS module registers fix callbacks with the core on load. When you call UsefulJS.fix
,
these callbacks are called and the fixes are applied. You can control which fixes are applied via the
(optional) opts
parameter. If you are happy with the defaults, you don't need to specify
anything. If, for some reason, you don't want the defined
function exported into the global
namespace, you'd call fix
like this:
UsefulJS.fix({ _core : { defined : false } });
Rather than supplying Objects as the input options, you can specify "all"
or
"none"
. So if you didn't want anything exported into the global namespace you could call:
UsefulJS.fix({ _core : "none" });
The return value is an object indicating which fixes have been applied. The naming convention in the output properties is the same as that in the input properties so that if the defaults are used, the output properties might look like this:
{ _core : { defined : true, _typeof : true, clone : true }, _array : { ... } ... }
_array
property in the return value will be populated while on Internet Explorer 9, it
won't be.
Generally, fixes that fill in standard methods and properties that are absent in the runtime environment are applied by default and have to be explicitly disabled. Non-standard extensions to the standard classes have to be explicitly enabled.
Implementation of String.fromCodePoint
.
UsefulJS.fromCodePoint(codePoint1[, codePoint2, ...])
If String.fromCodePoint
is implemented in the browser, this will
be the same function. It constructs a String from one or more code points (numeric
values between 0 and 0x10ffff). Code points between 0x10000 and 0x10ffff are
resolved into surrogate pairs.
Implementation of String.prototype.codePointAt
.
UsefulJS.codePointAt.call(str, pos)
If String.prototype.codePointAt
is implemented in the browser, this will
be the same function. It behaves like charCodeAt
unless the character
at pos is one half of a surrogate pair, in which case it combines the character
code at this position and the next into a single value >= 0x10000.
Implementation of Object.is
.
UsefulJS.is(a, b)
Evaluates to the same boolean value as a === b
with two exceptions:
returns false if a is 0 and b is -0 (or vice versa); returns true if a and b are
both NaN.
The fixes for the core module are defined in the _core namespace in the input and output properties. All are applied by default.
Make UsefulJS.defined
available in the global namespace.
Make UsefulJS._typeof
available in the global namespace.
Make UsefulJS.clone
available in the global namespace.
Add navigator.language
property if not already present.
navigator.language
contains
a value that you can use. On Webkit-based browsers, the value is baked in at compile-time and is consequently
useless.
Adds a bind method to Function.prototype
if not already present.
Adds an "is" static method to Object
if not already present.


This is another topic we get asked quite a bit.
- How do I do a 2D/3D Array?
When I also started working with multi-dimensional arrays I found it hard to find the answers I wanted too. So I'll post up some info that will hopefully help other people. I'll go over both of the 2 major methods (Vector vs Pointer).
Vector based multi-dimensional arrays
Vectors are a STL container that allow you to store pretty much anything in them. When used correctly they can be very powerful containers.
They provide an added benefit that they will automatically remove the memory they use when they go out of scope. This means that objects stored within a vector do not need to be de-allocated (but pointers to objects do).
You can also do some interesting things with dynamic multi-dimensional arrays with vectors. For example, if you only allocate the first dimension, then use the .push_back() to add records to the 2nd dimension it's no longer a grid, but an array with a dynamically sized 2nd dimension (much like a street of buildings each with a different amount of floors). This functionality can be achieved using pointers, but is much harder to do.
A simple 2D Array with vectors:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
#include <vector>
using std::vector;
#define HEIGHT 5
#define WIDTH 3
int main() {
vector<vector<double> > array2D;
// Set up sizes. (HEIGHT x WIDTH)
array2D.resize(HEIGHT);
for (int i = 0; i < HEIGHT; ++i)
array2D<i>.resize(WIDTH);
// Put some values in
array2D[1][2] = 6.0;
array2D[3][1] = 5.5;
return 0;
}
| |
A 3D Array with vectors.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#include <vector>
using std::vector;
#define HEIGHT 5
#define WIDTH 3
#define DEPTH 7
int main() {
vector<vector<vector<double> > > array3D;
// Set up sizes. (HEIGHT x WIDTH)
array3D.resize(HEIGHT);
for (int i = 0; i < HEIGHT; ++i) {
array3D<i>.resize(WIDTH);
for (int j = 0; j < WIDTH; ++j)
array3D<i>[j].resize(DEPTH);
}
// Put some values in
array3D[1][2][5] = 6.0;
array3D[3][1][4] = 5.5;
return 0;
}
| |
Pointer based multi-dimensional arrays
Pointer based multi-dimensional arrays provide you with a more raw access to the objects. The benefits can be added speed and you can apply custom optimizations to them.
Note: There are ways you can optimize this by combining the 2 dimensions into a single dimension (HEIGHTxWIDTH). I leave the discussion of this out, as it's a more advanced topic for people already familiar with this topic.
A simple 2D Array:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#define HEIGHT 5
#define WIDTH 3
int main() {
double **p2DArray;
// Allocate memory
p2DArray = new double*[HEIGHT];
for (int i = 0; i < HEIGHT; ++i)
p2DArray<i> = new double[WIDTH];
// Assign values
p2DArray[0][0] = 3.6;
p2DArray[1][2] = 4.0;
// De-Allocate memory to prevent memory leak
for (int i = 0; i < HEIGHT; ++i)
delete [] p2DArray<i>;
delete [] p2DArray;
return 0;
}
| |
A 3D Array:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
#define HEIGHT 5
#define WIDTH 3
#define DEPTH 7
int main() {
double ***p2DArray;
// Allocate memory
p2DArray = new double**[HEIGHT];
for (int i = 0; i < HEIGHT; ++i) {
p2DArray<i> = new double*[WIDTH];
for (int j = 0; j < WIDTH; ++j)
p2DArray<i>[j] = new double[DEPTH];
}
// Assign values
p2DArray[0][0][0] = 3.6;
p2DArray[1][2][4] = 4.0;
// De-Allocate memory to prevent memory leak
for (int i = 0; i < HEIGHT; ++i) {
for (int j = 0; j < WIDTH; ++j)
delete [] p2DArray<i>[j];
delete [] p2DArray<i>;
}
delete [] p2DArray;
return 0;
}
| |
One final thing to note. When creating dynamic arrays with your own object types, you cannot overload the constructor. The ISO standard forbids this, and you must initialize the values on the objects later. All objects allocated into arrays must utilize the default constructor.
The above code snippets should compile on both Windows and Linux with no problems.
Recommendations
Unless your application has an extreme need to be highly optimized, and you are quite proficient at C++ memory management, you will want to use the vector based approach. This method is a lot easier to manage, especially if you are just learning C++.
You can pass them by pointer.
e.g
void doSomethingWith2D(double **Array);
or
voud doSomethingWith2D(vector<vector<double> > &Array);


Saving Private Ryan Director: Steve Spielberg Starring: Tom Hanks Ed Burns Matt Damon Tom Sizemore Running: Two Hours-50 Mins Personal Rating: **** (out of four stars)
Today, war became a reality to me after seeing a screening of Saving Priivate Ryan. Steve Spielberg goes beyond reality with his latest production. The audience is tossed about the theatre witnessing the horror of war. Please keep the kids home as the R Rating is for reality.
Tom Hanks is stunning as Capt John Miller, set out in France during WW II to rescue and return home a soldier, Private Ryan (Matt Damon) who lost three brothers in the War. Spielberg at time takes us inside the heads of these individuals as they face death during the horrific battle scenes.
Private Ryan is not for everyone, but I felt the time was right for a movie like this to be made. The movie reminds us of the sacrifices made by our WW II fighting men and women. We must not ever forget them as many gave the ultimate sacrifice, their lives so that we may live in freedom today. For this I thank them and for Steve Spielberg for making a movie that I will never forget.
The Academy will not forget Tom Hanks come April 1999, as another well deserved Oscar with be in Tom's posession.
Eddie Burke Long Island, NY The Gateway to the Atlantic
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


SignUp Form
First Name
Last Name
E-Mail
Password
Phone Number
Address
City
State
Please select your state
Andhra Pradesh
Arunachal Pradesh
Assam
Bihar
Chhattisgarh
Goa
Gujarat
Haryana
Himachal Pradesh
Jharkhand
Karnataka
Kerala
Madhya Pradesh
Maharashtra
Manipur
Meghalaya
Mizoram
Nagaland
Odisha
Punjab
Rajasthan
Sikkim
Tamil Nadu
Telangana
Tripura
Uttar Pradesh
Uttarakhand
West Bengal
Zip Code
Who are you?
Doctor/Nurse/Patient
Doctor
Nurse
Patient
Gender
Male
Female
Prefer to not say
Success
Thanks for contacting us, we will get back to you shortly.
Sumbit


Flexible, object-oriented scripting language
Nested slides are useful for adding additional detail underneath a high level horizontal slide.
That's it, time to go back up.
..interactively
$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print 'Hello, Python!'
Hello, Python!
... or via a script "hello_python.py
"...
#!/usr/bin/env python
print 'Hello, Python!' # Say hello to my friend!
...which can be run like so...
$ python hello_python.py
Hello, Python!
a = 1 # integer (int)
b = 2.0 # floating point number (float)
c = True # boolean value True/False (bool)
d = "Hello OCNC students!" # "string" of characters, i.e. text (str)
e = 'Hello "the best year" of OCNC students!' # another string
Python is a "dynamic language",
(i.e. any variable can be created at any time)
To see the value of a variable use "print"
print a
+, -, *, /, //, **, %, ==, <, >, <=, >=, !=, and, or, not
Variables are combined with "operators" as it makes sense
print a + b
print 2 * a == b
print a / b
print a < b and (a / b + 0.5) > a
print a / 2 # extra points if you can explain what happens here!
The type of the operation depends on the type
print 'OCNC' + '2015'
Python has several convenient containers
a_tuple = (1, 2, 3) # tuples (single, double, triple, etc...)
a_list = [1, 2, 3] # lists (same as tuples but can change length)
a_dict = {'first':1, 'second':2, 'third':3} # a dictionary
They can contain any type including other containers
a_nested_list = [[1, 2], [1, 2, 3], [1]] # nested lists
a_nested_dict = {'foo': [1, 2, 3],
'bar': {42:'meaning of life', 1:'the loneliest'},
'abc': 'its easy as'} # nested dictionary/list
Like a list/tuple but much faster
import numpy as np # We'll come back to this
an_array = np.array([1, 2, 3, 4, 5])
another_array = np.ones(5)
yet_another_array = np.ones(6)
Element-wise arithmetic between arrays of same length
print an_array + another_array # add element-wise
print an_array - another_array # subtract element-wise
print an_array + yet_another_array # Error!! lengths don't match
Multi-dimensional, not nested
two_d = np.array([[1, 2], [3, 4]]) # works fine
two_d = np.array([[1, 2], [3, 4, 5]]) # Error!! Dims. not consistent
Tuples, Lists and 1-D Numpy arrays
a_list = [1, 2, 3, 4, 5] # or (1, 2, 3, 4, 5) for tuple
print a_list[0] # note! indexing starts from 0 (not 1 as in MATLAB)
print a[1:5] # access a range of elements.
print a[-1] # you can also index from the end
print a[0:4:2] # every second element
print 3 in a # test if it has a particular element.
Dictionaries
a_dict = {'1st':10, '2nd':100, '3rd':1000}
print a_dict['2nd'] # useful for mapping values to strings
Multi-dimension Numpy arrays
an_array = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
print an_array[1, 2] # access a single element
print an_array[2, :] # access a row
print an_array[:, 1] # access a column
Lists and dictionaries can be modified (not tuples)
a_list = [1, 2, 3, 4, 5]
a_list[2] = 10
a_list[9] = 20 # Error! List is shorted than 10
a_list.append(30) # Also try 'remove', 'pop' and 'extend'
a_dict = {'1st':10, '2nd':100, '3rd':1000}
a_dict['1st'] = 20 # replaces value for '1st'
a_dict['4th'] = 10000 # works fine, new value is inserted
But be careful, for efficient memory usage and speed Python variables are actually labels on the underlying data!
another_list = a_list # or so we may think...
another_list.append(2) # Warning! this may not be what you intend
print a_list
If this causes a problem, you need to use copy or deepcopy:
import copy
b = copy.copy(a)
a.append(3) # b==???
Use 'for' statements to iterate over elements of a container .
for <element> in <container>:
<do-statement>
<do-another-statement>
...
For example...
a_list = [1, 2, 3, 4, 5]
for element in a_list:
print 10 ** element
NB: unlike other languages indentation matters in Python
Make decisions on what to do with 'if' statements.
if <condition>:
<statement>
elif <condition>:
<statement>
else:
<statement>
Example:
a_list = [1, 2, 3, 4, 5]
for element in a_list:
if element == 4:
print 'skip'
else:
print 10 ** element
Avoid writing the same code multiple times with functions
def f(x, y):
return x ** 25 / y
Then, try (one of them causes an error!)
f(1, 2)
f(x=1, y=2)
f(y=2, x=1)
f(x=2, 2)
The default values can be also specified:
def f(x, y=2):
return x+y
Different ways of calling a function
f(1) # No default values
f(1, y=3) # With default values
def func(x, y):
""" func(x, y) returns the sum of x and y."""
return x+y
Then, try
help(func)
Try also other functions that we have seen such as
help(range)
and
help('in')
or in IPython
func?
If you want to return multiple values us a tuple
def integer_division(numerator, denominator):
divided = numerator // denominator
remainder = numerator % denominator
return divided, remainder # you can drop the parenthesis
Receiving tuples
result = integer_division(15, 6)
divided = result[0]
remainder = result[1]
Implicitly unpacking is more convenient
divided, remainder = integer_division(15, 6) # More convenient
In most cases when you need to install a Python module or package, use pip
...
$ pip install sympy
which will install the sympy
package, or
$ pip install neo
which will install the neo
package.
import numpy
print help(numpy.array)
To use a different name for the module in your file
import numpy as np
print help(np.array)
To only import specific functions from a module
from numpy import array, ones
help(array)
To import a submodule use '.'
import numpy.random
help(numpy.random.randn)
In Python, every file is as a module. For example, let's say you have a file called mymodule.py
"""Here you write a module help. Try help(mymodule) after import."""
def func1():
print "You called func1!"
it can be imported just like builtin modules
import mymodule
from mymodule import func1
func1()
Custom classes of objects are defined like so
class Cell(object):
"""A very simple cell model"""
def __init__(self, cell_type):
self.cell_type = cell_type
self._patch_clamps = []
def add_patch_electrode(self, location):
self._patch_clamps.append(location)
def list_patches(self):
return self.cell_type + ': ' + ', '.join(self._patch_clamps)
(Note self
in the method definitions)
and then you can make objects of the class as
c = Cell(cell_type='pyr')
c.cell_type # Call attributes.
c.add_patch_electrode('soma') # Call methods.
c.add_patch_electrode('spiny_dendrite')
print c.list_patches()
with open('example.dat', 'r+') as f: # open a file 'f'
a = f.read()
new_a = article.replace('butt', 'ass')
f.write(new_a)
Different 'mode' strings


| Name | Type | Description |
|---|---|---|
name |
string |
The name of the hook. |
script |
string |
The script that the hook runs. |
script_repository |
object |
The GitHub repository where the script is kept. |
environment |
object |
The pre-receive environment where the script is executed. |
enforcement |
string |
The state of enforcement for this hook. |
allow_downstream_configuration |
boolean |
Whether enforcement can be overridden at the org or repo level. |
Possible values for enforcement are enabled
, disabled
andtesting
. disabled
indicates the pre-receive hook will not run. enabled
indicates it will run and reject
any pushes that result in a non-zero status. testing
means the script will run but will not cause any pushes to be rejected.


14
1 Yahweh will have compassion on Jacob; he will again choose Israel and restore them into their own land. Foreigners will join with them and attach themselves to the house of Jacob.
2 The nations will bring them to their own place. Then the house of Israel will take them in the land of Yahweh as male and female servants. They will take captive those who had captured them, and they will rule over their oppressors.
3 On the day that Yahweh gives you rest from your suffering and anguish, and from the hard labor which you were required to perform,
4 you will sing this taunt song against the king of Babylon,
"How the oppressor has come to an end, the proud fury ended!
5 Yahweh has broken the staff of the wicked, the scepter of those rulers,
6 that struck the peoples in wrath with unceasing blows,
that ruled the nations in anger, with an attack that was
unrestrained.
7 The whole earth is at rest and is quiet; they begin celebrating with singing.
8 Even the fir trees rejoice over you with the cedars of Lebanon;
they say, 'Since you are laid low, no woodcutter comes up to cut us down.'
9 Sheol below is eager to meet you when you go there.
It arouses the dead for you, all the kings
of the earth,
making them rise up from their thrones, all the kings of the nations.
10 They all will speak and say to you,
'You have become as weak as us. You have become like us.
11 Your pomp has been brought down to sheol with the sound of your string instruments.
Maggots are spread under you, and worms cover
you.'
12 How you are fallen from heaven, daystar, son of the morning!
How you are cut down to the ground, you who conquered
the nations!
13 You had said in your heart, 'I will ascend into heaven,
I will exalt my throne above the stars of God,
and I will sit on the mount of assembly, in the far reaches of the north.
14 I will ascend above the heights of the clouds; I will make myself like the Most High God.'
15 Yet you are now brought down to sheol, to the depths of the pit.
16 Those who see you will gaze at you; they will consider you.

21 Prepare your slaughter for his children, for the iniquity of their ancestors,
so they will not rise up and possess the earth
and fill the whole world with cities.
22 "I will rise up against them"—this is the declaration of Yahweh of hosts.
"I will cut off from Babylon name, descendant, and posterity"—this is the declaration of Yahweh.
23 "I will also make her into a possession of owls, and into pools of water,
and I will sweep her with the broom of destruction"—this is the declaration of Yahweh of hosts.
24 Yahweh of hosts has sworn, "Surely,
as I have intended, so it will come about; and as I have purposed, so
it will be:
25 I will break the Assyrian in my land, and on my mountains trample him under foot.
Then his yoke will be lifted from
off them and his burden from off their shoulder."
26 This is the plan that is intended for the whole earth, and this is the hand that is raised over all the nations.
27 For Yahweh of hosts has planned this; who will stop him? His hand is raised, and who will turn it back?
28 In the year that king Ahaz died this declaration came:
29 Do not rejoice, Philistia, because the rod that struck you is broken.
For out of the serpent's root will
come an adder, and his offspring will be a fiery flying serpent.
30 The firstborn of the poor will eat, and the needy will lie down in safety.

For out of the north comes a cloud of smoke, and
there is no straggler in his ranks.
32 How then will one answer the messengers of that nation?
That Yahweh has founded Zion, and in her the afflicted of his people will find refuge.


Money Play. How should Red play 51?
pips Red=139 White=131
(CorrectAnswer= 0/0, ErrorScore= 0)
11/10, 6/1 is an entirely reasonable play and it is certainly not an error. However, just beating it is the very prosaic 8/2.
In a very level position not giving White sevens and most eights to hit it correct. Red’s position after 8/2 is fine and he can just hope for something better next time.
Sometimes the quiet play is correct and this position is a demonstration of that idea.
In a very level position not giving White sevens and most eights to hit it correct. Red’s position after 8/2 is fine and he can just hope for something better next time.
Sometimes the quiet play is correct and this position is a demonstration of that idea.
1. Cubeful 2-ply 8/2 Eq.: +0.078 0.516 0.128 0.003 - 0.484 0.093 0.002 2. Cubeful 2-ply 8/7 6/1 Eq.: +0.048 (-0.030) 0.510 0.125 0.003 - 0.490 0.101 0.003 3. Cubeful 2-ply 11/10 6/1 Eq.: +0.046 (-0.033) 0.511 0.120 0.003 - 0.489 0.095 0.003 4. Cubeful 2-ply 11/10 11/6 Eq.: +0.033 (-0.045) 0.503 0.114 0.003 - 0.497 0.084 0.002 5. Cubeful 2-ply 11/5 Eq.: -0.024 (-0.102) 0.496 0.127 0.004 - 0.504 0.115 0.004


King ColemanFounder and CTO of Rich Code Media a subsidary of E.W.D. I am a Senior IT professional. I like to sip coffee while researching and resolving complex technical issues. I take technical jargon and convert them into understandable concepts for my clients who are not technical by trade. I am also an BMW enthusiast DIY'er (I'm my own mechanic). |
Work Experiance
| Dates | Title | Company Name |
|---|---|---|
| 2019 - 2019 | Field Engineer | Harvard Business School |
| 2018 - 2019 | Desktop Support Admin | Housing Partnership Network |
| 2017 - 2018 | Techical Support Analyst | Weber Shandwick And Jack Morton |
| 2016 - 2017 | Helpdesk Analyst Lead | Draper Labs |
| 2015 - 2016 | DeskSide Support | Earnst And Young |
Skills |
|||
|---|---|---|---|
| End User On/Off-Boarding | ***** | Active Directory | ***** |
| Windows10 | ***** | MS Server 2012 | **** |
| Windows Security | ***** | Sytem Administration | **** |
| Computer/Windows Networking | ***** | VPN Config and Support | *** |
| User Profile and Account Management | ***** | VOIP Setup and Administration | **** |
For a full version of my resume in doc or pdf format
Email MeTo discuss possible opportunities
Cell Phone


Etihad Airways still has long way to go to become profitable: Group CEO
DUBAI: Abu Dhabi-based Etihad Airways still has a long way to go to become profitable, Group CEO Tony Douglas said on Monday (Nov 18).
"We are slightly ahead of where we plan to be. And if we stay focused will see a very strong Etihad," Douglas told reporters.
Etihad suffered its third consecutive annual loss in 2018 despite cost savings of nearly half a billion dollars as it cut its workforce and fleet.
Etihad, which has trimmed its ambitions to be a major intercontinental airline, has made losses of US$4.75 billion since 2016.
Douglas said a series of announcements are expected over the next two to three weeks about the new low-cost carrier it is setting up with Air Arabia.
"A whole schedule of announcements by the end of first quarter, second quarter," he said.
He declined to be more specific or say which destinations the low-cost carrier will serve.
The new carrier, Air Arabia Abu Dhabi, will be the UAE’s fifth airline. Others include Emirates and Dubai discount carrier flydubai.


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserDirectory
A UserDirectory represents an abstraction of an persistent organizational tree containing Users and Organizations. Users and Organizations may be assigned one or more Roles.
Users, Organizations, and Roles are all treated as instances of java.security.Principal, permitting them to be used flexibly across the java.security and atg.security packages. In particular, all Principals obtained from a UserDirectory will be directly usable in access control lists and entries managed by security domains compatible with that directory.
Some roles' membership may be dynamically calculated ("dynamic roles"), while others are explicitly assigned to individual users ("assignable roles"). Most roles are global roles, while RelativeRoles are special in that they represent a certain kind of relationship to a specific principal.
Global roles are organized in a hierarchy of RoleFolders that assists in navigating the global role namespace. RoleFolders are not Principals.
Notes:
Invocations of methods that change one or more transactionally managed objects will behave in a way that depends on whether a transaction is currently active. If no transaction is active, a new one will be created for the update and will be committed before the method returns. If a transaction is active, then all updates will take place within the scope of the transaction, which will remain uncommitted when the method returns.
A returned Principal, either singly or within a collection, must never be modified directly in any way by casting it to a modifiable Java type, since this would prohibit UserDirectory implementations from caching Principals.
All returned Collections are unmodifiable, and are in effect immutable due to the previous convention that the embedded Principal objects should never be modified.
For methods with a Collection result, empty Collection instances are always returned on a valid invocation, whereas null reflects a failure to perform the requested operation.
PrincipalType
| Field Summary | |
|---|---|
static java.lang.String |
CLASS_VERSION
|
static int |
SORT_ASCENDING
|
static int |
SORT_DESCENDING
|
| Method Summary | |
|---|---|
Organization |
findOrganizationByPrimaryKey(java.lang.Object pPrimaryKey)
Given a Organization's primary key, locate a corresponding Organization in the directory. |
Role |
findRoleByPrimaryKey(java.lang.Object pPrimaryKey)
Given a Role's primary key, locate a corresponding Role in the directory. |
User |
findUserByLogin(java.lang.String loginName)
Given a User's primary key, locate a corresponding User in the directory. |
User |
findUserByPrimaryKey(java.lang.Object pPrimaryKey)
Given a User's primary key, locate a corresponding User in the directory. |
Organization |
getOrganizationByPath(java.lang.String orgPath)
Find an Organization by its path. |
Role |
getRoleByPath(java.lang.String pRolePath)
Given the folder path of a global role, obtain the corresponding Role. |
RoleFolder |
getRoleFolderByPath(java.lang.String pRolePath)
Given the folder path of a global role, obtain the corresponding Role. |
java.util.Collection |
getRoles()
Get the set of all roles in the directory, both global and relative. |
java.util.Collection |
getRolesSortByName(int pStartIndex,
int pEndIndex,
int pSortOrder)
Get the set of all roles in the directory, both global and relative, sorted on the name of the role, with index control of the result set returned. |
Organization |
getRootOrganization()
Return an Organization that acts as the root of the organizational hierarchy. |
RoleFolder |
getRootRoleFolder()
Get the root RoleFolder in a hierarchy of RoleFolders that contain all global roles. |
java.lang.String |
getUserDirectoryName()
|
| Field Detail |
|---|
static final java.lang.String CLASS_VERSION
static final int SORT_ASCENDING
static final int SORT_DESCENDING
| Method Detail |
|---|
java.lang.String getUserDirectoryName()
User findUserByPrimaryKey(java.lang.Object pPrimaryKey)
pPrimaryKey
- the principal's primary key
User findUserByLogin(java.lang.String loginName)
loginName
- The user's unique login name.
Organization findOrganizationByPrimaryKey(java.lang.Object pPrimaryKey)
pPrimaryKey
- the principal's primary key
Role findRoleByPrimaryKey(java.lang.Object pPrimaryKey)
pPrimaryKey
- the principal's primary key
Organization getRootOrganization()
Organization getOrganizationByPath(java.lang.String orgPath)
orgPath
- The path from the root of the Organization.
java.util.Collection getRoles()
java.util.Collection getRolesSortByName(int pStartIndex, int pEndIndex, int pSortOrder)
pStartIndex
- starting index of rolespEndIndex
- ending index of rolespSortOrder
- sorted order of returned Collection. Values =
{ UserDirectory.SORT_ASCENDING, UserDirectory.SORT_DESCENDING }
RoleFolder getRootRoleFolder()
Role getRoleByPath(java.lang.String pRolePath)
pRolePath
- the path of a global role from the root role
folder to the global role, delimited by '/' characters. No
initial delimiter is required.
RoleFolder getRoleFolderByPath(java.lang.String pRolePath)
pRolePath
- the path of a global role from the root role
folder to the global role, delimited by '/' characters. No
initial delimiter is required.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Data Science for Social Good Europe 2017
Data-Driven Planning for Sustainable Tourism in Tuscany
Mass tourism is at a tipping point. High-speed trains and low-cost airlines allow larger amounts of people to travel faster, and more frequently than ever before. Tourism is of great economic benefit to communities worldwide, however many touristic destinations are insufficiently equipped to react to the increasing flux of visitors.
New methods combining data mining, machine learning, and data science are beginning to be used to understand the impact of mass tourism on cities and find solutions to better accommodate tourists. Data Science for Social Good Europe is a yearly summer initiative to use such techniques to tackle key issues with a social impact. This past summer 2017, a team data science fellows assisted several partner organisations in shedding light on tourism patterns in the city of Florence. This work using digital traces created by tourists to continue current work in progress by the municipality of Florence, with the aim of providing tools that can improve both the management of crowds and the quality experience for tourists and residents alike.
New methods combining data mining, machine learning, and data science are beginning to be used to understand the impact of mass tourism on cities and find solutions to better accommodate tourists. Data Science for Social Good Europe is a yearly summer initiative to use such techniques to tackle key issues with a social impact. This past summer 2017, a team data science fellows assisted several partner organisations in shedding light on tourism patterns in the city of Florence. This work using digital traces created by tourists to continue current work in progress by the municipality of Florence, with the aim of providing tools that can improve both the management of crowds and the quality experience for tourists and residents alike.


This service creates an account for {{.InstanceName}} users on our chat server.
To get started, click the verify button to verify your username on {{.InstanceName}}, then scan the provided barcode in your XMPP or Jabber compatible instant messaging client of choice (a few recommendations are provided below).


Have you tried using any of the insight and techniques for growing trust and sincerity? How did it go?
Once I was told by a co-worker that I was hard to get to know. She was tasked to be the liaison for her department if they needed change to the online application system or if something wasn’t working right.  She said she did that out of fear I would think negatively… well.. I did think that some of their ideas were insane.
We clearly started off not on the same boat and without trust. So one day, I decided that rather than having meeting at my desk, we went to the coffee shop since lunch time followed after that. When we finished early, we would continue talking about our work. It didn’t take long for me to know what it involved for Admission department to get a student enrolled. I also empathize whenever she feels frustrated about work. All that information, gave me the motivation on how can I make the system that I build better. It made sense that we share the same goal - if we don’t get students enrolled, both of us will be out of work. On her side, she got to know why some change require couple of days even though it might be small from the user side or why this isn’t such a good idea.
Try empathic listening - how did it go?
I did the exercise with my partner. It was okay since we are already used to with the previous listen and loop technique. This time I'm required to gauge her feeling by saying “What I hear you feel….” It was slight different for me because whenever I sense she was down, I had the urge to go put on the kettle because I know she would like to have a tea because it makes things better. I know better not to get up and disrupt the session.
How did you find the loving kindness meditation?
Never tried this but I think it should be easy to wish happiness to friends and family - those who you love.  Ok. I’ll try on javascript problem next time :)
Complete the political awareness exercise here in writing.
There was one situation when I was called out at my previous job for being incompetent in an email thread. My department launched a new portal at the beginning of the school year and one department head came at me saying that I’ve changed the content completely and that he wasn’t consulted. I mentioned to him I only transferred what was from the old portal unless there was already agreement made before.
My view
He was making accusatory without any basis or evidence. From the logs, I have not made any changes to the page for ages.
His views
Sam was the only one who could have done it since she developed the portal and is the administrator. Who else could change it?
At the end, tracked an email from couple of years ago from an old IT Administrator who decided to update the page without committing a log message about his change and then not communicating to the head of the department after that - so both of us were not in the loop.
Though I have to say that yes both were not at fault but his language in the email was not appropriate and my frustration was that the Administrator who was copied in it didn’t intervene.


Kanye West ‘drops $14million on Wyoming ranch’ but Kim Kardashian 'isn't a fan'
Kanye West has ‘splashed out $14.4million (£11.1m) on another ranch in Wyoming’ – despite wife Kim Kardashian ‘not being all that keen’ on moving down there.
Just months after shelling out $14million (£10.8m) on a huge property in the area, the Jesus Is King rapper is back at it again, and has reportedly dropped serious cash on another place.
Well, if you’ve got the money…
According to TMZ, the 42-year-old rapper has treated himself to Bighorn Mountain Ranch, which spans 6,713 acres, and comes complete with several log cabins and two heated helipads.
Because one heated helipad just won’t do?
Not only that, there are lodges dotted around and walk-in saunas, with the ranch surrounded by rolling hills, and deer, antelope and turkey casually roaming the grounds.
That’s going to be a housewarming party with a difference.
However, it has been claimed that Kim, 39, isn’t really that into the ‘simple housing’ that comes with the ranch, and won’t be making a permanent move from LA to Wyoming just yet.
Advertisement Advertisement
‘Kim is definitely not moving and living full-time in Wyoming right now. Kim likes visiting Wyoming, but she sees it more like a vacation place,’ an insider claimed. ‘It’s very quiet and private.
‘Every time they go, they enjoy it. But they are usually comfortable in luxury housing. The ranch only has simple housing. It’s mostly cabins with no amenities at all.
‘Kim just isn’t a fan of the cabins. There are many things that need to happen before she and the kids can spend more time there. Kim has a whole list of things. They would need to build a house so everyone can be comfortable.
‘And now, when everyone knows Kanye bought the ranch, there needs to be an elaborate security system put in.’
So Ye’s just dropped $14million for a holiday home?
Kim hasn’t ruled out the idea of leaving LA for good, explaining that she could see herself and their brood – children North, Saint, Chicago and Psalm – in Wyoming in the next decade.
During a chat with the Gold Digger rapper, he asked where she wants to be in the next 10 years.
Advertisement Advertisement
‘In my mind I’m already living in those 10 years. I see us living on a ranch in Wyoming, occasionally going to Palm Springs and our home in Los Angeles – and becoming a lawyer,’ she replied.
The Kardashian-West’s Take Wyoming, anyone?
Metro.co.uk has contacted reps for Kim and Kanye for a comment.
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


Class Tracy
Core debug tools - printing any value by var_dump(); in fixed bar at browser window right bottom border - timing printing - debuging shortcut functions initialization - exceptions hdd logging or printing in development mode
- MvcCore\Debug
- MvcCore\Ext\Debug\Tracy
public static
|
|
protected static
|
BarDump(),
Dump(),
Exception(),
FireLog(),
Log(),
ShutdownHandler(),
Timer(),
dumpHandler(),
exceptionHandler(),
initLogDirectory(),
timerHandler()
|
string |
VERSION
MvcCore Extension - Debug Tracy - version: Comparation by PHP function version_compare(); |
#
'4.2.0'
|
CRITICAL,
DEBUG,
ERROR,
EXCEPTION,
INFO,
JAVASCRIPT,
WARNING
|
public static
boolean
|
$autoInitPanels
Auto initialize all panel classes if exists in registry bellow. |
#
TRUE
|
public static
string[]
|
$ExtendedPanels
Extended Tracy panels registry for automatic panel initialization. If panel class exists, it is automaticly created and registred into Tracy bar. |
#
array(
'MvcCorePanel',
'SessionPanel',
'RoutingPanel',
'AuthPanel',
// 'IncludePanel', // added every time strictly, not in foreach
)
|
public static
string
|
$Editor
Add editor key for every Tracy editor link to open your files in specific editor. |
#
''
|
public static
callable
|
$InitGlobalShortHands
Initialize global development shorthands. |
#
array()
|
$EmailRecepient,
$LogDirectory,
$development,
$dumps,
$handlers,
$originalDebugClass,
$timers
|


Mineshaft
问题描述 :
For example, for the mineshaft in the first picture below, the minimal number of bends in a pipeline from the bottom to the surface is two. Different optimal solutions exist, one of which is shown in the second picture. The bullets indicate the bends in the pipeline.
The two walls of the mineshaft are formed by sequences of straight segments. The numbers of segments in the two sequences may be different. Further, the horizontal distance between the walls of the mineshaft may vary, but is always positive. Both walls start at the same level and end at the same level.
On the way from the bottom of the mineshaft to the surface, the level (the y-coordinate) increases with every segment of a wall. Hence, the mineshaft does not have horizontal plateaus or ‘ceilings’, and at no point does it go back down again.
For the purpose of this task, you may assume the diameter of the pipeline to be 0. At no point may the pipeline cross the walls. In order to attach the pipeline firmly to the wall, each segment of the pipeline has to touch the walls at (at least) two different places. However, the bending points of the pipeline are weak. They cannot be used to attach the pipeline to the walls. The end points of the pipeline, though, at the bottom and the top of the mineshaft, may be used to attach a segment to the walls.
Hence, the solution in the third picture above (also having two bends) is not allowed, because the lowest segment of the pipeline can be attached to the walls at only one place: at the bottom of the right wall.
The pipeline must start anywhere at the bottom of the mineshaft, and must end anywhere on the imaginary line between the top of the left wall and the top of the right wall. Note, however, that the endpoints of the pipeline may only be used to attach the pipeline, if they touch a wall. In particular, the endpoint at the bottom cannot be attached to any position at the bottom which is not the bottom of a wall.
Finally, the angle that the pipeline makes at a bending point can take any value satisfying −180° < α < 180° and (of course) α ≠ 0.
Note that sometimes it may be useful to have the pipeline intersect with itself. For example, in the mineshaft below, this is needed to get from the bottom to the top of the mineshaft with only three bends.
输入:
One line with one integer N1 (2 ≤ N1 ≤ 25): the number of points describing the left wall of the mineshaft.
N1 lines with the coordinates of the points describing the left wall of the mineshaft, from the bottom to the top. The ith line contains two integers xi and yi (-1,000 ≤ xi ≤ 1,000 and 0 ≤ yi ≤ 1,000) separated by a single space: the x- and y-coordinate of the point, respectively.
The y-coordinates are monotonically increasing: y1 < y2 < … < yN1.
One line with one integer N2 (2 ≤ N2 ≤ 25): the number of points describing the right wall of the mineshaft.
N2 lines with the coordinates of the points describing the right wall of the mineshaft, from the bottom to the top. The ith line contains two integers x′i and y′i (-1,000 ≤ x′i ≤ 1,000 and 0 ≤ y′i ≤ 1,000) separated by a single space: the x- and y-coordinate of the point, respectively.
The y-coordinates are monotonically increasing: y′1 < y′2 < … < y′N2.
We always have x1 < x′1, y1 = y′1, xN1 < x′N2, and yN1 = y′N2. The walls described by the sequences of points do not cross or even touch each other.
输出:
样例输入:
2 7 4 0 8 2 3 7 5 9 3 12 6 14 4 16 5 7 0 10 2 6 6 10 12 8 16 6 -10 10 -10 20 10 22 5 27 0 37 5 47 8 -8 10 -8 16 3 17 9 19 14 24 18 32 18 40 11 47
样例输出:
2 3
如果两个序列的最后字符不匹配（即X [M-1]！= Y [N-1]）
L（X [0 .. M-1]，Y [0 .. N-1]）= MAX（L（X [0 .. M-2]，Y [0 .. N-1]），L（X [0 .. M-1]，Y [0 .. N-1]）
这里写错了吧。
程序员会算法，等于一个古惑仔带了zhi抢啊
不是有公式吗？何不直接计算
已修正
示例程序中的代码不够稳健，没有考虑到输入了非法字符或者不合理输入的情况。
Dijkstra 不适合有负权值的边吧
#include <stdio.h>
int main(void)
{
int arr[] = {10,20,30,40,50,60};
int *p=arr;
printf("%d,%d,",*p++,*++p);
printf("%d,%d,%d",*p,*p++,*++p);
return 0;
}
为什么是 20,20,50,40,50. 我觉得的应该是 20,20,40,40,50 . 谁能解释下？
为什么不直接用STL排序呢？
正确
以了解 想問為甚麼 Tbl[6001] = {1} 初始化都是1
為何不是Tbl[0]=1 其他為0
我想整理一下leetcode的题解，站长能不能给权限
原来的主机不行，目前更换到了国内主机
这个应该是最朴素的KMP实现
因为要修改链表头(指针)，所以要用指针的指针


Cements
PPC, OPC, Super And WeatherPlus
Ultratech
UltraTech Cement Ltd is the largest manufacturer of grey cement, ready mix concrete (RMC) and white cement in India.
Steels
Iron, Steels & TMT Rebars
TATA Steel
Tata Steel ensures that the technologies and processes used to manufacture products must optimise resources and be efficient.
SAIL
Steel Authority of India Limited (SAIL) is one of the largest steel-making companies in India and one of the Maharatna’s of the country’s Central Public Sector Enterprises.
Jindal Panther
Jindal Steel and Power Limited (JSPL), one of India's primary and integrated steel producers, is one of the most respected brands in the B2B steel market in India.
MSP TMT
MSP Group manufactures the next-gen TMT bars. Constructed with Turbo Quench licensed under Herbert Rothe and conforming to various international quality standards.
Kamdhenu Kay2 TMT
Kamdhenu Limited, Bhiwadi unit has been authorized to manufacture Tempcore TMT under licence agreement.
Nakoda TMT
Jindal Steel and Power Limited (JSPL), one of India's primary and integrated steel producers, is one of the most respected brands in the B2B steel market in India.
Putty
Wallcare Putty
Asian Paints
The company was set up as a partnership firm by four friends who were willing to take on the world's biggest, most famous paint companies operating in India at that time.
Birla White Putty
Birla White is a unit of UltraTech Cement Ltd., flagship company of the US $48.3 BN Aditya Birla Group. A US $48.3 billion corporation, the Aditya Birla Group is in the League of Fortune 500.
JK White Cement
A leading cement manufacturer in the country, JK Cement Ltd is an affiliate of the multi-disciplinary industrial conglomerate JK Organisation, which was founded by Lala Kamlapat Singhania.
Berger
Berger Paints India is headquartered at Kolkata, with 16 strategically located manufacturing units across India (including the subsidiaries), 2 in Nepal, 1 each in Poland and Russia and about 162 stock points
Shalimar Paints
The eco-friendly product contains minimum harmful elements to protect your families better. The enhanced acrylic emulsion formulation results in better durability of the top coat.
Blocks
AAC Blocks
Ecorex
Ecorex has a rich legacy and experience of over 7 years in the Aerated Construction Industry. We have well defined processes of manufacturing best quality products.
Chemicals
Construction & Chemical Adhesives
Ultratech
UltraTech Cement Ltd is the largest manufacturer of grey cement, ready mix concrete (RMC) and white cement in India.
Dr. Fixit
Dr Fixit is a leading waterproofing expert assuring the right solutions for leak-free homes. Dr Fixit provides you with a clear 5-point waterproofing solution for leak-free homes.
Roff
Founded in 1959, Pidilite Industries Limited has been playing an integral role in your homes, offices and lives, for over 50 years. It is a name synonymous with delivering quality constructions, with comfort and care.
Plasters
LEVELLING AND READY MADE PLASTERS
Ultratech(BPD)
UltraTech Cement Ltd is the largest manufacturer of grey cement, ready mix concrete (RMC) and white cement in India.
Birla
Birla White is a unit of UltraTech Cement Ltd, flagship company of the US $48.3 BN Aditya Birla Group. A US $48.3 billion corporation, the Aditya Birla Group is in the League of Fortune 500.
Gyproc
Gyproc is a market leader in the building construction space in India for the last 30 years. Our products are an integral, functional, design and sustainable component of modern and emotional architecture.
PVC
WATER TANKS AND PVC PIPE FITTING
Supreme
Founded in 1942, Supreme is an acknowledged leader of India's plastics industry. Handling volumes of over 3,20,000 tonnes of polymers annually effectively makes the country's largest plastics processors.
Sintex
For more than 8 decades, Sintex have been helping their clients, industries and societies prosper. We’ve been leading the way in Plastics are present across major Asian, European, American, and African markets, in 9 countries including France, Germany, and USA.
OTech
We at Otech bring to you the most revolutionary and modern solution for domestic water storage. Otech ensures our tanks exude finesse, strength and high functionality.
PCI
Pest Controls
PCI
PCI became the first pest management company in India to hold education and awareness programmes on food safety as per international norms.
Power Tools
POWER TOOLS FOR INDUSTRIAL AND COMMERCIAL USAGE
Stanley Black & Decker
Stanley Black & Decker provides the tools and innovative solutions you can trust to get the job done—and we have since 1843.
De Walt
From 1924 to 2016 DEWALT continues to design and optimize professional workhorse solutions- tools, accessories and service - to ensure absolute confidence for the toughest jobsite conditions. WE are DEWALT, and we are GUARANTEED TOUGH.
PaverBlocks
ADVANCE (CPWD approved)
CPWD
CPWD has PAN India presence and has ability to undertake construction of complex projects even in difficult terrain and maintenance in post construction stage.
Marbles
TILES, GRANITE & MARBLES
Asia Pacific Marbles
ASIAPACIFIC Marbles brings to you a colossal collection, range and source of Imported Marbles in India. With over 25 years of experience in the field of imported marbles, we pride our hard and revolutionary work.
Somany
Somany Ceramics is your ideal destination for an extensive range of products including ceramic tile, floor tiles, polished vitrified tiles, digital tiles, wall tiles, wall claddings, sanitary ware, bathroom fittings, and state-of-the-art tile laying solutions.
Kajariya
Kajaria's manufacturing units are equipped with cutting edge modern technology. Intense automation, robotic car application and a zero chance for human error are few reasons for Kajaria to be the number 1 in the industry.
Plywood
PLYWOOD AND VENEERS
Greenply
Greenply manufacturers various interior infrastructure products such as plywood, block board, decorative laminates, decorative veneers, medium-density fiberboards (MDF), Laminate flooring and restroom cubicles.


runningtrack package¶
Submodules¶
runningtrack.changes module¶
runningtrack.config module¶
Helper functions to deal with configuration files
-
class
runningtrack.config.
OrderedDictYAMLLoader
(*args, **kwargs)[source]¶ Bases:
yaml.loader.Loader
A YAML loader that loads mappings into ordered dictionaries.
-
runningtrack.config.
merge_defaults
(config)[source]¶ Merge a dictionary that has an item with a “DEFAULT” key, if that item is itself a dictionary, then merge that item’s subitems with all the other items in the dictionary that are also themselves dictionaries.
The purpose is to mimic the behaviour of the [DEFAULT] sections of .ini or .conf files when using .json or .yaml files, or when using OrderedDict or dict data structures.
Parameters: config (dict or OrderedDict) – The dictionary that is to have its “DEFAULT” key merged with the other keys. Returns: The merged version of the dictionary as an OrderedDict, or the original config (be it a dict or an OrderedDict) if it had no “DEFAULT” key to begin with, or it was not a dict or an OrderedDict. Return type: OrderedDict or dict
runningtrack.const module¶
Dictionary in which the elements can be accessed as if they were attributes, and cannot be changed.
When you have defined a Const instance like this:
const = Const(ABC="123")
Then const["ABC"]
is the same as const.ABC
You can set a new constant item in the same way by assigning to it, but you CANNOT change items that already exist, because they are intended to be constant.
You can define items in the constructor, as in the example, but the value of such an item can be overridden by an OS environment value if it has the same name.
For example, if there is an OS environment variable called WEB_PORT with a value of 8080, and you define a const in this way:
const = Const(WEB_PORT=3000)
Then const.WEB_PORT
will have the value 8080, not 3000.
If you want to set a constant item that cannot be overriden by an envirnment variable, then set it after instanciating, like this:
const = Const()
const.WEB_PORT = 3000
You can pass one or more dictionaries to the constructor for when that is convenient for defining the values:
const = Const({
"ONE": 1,
"TWO": 2,
}, {
"THREE": 3,
"FOUR": 4,
}, FIVE=5)
This is the same as:
const = Const(ONE=1, TWO=2, THREE=3, FOUR=4, FIVE=5)
runningtrack.dates module¶
Helper functions to deal with dates
-
runningtrack.dates.
current_date
(utc_setting=True, moment=None)[source]¶ The current date as text in the ISO format.
Sig: (bool, Union[datetime.datetime, None]) -> str
Parameters: - utc_setting (bool, optional) – Whether we want the current moment to be timezone agnostic. (the default is True, which denotes to be timezone agnostic.)
- moment (datetime.datetime, optional) – The moment considered to be the “now” moment. (the default is None, which denotes the use of the current moment.) This parameter is mostly useful for testing purposes, otherwise it shouldn’t be provided.
Returns: The current date as text.
Return type: str
-
runningtrack.dates.
current_day
(utc_setting=True, moment=None)[source]¶ The current day of the week.
Sig: (bool, Union[datetime.datetime, None]) -> int
Parameters: - utc_setting (bool, optional) – Whether we want the current moment to be timezone agnostic. (the default is True, which denotes to be timezone agnostic.)
- moment (datetime.datetime, optional) – The moment considered to be the “now” moment. (the default is None, which denotes the use of the current moment.) This parameter is mostly useful for testing purposes, otherwise it shouldn’t be provided.
Returns: The current day of the week in range [0, 6], Monday is 0.
Return type: int
-
runningtrack.dates.
current_seconds
(moment=None)[source]¶ The seconds of the current minute.
Sig: (Union[datetime.datetime, None]) -> int Parameters: moment (datetime.datetime, optional) – The moment considered to be the “now” moment. (the default is None, which denotes the use of the current moment.) This parameter is mostly useful for testing purposes, otherwise it shouldn’t be provided. Returns: The current seconds within the current minute. Return type: int
-
runningtrack.dates.
current_seconds_milliseconds
(moment=None)[source]¶ The seconds and milliseconds of the current minute.
Sig: (Union[datetime.datetime, None]) -> float Parameters: moment (datetime.datetime, optional) – The moment considered to be the “now” moment. (the default is None, which denotes the use of the current moment.) This parameter is mostly useful for testing purposes, otherwise it shouldn’t be provided. Returns: The current seconds, with the milliseconds after the decimal point. Return type: float
-
runningtrack.dates.
current_time
(utc_setting=True, moment=None)[source]¶ The current time of the day in the HH:MM format (no seconds).
Sig: (bool, Union[datetime.datetime, None]) -> str
Parameters: - utc_setting (bool, optional) – Whether we want the current moment to be timezone agnostic. (the default is True, which denotes to be timezone agnostic.)
- moment (datetime.datetime, optional) – The moment considered to be the “now” moment. (the default is None, which denotes the use of the current moment.) This parameter is mostly useful for testing purposes, otherwise it shouldn’t be provided.
Returns: The current time of the day as text.
Return type: str
-
runningtrack.dates.
now
(utc_setting=True, timezone=None, timestamp=None)[source]¶ The current moment in time.
Sig: (bool, Union[datetime.timezone, None], Union[float, None]) -> datetime.datetime
Parameters: - utc_setting (bool, optional) – Whether we want the current moment to be timezone agnostic. (the default is True, which denotes to be timezone agnostic.)
- timezone (datetime.timezone, optional) – Which timezone we want the current moment to be reported in. (the default is None, which denotes the local machine’s timezone.)
- timestamp (float, optional) – POSIX timestamp of the moment considered to be the “now” moment. (the default is None, which denotes the use of the current moment.) This parameter is mostly useful for testing purposes, otherwise it shouldn’t be provided.
Returns: the_now_moment – The current moment.
Return type: datetime.datetime
runningtrack.track module¶
Module contents¶
“runninggroup” package
-
class
runningtrack.
ConcurrentLogger
(name, level=0)[source]¶ Bases:
logging.Logger
-
handle
(record)[source]¶ Call the handlers for the specified record.
This method is used for unpickled records received from a socket, as well as those created locally. Logger-level filtering is applied.
-
log_queue
= None¶
-
session
= ''¶
-
-
runningtrack.
FloatProgress
(value, min, max, description)¶
-
runningtrack.
HTML
(a)¶
-
runningtrack.
display
(a)¶


[ht::head {Installing RAMADDA}]
You need to specify the ramadda home directory. This is where it looks for properties files and other resources, where the java derby database is stored and where any uploaded data files are stored.
By default ramadda will use:
<tomcat home>/.unidata/repositoryi.e., the home directory of the process that runs tomcat.
You can override this a number of ways. What ramadda does is look for the property: ramadda_home in a variety of places, in precedence:
<param-value>-Dramadda_home=/home/dir</param-value>The problem with this is you have to unjar the war and change the web.xml. Then, when you install a new release you have to repeat the process.
-Dramadda_home=/home/dire.g.:
java -Xmx512m -Dramadda_home=/home/dir
ramadda_home=/home/dir
To run RAMADDA run the ramadda.sh. This just does:
java -Xmx512m -jar repository.jarBy default the server is on port 8080. To change the port do:
java -Xmx512m -jar repository.jar -port <some port>RAMADDA creates a local storage directory in:
<home dir>/.unidata/repositoryTo change this do:
java -Xmx512m -jar repository.jar -Dramadda_home=/home/dir
The major thing you want to change would be the database.
By default RAMADDA uses a local Java Derby database. RAMADDA also runs using mysql and postgres (though the postgres hasn't been test in a while). To define the database just define one of the ramadda.db properties in repository.properties:
ramadda.db=derby #ramadda.db=mysql #ramadda.db=postgresThe mysql database and user/password is defined in the repository.properties file. To change it add to the repository.properties file the following:
ramadda.db.mysql.url=jdbc:mysql://localhost:3306/repository?zeroDateTimeBehavior=convertToNull ramadda.db.mysql.user=the database user ramadda.db.mysql.password=the database password
Then, reconfigure RAMADDA to point to the new database and login again. Note: you'll have to add a new admin password, etc. Then go to the Admin->SQL page. If you saved the SQL file on the server then just enter:
file:/path/to/sql/filein the text area and hit execute.
If you have the SQL file on your local machine upload through the sql file form.
Its probably best to shutdown and then restart RAMADDA after doing this and you should have your old database running in the new RAMADDA.
If you changed systems then you also need to copy over the storage directory tree to the new system. This is in:
<ramadda_home>/storage
lib/repositorylib.jar lib/repositorytds.jarTo compile stand-alone (e.g., using javac) put those 2 jar files in your class path.
To compile using ant:
The default ant target (all) will compile the repository source and create:
lib/repository.jar lib/repository.warYou can run the repository stand-alone by doing:
java -jar repository.jarAll of the services except OpenDAP are available stand-alone.
The repository.war is a tomcat war file that needs to be placed in the tomcat install area.


sizeToRemove - any font size expressed as an integer.
Use this function to revert text to the default font size for the field. If you don’t specify a size, all of the text displays in the default font size that was set in Layout mode for the field. When the font size is specified by
sizeToRemove, only the specified font size is removed from every portion of the text displayed in that size and these same portions of the text are then displayed in the field's default font size.
TextSizeRemove(“10 Point Text and 18 Point Text”) returns
10 Point Text and 18 Point Text displayed in the field’s default font size.
TextSizeRemove(“10 Point Text and 18 Point Text”;18) returns
10 Point Text and 18 Point Text with the 18 point font size removed from the words
18 Point Text.


{{ cms:partial:shared/modular_box:phone:562-570-6555 }}
{{ cms:partial:shared/modular_box:hours:"Mon: 7:30 am - 4:30 pm
Tues: 7:30 am - 4:30 pm
Wed: 8:30 am - 4:30 pm
Thurs: 7:30 am - 4:30 pm
Fri: 7:30 am - 4:30 pm
We are closed Sat and Sun." }}
{{ cms:partial:shared/modular_box:map:"333 W Ocean Blvd, Long Beach, CA 90802" }}
{{ cms:partial:shared/modular_box:bus:"Metro Blue Line" }}
{{ cms:partial:shared/modular_box:bike:"Bike racks and bike share pods available." }}
{{ cms:partial:shared/modular_box:parking:"Parking is available at 332 West Broadway Avenue; the first 30 minutes are free, and each additional 20 minutes cost $1.25, with a maximum fee of $7.50. Metered parking is also available along Broadway and Cedar, directly in front of City Hall." }}


Asian markets mostly down as traders ease into weekend
HONG KONG, Nov 8 — Asian markets fell today as investors took their foot off the pedal after another healthy week, with eyes fixated on the next move in the China-US trade talks.
News out of Beijing that it had agreed a plan with Washington to start rolling back tariffs if negotiations progress fired a rally in late business on Thursday, and helped the Dow and S&P 500 to more records.
The announcement fanned hopes the world’s economic superpowers — who are currently finalising a mini trade pact as part of a wider deal — can resolve their long-running tariffs war that has hobbled the global growth outlook.
It also eased worries about the negotiations caused by reports that a hoped-for signing ceremony this month between Donald Trump and Xi Jinping could be delayed until December.
“The elevation of discussion from a trade truce to a possible tariff rollback is important and suggests both China and the US have come under pressure to seal a deal,” National Australia Bank’s Tapas Strickland said in a note.
But dealers struggled in Asia after the White House failed to confirm the plan, while a report said there was some opposition within the administration to such a move.
Meanwhile, Trump trade adviser and China hawk Peter Navarro told Fox Business “there is no agreement at this time to remove any of the existing tariffs as a condition of the phase one deal. The only person who can make that decision is Donald Trump”.
Neil Wilson, chief market analyst at Markets.com, said: “There a strong sense of the ‘if’ about this. If a first phase trade deal is done, there is agreement to roll back some existing tariffs, but only if the deal is agreed. Usual story — mixed reports really all just noise.”
Pound subdued
Adding to the malaise was a certain amount of profit-taking after another strong week across equity markets, which have been on a rally since last month as the trade talks showed progress.
Hong Kong fell 0.7 per cent following a six-day advance, while dealers in the city were bracing for a fresh weekend of protests after the death of a student who sustained head injuries when he fell during clashes with police.
Shanghai gave up 0.5 per cent after data showed Chinese exports and imports fell again last month, though not as quickly as expected, while Singapore was off 0.9 per cent and Seoul retreated 0.3 per cent.
Taipei lost 0.2 per cent, Manila was down 0.7 per cent and Jakarta gave up 0.1 per cent.
Mumbai fell 0.2 per cent and India’s rupee sank 0.5 per cent after Moody’s lowered its ratings outlook on the country’s debt.
The pound remained subdued after taking a hit on Thursday from an economic growth downgrade for 2020 by the Bank of England that fuelled speculation it could cut interest rates soon.
The central bank kept rates on hold but the decision was split for the first time in more than a year, with two dissenters calling for a reduction in borrowing costs to fend off the feared downturn.
In early trade, London and Frankfurt dipped 0.3 per cent, while Paris slipped 0.4 per cent.
Key figures around 0820 GMT
Tokyo — Nikkei 225: UP 0.3 per cent at 23,391.87 (close)
Hong Kong — Hang Seng: DOWN 0.7 per cent at 27,651.14 (close)
Shanghai — Composite: DOWN 0.5 per cent at 2,964.18 (close)
London — FTSE 100: DOWN 0.3 per cent at 7,381.24
Pound/dollar: DOWN at US$1.2811 from US$1.2813 at 2100 GMT
Euro/pound: UP at 86.25 pence from 86.23 pence
Euro/dollar: UP at US$1.1050 from US$1.1049
Dollar/yen: DOWN at 109.27 yen from 109.29 yen
West Texas Intermediate: DOWN 50 cents at US$56.65 per barrel
Brent North Sea crude: DOWN 49 cents at US$61.80 per barrel
New York — Dow: UP 0.7 per cent at 27,674.80 (close) — AFP


Piccut is a simple app to make your photos more beautiful and amazing using some of the tools available on it, These tools cut the backgrounds and change them to other backgrounds available within the application, or even change them to transparent, white or any other color you prefer.
Get itThese tools cut the backgrounds and change them to other backgrounds available within the application, or even change them to transparent, white or any other color you prefer, An easy-to-use tools that only determines the foreground and the tool automatically cuts the background of the image professionally and with high precision.
There are over a million photos and wallpapers ready for download with high quality and editable quality, you can install them with cut images.
You can combine your photos and install them up to a maximum of 10 pictures with wallpapers that you download from the market or a specific image from the gallery.


Here we have many concurrent parameter readers, but only a single parameter writer. This thread pool owns one function that returns one (random) floating point number. The pool sits ready to perform calculations on any new parameter value. Once a new parameter value is received, this pool calls its function a fixed number of times, and all of the function output is averaged in a thread-safe way. Actually, these function evals are expected to be in the log space, and the log-mean-exp is calculated using the log-sum-exp trick. For our particular applications, this function will also depend on observed data that doesn't change once the thread pool has been initialized.
More...
#include <thread_pool.h>
|
|
using | F = std::function< func_output_t(dyn_data_t, static_data_t)> |
| |
|
| | thread_pool (F f, unsigned num_comps, bool mt=true, unsigned num_threads=0) |
| | The ctor spawns the working threads and gets ready to start doing work. More...
|
| |
| void | add_observed_data (const static_data_t &obs_data) |
| | add observed data once before any calculations are performed More...
|
| |
|
| ~thread_pool () |
| | destructor
|
| |
| func_output_t | work (dyn_data_t new_param) |
| | changes the shared data member, then resets some variables, then starts all the work and returns the average. More...
|
| |
|
|
void | worker_thread () |
| | This function runs on all threads, and continuously waits for work to do. When a new parameter comes, calculations begin to be performed, and all their outputs are averaged together. When work is finished, threads idle.
|
| |
|
|
std::shared_mutex | m_input_mut |
| |
|
std::mutex | m_output_mut |
| |
|
unsigned | m_num_threads |
| |
|
std::atomic< unsigned > | m_count |
| |
|
std::atomic_bool | m_done |
| |
|
const unsigned | m_total_calcs |
| |
|
std::vector< func_output_t > | m_all_calcs |
| |
|
std::promise< func_output_t > | m_out |
| |
|
F | m_f |
| |
|
dyn_data_t | m_param |
| |
|
static_data_t | m_observed_data |
| |
|
bool | m_no_data_yet |
| |
|
std::vector< std::thread > | m_threads |
| |
|
join_threads | m_joiner |
| |
template<typename dyn_data_t, typename static_data_t, typename func_output_t, bool debug = false>
class thread_pool< dyn_data_t, static_data_t, func_output_t, debug >
Here we have many concurrent parameter readers, but only a single parameter writer. This thread pool owns one function that returns one (random) floating point number. The pool sits ready to perform calculations on any new parameter value. Once a new parameter value is received, this pool calls its function a fixed number of times, and all of the function output is averaged in a thread-safe way. Actually, these function evals are expected to be in the log space, and the log-mean-exp is calculated using the log-sum-exp trick. For our particular applications, this function will also depend on observed data that doesn't change once the thread pool has been initialized.
- Template Parameters
-
| dyn_data_t | dynamic data type. The type of input that gets changed repeatedly. |
| static_data_t | the type of input that only gets set once |
| func_output_t | type of function output |
| debug | do you want debug printing messages? |
◆ thread_pool()
template<typename dyn_data_t , typename static_data_t , typename func_output_t , bool debug = false>
| thread_pool< dyn_data_t, static_data_t, func_output_t, debug >::thread_pool |
( |
F |
f, |
|
|
unsigned |
num_comps, |
|
|
bool |
mt = true , |
|
|
unsigned |
num_threads = 0 |
|
) |
| |
|
inline |
The ctor spawns the working threads and gets ready to start doing work.
- Parameters
-
| f | the function that gets called a bunch of times. |
| num_comps | the number of times to call f with each new parameter input. |
| mt | do you want multiple threads? |
| num_threads | the number of threads you want or 0 which decides what's available for you |
◆ add_observed_data()
template<typename dyn_data_t , typename static_data_t , typename func_output_t , bool debug = false>
| void thread_pool< dyn_data_t, static_data_t, func_output_t, debug >::add_observed_data |
( |
const static_data_t & |
obs_data | ) |
|
|
inline |
add observed data once before any calculations are performed
- Parameters
-
| obs_data | the entire collection of observed data |
◆ work()
template<typename dyn_data_t , typename static_data_t , typename func_output_t , bool debug = false>
| func_output_t thread_pool< dyn_data_t, static_data_t, func_output_t, debug >::work |
( |
dyn_data_t |
new_param | ) |
|
|
inline |
changes the shared data member, then resets some variables, then starts all the work and returns the average.
- Parameters
-
- Returns
- a floating point average
The documentation for this class was generated from the following file:


Reports calls to wait() not made inside a loop.
wait()
wait() is normally used to suspend a thread until a condition is true, and that condition should be checked after the wait() returns. A loop is the clearest way to achieve this.


Minumum Team Size: {{minTeamSize}}
Maximum Team Size: {{maxTeamSize}}
Start Date: {{startDate | date:'yyyy-MM-dd'}}
End Date: {{endDate | date:'yyyy-MM-dd'}}
Details: {{details}}
Size: {{team.size}}
Places Left: {{team.size - team.currentTeamSize}}
Preferred Skills: {{team.skills.join(", ")}}
Skills Matched ({{team.skillsMatch.number}}): {{team.skillsMatch.match.join(", ")}}
Missing Skills Matched ({{team.missingSkillsMatch.number}}): {{team.missingSkillsMatch.match.join(", ")}}
Team members ({{team.currentTeamSize}}): {{member.name}},
Team Skills: {{team.teamSkills.join(", ")}}


Qt Quick Demo - Photo Surface
Photo Surface demonstrates how to use a Repeater with a FolderListModel and a FileDialog to access images from a folder selected by a user and how to handle dragging, rotation and pinch zooming within the same item using a PinchArea that contains a MouseArea.
All the app code is contained in one QML file, photosurface.qml. Inline JavaScript code is used to place, rotate, and scale images on the photo surface.
Running the Example
To run the example from Qt Creator, open the Welcome mode and select the example from Examples. For more information, visit Building and Running an Example.
Creating the Main Window
To create the main window for the Photo Surface app, we use the Window QML type as the root item. It automatically sets up the window for use with Qt Quick graphical types:
Window { id: root visible: true width: 1024; height: 600 color: "black" property int highestZ: 0 property real defaultSize: 200 property var currentFrame: undefined
To use the Window type, we must import it:
import QtQuick.Window 2.1
Accessing Folder Contents
We use a Repeater QML type together with the FolderListModel to display GIF, JPG, and PNG images located in a folder:
Repeater { model: FolderListModel { id: folderModel objectName: "folderModel" showDirs: false nameFilters: imageNameFilters }
To use the FolderListModel type, we must import it:
import Qt.labs.folderlistmodel 1.0
We use a FileDialog to enable users to select the folder that contains the images:
FileDialog { id: fileDialog title: "Choose a folder with some images" selectFolder: true folder: picturesLocation onAccepted: folderModel.folder = fileUrl + "/" }
To use the FileDialog type, we must import Qt Quick Dialogs:
import QtQuick.Dialogs 1.0
We use the fileDialog.open()
function to open the file dialog when the app starts:
Component.onCompleted: fileDialog.open()
Users can also click the file dialog icon to open the file dialog. We use an Image QML type to display the icon. Inside the Image type, we use a MouseArea with the onClicked
signal handler to call the fileDialog.open()
function:
Image { anchors.top: parent.top anchors.left: parent.left anchors.margins: 10 source: "resources/folder.png" MouseArea { anchors.fill: parent anchors.margins: -10 onClicked: fileDialog.open() hoverEnabled: true onPositionChanged: { tooltip.visible = false hoverTimer.start() } onExited: { tooltip.visible = false hoverTimer.stop() }
Displaying Images on the Photo Surface
We use a Rectangle as a delegate for a Repeater to provide a frame for each image that the FolderListModel finds in the selected folder. We use JavaScript Math()
methods to place the frames randomly on the photo surface and to rotate them at random angles, as well as to scale the images:
Rectangle { id: photoFrame width: image.width * (1 + 0.10 * image.height / image.width) height: image.height * 1.10 scale: defaultSize / Math.max(image.sourceSize.width, image.sourceSize.height) Behavior on scale { NumberAnimation { duration: 200 } } Behavior on x { NumberAnimation { duration: 200 } } Behavior on y { NumberAnimation { duration: 200 } } border.color: "black" border.width: 2 smooth: true antialiasing: true Component.onCompleted: { x = Math.random() * root.width - width / 2 y = Math.random() * root.height - height / 2 rotation = Math.random() * 13 - 6 }
Handling Pinch Gestures
We use a PinchArea that contains a MouseArea in the photo frames to handle dragging, rotation and pinch zooming of the frame:
PinchArea { anchors.fill: parent pinch.target: photoFrame pinch.minimumRotation: -360 pinch.maximumRotation: 360 pinch.minimumScale: 0.1 pinch.maximumScale: 10 pinch.dragAxis: Pinch.XAndYAxis onPinchStarted: setFrameColor();
We use the pinch
group property to control how the photo frames react to pinch gestures. The pinch.target
sets photoFrame
as the item to manipulate. The rotation properties specify that the frames can be rotated at all angles and the scale properties specify that they can be scaled between 0.1
and 10
.
In the MouseArea's onPressed
signal handler, we raise the selected photo frame to the top by increasing the value of its z
property. The root item stores the z value of the top-most frame. The border color of the photo frame is controlled in the onEntered
signal handler to highlight the selected image:
MouseArea { id: dragArea hoverEnabled: true anchors.fill: parent drag.target: photoFrame scrollGestureEnabled: false // 2-finger-flick gesture should pass through to the Flickable onPressed: { photoFrame.z = ++root.highestZ; parent.setFrameColor(); } onEntered: parent.setFrameColor();
To enable you to test the example on the desktop, we use the MouseArea's onWheel
signal handler to simulate pinch gestures by using a mouse:
onWheel: { if (wheel.modifiers & Qt.ControlModifier) { photoFrame.rotation += wheel.angleDelta.y / 120 * 5; if (Math.abs(photoFrame.rotation) < 4) photoFrame.rotation = 0; } else { photoFrame.rotation += wheel.angleDelta.x / 120; if (Math.abs(photoFrame.rotation) < 0.6) photoFrame.rotation = 0; var scaleBefore = photoFrame.scale; photoFrame.scale += photoFrame.scale * wheel.angleDelta.y / 120 / 10; } }
The onWheel
signal handler is called in response to mouse wheel gestures. Use the vertical wheel to zoom and Ctrl and the vertical wheel to rotate frames. If the mouse has a horizontal wheel, use it to rotate frames.
Files:
See also QML Applications.


Better Beans. Better Coffee
A relaxed and contemporary cafe bar in the city centre of Limassol
Menu
/
Location
/
Phone


Classes supporting the com.interface21.web.context package, such as WebApplicationContext implementations, and a utility class for retrieval of the root application context etc.