Download and install:
R studio (https://www.rstudio.com/)
Open R studio:
install.packages('devtools')
devtools::install_github('JGCRI/rgcam')
devtools::install_github('JGCRI/plutus')
This example will give you a step-by-step instruction on using the core functionality of plutus
.
The default data and assumptions used in plutus
can be found in GCAM v5.3 (See Table 1). However, if any of those files listed in Table 1 have been updated in your GCAM run, it is necessary to use the updated values in plutus
as well. plutus
uses argument gcamdataFile
to specify the path to ALL of the updated files.
Table 1: Data and assumption files. “~\” represents the path to your GCAM v5.3 home folder.
| Data or Assumption | Technology | Region | Data File in GCAM v5.3 |
|---|---|---|---|
| Overnight capital costs | Electricity generation technologies | Global | ~\input\gcamdata\outputs\L2233.GlobalIntTechCapital_elec.csv ~\input\gcamdata\outputs\L2233.GlobalTechCapital_elecPassthru.csv |
| Overnight capital costs | Cooling technologies | Global | ~\input\gcamdata\outputs\L2233.GlobalIntTechCapital_elec_cool.csv ~\input\gcamdata\outputs\L2233.GlobalTechCapital_elec_cool.csv |
| Capacity factors | Electricity generation technologies | Global | ~\input\gcamdata\outputs\L223.GlobalTechCapFac_elec.csv |
| Capacity factors | Intermittant technologies | Global | ~\input\gcamdata\outputs\L223.GlobalIntTechCapFac_elec.csv |
| Capacity factors | Intermittant technologies | Regional | ~\input\gcamdata\outputs\L223.StubTechCapFactor_elec.csv |
| Lifetime and steepness | Electricity generation technologies | Global | ~\input\gcamdata\inst\extdata\energy\A23.globaltech_retirement.csv |
Note: In this example, our GCAM sample dataset is based on the default data and assumptions, so we do not need to update those files in plutus
.
plutus::gcamInvest
to estimate stranded assets and electricity investmentsHere are the core arguments we used in this example:
gcamdatabase
: FULL path to the GCAM output XML database folder.reReadData
: If TRUE, plutus
will read the GCAM database and create a queryData.proj file under the output directory.scenOrigNames
: Choose scenarios to read in. Default = ‘All’ will read all the scenarios.regionsSelect
: Choose regions to read in. Defaul = NULL will read all the regions.saveData
: If TRUE, plutus
will save data by different aggregated classes.
# Load required packages
library(plutus)
library(dplyr)
# Set your working directory based on the example dataset location
workdir <- setwd('E:/plutus_example/')
# provide path to the desired GCAM database folder.
path_to_gcamdatabase <- 'E:/plutus_example/IDBNexus_gcam5p3_HadGEM2-ES_rcp8p5'
# Specify the path to data file folder if any data files has been updated
# path_to_gcamdataFile <- 'E:/plutus_example/gcamdataFile'
# Use plutus::gcamInvest to calculate stranded assets and electricity investments
invest <- plutus::gcamInvest(gcamdatabase = path_to_gcamdatabase,
reReadData = T,
# gcamdataFile = path_to_gcamdataFile, # Use this argument if any data files has been updated
scenOrigNames = c('Reference'),
regionsSelect = c('USA', 'China'),
saveData = T)
plutus::gcamInvest
returns a list containing:
data
: a dataframe with the post-processed GCAM output showing stranded assets and electricity investments (see Table 2) by scenario, region, technology, and time perioddataAggParam
: a dataframe with the data aggregated to the parameterdataAggClass1
: a dataframe with the data aggregated to class 1dataAggclass2
: a dataframe with the data aggregated to class 2scenarios
: A list of the scenariosqueries
: A list of the queries used to extract the datadata
contains the most detailed information. Check the structure and content of data
and select the most relevant columns including scenario, region, param, class1 (= fuel types), x (= year), units, and value.
# Get dataframe with post-processed outputs for stranded assets and electricity investment
df_invest <- invest$data
# Check dataframe structure
str(df_invest)
## tibble [1,152 x 22] (S3: tbl_df/tbl/data.frame)
## $ scenario : chr [1:1152] "Reference" "Reference" "Reference" "Reference" ...
## $ region : chr [1:1152] "China" "China" "China" "China" ...
## $ subRegion : chr [1:1152] "China" "China" "China" "China" ...
## $ param : chr [1:1152] "elecNewCapCost" "elecNewCapCost" "elecNewCapCost" "elecNewCapCost" ...
## $ sources : chr [1:1152] "Sources" "Sources" "Sources" "Sources" ...
## $ class1 : chr [1:1152] "Bioenergy" "Bioenergy" "Bioenergy" "Bioenergy" ...
## $ class2 : chr [1:1152] "class2" "class2" "class2" "class2" ...
## $ x : num [1:1152] 2015 2020 2025 2030 2035 ...
## $ xLabel : chr [1:1152] "Year" "Year" "Year" "Year" ...
## $ vintage : chr [1:1152] "Vint_2015" "Vint_2020" "Vint_2025" "Vint_2030" ...
## $ units : chr [1:1152] "New Elec Cap Cost (Billion 2010 USD)" "New Elec Cap Cost (Billion 2010 USD)" "New Elec Cap Cost (Billion 2010 USD)" "New Elec Cap Cost (Billion 2010 USD)" ...
## $ aggregate : chr [1:1152] "sum" "sum" "sum" "sum" ...
## $ classLabel1 : chr [1:1152] "Fuel" "Fuel" "Fuel" "Fuel" ...
## $ classPalette1: chr [1:1152] "pal_metis" "pal_metis" "pal_metis" "pal_metis" ...
## $ classLabel2 : chr [1:1152] "classLabel2" "classLabel2" "classLabel2" "classLabel2" ...
## $ classPalette2: chr [1:1152] "classPalette2" "classPalette2" "classPalette2" "classPalette2" ...
## $ origScen : chr [1:1152] "Reference" "Reference" "Reference" "Reference" ...
## $ origQuery : chr [1:1152] "elec gen by gen tech and cooling tech and vintage" "elec gen by gen tech and cooling tech and vintage" "elec gen by gen tech and cooling tech and vintage" "elec gen by gen tech and cooling tech and vintage" ...
## $ origUnits : chr [1:1152] "billion 2010 USD" "billion 2010 USD" "billion 2010 USD" "billion 2010 USD" ...
## $ origX : num [1:1152] 2015 2020 2025 2030 2035 ...
## $ value : num [1:1152] 0 0 5.84 8.75 8.95 ...
## $ origValue : num [1:1152] 0 0 5.84 8.75 8.95 ...
# Select key variables
df_invest_sub <- df_invest %>%
dplyr::select(scenario, region, param, class1, x, units, value) %>%
dplyr::rename(fuel = class1,
year = x)
head(df_invest_sub)
## # A tibble: 6 x 7
## scenario region param fuel year units value
## <chr> <chr> <chr> <chr> <dbl> <chr> <dbl>
## 1 Reference China elecNewCapC~ Bioener~ 2015 New Elec Cap Cost (Billion~ 0
## 2 Reference China elecNewCapC~ Bioener~ 2020 New Elec Cap Cost (Billion~ 0
## 3 Reference China elecNewCapC~ Bioener~ 2025 New Elec Cap Cost (Billion~ 5.84
## 4 Reference China elecNewCapC~ Bioener~ 2030 New Elec Cap Cost (Billion~ 8.75
## 5 Reference China elecNewCapC~ Bioener~ 2035 New Elec Cap Cost (Billion~ 8.95
## 6 Reference China elecNewCapC~ Bioener~ 2040 New Elec Cap Cost (Billion~ 8.42
# Check out 8 parameters
unique(df_invest$param)
## [1] "elecNewCapCost" "elecNewCapGW"
## [3] "elecAnnualRetPrematureCost" "elecAnnualRetPrematureGW"
## [5] "elecCumCapCost" "elecCumCapGW"
## [7] "elecCumRetPrematureCost" "elecCumRetPrematureGW"
There are eight different parameters in the output showing stranded assets or electricity investments in terms of monetary value (Billion 2010 USD) or installed capacity (GW). The detailed descriptions are in Table 2. GCAM v5.3 is operated in five-years time step with 2015 as the final calibration year (base year). Annual value is the value calculated at each time step. Cumulative value represents the cumulative total over five-year time step.
Table 2: Descriptions of output parameters for stranded assets and electricity investments.
| Parameter | Description | Unit |
|---|---|---|
| elecNewCapCost | Annual electricity capacity installations | Billion 2010 USD |
| elecNewCapGW | Annual electricity capacity installations | Gigawatts |
| elecAnnualRetPrematureCost | Annual premature retirements | Billion 2010 USD |
| elecAnnualRetPrematureGW | Annual premature retirements | Gigawatts |
| elecCumCapCost | Cumulative electricity capacity installations | Billion 2010 USD |
| elecCumCapGW | Cumulative electricity capacity installations | Gigawatts |
| elecCumRetPrematureCost | Cumulative premature retirements | Billion 2010 USD |
| elecCumRetPrematureGW | Cumulative premature retirements | Gigawatts |


An example with aspect ratio locking and preview pane. Obviously the most visual demo, the preview pane is accomplished entirely outside of Jcrop with a simple jQuery-flavored callback. This type of interface could be useful for creating a thumbnail or avatar. The onChange event handler is used to update the view in the preview pane.


READPROFILE
Section: User Commands (1)Updated: May 1996
Index Return to Main Contents
NAME
readprofile - a tool to read kernel profiling informationSYNOPSIS
readprofile [options]VERSION
This manpage documents version 2.0 of the program.DESCRIPTION
The readprofile command uses the /proc/profile information to print ascii data on standard output. The output is organized in three columns: the first is the number of clock ticks, the second is the name of the C function in the kernel where those many ticks occurred, and the third is the normalized `load' of the procedure, calculated as a ratio between the number of ticks and the length of the procedure. The output is filled with blanks to ease readability.
Available command line options are the following:
- -m mapfile
-
Specify a mapfile, which by default is
/usr/src/linux/System.map.
You should specify the map file on cmdline if your current kernel isn't the
last one you compiled, or if you keep System.map elsewhere. If the name of
the map file ends with `.gz' it is decompressed on the fly.
- -p pro-file
-
Specify a different profiling buffer, which by default is
/proc/profile.
Using a different pro-file is useful if you want to `freeze' the
kernel profiling at some time and read it later. The
/proc/profile
file can be copied using `cat' or `cp'. There is no more support for
compressed profile buffers, like in
readprofile-1.1,
because the program needs to know the size of the buffer in advance.
- -i
-
Info. This makes
readprofile
only print the profiling step used by the kernel.
The profiling step is the resolution of the profiling buffer, and
is chosen during kernel configuration (through `make config'),
or in the kernel's command line.
If the
-t
(terse) switch is used together with
-i
only the decimal number is printed.
- -a
-
Print all symbols in the mapfile. By default the procedures with 0 reported
ticks are not printed.
- -b
-
Print individual histogram-bin counts.
- -r
-
Reset the profiling buffer. This can only be invoked by root, because
/proc/profile
is readable by everybody but writable only by the superuser. However,
you can make
readprofile
setuid 0, in order to reset the buffer without gaining privileges.
- -M multiplier
-
On some architectures it is possible to alter the frequency at which
the kernel delivers profiling interrupts to each CPU. This option allows you to
set the frequency, as a multiplier of the system clock frequency, HZ.
This is supported on i386-SMP (2.2 and 2.4 kernel) and also on sparc-SMP
and sparc64-SMP (2.4 kernel). This option also resets the profiling buffer,
and requires superuser privileges.
- -v
-
Verbose. The output is organized in four columns and filled with blanks.
The first column is the RAM address of a kernel function, the second is
the name of the function, the third is the number of clock ticks and the
last is the normalized load.
- -V
-
Version. This makes
readprofile
print its version number and exit.
EXAMPLES
Browse the profiling buffer ordering by clock ticks:readprofile | sort -nr | lessPrint the 20 most loaded procedures:
readprofile | sort -nr +2 | head -20Print only filesystem profile:
readprofile | grep _ext2Look at all the kernel information, with ram addresses"
readprofile -av | lessBrowse a `freezed' profile buffer for a non current kernel:
readprofile -p ~/profile.freeze -m /zImage.map.gzRequest profiling at 2kHz per CPU, and reset the profiling buffer
sudo readprofile -M 20
BUGS
readprofile only works with an 1.3.x or newer kernel, because /proc/profile changed in the step from 1.2 to 1.3
This program only works with ELF kernels. The change for a.out kernels is trivial, and left as an exercise to the a.out user.
To enable profiling, the kernel must be rebooted, because no profiling module is available, and it wouldn't be easy to build. To enable profiling, you can specify "profile=2" (or another number) on the kernel commandline. The number you specify is the two-exponent used as profiling step.
Profiling is disabled when interrupts are inhibited. This means that many profiling ticks happen when interrupts are re-enabled. Watch out for misleading information.
FILES
/proc/profile A binary snapshot of the profiling buffer. /usr/src/linux/System.map The symbol table for the kernel. /usr/src/linux/* The program being profiled :-)
AVAILABILITY
The readprofile command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
Index
This document was created by man2html, using the manual pages.
Time: 05:29:10 GMT, December 24, 2015


Apple releases For All Mankind 'Creating the World Featurette'
Source: Apple
What you need to know
- Apple has shared a 'Creating the World' Featurette for its Apple TV+ show For All Mankind.
- In the spotlight is the authenticity and attention to detail in the set design of the show.
- There are interview snippets from cast and crew, including Executive Producer Ronald D. Moore (Outlander, Star Trek, Battlestar Galactica.)
Apple has published a 'Creating the World Featurette' for its Apple TV+ show For All Mankind to YouTube.
The four-minute video gives viewers a quick snapshot behind the scenes of Apple TV+'s space race drama. The description of the video states:
From the lunar surface of the moon to the precise recreation of the original Mission Control, the level of authenticity and attention to detail that brought For All Mankind to life is astounding. Hear from the Executive Producers and crew members regarding the incredible care and craft that went into building the sets, finding the real-life props and designing the wardrobes for this nostalgic, alternate history drama.
The focus of the video is the attention to detail applied to the design of sets and the inclusion of props within the show. Technical Advisor Garrett Reisman marvels at the accuracy of the Mission Control set, down to the door hinges, the paint color and even the pens on the desk, which are all said to be totally authentic to the actual location as it was in 1969. Even one of the wrenches used on set was an actual wrench used on an Apollo mission. It seems a great deal of importance was placed on accuracy and authenticity in the show. Actor Joel Kinnaman, who stars as Edward Baldwin, talks about how the meticulously-detailed world helped the actors to fully immerse themselves in the roles they were playing.
Whilst the show is a slow-burner to begin with, our review of the show's first three episodes ended with a solid 4/5 star-rating, you can read that full review here.
For All Apple devices!
Apple TV+
Check out the meticulous set-building, authentic-wrench wielding For All Mankind and its first five episodes available now. A sixth is coming Friday 22 Nov.!
Subscribe, or enjoy a year's free viewing if you bought an iPhone, iPod, iPad Mac or Apple TV after September 10, 2019.
We may earn a commission for purchases using our links. Learn more.


Hello CMakeIntroduction -------------
A short tutorial on using cmake and the android ndk standalone toolchain.I. Requirements ----------------
You will need ant to compile the java. sudo apt-get install ant You must have the android standalone toolchain either in /opt/android-toolchain or have the environment variable set: export ANDROID_NDK_TOOLCHAIN_ROOT=$HOME/android-toolchain Also, please set the android.toolchain.cmake as an evironment variable for the convience of this tutorial. export ANDTOOLCHAIN=~/android-cmake/toolchain/android.toolchain.cmake Highly recommended that you either use cmake-gui or ccmake to step through the cmake process.II. Build for the PC -------------------
cd to the samples/hello-cmake directory mkdir pcbuild cd pcbuild cmake .. make Now build the java. cd to samples/hello-cmake ./build_java.sh ./run_java.sh Hello from JNI ! If you look in run_java.sh, it exports the lib/pc path (where the shared library was put), so that the java may load the shared library.III. Build for the Android -------------------
cd to the samples/hello-cmake directory export ANDROID_NDK_TOOLCHAIN_ROOT=~/android-toolchain export ANDTOOLCHAIN=~/android-cmake/toolchain/android.toolchain.cmake mkdir androidbuild cd androidbuild cmake -DCMAKE_TOOLCHAIN_FILE=$ANDTOOLCHAIN .. make You should see something like: Linking C shared library ../libs/armeabi-v7a/libhello-cmake.so Try cmake-gui and play with the arm targets and such. Please look at the cmake lists, it simple and commented.IV. Install for Android -------------------
Lets get this shared library ready for android. cd androidbuild cmake-gui .. Now in select armeabi for ARM_TARGETS. This is created by the android.toolchain and determines the abi compatibility of the shared library. It will also change the install directory of the shared library. Also, point the LIBRARY_OUTPUT_PATH_ROOT to samples/hello-android-cmake path. This has the effect of installing the shared library into the correct folder for android sdk build system. make Now rerun cmake-gui and select armeabi-v7a for the ARM_TARGETS. Run make, and you should now see the two versions of the shared library installed in the hello-android-cmake/libs directory. You may want to set the advanced CMAKE_VERBOSE_MAKEFILE flag from cmake-gui, to see the compiler and linker flags. Now you are ready to move on to the hello-android-cmake.html sample.


| DevIL Documentation | Home | Previous | Next |
The ilSetWrite function changes the writing file functions used by DevIL.
ILvoid ilSetWrite(
fOpenWProc Open,
fCloseWProc Close,
fPutcProc Putc,
fSeekWProc Seek,
fTellRProc Tell,
fWriteProc Write
);
ilSetWrite allows you to override the default DevIL saving functions with your own. You are virtually unlimited in how your functions work, as long as they have the same behaviour as DevIL's default saving functions. All the functions work on the ILHANDLE type, which is a just a void pointer.
None
ilSetRead, ilResetRead, ilResetWrite


Global Web Fabric
This example shows how to build a multi-site web application fabric with DNS configured on the front-end to combine the sites, routing users to the location closest to them.
It can combine with the Simple Web Cluster example or the Portable Cloud Foundry example, but does not assume knowledge of either of these.
Before You Begin
To use the examples, you'll need curl
, git
, java
(1.6+), and maven
(v3) installed.
Installing Brooklyn
(If you followed the Getting Started instructions, you can skip to Installing the Examples.)
First, grab a copy of the Brooklyn snapshot distribution you wish to use from
the Sonatype snapshot repo
(or build it yourself following instructions here),
unpack it to your favourite location (e.g. $(pwd)
),
and export BROOKLYN_HOME
:
% curl -L -o brooklyn-dist-0.7.0-SNAPSHOT-dist.tar.gz "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=io.brooklyn&v=0.7.0-SNAPSHOT&a=brooklyn-dist&c=dist&e=tar.gz"
% tar xvzf brooklyn-dist-0.7.0-SNAPSHOT-dist.tar.gz
% export BROOKLYN_HOME=$(pwd)/brooklyn-0.7.0-SNAPSHOT/
Installing the Examples
Grab a copy of the brooklyn-examples source code and build it with Maven:
% git clone https://github.com/brooklyncentral/brooklyn-examples.git
% cd brooklyn-examples
% mvn clean install
Please note, these instructions are for a SNAPSHOT release of Brooklyn, so proceed with caution. For the latest stable version, go here.
For more information on ways to download Brooklyn please see the download page. For more information on the Brooklyn CLI and launching apps, please visit this section of the user guide.
Now, go to this particular example's directory:
% cd global-web-fabric
The CLI needs to know where to find your compiled examples. You can set this up by exporting
the BROOKLYN_CLASSPATH
environment variable in the following way:
% export BROOKLYN_CLASSPATH=$(pwd)/target/classes
The project global-web-fabric
contains the code used
in this example under src/main/java
.
Setting Up Geographic DNS
This example uses geoscaling.com to provide free geographic-dependent DNS services. This will forward a domain name of your choice to various IPs depending on a script, e.g. computing the nearest IP based on latitude and longitude of the requester and the targets. Brooklyn will automatically generate and update this script, but you do need to create and configure a Geoscaling account:
- Create the free account here.
- Click the link in the email you receive.
- Enter the domain name you wish to use into geoscaling (see below).
The simplest domain name to choose is something unique under geopaas.org
, e.g. yourname.geopaas.org
,
which we have already configured for Geoscaling to manage.
If you are using your own domain name,
set its nameservers as advised by geoscaling (e.g. ns{1,2,3,4}.geoscaling.com
).
Next we need to supply this information to Brooklyn at runtime.
The simplest way is to create or add the following fields to ~/.brooklyn/brooklyn.properties
:
brooklyn.geoscaling.username=yourname
brooklyn.geoscaling.password=s3cr3t
brooklyn.geoscaling.primaryDomain=yourname.geopaas.org
Replace the values of these fields as appropriate, of course! You can, if you prefer, supply (or override) these values in your Brooklyn application.
Setting Up the Locations Database
In order to generate the "closest-IP" script,
Brooklyn needs a way to find out the latitude and longitude of the
servers you are using.
The simplest way to do this is do download the free GeoCityLite binary flatfile
from MaxMind,
unpack it, and copy it to ~/.brooklyn/MaxMind-GeoLiteCity.dat
.
This will be picked up automatically if it is installed.
You can instead specify to use an online lookup service, such as
utrace.de by specifying
-Dbrooklyn.location.geo.HostGeoLookup=brooklyn.location.geo.UtraceHostGeoLookup
;
but note this has a cap of 100 per day.
This information is also used to display locations on the map in the Brooklyn dashboard. Note however that these free services are not 100% accurate; they are handy for dev/test but in a production system you may wish to specify the geographical information manually in your application, or purchase a commercial locations-database subscription.
The Code
Now let's start writing our application. The heavy lifting will be done by off-the-shelf Brooklyn classes:
DynamicFabric
will create the entity specified byfactory
in each location it is givenGeoscalingDnsService
monitors children of a specified entity (theDynamicFabric
) and adds them as DNS targets for the region they are in
First, however, let's create the Java class -- call it GlobalWebFabricExample
.
This will extend the Brooklyn AbstractApplication
:
package brooklyn.demo;
import static com.google.common.base.Preconditions.checkNotNull;
import brooklyn.entity.basic.AbstractApplication;
public class GlobalWebFabricExample extends AbstractApplication {
@Override
public void init() {
// TODO create our app!
}
}
The Fabric
The DynamicFabric
by default has no knowledge of what it will build,
other than the factory
it is given to create an entity in each region.
We'll use the class ElasticJavaWebAppService.Factory
which creates
an elastic Java Web App service,
such as the ControlledDynamicWebAppCluster
used in the
Simple Web Cluster example, if deploying to VMs,
or perhaps a CloudFoundryJavaWebAppCluster
if deploying to a Cloud Foundry location
(see brooklyn-cloudfoundry repo).
DynamicFabric webFabric = addChild(EntitySpec.create(DynamicFabric.class)
.displayName("Web Fabric")
.configure(DynamicFabric.FACTORY, new ElasticJavaWebAppService.Factory())
.configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH));
Here we have specified the WAR to use with configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH)
.
The war configuration used in the previous example is only available on web-aware entities;
configuration specified with a ConfigKey can be done on any entity,
and is inherited at runtime, so this provides a useful way to specify the WAR to use
even though the web-aware entities are only constructed at runtime.
Stitching the Fabric together with DNS
To stitch these together seamlessly, another entity will run a policy
which collects the public-facing IP address of each cluster created by the fabric,
as it comes online, by watching for SERVICE_UP
sensors.
First, however, let's make sure any load-balancer proxies (e.g. nginx) in these clusters
are listening on port 80:
DynamicFabric webFabric = addChild(EntitySpec.create(DynamicFabric.class)
.displayName("Web Fabric")
.configure(DynamicFabric.FACTORY, new ElasticJavaWebAppService.Factory())
.configure(ElasticJavaWebAppService.ROOT_WAR, WAR_PATH)
.configure(AbstractController.PROXY_HTTP_PORT, PortRanges.fromInteger(80)));
Let's now define the Geoscaling entity which does the stitching.
We need to supply the username, password, and primaryDomainName for Geoscaling;
we'll take this from the brooklyn.properties
file mentioned above.
We'll also specify a smartSubdomainName
, to use Geoscaling's facility for
lightweight sub-domains to prevent DNS caching and multiple instances of our application
from confusing us -- e.g. brooklyn-1234.yourname.geopaas.org
.
StringConfigMap config = getManagementContext().getConfig();
GeoscalingDnsService geoDns = addChild(EntitySpec.create(GeoscalingDnsService.class)
.displayName("GeoScaling DNS")
.configure("username", checkNotNull(config.getFirst("brooklyn.geoscaling.username"), "username"))
.configure("password", checkNotNull(config.getFirst("brooklyn.geoscaling.password"), "password"))
.configure("primaryDomainName", checkNotNull(config.getFirst("brooklyn.geoscaling.primaryDomain"), "primaryDomain"))
.configure("smartSubdomainName", "brooklyn"));
Lastly we need to tell this instance what entity it should monitor for children to include as targets:
geoDns.setTargetEntityProvider(webFabric);
Cloud Foundry and other PaaS Targets
At this point our core application is ready, and can be deployed to AWS or another VM cloud.
This may take between 15 and 30 minutes to run,
mainly spent downloading software
(unless of course you specify a pre-configured imageId
which contains the software).
A quicker alternative is to deploy to a Java Web App platform-as-a-service such as Cloud Foundry. A major advantage here is that they can provision very quickly, in a matter of seconds. Code for this can be found in the brooklyn-cloudfoundry repo, along with an example global-web-fabric app.
Imports
Your imports should look as follows:
import static com.google.common.base.Preconditions.checkNotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import brooklyn.config.StringConfigMap;
import brooklyn.entity.basic.AbstractApplication;
import brooklyn.entity.basic.Attributes;
import brooklyn.entity.dns.geoscaling.GeoscalingDnsService;
import brooklyn.entity.group.DynamicFabric;
import brooklyn.entity.proxy.AbstractController;
import brooklyn.entity.proxying.EntitySpec;
import brooklyn.entity.proxying.EntitySpecs;
import brooklyn.entity.webapp.ElasticJavaWebAppService;
import brooklyn.location.basic.PortRanges;
Use of main method (optional)
In this example, we will use the brooklyn CLI launcher. However, it is possible to write your own main method.
The following static constants are assumed (most of these as in the Simple Web Cluster example and others):
WAR_PATH
, pointing to the webapp to deploy (a default supplied as part of the Brooklyn examples is used here)DEFAULT_LOCATIONS
, containing a string spec of the locations to deploy to if none are supplied on the command-line; for this examplelocalhost
will frequently not work unless Geoscaling can see it (i.e. it has a public IP and appropriate firewall settings)
The code (which can safely be omitted) is as follows:
import brooklyn.launcher.BrooklynLauncher;
import brooklyn.util.CommandLineUtil;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
// class definition, and rest of class goes here...
public static final Logger log = LoggerFactory.getLogger(GlobalWebFabricExample.class);
// points to the webapp to deploy (a default supplied as part of the Brooklyn examples is used here)
public static final String WAR_PATH = "classpath://hello-world-webapp.war";
// locations to deploy to if none are supplied on the command-line; for this example `localhost` will
// frequently not work unless Geoscaling can see it (i.e. it has a public IP and appropriate firewall settings)
static final List<String> DEFAULT_LOCATIONS = ImmutableList.of(
"aws-ec2:eu-west-1",
"aws-ec2:ap-southeast-1",
"aws-ec2:us-west-1" );
public static void main(String[] argv) {
List<String> args = Lists.newArrayList(argv);
String port = CommandLineUtil.getCommandLineOption(args, "--port", "8081+");
String locations = CommandLineUtil.getCommandLineOption(args, "--locations", Joiner.on(",").join(DEFAULT_LOCATIONS));
BrooklynLauncher launcher = BrooklynLauncher.newInstance()
.application(EntitySpecs.appSpec(GlobalWebFabricExample.class).displayName("Brooklyn Global Web Fabric Example"))
.webconsolePort(port)
.locations(Arrays.asList(locations))
.start();
Entities.dumpInfo(app);
}
Running the Example
Now let's run this example.
${BROOKLYN_HOME}/bin/brooklyn launch --app brooklyn.demo.GlobalWebFabricExample \
--location jclouds:aws-ec2:eu-west-1,jclouds:aws-ec2:ap-southeast-1,jclouds:aws-ec2:us-west-1
The management web console will start, followed by the web-app services in the locations specified creating the VM's as needed. Let's look at the management web console, on port 8081:
This shows the targets (e.g. Ireland (AWS eu-west-1), Singapore (AWS ap-southeast-1), and California (AWS us-west-1)). This also shows the current status of the application.
Navigating to the "applications" tab, we can view sensors, invoke effectors, control policies,
and track activity,
for instance if a cluster is slow to start and you want to find out what is going on
(you'll find additional information in the brooklyn.log
file).
Let's drill down on the Geoscaling DNS entity's sensors:
Here we see it has chosen brooklyn-vOZ7b4BL.martincloudsoft.geopaas.org
as the geo-load-balanced domain name.
(Yours will be under yourname.geopaas.org
, unless you chose a different domain earlier.)
We can also see the hosts it is forwarding to, one for each cluster, corresponding to the
children of the Web Fabric (propagated from the nginx hostnames, in the case of the ControlledDynamicWebAppCluster instances).
Checking the Web App
Once Geoscaling reports at least one target, you should be able to access it on the geo-load-balanced domain name:
Under the covers you are being routed to one of the clusters that has been deployed -- whichever one is closest to you. (Due to DNS caching, at your machine or your ISP, clusters which come online after your first lookup will not be picked up until TTL expires, typically 10m, although often more if DNS services don't respect TTL.)
Checking DNS Information
Let's find out exactly where we were routed:
% dig brooklyn-csgFCzTm.geopaas.org
; <<>> DiG 9.4.3-P3 <<>> brooklyn-csgFCzTm.geopaas.org
;; QUESTION SECTION:
;brooklyn-csgFCzTm.geopaas.org. IN A
;; ANSWER SECTION:
brooklyn-csgFCzTm.geopaas.org. 120 IN CNAME ec2-46-137-138-4.eu-west-1.compute.amazonaws.com.
ec2-46-137-138-4.eu-west-1.compute.amazonaws.com. 215 IN A <IP_ADDRESS>
This was run from Scotland so it seems a sensible choice.
(Some portions of the output from dig
have been removed for readability.)
We can get more information by looking at the TXT records:
% dig +trace @ns1.geoscaling.com TXT brooklyn-csgFCzTm.geopaas.org
; <<>> DiG 9.4.3-P3 <<>> +trace @ns1.geoscaling.com TXT brooklyn-csgFCzTm.geopaas.org
...
geopaas.org. 86400 IN NS ns1.geoscaling.com.
geopaas.org. 86400 IN NS ns2.geoscaling.com.
geopaas.org. 86400 IN NS ns3.geoscaling.com.
geopaas.org. 86400 IN NS ns4.geoscaling.com.
;; Received 133 bytes from <IP_ADDRESS>#53(a2.org.afilias-nst.info) in 45 ms
brooklyn-csgFCzTm.geopaas.org. 300 IN TXT "Request from [54,-2]-(GB) directed to Ireland (IE)"
brooklyn-csgFCzTm.geopaas.org. 300 IN TXT "GeoScaling config auto-updated by Brooklyn 2012-04-26 12:27:25 UTC"
;; Received 189 bytes from <IP_ADDRESS>#53(ns3.geoscaling.com) in 60 ms
Next Steps
This example has shown how to create a multi-region fabric, using the abstractions from jclouds under the covers to make it easy to access different hosting providers simultaneously, and using higher-level abstractions in Brooklyn to mix PaaS systems with bare-VM (or even bare-metal, if you specify fixed IPs).
This is meant as just the beginning however.
Here are some questions to think about and code challenges to give you a steer for what to explore next.
The routines used at Geoscaling optimize for latency between the user and the location of the web-cluster. What other strategies might be used? Cost? Compliance? How would you code these?
This example ignores data, but you clearly can't do that in the real world. When big-data is involved, does this introduce other considerations for optimizing geo-location?
Add a data tier to this system, such as MySQL or Mongo, or even Hadoop. You might start with a single instance or cluster, but the real fun starts with a fabric, and defining the synchronization/replication strategies between the different clusters. This isn't for the faint-hearted, but whatever you create will certainly be of interest to people in the Brooklyn community. Please let us know what you've built!


module SubjectsHelper
Public Instance Methods
dom_input_name(form, field_name)
click to toggle source
# File app/helpers/subjects_helper.rb, line 128 def dom_input_name(form, field_name) "#{form.object_name}[#{field_name.to_s.sub(/\?$/,"")}]" end
get_NaN_objectives(topic)
click to toggle source
# File app/helpers/subjects_helper.rb, line 98 def get_NaN_objectives(topic) questions = get_questions_of_topic(topic) nan = 0.0 / 0.0 nan_objectives = [] topic.objectives.each do |objective| if progress_in_objective(objective) < 101 then else nan_objectives.push(objective) end end nan_objectives end
get_bad_objectives(topic)
click to toggle source
# File app/helpers/subjects_helper.rb, line 87 def get_bad_objectives(topic) questions = get_questions_of_topic(topic) bad_objectives = [] topic.objectives.each do |objective| if progress_in_objective(objective) < 45 then bad_objectives.push(objective) end end bad_objectives end
get_good_objectives(topic)
click to toggle source
# File app/helpers/subjects_helper.rb, line 65 def get_good_objectives(topic) questions = get_questions_of_topic(topic) good_objectives = [] topic.objectives.each do |objective| if progress_in_objective(objective) > 70 then good_objectives.push(objective) end end good_objectives end
get_objective_state(objective)
click to toggle source
# File app/helpers/subjects_helper.rb, line 113 def get_objective_state(objective) objective_status = objective.objective_states.where(:user => current_user).last.status unless objective.objective_states.where(:user => current_user).count == 0 if objective_status == "full" then return "".html_safe elsif objective_status == "not fluent" then return "F".html_safe elsif objective_status == "partial" then return "P".html_safe elsif objective_status == "none" then return "".html_safe else return "".html_safe end end
get_ok_objectives(topic)
click to toggle source
# File app/helpers/subjects_helper.rb, line 76 def get_ok_objectives(topic) questions = get_questions_of_topic(topic) ok_objectives = [] topic.objectives.each do |objective| if progress_in_objective(objective) > 45 and progress_in_objective(objective) < 70 then ok_objectives.push(objective) end end ok_objectives end
get_questions_of_topic(topic)
click to toggle source
# File app/helpers/subjects_helper.rb, line 52 def get_questions_of_topic(topic) questionss = [] topic.objectives.each do |objective| objective.questions.each do |question| questionss.push(question) end end questionss.uniq end
marks(question)
click to toggle source
# File app/helpers/subjects_helper.rb, line 2 def marks(question) return "#{question.answers.where(:user => current_user).last.marks_integer}/#{question.total_marks}" end
objective_traffic_light(objective)
click to toggle source
# File app/helpers/subjects_helper.rb, line 33 def objective_traffic_light(objective) score = progress_in_objective(objective) nan = 0.0/0 # OR nan = Float::NAN nan.class nan.nan? nan.is_a?(Float) && nan.nan? (score.is_a?(Float) && score.nan?) ? 0 : score if score < 50 then return "red" elsif score < 69 return "yellow" elsif score > 70 return "green" else return "" end end
progress_in_objective(objective)
click to toggle source
# File app/helpers/subjects_helper.rb, line 21 def progress_in_objective(objective) marks = 0 total_marks = 0 objective.questions.each do |question| unless question.answers.where(:user => current_user).count == 0 then marks += question.answers.where(:user => current_user).last.marks_integer.to_i * time_degredation(question) total_marks += question.total_marks end end return (marks.to_f / total_marks.to_f) * 100 end
progress_in_topic(topic)
click to toggle source
# File app/helpers/subjects_helper.rb, line 5 def progress_in_topic(topic) unless get_questions_of_topic(topic).count == 0 then #fix for topics that dont have questions returning nil rather than 0.00 marks = 0 total_marks = 0 get_questions_of_topic(topic).each do |question| unless question.answers.where(:user => current_user).blank? marks += question.answers.where(:user => current_user).last.marks_integer.to_i * time_degredation(question) total_marks += question.total_marks end end return (marks.to_f / total_marks.to_f) * 100 else return 0 end end


Team Pictures
2017 Season: Steamworks
2016 Season: Stronghold
2015 Season: Recycle Rush
2014 Season: Areial Assist
2013 Season: Ultimate Ascent


Milestones and bindings
Control as many time-based and status-based events as you need.
W3Flints Clock-Timer allows you to implement some cool features with a few lines of code, calling some critical bindings and checking the milestone queue, if provided.
Milestones
Use milestones when you need to hook any behavior using an approximate time. Because of the relation between the step option and the accuracy level of any time object, W3Flints Clock-Timer cannot guarantee the puntual execution of a milestone, but it provides a second-to-second check, ensuring the execution of the milestone callback.
The milestone queue is a key-value object, in which the key is a datetime in ANSI format, and the value is a function which receives the device and the instant as parameters.
Helpers:
W3Flints Clock-Timer provides some helpers to create timestamps. Those are very useful to create keys fro the milestone stack and deadlines for timers.
- W3FCT.fn.dt.stamp(date): creates an ANSI representation for a Date object.
- W3FCT.fn.dt.stampFromOffset(offset): creates a Date object given an offset in seconds and the current time.
- W3FCT.fn.dt.fromANSI(ansi_string): converts an ANSI representation into a Date object.
Bindings
Bindings are a core-level and more accurate method to check the current time and clock status.
A full example
Let's create a timer with some milestones and bindings:


AWS::AmazonMQ::Broker
A broker is a message broker environment running on Amazon MQ. It is the basic building block of Amazon MQ.
The AWS::AmazonMQ::Broker
resource lets you create Amazon MQ for ActiveMQ and Amazon MQ for RabbitMQ brokers, add
configuration changes or modify users for a speified ActiveMQ broker, return information about the
specified broker, and delete the broker. For more information, see How Amazon MQ works in the Amazon MQ Developer
Guide.
-
ec2:CreateNetworkInterface
This permission is required to allow Amazon MQ to create an elastic network interface (ENI) on behalf of your account.
-
ec2:CreateNetworkInterfacePermission
This permission is required to attach the ENI to the broker instance.
-
ec2:DeleteNetworkInterface
-
ec2:DeleteNetworkInterfacePermission
-
ec2:DetachNetworkInterface
-
ec2:DescribeInternetGateways
-
ec2:DescribeNetworkInterfaces
-
ec2:DescribeNetworkInterfacePermissions
-
ec2:DescribeRouteTables
-
ec2:DescribeSecurityGroups
-
ec2:DescribeSubnets
-
ec2:DescribeVpcs
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::AmazonMQ::Broker", "Properties" : { "AuthenticationStrategy" :
String
, "AutoMinorVersionUpgrade" :Boolean
, "BrokerName" :String
, "Configuration" :ConfigurationId
, "DeploymentMode" :String
, "EncryptionOptions" :EncryptionOptions
, "EngineType" :String
, "EngineVersion" :String
, "HostInstanceType" :String
, "LdapServerMetadata" :LdapServerMetadata
, "Logs" :LogList
, "MaintenanceWindowStartTime" :MaintenanceWindow
, "PubliclyAccessible" :Boolean
, "SecurityGroups" :[ String, ... ]
, "StorageType" :String
, "SubnetIds" :[ String, ... ]
, "Tags" :[ TagsEntry, ... ]
, "Users" :[ User, ... ]
} }
YAML
Type: AWS::AmazonMQ::Broker Properties: AuthenticationStrategy:
String
AutoMinorVersionUpgrade:Boolean
BrokerName:String
Configuration:ConfigurationId
DeploymentMode:String
EncryptionOptions:EncryptionOptions
EngineType:String
EngineVersion:String
HostInstanceType:String
LdapServerMetadata:LdapServerMetadata
Logs:LogList
MaintenanceWindowStartTime:MaintenanceWindow
PubliclyAccessible:Boolean
SecurityGroups:- String
StorageType:String
SubnetIds:- String
Tags:- TagsEntry
Users:- User
Properties
AuthenticationStrategy
-
Optional. The authentication strategy used to secure the broker. The default is
SIMPLE
.Required: No
Type: String
Update requires: Replacement
AutoMinorVersionUpgrade
-
Enables automatic upgrades to new minor versions for brokers, as new broker engine versions are released and supported by Amazon MQ. Automatic upgrades occur during the scheduled maintenance window of the broker or after a manual broker reboot.
Required: Yes
Type: Boolean
Update requires: No interruption
BrokerName
-
The name of the broker. This value must be unique in your AWS account, 1-50 characters long, must contain only letters, numbers, dashes, and underscores, and must not contain white spaces, brackets, wildcard characters, or special characters.
Important Do not add personally identifiable information (PII) or other confidential or sensitive information in broker names. Broker names are accessible to other AWS services, including CCloudWatch Logs. Broker names are not intended to be used for private or sensitive data.
Required: Yes
Type: String
Update requires: Replacement
Configuration
-
A list of information about the configuration. Does not apply to RabbitMQ brokers.
Required: No
Type: ConfigurationId
Update requires: Some interruptions
DeploymentMode
-
The deployment mode of the broker. Available values:
SINGLE_INSTANCE
ACTIVE_STANDBY_MULTI_AZ
CLUSTER_MULTI_AZ
Required: Yes
Type: String
Update requires: Replacement
EncryptionOptions
-
Encryption options for the broker. Does not apply to RabbitMQ brokers.
Required: No
Type: EncryptionOptions
Update requires: Replacement
EngineType
-
The type of broker engine. Currently, Amazon MQ supports
ACTIVEMQ
andRABBITMQ
.Required: Yes
Type: String
Update requires: Replacement
EngineVersion
-
The version of the broker engine. For a list of supported engine versions, see Engine in the Amazon MQ Developer Guide.
Required: Yes
Type: String
Update requires: No interruption
HostInstanceType
-
The broker's instance type.
Required: Yes
Type: String
Update requires: Some interruptions
LdapServerMetadata
-
Optional. The metadata of the LDAP server used to authenticate and authorize connections to the broker. Does not apply to RabbitMQ brokers.
Required: No
Type: LdapServerMetadata
Update requires: No interruption
Logs
-
Enables Amazon CloudWatch logging for brokers.
Required: No
Type: LogList
Update requires: No interruption
MaintenanceWindowStartTime
-
The scheduled time period relative to UTC during which Amazon MQ begins to apply pending updates or patches to the broker.
Required: No
Type: MaintenanceWindow
Update requires: No interruption
PubliclyAccessible
-
Enables connections from applications outside of the VPC that hosts the broker's subnets.
Required: Yes
Type: Boolean
Update requires: Replacement
SecurityGroups
-
The list of rules (1 minimum, 125 maximum) that authorize connections to brokers.
Required: No
Type: List of String
Update requires: No interruption
StorageType
-
The broker's storage type.
Required: No
Type: String
Update requires: Replacement
SubnetIds
-
The list of groups that define which subnets and IP ranges the broker can use from different Availability Zones. If you specify more than one subnet, the subnets must be in different Availability Zones. Amazon MQ will not be able to create VPC endpoints for your broker with multiple subnets in the same Availability Zone. A SINGLE_INSTANCE deployment requires one subnet (for example, the default subnet). An ACTIVE_STANDBY_MULTI_AZ deployment (ACTIVEMQ) requires two subnets. A CLUSTER_MULTI_AZ deployment (RABBITMQ) has no subnet requirements when deployed with public accessibility, deployment without public accessibility requires at least one subnet.
Important If you specify subnets in a shared VPC for a RabbitMQ broker, the associated VPC to which the specified subnets belong must be owned by your AWS account. Amazon MQ will not be able to create VPC enpoints in VPCs that are not owned by your AWS account.
Required: No
Type: List of String
Update requires: Replacement
Tags
-
An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Billing and Cost Management User Guide.
Required: No
Type: List of TagsEntry
Update requires: No interruption
Users
-
The list of broker users (persons or applications) who can access queues and topics. For Amazon MQ for RabbitMQ brokers, one and only one administrative user is accepted and created when a broker is first provisioned. All subsequent RabbitMQ users are created by via the RabbitMQ web console or by using the RabbitMQ management API.
Required: Yes
Type: List of User
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the Amazon MQ broker ID. For example:
b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9
For more information about using the Ref
function, see Ref.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt.
AmqpEndpoints
-
The AMQP endpoints of each broker instance as a list of strings.
amqp+ssl://b-4aada85d-a80c-4be0-9d30-e344a01b921e-1.mq.eu-central-amazonaws.com:5671
Arn
-
The Amazon Resource Name (ARN) of the Amazon MQ broker.
arn:aws:mq:us-east-2:123456789012:broker:MyBroker:b-1234a5b6-78cd-901e-2fgh-3i45j6k178l9
ConfigurationId
-
The unique ID that Amazon MQ generates for the configuration.
c-1234a5b6-78cd-901e-2fgh-3i45j6k178l9
ConfigurationRevision
-
The revision number of the configuration.
1
IpAddresses
-
The IP addresses of each broker instance as a list of strings. Does not apply to RabbitMQ brokers.
['<IP_ADDRESS>', '<IP_ADDRESS>']
MqttEndpoints
-
The MQTT endpoints of each broker instance as a list of strings.
mqtt+ssl://b-4aada85d-a80c-4be0-9d30-e344a01b921e-1.mq.eu-central-amazonaws.com:8883
OpenWireEndpoints
-
The OpenWire endpoints of each broker instance as a list of strings.
ssl://b-4aada85d-a80c-4be0-9d30-e344a01b921e-1.mq.eu-central-amazonaws.com:61617
StompEndpoints
-
The STOMP endpoints of each broker instance as a list of strings.
stomp+ssl://b-4aada85d-a80c-4be0-9d30-e344a01b921e-1.mq.eu-central-amazonaws.com:61614
WssEndpoints
-
The WSS endpoints of each broker instance as a list of strings.
wss://b-4aada85d-a80c-4be0-9d30-e344a01b921e-1.mq.eu-central-amazonaws.com:61619
Examples
Basic Amazon MQ Broker
The following examples creates a basic Amazon MQ broker. The RabbitMQ example creates a broker with one administrative user, while the ActiveMQ example creates a broker with one user that belongs to a group.
JSON
{ "Description": "Create a basic Amazon MQ for ActiveMQ broker", "Resources": { "BasicBroker": { "Type": "AWS::AmazonMQ::Broker", "Properties": { "AutoMinorVersionUpgrade": "false", "BrokerName": "MyBasicActiveBroker", "DeploymentMode": "SINGLE_INSTANCE", "EngineType": "ActiveMQ", "EngineVersion": "5.15.0", "HostInstanceType": "mq.t2.micro", "PubliclyAccessible": "true", "Users": [ { "ConsoleAccess": "true", "Groups": [ "MyGroup" ], "Password" : "AmazonMqPassword", "Username" : "AmazonMqUsername" } ] } } } }
JSON
{ "Description": "Create a basic Amazon MQ for RabbitMQ broker", "Resources": { "BasicBroker": { "Type": "AWS::AmazonMQ::Broker", "Properties": { "AutoMinorVersionUpgrade": "false", "BrokerName": "MyBasicRabbitBroker", "DeploymentMode": "SINGLE_INSTANCE", "EngineType": "RabbitMQ", "EngineVersion": "3.8.6", "HostInstanceType": "mq.t3.micro", "PubliclyAccessible": "true", "Users": [ { "Password" : "AmazonMqPassword", "Username" : "AmazonMqUsername" } ] } } } }
YAML
--- Description: "Create a basic Amazon MQ for ActiveMQ broker" Resources: BasicBroker: Type: "AWS::AmazonMQ::Broker" Properties: AutoMinorVersionUpgrade: "false" BrokerName: MyBasicActiveBroker DeploymentMode: SINGLE_INSTANCE EngineType: ActiveMQ EngineVersion: "5.15.0" HostInstanceType: mq.t2.micro PubliclyAccessible: "true" Users: - ConsoleAccess: "true" Groups: - MyGroup Password: AmazonMqPassword Username: AmazonMqUsername
YAML
--- Description: "Create a basic Amazon MQ for RabbitMQ broker" Resources: BasicBroker: Type: "AWS::AmazonMQ::Broker" Properties: AutoMinorVersionUpgrade: "false" BrokerName: MyBasicRabbitBroker DeploymentMode: SINGLE_INSTANCE EngineType: RabbitMQ EngineVersion: "3.8.6" HostInstanceType: mq.t3.micro PubliclyAccessible: "true" Users: - Password: AmazonMqPassword Username: AmazonMqUsername
Complex Amazon MQ Broker
The following example creates a complex Amazon MQ broker. The ActiveMQ example creates a broker with two users that don't belong to a group and one user that belongs in a group. The RabbitMQ example creates one administrator user, which can then create and manage other users via the RabbitMQ web console or the management API.
JSON
{ "Description": "Create a complex, single-instance Amazon MQ for ActiveMQ broker", "Resources": { "ComplexBroker": { "Type": "AWS::AmazonMQ::Broker", "Properties": { "AutoMinorVersionUpgrade": "false", "BrokerName": "MyComplexActiveBroker", "Configuration": { "Id": { "Ref": "Configuration1" }, "Revision" : { "Fn::GetAtt": ["Configuration1", "Revision"] } }, "DeploymentMode": "SINGLE_INSTANCE", "EngineType": "ActiveMQ", "EngineVersion": "5.15.0", "HostInstanceType": "mq.t2.micro", "Logs": { "General": true, "Audit": false }, "MaintenanceWindowStartTime": { "DayOfWeek": "Monday", "TimeOfDay": "22:45", "TimeZone": "America/Los_Angeles" }, "PubliclyAccessible": "true", "SecurityGroups": [ "sg-a1b234cd", "sg-e5f678gh" ], "SubnetIds": [ "subnet-12a3b45c", "subnet-67d8e90f" ], "Users": [{ "ConsoleAccess": "true", "Password" : "AmazonMqPassword", "Username" : "AmazonMqUsername" }, { "Password" : "AmazonMqPassword2", "Username" : "AmazonMqUsername2" }, { "Groups": [ "MyGroup1", "MyGroup2" ], "Password" : "AmazonMqPassword3", "Username" : "AmazonMqUsername3" }] } } } }
JSON
{ "Description": "Create a complex, single-instance Amazon MQ RabbitMQ broker without public accessibility", "Resources": { "ComplexBroker": { "Type": "AWS::AmazonMQ::Broker", "Properties": { "AutoMinorVersionUpgrade": "true", "BrokerName": "MyComplexRabbitBroker", "DeploymentMode": "SINGLE_INSTANCE", "EngineType": "RabbitMQ", "EngineVersion": "3.8.6", "HostInstanceType": "mq.t3.micro", "Logs": { "General": true }, "MaintenanceWindowStartTime": { "DayOfWeek": "Monday", "TimeOfDay": "22:45", "TimeZone": "America/Los_Angeles" }, "PubliclyAccessible": "false", "SecurityGroups": [ "sg-1a234b5cd6efgh7i8" ], "SubnetIds": [ "subnet-123456b7891abcd1f" ], "Users": [ { "Password" : "AmazonMqPassword", "Username" : "AmazonMqUsername" } ] } } } }
YAML
Description: Create a complex, single-instance Amazon MQ for ActiveMQ broker Resources: ComplexBroker: Type: 'AWS::AmazonMQ::Broker' Properties: AutoMinorVersionUpgrade: 'false' BrokerName: MyComplexActiveBroker Configuration: Id: !Ref Configuration1 Revision: !GetAtt - Configuration1 - Revision DeploymentMode: SINGLE_INSTANCE EngineType: ActiveMQ EngineVersion: 5.15.0 HostInstanceType: mq.t2.micro Logs: General: true Audit: false MaintenanceWindowStartTime: DayOfWeek: Monday TimeOfDay: '22:45' TimeZone: America/Los_Angeles PubliclyAccessible: 'true' SecurityGroups: - sg-a1b234cd - sg-e5f678gh SubnetIds: - subnet-12a3b45c - subnet-67d8e90f Users: - ConsoleAccess: 'true' Password: AmazonMqPassword Username: AmazonMqUsername - Password: AmazonMqPassword2 Username: AmazonMqUsername2 - Groups: - MyGroup1 - MyGroup2 Password: AmazonMqPassword3 Username: AmazonMqUsername3
YAML
Description: Create a single-instance Amazon MQ for RabbitMQ broker without public accessibility Resources: ComplexBroker: Type: 'AWS::AmazonMQ::Broker' Properties: AutoMinorVersionUpgrade: false BrokerName: MyComplexRabbitBroker DeploymentMode: SINGLE_INSTANCE EngineType: RabbitMQ EngineVersion: 3.8.6 HostInstanceType: mq.t3.micro Logs: General: true MaintenanceWindowStartTime: DayOfWeek: Monday TimeOfDay: '22:45' TimeZone: America/Los_Angeles PubliclyAccessible: false SecurityGroups: - 'sg-1a234b5cd6efgh7i8' SubnetIds: - 'subnet-123456b7891abcd1f' Users: - Password: AmazonMqPassword Username: AmazonMqUsername


Note
This page is only relevant for React 16 and earlier, and for React Native.
React 17 on the web does not use event pooling.
Read more about this change in React 17.
The SyntheticEvent
objects are pooled. This means that the
SyntheticEvent
object will be reused and all properties will be nullified after the event handler has
been called. For example, this won't work:
function handleChange(e) {
// This won't work because the event object gets reused.
setTimeout(() => {
console.log(e.target.value); // Too late!
}, 100);
}
If you need to access event object's properties after the event handler has run, you need to call
e.persist()
:


Natural Gas: Massive Weather Model Divergence Presents Excellent Trading Setup
by HFIR EnergySummary
- There's a massive disagreement in the weather models right now, and the fate of where natural gas prices go will be determined by which one wins.
- Our view has now flipped from being bearish to being bullish.
- We have now sold our DGAZ position at a small profit for a long UGAZ position.
- Another reason why we are long at the moment is because the market seems to be significantly discounting GFS-ENS and only watching ECMWF-EPS.
- Our take is that if ECMWF-EPS reverts higher, Dec. contracts have upside to $2.85/MMBtu.
Welcome to the massive divergence edition of Natural Gas Daily!
There's a massive disagreement in the weather models right now, and the fate of where natural gas prices go will be determined by which one wins.
ECMWF-EPS and GFS-ENS have very different views at the moment for where the weather is trending. For GFS-ENS, the blocking pattern in Canada persists, which then leads to a pronounced cold in the Northeast. This spikes HDDs and is bullish for natural gas.
Source: HFIRweather.com
But, for ECMWF-EPS, the blocking pattern is not there in Canada, so the cold is not as pronounced, which is why we are seeing heating demand trend along the seasonal average.
Our view at the start of this week was that the weather models would keep trending bearish, resulting in our DGAZ position. Up until yesterday, in fact, the weather models appeared to have been trending that way. But we have now completely reversed course. Our view now is that ECMWF-EPS is likely to catch up to GFS-ENS, which could see a much colder than normal outlook into the end of November and early December.
Source: HFI Portfolio
Our trading position, as a result, reflects our change in view. We have now sold our DGAZ positions at a small profit to being long UGAZ.
Another reason why we are long at the moment is because the market seems to be significantly discounting GFS-ENS and only watching ECMWF-EPS. As a result, if GFS-ENS was to come in on its outlook, the downside would be somewhat limited, while a bullish surprise from ECMWF-EPS would send prices much higher. Our take is that if ECMWF-EPS reverts higher, Dec. contracts have upside to $2.85/MMBtu.
This is how we are currently playing the near-term natural gas outlook.
We will be watching weather models closely, so if you are trading natural gas and need guidance on weather, fundamentals, and trader positioning, we think you should sign-up for HFI Research Natural Gas. Sign-up here now.
Disclosure: I am/we are long UGAZ. I wrote this article myself, and it expresses my own opinions. I am not receiving compensation for it (other than from Seeking Alpha). I have no business relationship with any company whose stock is mentioned in this article.


I love nature and wildlife My passion is capturing it in photographs to share with others. I fell in love with photography a long time ago. I was 13 when I first started taking photos. I captured everything. Doing pgotography is too much fun.Photography also tells a story. Everyone has a story. Now that people can capture images on their phones, everyone is capable of telling their own personal story through everyday photos. It is amazing that we are able to do this at the tips of our fingers and i love to capture thoes memories with my phone :)


Gateway
BOT
28-Apr-19 09:40 PM
[dscrdvrsc] <kingcolex> Stex has kyc?
[dscrdvrsc] <kingcolex> No thanks
[dscrdvrsc] <kingcolex> Anyone want to buy 270 vrsc?
[dscrdvrsc] <Thoskk> Stex only has KYC if you want to trade FIAT
[dscrdvrsc] <Thoskk> wtFUD...
[dscrdvrsc] <Oink> People that mistake me for him, without any verification, I don't even WANT to trade with
(edited)
[dscrdvrsc] <Oink> Now you mention it, no, I'm not
(edited)
[dscrdvrsc] <Oink> I hate people abusing my Nick
(edited)
[dscrdvrsc] <kingcolex> Yeah I had PM's with him still, looks like it's not you. Sorry for the bad luck of him using that name
[dscrdvrsc] <Oink> It's OK
[dscrdvrsc] <Thoskk> maybe it's wise not to accuse someone before verifying it's the right person.
[dscrdvrsc] <Oink> I would appreciate if you removed a couple of lines up there, @kingcolex
(edited)
[dscrdvrsc] <kingcolex> Done
[dscrdvrsc] <Thoskk> thanks @kingcolex
[dscrdvrsc] <kingcolex> Well thoskk I figured since it's a coin that he most likely mines and that's not a common name he might be here trying to scheme
[dscrdvrsc] <Oink> TY very much
[dscrdvrsc] <Thoskk> Oink is here longer than me @kingcolex , and he's one of the most trustworthy persons in this discord I know.
[dscrdvrsc] <Oink> Besides that, if I commit a crime it must be worth billions, enough to live the rest of my life in wealth on an
[dscrdvrsc] <Thoskk> on a palm tree?
[dscrdvrsc] <Oink> Yup... a treehouse with a hammock on a private deserted remote island
[dscrdvrsc] <Oink> But I couldn’t find an emoticon for that
[dscrdvrsc] <Thoskk> you'd need two for it to work...
[dscrdvrsc] <Oink> I hate work...
[dscrdvrsc] <Badfish> You know... I was wondering if oink was oink
[dscrdvrsc] <Oink> I was, am and will always remain Oink
[dscrdvrsc] <Oink> I should have trademarked the name 30 years ago....


The Last Resort You'll Ever Need
Accomodations
Activities
Travel Arrangements
Pictures and Other things!
Contact us Here!


|
||
|
Invoice
Joining Fees May 2021
|
||
|
Mimijoe Manpower and Allied Services
Agway Warehouse, Km 10, Sasa, 1111, Buenavista, Agusta Del Norte, Mindanao, Philippines
11223444555
|
||
| Fee Summary | Amount | Amount |
|
|
||
|
|
89,285.71 | |
|
|
10,714.29 | |
|
|
100,000.00 | |
|
|
1,785.71 | |
|
|
98,214.29 |
This is computer generated, no signature required.


 Each of these techniques provides a distinct way to store data on the user's hard drive, instead of the server, where data usually resides. There are two main reasons to do this: (a) to make the web app available offline; (b) to improve performance. For a detailed explanation of the use cases for client-side storage, see the HTML5Rocks article, "Offline": What does it mean and why should I care?.
The APIs share a similar scope and similar principles. So let's first understand what they have in common before launching to the specifics of each.
In practice, "client-side storage" means data is passed to the browser's storage API, which saves it on the local device in the same area as it stores other user-specific information, e.g. preferences and cache. Beyond saving data, the APIs let you retrieve data, and in some cases, perform searches and batch manipulations.
All four storage APIs tie data to a single "origin". e.g. if http://abc.example.com saves some data, then the browser will only permit http://abc.example.com to access that data in the future. When it comes to "origins", the domain must be exactly the same, so http://example.com and http://def.example.com are both disqualified. The port must match too, so http://abc.example.com:123 also cannot see http://abc.example.com (which defaults to port 80), and so must the protocol (http versus https, etc.).
You can imagine the chaos if any website was allowed to populate unsuspecting hard drives with gigabytes of data! Thus, browsers impose limits on storage capacity. When your app attempts to exceed that limit, the browser will typically show a dialog to let the user confirm the increase. You might expect the browser to enforce a single limit for all storage an origin can use, but the major browsers are actually enforcing limits separately for each storage mechanism. This may change in the future, but for now, you should think of the browser as maintaining a 2-D matrix, with "origin" in one dimension and "storage" in the other. For example, "http://abc.example.com" is allowed to store up to 5MB of Web Storage, 25MB of Web SQL Database Storage, and forbidden to use Indexed Database. Another welcome enhancement in this area would be user interfaces to let users view and control how much space they have allocated for each origin.
There are also environments where the user can see upfront how much storage will be used, e.g. in the case of the Chrome Web Store, when a user installs an app, they will be prompted upfront to accept its permissions, which include storage limits. One possible value is "unlimited_storage".
The two "database" storage formats support transactions. The aim is the same reason regular relational databases use transactions: To ensure the integrity of the database. Transactions prevent "race conditions", a phenomenon where two sequences of operations are applied to the database at the same time, leading to results that are both unpredictable and a database whose state is of dubious accuracy.
Most of the storage formats all support synchronous and asynchronous modes. Synchronous mode is blocking, meaning that the storage operation will be executed to completion before the next line of Javascript is executed. Asynchronous mode will cause the next line of Javascript to be executed immediately, with a new thread implicitly created to perform the storage operation. The application will be notified when the operation is finished by way of a callback function being called, a function which must be specified when the call is made.
Synchronous mode is okay for low-impact situations, e.g. maintaining a set of preferences; it's a much simpler programming model, and such operations only take a few milliseconds. But in many production situations, data crunching will block the main thread, which includes the user interface. The display won't update during that time, and the user won't know if their mouse and keyboard actions have been received. So with larger data and complex operations, you should really choose asynchronous mode to keep your app running smoothly. Or alternatively, you can run synchronous operations in a spearate thread using Web Workers. Indeed, aside from Web Storage, you're forced to do it this way; all the other APIs only make their synchronous versions available from inside a Web Worker.
Web Storage is basically a single persistent object called localStorage. You can set values using localStorage.foo = "bar" and retrieve them later on — even when the browser has been closed and re-opened — as localStorage.foo. There's also a second object called sessionStorage available, which works the same way, but clears when the window is closed.
Web Storage is an example of a NoSQL key-value store.
| Strengths of Web Storage | Weakness of Web Storage |
|---|---|
|
|
Web SQL Database is a structured database with all the functionality - and complexity - of a typical SQL-powered relational database. Indexed Database sits somewhere between the two. It has free-form key-value pairs, like Web Storage, but also the capability to index fields from those values, so searching is much faster.
| Strengths of Web SQL Database | Weakness of Web SQL Database |
|---|---|
|
|
So far, we have seen that Web Storage and Web SQL Database both have major strengths as well as major weaknesses. Indexed Database has arisen from experiences with both of those earlier APIs, and can be seen as an attempt to combine their strengths without incurring their weaknesses.
An Indexed Database is a collection of "object stores" which you can just drop objects into. The stores are something like SQL tables, but in this case, there's no constraints on the object structure and so no need to define anything upfront. So this is similar to Web Storage, with the advantage that you can have as many databases as you like, and as many stores within each database. But unlike Web Storage, there are important performance benefits: An asynchronous API, and you can create indexes on stores to improve search speed.
| Strengths of IndexedDB | Weakness of IndexedDB |
|---|---|
|
|
The previous formats are all suitable for text and structured data, but when it comes to large files and binary content, we need something else. Fortunately, we now have a FileSystem API standard. It gives each domain a full hierarchical filesystem, and in Chrome at least, these are real files sitting on the user's hard drive. For reading and writing of individual files, the API builds on the existing File API.
| Strengths of FileSystem API | Weakness of FileSystem API |
|---|---|
|
|
This section compares how the various APIs tackle the same problem. The example is a "geo-mood" checkin system, where you can track your mood across time and place. The interface lets you switch between database types. Of course, this is slightly contrived as in real world situations, one database type will always make more sense than the rest, and FileSystem API is not suited to this kind of application at all! But for demonstration purposes, it's helpful indeed if we can see the different means we can use to achieve the same end. Note too that some of the code snippets have been refactored for readability.
To make the demo interesting, we'll isolate the data storage aspects using standard object-oriented design techniques, more specifically the Strategy pattern. The UI logic will only know there is a "store"; it won't need to know how the store is implemented, because each store has exactly the same methods on it. So the UI code can just call store.setup(), store.count(), and so on. In reality, there are four implementations of the store, one for each storage type. When the app starts up, it inspects the URL and instantiates the right store.
To keep the API consistent, the methods are asynchronous, i.e. they pass results back to the caller. This is even true for the Web Storage implementation, where the underlying implementation is local.
In the walkthroughs below, we'll skip the UI and geolocation logic to focus on the storage techniques.
For localStorage, we do a simple check to see if the store exists. If not, we'll create a new array and store it against the localStorage "checkins" key. We use JSON to convert the structure to a string first, since, in most browsers, localStorage only stores strings.
if (!localStorage.checkins) localStorage.checkins = JSON.stringify([]);
For Web SQL Database, we need to create the database structure if it doesn't exist. openDatabase fortunately creates the database automatically if it doesn't exist, and, likewise, we use the SQL phrase "if not exists" to ensure the new checkins table is not overridden if it is already present. We have to define the structure of the data upfront, i.e. the name and type of each column in the checkins table. Each row will represent a single checkin.
this.db = openDatabase('geomood', '1.0', 'Geo-Mood Checkins', 8192); this.db.transaction(function(tx) { tx.executeSql("create table if not exists " + "checkins(id integer primary key asc, time integer, latitude float," + "longitude float, mood string)", [], function() { console.log("siucc"); } ); });
Indexed Database setup takes some work, because it enforces a database version system; if we attempt to open a new database, the result will be a database whose version is null, which is our cue to set it up. And in setting it up, we obviously want to set the version so it doesn't return null next time! Thus, we must call setVersion()
and we set up the database once the version has been set.
Another thing we do here is creating a mood index, so we will later be able to quickly search for all checkins matching a particular mood.
setup: function(handler) { var openRequest = indexedDB.open("geomood", "Geo-Mood Checkins"); openRequest.onsuccess = function(ev) { db = ev.target.result; db.onerror = function(ev) { console.log("db error", arguments, ev.target.webkitErrorMessage); } db.version==version ? handler() : indexedStore.reset(handler); } }, reset: function(handler) { var versionRequest = db.setVersion(version); versionRequest.onsuccess = function(ev) { if (db.objectStoreNames.contains("checkins")) db.deleteObjectStore("checkins"); var checkinsStore = db.createObjectStore("checkins", { keyPath: "time" }); checkinsStore.createIndex("moodIndex", "mood", { unique: false }); handler(); } },
Finally, FileSystem setup. We'll store each checkin in its own file, JSON-encoded, and all of them inside a "checkins/" directory. Again, this is not the most appropriate use of FileSystem API, but good for demonstration purposes.
The setup gets a handle on the overall FileSystem, using it to check for the "checkins" directory. If it's not there, we create it with getDirectory.
setup: function(handler) { requestFileSystem( window.PERSISTENT, 1024*1024, function(fs) { fs.root.getDirectory( "checkins", {}, // no "create" option, so this is a read op function(dir) { checkinsDir = dir; handler(); }, function() { fs.root.getDirectory( "checkins", {create: true}, function(dir) { checkinsDir = dir; handler(); }, onError ); } ); }, function(e) { console.log("error "+e.code+"initialising - see http://goo.gl/YW0TI"); } ); }
With localStorage, we simply pull the checkins array out, add a new one to the end, and save it again. We also have to do the JSON dance to store it in string form.
var checkins = JSON.parse(localStorage["checkins"]); checkins.push(checkin); localStorage["checkins"] = JSON.stringify(checkins);
With Web SQL Database, we run everything inside a transaction. We're going to create a new row in the checkins table, It's a straightforward SQL call, and instead of including the checkin data in the "insert" command, we use "?" syntax because it's cleaner and more secure. The actual data - the four values we want to store as columns in the new checkins row - are specified in the second row. The "?" elements will be replaced by those values (checkin.time, checkin.latitude, etc.). The next two arguments indicate functions which will be called when the operation has completed, one for success and one for failure. In this app, we use the same generic error handler for all transactions. In this case, the success function is simply the handler that was passed into the search function - we ensure the handler will be called on success so that the UI logic can be notified when the operation has been completed (e.g. to update the count of checkins so far).
store.db.transaction(function(tx) { tx.executeSql( "insert into checkins " + "(time, latitude, longitude, mood) values (?,?,?,?);", [checkin.time, checkin.latitude, checkin.longitude, checkin.mood], handler, store.onError ); });
Once the store is set up, saving in IndexedDB is almost as simple as Web Storage, with the advantage of working asynchronously, in a transaction:
> var store = db.transaction([], IDBTransaction.READ_WRITE, 0).objectStore("checkins"); var request = store.put(checkin); request.onsuccess = handler;
With FileStore, once we create a file and get a handle on it, we can use the FileWriter API to populate it:
> fs.root.getFile("checkins/" + checkin.time, {create: true, exclusive: true}, function(file) { file.createWriter(function(writer) { writer.onerror = fileStore.onError; var bb = new WebKitBlobBuilder; bb.append(JSON.stringify(checkin)); writer.write(bb.getBlob("text/plain")); handler(); }, fileStore.onError); }, fileStore.onError);
The next function fishes out all checkins matching a particular mood, so the user can see where and when they were happy recently, for example. With localStorage, we have to manually walk through each checkin and compare it to the mood, building up a list of matches. It's good practice to return clones of the data that's stored, rather than the actual objects, since searching should be a read-only operation; hence we pass each matching checkin object through a generic clone() operation.
var allCheckins = JSON.parse(localStorage["checkins"]); var matchingCheckins = []; allCheckins.forEach(function(checkin) { if (checkin.mood == moodQuery) { matchingCheckins.push(clone(checkin)); } }); handler(matchingCheckins);
With Web SQL Database, we perform a query that returns only the checkin rows that we need. However, we still have to manually walk through that list to accumulate the checkin structures, as the database API returns database rows, rather than an array. (This is a good thing for large result sets, but right now, it adds some work for us to do!)
var matchingCheckins = []; store.db.transaction(function(tx) { tx.executeSql( "select * from checkins where mood=?", [moodQuery], function(tx, results) { for (var i = 0; i < results.rows.length; i++) { matchingCheckins.push(clone(results.rows.item(i))); } handler(matchingCheckins); }, store.onError ); });
Naturally enough, the IndexedDB solution uses an index, the index on "mood we created earlier, called "moodIndex". We use a cursor to iterate through each checkin matching the query. Note that this cursor pattern can also be used against an entire store; so, with indexes, it's like we get a window into the store where we can only see matching objects (similar to a "view" in traditional databases).
var store = db.transaction([], IDBTransaction.READ_ONLY, 0).objectStore("checkins"); var request = moodQuery ? store.index("moodIndex").openCursor(new IDBKeyRange.only(moodQuery)) : store.openCursor(); request.onsuccess = function(ev) { var cursor = request.result; if (cursor) { handler(cursor.value); cursor["continue"](); } };
As with many traditional filesystems, there's no indexing, so a search algorithm (like that used by the Unix "grep" command) must iterate through each file. We extract a Reader from the checkins directory, which lets us walk through each file via readEntries()
. For each file, we again extract a reader, and inspect its contents via readAsText()
. As these operations are asynchronous, we need to chain calls together, which is the function served by readNext()
.
checkinsDir.createReader().readEntries(function(files) { var reader, fileCount=0, checkins=[]; var readNextFile = function() { reader = new FileReader(); if (fileCount == files.length) return; reader.onload = function(e) { var checkin = JSON.parse(this.result); if (moodQuery==checkin.mood||!moodQuery) handler(checkin); readNextFile(); }; files[fileCount++].file(function(file) { reader.readAsText(file); }); }; readNextFile(); });
Finally, we need to count all checkins.
For localStorage, we simply de-serialize the checkins array structure and find its length.
handler(JSON.parse(localStorage["checkins"]).length);
With Web SQL Database, we could retrieve each row in the database (select * from checkins) and look at the length of the result set, but if we know our way around SQL, there's an easier - and faster - way. We can perform a special select statement to retrieve the count. It will return exactly one row, having one column containing the count.
store.db.transaction(function(tx) { tx.executeSql( "select count(*) from checkins;", [], function(tx, results) { handler(results.rows.item(0)["count(*)"]); }, store.onError );
Unfortunately, Indexed Database doesn't offer any counting facility, so we have to iterate through all checkins.
var count = 0; var request = db.transaction([], IDBTransaction.READ_ONLY, 0).objectStore("checkins").openCursor(); request.onsuccess = function(ev) { var cursor = request.result; cursor ? ++count && cursor["continue"]() : handler(count); };
For FileSystem, a directory reader's readEntries()
method provides a list of files, so we can just return the length of that list.
checkinsDir.createReader().readEntries(function(files) { handler(files.length); });
This has been a high-level overview of modern client-side storage techniques. You should also check out the overview on offline apps and, for more detailed introductions to specific APIs, see the tutorials on offline and storage topics.
{% endblock %}


|
gtsam 4.1.1
gtsam
|
A Bayes tree with an update methods that implements the iSAM algorithm.
Given a set of new factors, it re-eliminates the invalidated part of the tree.
Standard Constructors | |
| ISAM () | |
| Create an empty Bayes Tree. | |
| ISAM (const Base &bayesTree) | |
| Copy constructor. | |
Advanced Interface Interface | |
| void | update (const FactorGraphType &newFactors, const Eliminate &function=EliminationTraitsType::DefaultEliminate) |
| update the Bayes tree with a set of new factors, typically derived from measurements More... | |
| void | updateInternal (const FactorGraphType &newFactors, Cliques *orphans, const Eliminate &function=EliminationTraitsType::DefaultEliminate) |
| updateInternal provides access to list of orphans for drawing purposes | |
| void gtsam::ISAM< BAYESTREE >::update | ( | const FactorGraphType & | newFactors, |
| const Eliminate & | function = EliminationTraitsType::DefaultEliminate |
||
| ) |
update the Bayes tree with a set of new factors, typically derived from measurements
| newFactors | is a factor graph that contains the new factors |
| function | an elimination routine |


AWS::Route53::HostedZone
Creates a new public or private hosted zone. You create records in a public hosted zone to define how you want to route traffic on the internet for a domain, such as example.com, and its subdomains (apex.example.com, acme.example.com). You create records in a private hosted zone to define how you want to route traffic for a domain and its subdomains within one or more Amazon Virtual Private Clouds (Amazon VPCs).
You can't convert a public hosted zone to a private hosted zone or vice versa. Instead, you must create a new hosted zone with the same name and create new resource record sets.
For more information about charges for hosted zones, see Amazon Route 53 Pricing
Note the following:
-
You can't create a hosted zone for a top-level domain (TLD) such as .com.
-
If your domain is registered with a registrar other than Route 53, you must update the name servers with your registrar to make Route 53 the DNS service for the domain. For more information, see Migrating DNS Service for an Existing Domain to Amazon Route 53 in the Amazon Route 53 Developer Guide.
When you submit a CreateHostedZone
request, the initial status of the
hosted zone is PENDING
. For public hosted zones, this means that the NS and
SOA records are not yet available on all Route 53 DNS servers. When the NS and
SOA records are available, the status of the zone changes to INSYNC
.
The CreateHostedZone
request requires the caller to have an
ec2:DescribeVpcs
permission.
When creating private hosted zones, the Amazon VPC must belong to the same partition where the hosted zone is created. A partition is a group of AWS Regions. Each AWS account is scoped to one partition.
The following are the supported partitions:
-
aws
- AWS Regions -
aws-cn
- China Regions -
aws-us-gov
- AWS GovCloud (US) Region
For more information, see Access Management in the AWS General Reference.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Route53::HostedZone", "Properties" : { "HostedZoneConfig" :
HostedZoneConfig
, "HostedZoneTags" :[ HostedZoneTag, ... ]
, "Name" :String
, "QueryLoggingConfig" :QueryLoggingConfig
, "VPCs" :[ VPC, ... ]
} }
YAML
Type: AWS::Route53::HostedZone Properties: HostedZoneConfig:
HostedZoneConfig
HostedZoneTags:- HostedZoneTag
Name:String
QueryLoggingConfig:QueryLoggingConfig
VPCs:- VPC
Properties
HostedZoneConfig
-
A complex type that contains an optional comment.
If you don't want to specify a comment, omit the
HostedZoneConfig
andComment
elements.Required: No
Type: HostedZoneConfig
Update requires: No interruption
HostedZoneTags
-
Adds, edits, or deletes tags for a health check or a hosted zone.
For information about using tags for cost allocation, see Using Cost Allocation Tags in the AWS Billing and Cost Management User Guide.
Required: No
Type: List of HostedZoneTag
Update requires: No interruption
Name
-
The name of the domain. Specify a fully qualified domain name, for example, www.example.com. The trailing dot is optional; Amazon Route 53 assumes that the domain name is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical.
If you're creating a public hosted zone, this is the name you have registered with your DNS registrar. If your domain name is registered with a registrar other than Route 53, change the name servers for your domain to the set of
NameServers
that are returned by theFn::GetAtt
intrinsic function.Required: No
Type: String
Maximum:
1024
Update requires: Replacement
QueryLoggingConfig
-
Creates a configuration for DNS query logging. After you create a query logging configuration, Amazon Route 53 begins to publish log data to an Amazon CloudWatch Logs log group.
DNS query logs contain information about the queries that Route 53 receives for a specified public hosted zone, such as the following:
-
Route 53 edge location that responded to the DNS query
-
Domain or subdomain that was requested
-
DNS record type, such as A or AAAA
-
DNS response code, such as
NoError
orServFail
- Log Group and Resource Policy
-
Before you create a query logging configuration, perform the following operations.
Note If you create a query logging configuration using the Route 53 console, Route 53 performs these operations automatically.
-
Create a CloudWatch Logs log group, and make note of the ARN, which you specify when you create a query logging configuration. Note the following:
-
You must create the log group in the us-east-1 region.
-
You must use the same AWS account to create the log group and the hosted zone that you want to configure query logging for.
-
When you create log groups for query logging, we recommend that you use a consistent prefix, for example:
/aws/route53/hosted zone name
In the next step, you'll create a resource policy, which controls access to one or more log groups and the associated AWS resources, such as Route 53 hosted zones. There's a limit on the number of resource policies that you can create, so we recommend that you use a consistent prefix so you can use the same resource policy for all the log groups that you create for query logging.
-
-
Create a CloudWatch Logs resource policy, and give it the permissions that Route 53 needs to create log streams and to send query logs to log streams. For the value of
Resource
, specify the ARN for the log group that you created in the previous step. To use the same resource policy for all the CloudWatch Logs log groups that you created for query logging configurations, replace the hosted zone name with*
, for example:arn:aws:logs:us-east-1:123412341234:log-group:/aws/route53/*
To avoid the confused deputy problem, a security issue where an entity without a permission for an action can coerce a more-privileged entity to perform it, you can optionally limit the permissions that a service has to a resource in a resource-based policy by supplying the following values:
-
For
aws:SourceArn
, supply the hosted zone ARN used in creating the query logging configuration. For example,aws:SourceArn: arn:aws:route53:::hostedzone/hosted zone ID
. -
For
aws:SourceAccount
, supply the account ID for the account that creates the query logging configuration. For example,aws:SourceAccount:111111111111
.
For more information, see The confused deputy problem in the AWS IAM User Guide.
Note You can't use the CloudWatch console to create or edit a resource policy. You must use the CloudWatch API, one of the AWS SDKs, or the AWS CLI.
-
-
- Log Streams and Edge Locations
-
When Route 53 finishes creating the configuration for DNS query logging, it does the following:
-
Creates a log stream for an edge location the first time that the edge location responds to DNS queries for the specified hosted zone. That log stream is used to log all queries that Route 53 responds to for that edge location.
-
Begins to send query logs to the applicable log stream.
The name of each log stream is in the following format:
hosted zone ID/edge location code
The edge location code is a three-letter code and an arbitrarily assigned number, for example, DFW3. The three-letter code typically corresponds with the International Air Transport Association airport code for an airport near the edge location. (These abbreviations might change in the future.) For a list of edge locations, see "The Route 53 Global Network" on the Route 53 Product Details
page. -
- Queries That Are Logged
-
Query logs contain only the queries that DNS resolvers forward to Route 53. If a DNS resolver has already cached the response to a query (such as the IP address for a load balancer for example.com), the resolver will continue to return the cached response. It doesn't forward another query to Route 53 until the TTL for the corresponding resource record set expires. Depending on how many DNS queries are submitted for a resource record set, and depending on the TTL for that resource record set, query logs might contain information about only one query out of every several thousand queries that are submitted to DNS. For more information about how DNS works, see Routing Internet Traffic to Your Website or Web Application in the Amazon Route 53 Developer Guide.
- Log File Format
-
For a list of the values in each query log and the format of each value, see Logging DNS Queries in the Amazon Route 53 Developer Guide.
- Pricing
-
For information about charges for query logs, see Amazon CloudWatch Pricing
. - How to Stop Logging
-
If you want Route 53 to stop sending query logs to CloudWatch Logs, delete the query logging configuration. For more information, see DeleteQueryLoggingConfig.
Required: No
Type: QueryLoggingConfig
Update requires: No interruption
-
VPCs
-
Private hosted zones: A complex type that contains information about the VPCs that are associated with the specified hosted zone.
Note For public hosted zones, omit
VPCs
,VPCId
, andVPCRegion
.Required: No
Type: List of VPC
Update requires: No interruption
Return values
Ref
When you pass the logical ID of this resource to the intrinsic Ref
function, Ref
returns the hosted zone ID, such as Z23ABC4XYZL05B
.
For more information about using the Ref
function, see Ref.
Fn::GetAtt
The Fn::GetAtt
intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt
intrinsic function, see Fn::GetAtt.
Examples
Creating a private hosted zone
The following template snippet creates a private hosted zone for the example.com domain.
JSON
{ "DNS": { "Type": "AWS: : Route53: : HostedZone", "Properties": { "HostedZoneConfig": { "Comment": "Myhostedzoneforexample.com" }, "Name": "example.com", "VPCs": [ { "VPCId": "vpc-abcd1234", "VPCRegion": "ap-northeast-1" }, { "VPCId": "vpc-efgh5678", "VPCRegion": "us-west-2" } ], "HostedZoneTags": [ { "Key": "SampleKey1", "Value": "SampleValue1" }, { "Key": "SampleKey2", "Value": "SampleValue2" } ] } } }
YAML
DNS: Type: "AWS::Route53::HostedZone" Properties: HostedZoneConfig: Comment: 'My hosted zone for example.com' Name: 'example.com' VPCs: - VPCId: 'vpc-abcd1234' VPCRegion: 'ap-northeast-1' - VPCId: 'vpc-efgh5678' VPCRegion: 'us-west-2' HostedZoneTags: - Key: 'SampleKey1' Value: 'SampleValue1' - Key: 'SampleKey2' Value: 'SampleValue2'
See also
-
CreateHostedZone in the Amazon Route 53 API Reference


Login to etu.utt.fr and go to https://etu.utt.fr/api/panel/app/create to register your application and get a client_id and client_secret. Ensure you write the good OAuth 2 authorization callback URL.
Set the "callback URL" to: {{siteUrl}}_oauth/utt
Complete the rest of the form as required, along with the captcha and press submit.
Record the client_id and client_secret in the "Client Id" and "Client Secret" fields of this form and press submit to save the configuration


“The world is round. Time is fleeting. Is man an ox? No. Is he a patent inkstand? No. Was he created to occupy a house and fit his head to a hat? No. Then why delay? Why smother your longings? I says … this won't do. This ain't your destiny. Rise! Be winged! Chase the ideal! Get on the vastness! Seek and find.” — Arthur Colton, The Belted Seas


In Javascript there are two different types of Scope. Global scope and local scope.
Global scope contains variables that apply to the whole document that you are creating.
Local scope are variables within a function and only apply to that function. If you ran something in that local scope it would not apply to all the other functions that you have written.
A really good analogy of global and local scope that i read is that every country has a border that contains that country's scope. Within that country's scope there are cities and they have their own scope too.


|
x# - x vector length
y# - y vector length z# - z vector length |
|
Returns the yaw value of a vector.
Using this command will return the same result as using EntityYaw to get the yaw value of an entity that is pointing in the vector's direction. See also: VectorPitch, EntityYaw. |
|
; VectorYaw Example
; ----------------- Graphics3D 640,480 SetBuffer BackBuffer() ; Set vector x,y,z values vx#=2 vy#=2 vz#=0 camera=CreateCamera() PositionEntity camera,0,0,-5 light=CreateLight() cone=CreateCone() ; Rotate cone so that it points in the direction it is facing RotateMesh cone,90,0,0 pivot=CreatePivot() ; Position pivot to represent a vector PositionEntity pivot,vx#,vy#,vz# ; Point cone in direction of pivot. It should now have same yaw value. PointEntity cone,pivot While Not KeyDown(1) RenderWorld ; Print entity yaw value and vector yaw value. Both should be identical. Text 0,0,"Entity yaw: "+EntityYaw(cone) Text 0,20,"Vector yaw: "+VectorYaw(vx#,vy#,vz#) Flip Wend End |


RetroVID is an
Executor which collects
chains of
SubGene hits through fragment
threading. These chains are considered as possible ERVs.
It is not normally meaningful to run RetroVID interactively. It needs
the LTR information put by
LTRID
into a RetroVID script.
The first step in RetroVID operation is to refresh all the
Motifs defined in the 'Motifs' parameter
in the current
Database.
Thereafter all SubGene hits compatible with the distance requirements
in
MotifGroups.txt are constructed from
the
detection Motifs. Both these procedures are fairly fast.
Thereafter, chains (ie, potential ERVs) are constructed from the
SubGene hits, in accordance
with the distance constraints in
SubGenes.txt.
This
procedure
could in some cases take very long if unchecked. Therefore, this search
is not exhaustive, but limited by the parameters SubGeneHitsMax (see
below) which limits the number of SubGene hits tried
at each stage. and MaxSubGeneSkip which limits the number of sequential
SubGenes not represented in the chain. Still, the number of chains
tried is often in the
millions. Therefore, most of the chains are thrown out at an early
stage as obviously worse than some other chain or having too low score.
Next,
broken
chains, ie chains that violate one (or rarely more) distance constraint
but could be explained as containing a deletion or
insertion are constructed by pairing among the remaining chains. Since
useful parts
may already have been discarded, this search is necessarily incomplete.
The above procedure is normally repeated for both DNA strands.
Thereafter, a set of highscoring, non-overlapping chains is extracted.
Thereafter, each of these selected chains is subjected to a refinement
procedure, essentially a rebuild from scratch, but including
characterization Motifs. Since, with the standard structure of
Motifs.txt, this means that two more SubGenes (PBS and PPT) are used,
this step may in some cases
become very time-consuming. Therefore, it has its own counterpart to
SubGeneHitsMax, ImproveHitsMax, which may be set to less than than
SubGeneHitsMax. The refinement procedure also makes an extra try
to get both LTRs into the chain, possibly by introducing a chain break
(this may make previously nonoverlapping chains overlap).
This improvement is performed
by the default
ChainProcessor. The
complete procedure is that each chain is tried with each ChainProcessor
available. If the isEligible method of the ChainProcessor returns true,
the chain is subjected to the processChain method. After all this is
done, the postProcess method of each ChainProcessor is called. Thus,
the actual processing will depend on which ChainProcessors are actually
present in the
plugins directory.
The
RVectors of the
SubGene hits in a chain are summed to an RVector for the entire chain,
which determines the
virus genus of the
chain. From its modulus, the score of the chain is calculated with some
corrections (see below).
The output from RetroVID consists of
- A file with selected chains (a Chainview script)
- Optionally, similar files with topscoring chains,
irrespective of selection, for each strand.
- For each selected chain, up to four ordinary ORFID scripts (one for each Gene)
plus an ORFID
"superscript" with suffix 'MScript_.txt' or 'NScript.txt', containing
the names of ORFID scripts to be executed in
conjunction (see FitPuteins parameter below). If the genus of the chain
is ambiguous, ORFID scripts will be generated for each possible genus.
- For each selected chain without LTRs or with total
LTR length less than 200 bases, a PseuGID
script.
- For each selected chain, a XonID
script.
- Possibly other files created by tje ChainProcessors called.
The parameters of RetroVID are:
- InputFile: Name of file to get parameters from. Only
used in interactive mode.
- DNAFile: The name of the DNA file in the current
directory to search in. Default: name of current directory + '.txt'.
- Database: Database subdirectory to use.
Default: Ordinary.
- ConservationFactor: Bonus factor for highly conserved
positions in AcidMotifs and BaseMotifs. Default: 2.0.
- FrameFactor: Bonus factor for a chain with no
disturbing frame shifts. Default: 1.5.
- LengthBonus: Bonus factor applied for each
SubGeneHit. Default: 1.02.
- SDFactor: To multiply SD with when setting threshold
for OrdinaryMotifs. Default:
5.5.
- SubGeneHitsMax: Maximum number of SubGeneHits tried
in one SubGene when making a Chain. Default: 5.
- ImproveHitsMax: Maximum number of SubGeneHits tried
in one SubGene when improving a Chain. Default: 5.
- SelectionThreshold: Chains with less score than this
before improving cannot be selected. Default: 150.0.
- FinalSelectionThreshold: Chains with less score than
this are not selected after improvement. Default: 250.0.
- KeepThreshold: Chains with less score than this are
discarded early. Default: 25.0.
- MaxSubGeneSkip: Largest number of SubGenes skipped in
forming Chains. Default: 2.
- BrokenPenalty: Penalty factor applied to score of
broken Chain. Default: 0.9.
- BrokenPasses: If this is set >1, Chains with more
breaks may be constructed. Default: 1.
- FitPuteins: If this is Yes, ordinary ORFID scripts
are
generated non-sweepable, and an ORFID superscript listing the names of
these
scripts is generated. Default: Yes.
- Strand: May be Both, Primary or Secondary, depending
on which DNA strand should be analyzed. Default: Both.
- ORFIDMinScore: For Chains with less score than this,
ORFID scripts are not generated sweepable.
Default: 200.
- MakeChainsFiles. If this is >0, Chain output files
are generated for each strand, with up to this many Chains,
irrespective of selection. Default: 0.
- Debugging: If this is Yes, a lot of extra information
is written to Standard Output. Default: No.


WELCOME TO MY PORTFOLIO
Kavya Prakash
Hello, My name is Kavya G P,I am pursuing my Bachelor of Engineering
under the stream Computer Science & Engineering.Currently , I'm in final year of my degree.
I love to sketch and play carrom . My favourite hobby is gardening , I love to be with plants.
I also like coding and want to be a successful developer.
Skills
- Communication skills
- C Language
- C++
- Java[Beginner]
- Python 3[Beginner]
- SQL database
- Front end development[HTML & CSS]
- Blockchain & Security[Basics]
Certifications
- Introduction to Python Programming by Great Learning
- Introduction to Cyber Security by Cisco Network Academy
- Introduction to IOT by Cisco Network Academy
- Software defined storage concepts by VMware


Wed Jul 4, 2007
I’m administering a new podcast for Rev. Craig Vance at my church. Craig’s sermons are really insightful and quite intellectual. Anyway, the technical side of things has hardly been cutting edge as I’ve been recording onto cassette tapes that get chewed up in my 1990 cassette player before they even get turned into an MP3. Nevertheless, I’ve managed two so far and plan to keep that site updated every week. Check it out if you’re interested.
I’ve also decided to redesign this website and make it even more functional and even better looking. As I obviously don’t update this blog very regularly, I’ve decided to give it a less prominent place in the scheme of things. I’m debating whether to switch to Joomla and keep the Wordpress engine or just switch over totally to maintain consistency among the site elements. We’ll see how it turns out - it’ll take a while I’m sure…