July 1, 2016
This guide is a step-by-step procedure for the generation of hourly meteorological data at a desired geographical location through the setup, running and post-processing of a mesoscale weather numerical model.
This guide was developed as a result of a project by Novus and Klimaat and sponsored by ASHRAE through Technical Committee 4.2.
The two specific goals of this project were:
More details on the project, is provided in the final report: main body (3.5MB) & appendices (14.9MB).
This guide relies on a number of key requirements:
The software referred to in this procedure is under continuous development. It is expected that the instructions contained here are subject to change and relevant to WRF simulations circa 2016.
Neither Klimaat nor ASHRAE warrant that the information in this guide is free of errors. This information is provided as is
without warranty of any kind, either expressed or implied. The entire risk as to the quality and performance of the program and data is with you. In no event will ASHRAE or the program developer be liable to you for any damages, including without limitation any lost profits, lost savings, or other incidental or consequential damages arising out of the use of or inability to use this information.
With all that out of the way, let's get the software installed.
In this section we describe the installation of the required software.
A recent version of the Java runtime environment, e.g. version 7, is required for some of the graphical applications such as Domain Wizard
and Panoply
. It is typically easily installed through a given Linux distribution's package manager. For example, on Debian-based systems (e.g. Ubuntu), it can be installed via
sudo apt-get install default-jre
Your mileage may vary.
The crucial element of this entire process is the STRC UEMS software package. UEMS contains all the functionality of the advanced mesoscale modelling software WRF, yet with a much simplified installation, configuration, and execution. It is maintained by the good people at UCAR, particularly Robert Rozumalski.
Clear and colourful instructions on how to install and use UEMS can be found at the UEMS website.
The four main steps are:
Registering in order to receive a Perl installation script uems_install.pl
.
Running the script to install on your computer based on the instructions in the users guide, especially Chapter 2 (PDF).
For the impatient, this involves opening a terminal window and typing:
perl uems_install.pl --install
The main decision will be where to install (e.g. /home/jeeves/
). Make sure you provide an absolute path, i.e. starting with /
.
uems_install.pl
will then proceed to download and install approximately 20GB, so ensure sufficient space is available in the chosen installation directory. The largest portion is reserved for world-wide static high-resolution (30 seconds of arc) data such as topography and land-use classes. Coffee time!
UEMS adds some code to your ~/.bash_profile
which sets a few environment variables and adds the UEMS scripts to your path. Note that the commands in ~/.bash_profile
are not executed until you are running a login terminal. Most new terminals opened on the desktop are not in fact login terminals. Thus, I find it more useful to move the relevant lines into ~/.bashrc
, which is typically always executed. The relevant lines in ~/.bash_profile
resemble:
if [ -f /home/jeeves/uems/etc/EMS.profile ] ; then source /home/jeeves/uems/etc/EMS.profile fi
Move them over to ~/.bashrc
and open a new terminal which should activate your environment variables. You can confirm proper configuration by typing the following at the command line:
echo $EMS
This should result in something like:
/home/jeeves/uems
Your mileage may vary.
Confirming installation by running a benchmark simulation. Full instructions can be found in Appendix B (PDF). The steps are essentially
cd $EMS_UTIL/benchmark/27april2011 ems_prep --benchmark --domain 2 ems_run --domain 2
ems_prep
will setup the benchmark simulation, indicating success with something like "Your awesome EMS Prep party is complete". ems_run
will run the benchmark, taking a few hours to do so.
Panoply is a Java-based application that plots geo-gridded and other arrays from netCDF, HDF, GRIB, and other datasets. GRIB is the file format of input files to WRF while netCDF is the file format for WRF output files.
An older version of Panoply ships with UEMS and is used by Domain Wizard
when viewing your domains. However, the new Panoply has a number of features that make it worthwhile to download separately. Instructions can be found here.
To be able to run Panoply from anywhere, add an alias
in your ~/.bashrc
:
alias panoply=/path/to/PanoplyJ/panoply.sh
Open a new terminal and type panoply
to test your installation. If successful, you should be able to load the files from your benchmark run.
For the output WRF netCDF files generated, Open
one of the files located in $EMS_UTIL/benchmark/27april2011/wrfprd
. Note that you will not see any files listed until you list files of type All Files
. Unfortunately, WRF generates files with an empty extension, without the expected netCDF .nc
extension. Select one of the available Datasets (e.g. T2), click Create Plot
, click Create
to accept the default plot type, and you should see something like:
The postage-stamp-size rectangle in the above image represents the largest domain (d01) that was solved in the benchmark simulation. You can adjust map properties and projection to zoom into the domain.
git is a distributed version control system
. Installing git will allow you to both download or clone
the source code from github for some of the packages below, plus allow you to keep them up to date. or fork
the source code if you want to make personal changes.
If you do not have it installed, use your favourite Linux package installation method. e.g. on Debian (Ubuntu) systems:
sudo apt-get install git
We mark this installation as optional as for every repository on github, there is an option to kick it ol' school by downloading a ZIP file containing the source.
In order to read the WRF data files, we need to install the netcdf4-python package. You have two paths:
sudo apt-get install python-netcdf4
If that is successful, your netcdf
installation is complete.
python-netcdf4
itself has a number of prerequisites: we need to install numpy
, cython
, netcdf4
, and hdf5
:
numpy: This is a Python package offering many of the features and delights of Matlab®
cython: This is a C-compiler for Python to make things go fast, fast, fast
libnetcdf4-dev: This provides the API library to read and write the NetCDF files used to store WRF data
To install these packages, on recent Debian-based systems
sudo apt-get install python-numpy cython libnetcdf-dev libhdf5-dev python-dev
Finally, to download python-netcdf4
, either git
it
git clone https://github.com/Unidata/netcdf4-python.git
or grab the source code by clicking on Download ZIP
after clicking on Clone or download
at the github repository and unzipping into a suitable directory.
Then installation is via
cd netcdf4-python python setup.py build sudo python setup.py install
The big benefit of using git: when the package is updated, you can simply go to the directory and pull
all the changes
cd netcdf4-python git pull python setup.py build sudo python setup.py install
As a bonus, python-netcdf4
provides a script called nc3tonc4
which will compress existing WRF output files by about a third.
UEMS vastly simplifies WRF modelling. We take this one (baby) step further by providing Python code to aide in the splitting up of large simulations in multiple chunks
, and the subsequent collation or dechunking
of the results into a coherent time series.
This software, called emspy
, is hosted on github repository. This repository allows us to respond as new versions of UEMS are released (and to fix the resulting many bugs).
As per python-netcdf4
, you can either git
it:
git clone https://github.com/klimaat/emspy.git
Or, just click Download ZIP
at github.
empsy
has been simplifed into just two executable Python scripts. You have two ways to operate:
emspy
. That is, add the following to your ~/.bashrc
export PATH=$PATH:/directory/where/emspy/exists
emspy
is now ready to use. Test installation by typing
ems_chunk.py -h
Which should return the usage and command-line switches for ems_chunk.py
.
Warning: This code was written by engineers not professional coders. It is likely to be brimming with bugs. As emspy
evolves, it can be updated via
cd /directory/where/emspy/exists git pull
We also encourage you to peruse and modify the code as you see fit. Suggestions are welcome.
Congratulations, you are done installing the software. Now let's talk about Data
.
Your WRF model must be coupled with the output of another three-dimensional model dataset, one with greater area coverage:
initial conditions.
boundary conditions.
nudging.
For historical simulations, there are a number of re-analysis datasets which are large scale weather models which have assimilated observations and dynamically interpolated observations to a regular grid. Two we recommend and that are pre-configured for use with WRF-EMS are:
Other datasets are possible, including MERRA or ECWMF. While ECWMF is available, MERRA is not currently configured for UEMS.
UEMS will automatically download files as needed. However, these datasets are enormous: e.g. a single year of NARR or CFSR requires approximately 50GB. This, even after the extraneous variables were culled by the good people at UCAR.
UEMS thus provides an attractive option: the so-called personal tile
method. In this method only a small subset (tile) of data is downloaded, i.e. bounded by the extents of your largest domain and only the variables needed, resulting in files that are 1% of the size. These datasets will be referred to as narrpt
and cfsrpt
.
Okay, let's start setting up your simulation.
By default, all your run
files are stored in a directory pointed to by the environment variable $EMS_RUN
. This will be setup by default to a runs
directory under the main UEMS installation directory. However, you may want to point this environment variable to another location, perhaps where you have a large network drive. To do this, you will need to add a line below to where you modified the ~/.bashrc
script previously
export EMS_RUN=/path/to/another/folder
The first step in getting a simulation setup is establishing a series of grids of increasing resolution and decreasing size centered on your chosen latitude/longitude and then interpolating static quantities such as topography, monthly vegetation, and land-use. This is all accomplished through a graphical tool called Domain Wizard
.
First start the Domain Wizard:
dwiz &
You will be presented with a window dialog. Click Continue
to Create New Domain
Enter a domain Name
and Description
. The Name will be used as a directory name so keep it simple (e.g. atlanta
or new_york
). Use _ as a space. Click Continue
.
Drag a rectangle, centered around your location, approximately 30°×30°. Size doesn't matter as we will be adjusting it in the next steps.
Under Projection Options
, Type
will be now be highlighted. Select Lambert Conformal.
Enter the longitude and latitude of your desired center point under Centerpoint Lon
and Centerpoint Lat
, respectively. At this point you should see something like this:
Click Update Map
and then enter:
Horizontal Dimension X: 70
Horizontal Dimension Y: 70
Grid points distance (km): 36
Geographic data resolution: 10m
This will establish a 70×70 or a 2520km×2520km parent domain.
At this point you can configure your nested
domains, d02, d03, etc.
Click the Nests
tab and click New
. Leave all the Nest Properties
at their default settings but enter the following under Nest Coordinates
:
This establishes where in the parent, d01, the new nested domain, d02, sits.
Click OK
:
The above configuration centers d02 within d01, has the same cell dimension (70×70), but has three times the resolution (12km×12km).
We repeat the above step to generate another domain, d03, of resolution 4km×4km.
Note: At this point, another domain, d04, could be formed of size 1.3km×1.3km. However, each subsequent nested domain, even though of the same 70×70 dimension, requires 3 times as much computational effort. This is due to the requirement that the discrete time step on the finer grids is approximately three times smaller in order to maintain stability (see CFL for more information). If you have the computational power, go for it. As 500-1000m is the limit of conventional WRF modelling, we do not recommend any more than 4 domains in total.
At this point, we click Next
and then Localize Domain
to interpolate all of the static fields, such as albedo and green fraction, onto our domains.
Clicking Next
at this point brings up the ability to view your domains in Panoply.
Note that the version of Panoply hard-coded into UEMS is a much older version, so the interface is slightly different.
Click Exit
to leave Domain Wizard. You now have a base directory in the runs
directory called atlanta
. You are now ready to prep and simulate your domain. We are now ready to start actually putting the computers to work.
At this point, everything is configured to run; we simply need to split your simulation into a number of chunks
, adjust the default UEMS parameters, prep, and finally run. Thankfully, emspy
provides a script, ems_chunk.py
to make this easy.
To get familiar with this script, type
ems_chunk.py -h
Essentially, ems_chunk.py
simply requires which domain you want to run and the start and end dates. e.g.
ems_chunk.py atlanta 20000101 20000131
The above will run the Atlanta simulation you setup previously for the month of January 2000. It will split the run into a series of chunks of 3 days in length, with a suitable spin-up
period of 12 hours, and run the chunks in sequence.
By default, it will be use the tiled version of the CFSR dataset but can use NARR. This is selected with the -d
switch.
ems_chunk.py -d narrpt atlanta 20000101 20000131
By default, it will run all the nested domains you have configured. If you have setup, say, d01, d02, d03, d04, but only want to solve up to d03, you can pass the switch -n
ems_chunk.py -n 3 -d narrpt atlanta 20000101 20000131
ems_chunk.py
can be run in prep
-only mode. That is, skip actually running each chunk, in case you want to run them all later, perhaps after you've downloaded all the required tiles. Just pass a -s
switch
ems_chunk.py -s -d narrpt atlanta 20000101 20000131
Finally, if you try to re-run, ems_chunk.py
will first check the directories to see if there was a chunk has been already prep'd and run and skip them if so. This allows you to repeatedly start and stop ems_chunk.py>
and it will pick up approximately where you left off. If however, you want to force it to prep and run, overwriting whatever work has been done, just add a -f
switch
ems_chunk.py -f -d narrpt atlanta 20000101 20000131
You can use Panoply to view your wrfout files. They can be found in the wrfprd
directory of each chunk's run directory, e.g. atlanta_20000101
.
Also, a log file with some of the gory details is created in the $EMS_RUN
directory labelled e.g. atlanta.log
.
If you want to start ems_chunk.py
in a terminal (perhaps on a remote machine) and want to later close that terminal, prepend your command with nohup
and append an &
. This will ensure that your simulation is not interrupted. All the typical text output will go to a file called nohup.out
.
nohup ems_chunk.py atlanta 20000101 20000131 &
A typical simulation with three domains (d01/36km, d02/12km, d03/4km) will take on order 2 hours to run a single three-day chunk on a standard eight-core linux machine. As there are 122 chunks in a year, that means a single year simulation will take approximately 12 days. If an additional nest is added, (d04/1km), you will see approximately a three-fold increase in total simulation time, requiring approximately a month to complete a year of simulation.
The simulation time can be reduced by throwing more computers at it via a cluster or simple network of computers. While this feature has not been coded in ems_chunk.py
at the moment, it is on the wish list.
The code has been established with a number of fixed, robust configuration parameters to select e.g. radiation schemes. There are more parameterization schemes than you can shake a stick at. UEMS provides well-documented files that are stored in the e.g. atlanta/conf/ems_run
. Explore the various files and options available.
If you find that you need a certain configuration option implemented. You have two options:
ems_chunk.py
, manual edit the relevant files. However, you will have to do this every time you create a new domain using dwiz
.
ems_chunk.py
itself to automatically modify the desired config files. See the relevant lines in the code.
At this point you have run a simulation for a period of time and want to de-chunk
. The counter to ems_chunk.py
is ems_dechunk.py
. This tool allows you to repeatedly mine your simulation to generate a time series (in CSV format) at various locations in your domain.
ems_dechunk.py -h
The key parameters to ems_dechunk.py
are the domain to operate on, e.g. atlanta, and the location in the domain that you are interested in. Location is specified either through either grid indices (i,j), switch -ij
, or explicit geographical coordinates (latitude, longitude), switch -ll
. If geographical units are chosen, the latitude and longitude snap to the nearest grid point.
For example, the center of the 70×70 Atlanta grid could be generated via
ems_dechunk.py atlanta -ij 35 35
Or via geographical coordinates
ems_dechunk.py atlanta -ll 33.834 -84.329
As WRF outputs data as the centers of cells, for a 70×70 grid, there are 69×69 cells.
The indexing convention is flipped matrix
. That is, (i,j)=(1,1) is the southwest point of the grid, (i,j)=(69,1) is the northwest point, (i,j)=(1,69) is the southeast point, while (i,j)=(69,69) is the northeast point.
By default, the finest nest domain will be extracted. If a coarser grid is desired, perhaps for comparing 1km results to 4km results, simply specify the nest desired with the -n
switch.
ems_dechunk.py atlanta -n 3 -ll 33.834 -84.329
The resulting CSV file, e.g. atlanta_i35_j35.csv
will be located found in the $EMS_RUN
directory. As it stands, a subset of the full UEMS list of variables is exported, see Table 1, though this list is easily expanded (see code). Also, note that all dates and times are Universal Coordinate Time (UTC).
| Variable | Units | Derived From |
|---|---|---|
| Screen (2m) drybulb temperature | °C | T2 |
| Screen (2m) humidity ratio | g/kg of dry air | Q2 |
| Screen (2m) relative humidity | % | RH02 |
| Surface pressure | Pa | PSFC |
| Wind speed (10m) | m/s | U10, V10 |
| Wind direction (10m) | ° | U10, V10 |
| Global horizontal shortwave down | W·hr/m² | SWDOWN |
| Rainfall | mm | TACC_PRECIP |
| Snowfall (liquid equiv.) | mm | TACC_SNOW |
That's it! Please report any errors, comments, suggestions, concerns to the maintainers, Klimaat or add to the issue tracker on github.


Provides fast methods to work with Merton's distance to default model introduced in Merton (1974) <doi:10.1111/j.1540-6261.1974.tb03058.x>. The methods includes simulation and estimation of the parameters.
| Version: | 0.2.0 |
| Imports: | Rcpp, checkmate |
| LinkingTo: | Rcpp, RcppArmadillo |
| Suggests: | knitr, rmarkdown, testthat, microbenchmark |
| Published: | 2018-09-10 |
| Author: | Benjamin Christoffersen [cre, aut], R-core [cph] |
| Maintainer: | Benjamin Christoffersen <boennecd at gmail.com> |
| BugReports: | https://github.com/boennecd/DtD/issues |
| License: | GPL-2 |
| NeedsCompilation: | yes |
| SystemRequirements: | C++11 |
| Materials: | NEWS |
| In views: | Finance |
| CRAN checks: | DtD results |
| Reference manual: | DtD.pdf |
| Vignettes: |
Using Distance to Default |
| Package source: | DtD_0.2.0.tar.gz |
| Windows binaries: | r-devel: DtD_0.2.0.zip, r-release: DtD_0.2.0.zip, r-oldrel: DtD_0.2.0.zip |
| OS X binaries: | r-release: DtD_0.2.0.tgz, r-oldrel: DtD_0.2.0.tgz |
| Old sources: | DtD archive |
Please use the canonical form https://CRAN.R-project.org/package=DtD to link to this page.


--- layout: post title: "How to create a pure F# ASP.NET Web API project" description: "How to create a single F# project for an ASP.NET Web API, without using an auxiliary C# or VB host project." date: 2013-08-23 09:13 UTC tags: [Services, Languages, F#, ASP.NET Web API] image: "/content/binary/initial-fsharp-project.png" --- {% include JB/setup %}
{{ page.description }}
Implementing an ASP.NET Web API service in F# is a relatively well-described process, but everywhere I look, it seems that people are relying on a (Humble) C# Web Project to act as a host for a library written in F#. You can use an online Visual Studio template, or you can do this by hand - it's not particularly difficult. Where's the challenge in that?
Partly in a quest to demonstrate that F# is a general-purpose language, and partly just to see if it can be done, I wanted to create a pure F# ASP.NET Web API project, without relying on a C# host project. Most people on Twitter advised against it because there's no F# support for Razor, *.aspx, or *.cshtml. However, that's not a concern for a Web API, since it's not going to generate HTML anyway.
As @dotnetnerd puts it:
"not trivial but doable"That turns out to be quite an accurate description. Here's how.
The first thing I did was to create a normal F# library project.
As you can see, there's nothing in that project yet.
In contrast to C# and VB, there's no built-in F# Web Project template. However, in order to work with a web project in Visual Studio 2012, it helps if the project is a 'real' Web Project, because it means that you can launch it in IIS Express, and such things.
Because there's no built-in Web Project template for F#, I'm not aware of a nice way to do this through the Visual Studio UI, but you can open your .fsproj file in an text editor and hand-edit it. In order to turn my project into a Web Project, I added this line of code to my .fsproj file (just below the Project/PropertyGroup/ProjectGuid element):
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{F2A71F9B-5D33-465A-A702-920D77279786}</ProjectTypeGuids>
The 349c5851-65df-11da-9384-00065b846f21 GUID tells Visual Studio that this is a Web Project, while F2A71F9B-5D33-465A-A702-920D77279786 indicates an F# project.
This isn't entirely without drawbacks (that I'll get to in a minute), but you can now reload the project in Visual Studio, and you actually have an F# Web Project.
One of the things you can do with a Web Project is to right-click in Solution Explorer and select "Use IIS Express...", so I did that.
In order to use the ASP.NET Web API, you'll need to add the appropriate dependencies. I did that by adding the Microsoft.AspNet.WebApi.WebHost NuGet package.
One of the disadvantages of creating an F# Web Project is that it's an unknown combination, so you can't add anything to the project:
In order to work around this problem, I again hand-edited the .fsproj file, temporarily commenting out the ProjectTypeGuids element I previously added. Then I added an F# code file, and finally added the ProjectTypeGuids element again.
The default output folder for the debug build is "bin\Debug". Although I'm not sure whether this is strictly necessary, I changed it to "bin" because that's how C# Web Projects work...
In order to be able to derive a Global class from System.Web.HttpApplication, I added a reference to System.Web. This is a BCL library, so I added it by using the old-fashioned Add reference menu item (instead of using NuGet).
Next, I added a Global.asax file with this content:
<%@ Application Inherits="Ploeh.Samples.FebApi.Global" %>
The class Ploeh.Samples.FebApi.Global doesn't exist yet, so if you try to run the site at this stage, it's going to fail.
In order to add the Ploeh.Samples.FebApi.Global class, I wrote the first F# code in the project:
namespace Ploeh.Samples.FebApi open System type Global() = inherit System.Web.HttpApplication() member this.Application_Start (sender : obj) (e : EventArgs) = ()
The site still can't run, but at least now it doesn't complain about a missing Global class.
The next step was to add a default Web API route:
namespace Ploeh.Samples.FebApi open System open System.Web.Http type HttpRouteDefaults = { Controller : string; Id : obj } type Global() = inherit System.Web.HttpApplication() member this.Application_Start (sender : obj) (e : EventArgs) = GlobalConfiguration.Configuration.Routes.MapHttpRoute( "DefaultAPI", "{controller}/{id}", { Controller = "Home"; Id = RouteParameter.Optional }) |> ignore
At this point, you actually have an ASP.NET Web API site, because now, when you attempt to run the site, you get this error message:
No HTTP resource was found that matches the request URI 'http://localhost:64176/'. No type was found that matches the controller named 'Home'.Which is great, because this is known territory.
Adding the missing HomeController class is easy:
type HomeController() = inherit ApiController()
Of course, it doesn't do anything yet, so when you browse to the API, you get this (entirely expected) error message:
The requested resource does not support http method 'GET'.This problem is easy to solve:
type HomeRendition() = [<DefaultValue>] val mutable Message : string [<DefaultValue>] val mutable Time : string type HomeController() = inherit ApiController() member this.Get() = this.Request.CreateResponse( HttpStatusCode.OK, HomeRendition( Message = "Hello from F#", Time = DateTimeOffset.Now.ToString("o")))
Now, when browsing to the API, you get something like this:
<HomeRendition xmlns="http://schemas.datacontract.org/2004/07/Ploeh.Samples.FebApi"> <Message>Hello from F#</Message> <Time>2013-08-23T10:26:40.8490741+02:00</Time> </HomeRendition>
Success, of a sort!
This Web API now runs in IIS Express on my local machine. However, at this point, it still doesn't run in an Azure Web Site (which is something I also wanted to enable), but I'll cover how to do that in a future post.
Update 2013.19.12: It turns out that it's possible to hack the registry to make it possible to add standard F# project items to the project.
Update 2014.02.17: Since I wrote this article, new F# templates are now available for Visual Studio, including a template for F# ASP.NET MVC 5 and Web API 2 projects.
Comments
This is so awesome!
One note: For adding a new file, I simply used Ctrl+N (i.e. File>New) to create a file in the Miscellaneous Files meta solution folder. I saved the file in the physical project folder, then in Solution Explorer I dragged it's icon from the Miscellaneous Files folder onto the F# Project node. Voila! New code file. Not as easy as it should be, but easier than unloading the project to edit the fsproj file.
Mike, that's a great tip! Thank you.
Another option is to create the file in the file system (with Windows Explorer, or your preferred shell), and then add the existing file to the project.


Yahaya Bello visits Buhari with Certificate of Return (Photos)
by Ifeanyi NgeremThe National Chairman of the All Progressives Congress (APC) on Thursday formally presented the Kogi State Gov.-elect, Yahaya Bello, to President Muhammadu Buhari at the Presidential Villa, Abuja, newsmen reports.
Recall we earlier reported that the re-elected Governor received a Certificate of Return from the Independent National Electoral Commission (INEC) in Abuja, today.
According to the News Agency of Nigeria (NAN) it was observed that the meeting between the president and the re-elected governor alongside the APC national chairman was held behind closed doors.
See photos below:


Package io.github.imunsmart.items
Class ProductionRecord
- java.lang.Object
-
- io.github.imunsmart.items.ProductionRecord
-
public class ProductionRecord extends java.lang.Object
ProductionRecord class, stores information about a production event, including the production number, product ID, serial number, date produced, and product (optional).- Since:
- 10/31/2020
- Version:
- 1.0
- Author:
- Devin Arena
-
-
Constructor Summary
Constructors Constructor Description ProductionRecord(int productId)
ProductionRecord constructor for product id only.ProductionRecord(int productionNumber, int productId, java.lang.String serialNumber, java.util.Date produced, java.lang.String employee)
ProductionRecord constructor for production number, product id, serial number, and date.ProductionRecord(Product product, int numberOfCreated, java.lang.String employee)
ProductionRecord constructor for product and number of created, generates a serial number programmatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getEmployee()
java.util.Date
getProduced()
The date of the production record.int
getProductId()
Product identification number for the record.int
getProductionNumber()
Production number for product type.java.lang.String
getSerialNumber()
The serial number of the production record.void
setEmployee(java.lang.String employee)
void
setProduced(java.util.Date produced)
Sets the date of the production record.void
setProduct(Product product)
Sets the product of the record.void
setProductId(int productId)
Sets the product identification number for the record.void
setProductionNumber(int productionNumber)
Sets the production number for the product type.void
setSerialNumber(java.lang.String serialNumber)
Sets the serial number of the production record.java.lang.String
toString()
toString() implementation, converts important fields to a readable string based on what information was given for production.
-
-
-
Constructor Detail
-
ProductionRecord
public ProductionRecord(int productId)
ProductionRecord constructor for product id only.- Parameters:
productId
- id of the product
-
ProductionRecord
public ProductionRecord(int productionNumber, int productId, java.lang.String serialNumber, java.util.Date produced, java.lang.String employee)
ProductionRecord constructor for production number, product id, serial number, and date. produced- Parameters:
productionNumber
- production number for the product typeproductId
- product idserialNumber
- serial number of the productproduced
- date producedemployee
- the employee who ran the production
-
ProductionRecord
public ProductionRecord(Product product, int numberOfCreated, java.lang.String employee)
ProductionRecord constructor for product and number of created, generates a serial number programmatically.- Parameters:
product
- product to recordnumberOfCreated
- number of that product typeemployee
- the employee who ran the production
-
-
Method Detail
-
getProductionNumber
public int getProductionNumber()
Production number for product type.- Returns:
- production number
-
setProductionNumber
public void setProductionNumber(int productionNumber)
Sets the production number for the product type.- Parameters:
productionNumber
- production number for the product type
-
getProductId
public int getProductId()
Product identification number for the record.- Returns:
- product identification number
-
setProductId
public void setProductId(int productId)
Sets the product identification number for the record.- Parameters:
productId
- identification number to set to
-
getSerialNumber
public java.lang.String getSerialNumber()
The serial number of the production record.- Returns:
- production record serial number
-
setSerialNumber
public void setSerialNumber(java.lang.String serialNumber)
Sets the serial number of the production record.- Parameters:
serialNumber
- serial number to set to
-
getProduced
public java.util.Date getProduced()
The date of the production record.- Returns:
- date of production
-
setProduced
public void setProduced(java.util.Date produced)
Sets the date of the production record.- Parameters:
produced
- date of production record
-
setProduct
public void setProduct(Product product)
Sets the product of the record.- Parameters:
product
- the product to set
-
setEmployee
public void setEmployee(java.lang.String employee)
-
getEmployee
public java.lang.String getEmployee()
-
toString
public java.lang.String toString()
toString() implementation, converts important fields to a readable string based on what information was given for production.- Overrides:
toString
in classjava.lang.Object
- Returns:
- formatted String containing important fields based on what info was given
-
-


{% extends "base_generic.html" %} {% load crispy_forms_tags %} {% block pagetitle %}Finding Form{% endblock %} {% block content %}
Ghostwriter supports various template keywords you may utilize to format text and insert various pieces of information:
{% verbatim %}| Keyword | Usage |
|---|---|
| {{.client}} | This keyword will be replaced with the client's short name. The full name will be used if a short name has not been set for the client. |
| {{.code_block}} & {{.end_code_block}} | Wrap text with these keywords to transform the text into a code block within the finding text (alternative to attaching a text file as evidence). Place the {{.end_code_block}} keyword on a new line. |
| {{.caption}} | Start a line of text with this keyword to make it a caption. This is intended to follow a code block. |
| {{.inline_code}} & {{.end_inline_code}} | Wrap text with these keywords to format the text using the template's "Code (inline)" style. This is useful for highlighting code/commands without creating a figure. |
| {{.bulleted_list}} & {{.end_bulleted_list}} | Wrap text with these keywords to transform the text into a bulleted list. Each new line between the keywords will be a bullet. Place the {{.end_bulleted_list}} keyword on a new line. |
| {{.numbered_list}} & {{.end_numbered_list}} | Wrap text with these keywords to transform the text into a numbered list. Each new line between the keywords will be a sequentially numbered line. Place the {{.end_numbered_list}} keyword on a new line. |
Fill-out this form as completely as possible with the necessary information and references for this finding:
{% if form.errors %} {% for field in form %} {% for error in field.errors %}


Home
Student
Registration
Fees
Marks
ID
Administrator
Page 1-2
Page 1-2
Page 1-3
Employee
Page 1-2
Page 1-2
Page 1-3
Contact us
About Us
Feedback
Sign Up
Student
Admin
Employee
Login
Student
Admin
Employee
Registration Form
Full Name
Last Name, First Name, eg.:Khatri, Anubhav
Email
Password
Date of Birth
Course
BBS
BMS
BSc.(H) Computer Science
BFIA
BTech(Computer Science)
Gender
Female
Male
Unknown
Category
General
SC
ST
OBC
I accept
terms


ASP Webforms AJAX
Webforms UpdatePanels
These are very easy way of updating webform sections with ajax. Under the covers it's fairly heavyweight, but for a traditional webform pages it's very effective.
Remember to add EnablePartialRendering
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
A ScriptManagerProxy can be used on content pages if the ScriptManager is in a MasterPage
By default, each panel update is fired by its children (ChildrenAsTriggers). Add triggers, either a PostBackTrigger to force a full page refresh, or a AsyncPostBackTrigger to fire a partial update from any control on the page.
Use asp:Timer either inside the UpdatePanel, or outside with a trigger, to refresh at Interval (ms).
Use asp:UpdateProgress (with displayAfter="1000") with a <ProgressTemplate> to show a loading image or text.
- UpdateMode=Always means it refreshes for any postback anywhere on page (INCLUDING partial updates in other updatePanels).
- Use UpdateMode=Conditional with nested updatePanels so only child updatePanels update.
For back/forward support (MSDN):
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnableHistory="true" EnableSecureHistoryState="false"
onNavigate="ScriptManager1_Navigate">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<asp:Label ID="Label1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
Record the history transitions in code behind with AddHistoryPoint and handle the ScriptManager.OnNavigate event.
protected void Button1_Click(object sender, EventArgs e)
{
ShowData(DateTime.Now.ToLongTimeString());
}
private void ShowData(string s)
{
Label1.Text = s;
if (ScriptManager1.IsInAsyncPostBack && !ScriptManager1.IsNavigating)
{
ScriptManager1.AddHistoryPoint("History", s, s);
}
}
protected void ScriptManager1_Navigate(object sender, HistoryEventArgs e)
{
ShowData(e.State["History"]);
}
Asmx ScriptService
Just add the [ScriptService] to the class and [WebMethod].
Client side it's much more lightweight with jQuery (see jQuery notes)
var notify = $("#notification");
$.ajax({
url: '<%= ResolveClientUrl("~/NotificationService.svc") %>/Load',
success: function (data) {
data = data.d ? data.d : data;
notify.text(data.message);
notify.show("slow");
},
error: function (jqXHR, msg) { notify.show("slow").text("Error: " + msg); }
});
With a POST
$.ajax({
type: "POST",
contentType: "application/json",
url: "WebService.asmx/WebMethodName",
data: "{}",
success: function (x) {
data = data.d ? data.d : data;
alert(x.Message); }
});
Important: the jQuery data parameter should be quoted (a string - eg use JSON.stringify()), otherwise jQuery URL encodes your object (and asmx MUST be json).
$.getJSON(url) doesn't send the contentType of application/json (apparently) so doesn't work.
You may need to add a jQuery dataFilter to deal with ASP.Net dates (json doesn't have native date support).
Caution: unlike ASP MVC's DefaultDataBinder, the WCF is very fussy so [DataContract] inputs must match the posted json exactly. Here's the pattern:
var data = { category: {
id: $('#<%= SelectId.ClientID %>').val(),
name: $('#<%= CategoryName.ClientID %>').val()
}
};
var s = JSON.stringify(data);
var throbber = $('#<%= Throbber.ClientID %>');
throbber.toggleClass("hidden");
$.ajax({
type: "POST",
contentType: "application/json",
url: "Service1.svc/SaveCategory",
data: s,
success: function (data) {
data = data.d ? data.d : data;
show(data); },
error: function (msg) { show(msg); throbber.toggleClass("hidden"); }
});
The contract must match in case.
[DataContract(Name = "category")]
public class Category
{
[DataMember(Name = "name", IsRequired = false)]
public string CategoryName { get; set; }
[DataMember(Name = "id", IsRequired = false)]
public string CategoryId { get; set; }
ASP.Net 3.5+ returns a Json object wrapped with a "d" to prevent XSS. Either
data = data.d ? data.d : data;
or (slightly safer if you return a boolean)
data = data.hasOwnProperty("d") ? data.d : data;
AjaxMethods
Full details here, but basically you need:
- asp:ScriptManager EnablePageMethods="true"
- [WebMethod] on a static method of the code behind Page
- In client javascript, you get a PageMethods.xxx(arg1, arg2, onSuccess, onFail) function.
Exposing WCF to Ajax
See also WCF; MSDN RESTful WCF
Use Add New Item = AJAX-enabled WCF Service template.
On service class add
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
- On the [OperationContract] you can add [WebInvoke]/ [WebGet]
- HTTP verbs: GET= [WebGet]. Or: [WebInvoke(Method = "GET")] (default = POST)
- Default request/response is Json
On the js client, use "Content-Type", "application/json" mime type (see above) - For xml - use [WebInvoke(ResponseFormat = WebMessageFormat.Xml)] and add the line
WebOperationContext.Current.OutgoingResponse.ContentType = "text/xml"; - The request format can be dynamic (Json/Xml/querystring depending on what is sent)- automaticFormatSelectionEnabled=true
<behaviors>
<endpointBehaviors>
<behavior>
<webHttp automaticFormatSelectionEnabled="true" />
</behavior>
</endpointBehaviors>
</behaviors> - WebOperationContext.Current has properties IncomingRequest and OutgoingResponse, methods CreateJsonResponse<T> (and Xml, Text and Atom).
- There's URI routing/mapping for simple scalar arguments:
[WebInvoke(UriTemplate = "Stuff?id={id}")]
public string GetStuff(int id)
You can delete all the WCF configuration if you change the .svc to use the WebScriptServiceHostFactory.
<%@ ServiceHost Language="C#" Debug="true" Service="MyWebApp.Service1" CodeBehind="Service1.svc.cs"
Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>
In WCF, you can authenticate using ASP.Net authentication by creating an svc/endpoint with Service="System.Web.ApplicationServices.AuthenticationService". Enable the services in system.web.extensions/scripting/webServices/authenticationService enabled="true".
WCF vs Ajax ScriptService
| Asmx | WCF |
|---|---|
| [ScriptService] | [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] |
| [WebMethod] | [OperationContract] plus [WebInvoke]/ [WebGet] |
| Ajax's JavascriptSerializer is better with dictionaries with string keys than WCF's DataContractJsonSerializer, and more flexible with dates |


Registration
Picture Information ::
No picture information found
Picture Information record has been added.


Afghanistan beat West Indies to clinch T20 series
Lucknow - Teenage opener Rahmanullah Gurbaz hit an attacking half-century to set up Afghanistan's 29-run series-clinching win over the West Indies in the third Twenty20 international on Sunday.

They won the series 2-1 after losing the opening game and being swept in the preceding ODIs 3-0.
Paceman Naveen-ul-Haq took three wickets to choke the West Indies' chase despite a valiant 52 by wicketkeeper-batsman Shai Hope.
But it was the 17-year-old Gurbaz, a wicketkeeper-batsman, who stood out with his second T20I fifty after the Afghans were in early trouble at 12 for two.
Gurbaz, named man of the match, put on a crucial 50-run stand for the fourth wicket with former captain Asghar Afghan, who made 24, and surpassed his previous T20I best of 61.
He smashed six fours and five sixes before falling to West Indies skipper Kieron Pollard.
Pacemen Sheldon Cottrell, Kesrick Williams and Keemo Paul took two wickets each.
The West Indies lost regular wickets to falter in their chase against a disciplined Afghanistan attack that made the most of a slow track.
Hope, who was dropped on 11 by Naveen off Gulbadin Naib, completed his second T20I fifty but got little support from the other end.
Bowling all-rounder Karim Janat could not repeat his heroics from the second game where he claimed five wickets and scored 26 runs, but was named man of the series.
The two teams will next play a one-off Test starting November 27.


| 1 | /* ====================================== | |
| 2 | * JFreeChart : a free Java chart library | |
| 3 | * ====================================== | |
| 4 | * | |
| 5 | * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. | |
| 6 | * | |
| 7 | * Project Info: http://www.jfree.org/jfreechart/index.html | |
| 8 | * | |
| 9 | * This library is free software; you can redistribute it and/or modify it | |
| 10 | * under the terms of the GNU Lesser General Public License as published by | |
| 11 | * the Free Software Foundation; either version 2.1 of the License, or | |
| 12 | * (at your option) any later version. | |
| 13 | * | |
| 14 | * This library is distributed in the hope that it will be useful, but | |
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | |
| 16 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public | |
| 17 | * License for more details. | |
| 18 | * | |
| 19 | * You should have received a copy of the GNU Lesser General Public | |
| 20 | * License along with this library; if not, write to the Free Software | |
| 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, | |
| 22 | * USA. | |
| 23 | * | |
| 24 | * [Java is a trademark or registered trademark of Sun Microsystems, Inc. | |
| 25 | * in the United States and other countries.] | |
| 26 | * | |
| 27 | * ------------------------------- | |
| 28 | * CustomCategoryURLGenerator.java | |
| 29 | * ------------------------------- | |
| 30 | * (C) Copyright 2008, by Diego Pierangeli and Contributors. | |
| 31 | * | |
| 32 | * Original Author: Diego Pierangeli; | |
| 33 | * Contributors: David Gilbert (for Object Refinery Limited); | |
| 34 | * | |
| 35 | * Changes: | |
| 36 | * -------- | |
| 37 | * 23-Apr-2008 : Version 1, contributed by Diego Pierangeli based on | |
| 38 | * CustomXYURLGenerator by Richard Atkinson, with some | |
| 39 | * modifications by David Gilbert(DG); | |
| 40 | * | |
| 41 | */ | |
| 42 | package org.jfree.chart.urls; | |
| 43 | ||
| 44 | import java.io.Serializable; | |
| 45 | import java.util.ArrayList; | |
| 46 | import java.util.List; | |
| 47 | ||
| 48 | import org.jfree.chart.util.PublicCloneable; | |
| 49 | import org.jfree.data.category.CategoryDataset; | |
| 50 | ||
| 51 | /** | |
| 52 | * A custom URL generator. | |
| 53 | */ | |
| 54 | public class CustomCategoryURLGenerator implements CategoryURLGenerator, | |
| 55 | Cloneable, PublicCloneable, Serializable { | |
| 56 | ||
| 57 | /** Storage for the URLs. */ | |
| 58 | private ArrayList urlSeries = new ArrayList(); | |
| 59 | ||
| 60 | /** | |
| 61 | * Default constructor. | |
| 62 | */ | |
| 63 | public CustomCategoryURLGenerator() { | |
| 64 | super(); | |
| 65 | } | |
| 66 | ||
| 67 | /** | |
| 68 | * Returns the number of URL lists stored by the renderer. | |
| 69 | * | |
| 70 | * @return The list count. | |
| 71 | */ | |
| 72 | public int getListCount() { | |
| 73 |
1
1. getListCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return this.urlSeries.size(); |
| 74 | } | |
| 75 | ||
| 76 | /** | |
| 77 | * Returns the number of URLs in a given list. | |
| 78 | * | |
| 79 | * @param list the list index (zero based). | |
| 80 | * | |
| 81 | * @return The URL count. | |
| 82 | */ | |
| 83 | public int getURLCount(int list) { | |
| 84 | int result = 0; | |
| 85 | List urls = (List) this.urlSeries.get(list); | |
| 86 |
1
1. getURLCount : negated conditional → KILLED |
if (urls != null) { |
| 87 | result = urls.size(); | |
| 88 | } | |
| 89 |
1
1. getURLCount : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return result; |
| 90 | } | |
| 91 | ||
| 92 | /** | |
| 93 | * Returns the URL for an item. | |
| 94 | * | |
| 95 | * @param series the series index. | |
| 96 | * @param item the item index. | |
| 97 | * | |
| 98 | * @return The URL (possibly null). | |
| 99 | */ | |
| 100 | public String getURL(int series, int item) { | |
| 101 | String result = null; | |
| 102 |
2
1. getURL : changed conditional boundary → SURVIVED 2. getURL : negated conditional → KILLED |
if (series < getListCount()) { |
| 103 | List urls = (List) this.urlSeries.get(series); | |
| 104 |
1
1. getURL : negated conditional → KILLED |
if (urls != null) { |
| 105 |
2
1. getURL : changed conditional boundary → SURVIVED 2. getURL : negated conditional → KILLED |
if (item < urls.size()) { |
| 106 | result = (String) urls.get(item); | |
| 107 | } | |
| 108 | } | |
| 109 | } | |
| 110 |
1
1. getURL : mutated return of Object value for org/jfree/chart/urls/CustomCategoryURLGenerator::getURL to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return result; |
| 111 | } | |
| 112 | ||
| 113 | /** | |
| 114 | * Generates a URL. | |
| 115 | * | |
| 116 | * @param dataset the dataset (ignored in this implementation). | |
| 117 | * @param series the series (zero-based index). | |
| 118 | * @param item the item (zero-based index). | |
| 119 | * | |
| 120 | * @return A string containing the URL (possibly null). | |
| 121 | */ | |
| 122 | public String generateURL(CategoryDataset dataset, int series, int item) { | |
| 123 |
1
1. generateURL : mutated return of Object value for org/jfree/chart/urls/CustomCategoryURLGenerator::generateURL to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return getURL(series, item); |
| 124 | } | |
| 125 | ||
| 126 | /** | |
| 127 | * Adds a list of URLs. | |
| 128 | * | |
| 129 | * @param urls the list of URLs (null permitted). | |
| 130 | */ | |
| 131 | public void addURLSeries(List urls) { | |
| 132 | List listToAdd = null; | |
| 133 |
1
1. addURLSeries : negated conditional → KILLED |
if (urls != null) { |
| 134 | listToAdd = new java.util.ArrayList(urls); | |
| 135 | } | |
| 136 | this.urlSeries.add(listToAdd); | |
| 137 | } | |
| 138 | ||
| 139 | /** | |
| 140 | * Tests if this object is equal to another. | |
| 141 | * | |
| 142 | * @param obj the other object. | |
| 143 | * | |
| 144 | * @return A boolean. | |
| 145 | */ | |
| 146 | public boolean equals(Object obj) { | |
| 147 |
1
1. equals : negated conditional → KILLED |
if (obj == this) { |
| 148 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return true; |
| 149 | } | |
| 150 |
1
1. equals : negated conditional → KILLED |
if (!(obj instanceof CustomCategoryURLGenerator)) { |
| 151 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return false; |
| 152 | } | |
| 153 | CustomCategoryURLGenerator generator = (CustomCategoryURLGenerator) obj; | |
| 154 | int listCount = getListCount(); | |
| 155 |
1
1. equals : negated conditional → KILLED |
if (listCount != generator.getListCount()) { |
| 156 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return false; |
| 157 | } | |
| 158 | ||
| 159 |
3
1. equals : changed conditional boundary → KILLED 2. equals : Changed increment from 1 to -1 → KILLED 3. equals : negated conditional → KILLED |
for (int series = 0; series < listCount; series++) { |
| 160 | int urlCount = getURLCount(series); | |
| 161 |
1
1. equals : negated conditional → KILLED |
if (urlCount != generator.getURLCount(series)) { |
| 162 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return false; |
| 163 | } | |
| 164 | ||
| 165 |
3
1. equals : changed conditional boundary → SURVIVED 2. equals : negated conditional → SURVIVED 3. equals : Changed increment from 1 to -1 → KILLED |
for (int item = 0; item < urlCount; item++) { |
| 166 | String u1 = getURL(series, item); | |
| 167 | String u2 = generator.getURL(series, item); | |
| 168 |
1
1. equals : negated conditional → KILLED |
if (u1 != null) { |
| 169 |
1
1. equals : negated conditional → KILLED |
if (!u1.equals(u2)) { |
| 170 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return false; |
| 171 | } | |
| 172 | } else { | |
| 173 |
1
1. equals : negated conditional → NO_COVERAGE |
if (u2 != null) { |
| 174 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return false; |
| 175 | } | |
| 176 | } | |
| 177 | } | |
| 178 | } | |
| 179 |
1
1. equals : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED |
return true; |
| 180 | } | |
| 181 | ||
| 182 | /** | |
| 183 | * Returns a new generator that is a copy of, and independent from, this | |
| 184 | * generator. | |
| 185 | * | |
| 186 | * @return A clone. | |
| 187 | * | |
| 188 | * @throws CloneNotSupportedException if there is a problem with cloning. | |
| 189 | */ | |
| 190 | public Object clone() throws CloneNotSupportedException { | |
| 191 | CustomCategoryURLGenerator clone | |
| 192 | = (CustomCategoryURLGenerator) super.clone(); | |
| 193 | clone.urlSeries = new java.util.ArrayList(this.urlSeries); | |
| 194 |
1
1. clone : mutated return of Object value for org/jfree/chart/urls/CustomCategoryURLGenerator::clone to ( if (x != null) null else throw new RuntimeException ) → KILLED |
return clone; |
| 195 | } | |
| 196 | ||
| 197 | } | |
Mutations | ||
| 73 |
1.1 |
|
| 86 |
1.1 |
|
| 89 |
1.1 |
|
| 102 |
1.1 2.2 |
|
| 104 |
1.1 |
|
| 105 |
1.1 2.2 |
|
| 110 |
1.1 |
|
| 123 |
1.1 |
|
| 133 |
1.1 |
|
| 147 |
1.1 |
|
| 148 |
1.1 |
|
| 150 |
1.1 |
|
| 151 |
1.1 |
|
| 155 |
1.1 |
|
| 156 |
1.1 |
|
| 159 |
1.1 2.2 3.3 |
|
| 161 |
1.1 |
|
| 162 |
1.1 |
|
| 165 |
1.1 2.2 3.3 |
|
| 168 |
1.1 |
|
| 169 |
1.1 |
|
| 170 |
1.1 |
|
| 173 |
1.1 |
|
| 174 |
1.1 |
|
| 179 |
1.1 |
|
| 194 |
1.1 |


Types of access modifiers
In Java, there are several types of modifiers for controlling access to classes and members:
- private;
- package-private (also known as default, implicit);
- protected;
- public.
Only private, protected and public modifiers have the corresponding keywords. The package-private access modifier has not a keyword, but it's used when no any keyword specified.
Access modifiers for classes
A top-level class (not inner, not nested) can have one of two modifiers:
- package-private (default, no explicit modifier): a class is visible only for classes from the same package;
- public: a class is visible to all classes everywhere.
Here is a class inside the package
org.stepik.alt.java.packages.theory.p1. It has
package-private access.
package org.stepik.alt.java.packages.theory.p1;
class A {
}
The class is visible only for classes from the same package. It's not visible for classes from any other packages including:
org.stepik
org.stepik.alt.java.packages.theory
default package
Here is a public class inside the
package org.stepik.alt.java.packages.theory.p2.
package org.stepik.alt.java.packages.theory.p2;
public class B {
}
The class is visible to all classes everywhere including the following packages:
org.stepik
org.stepik.alt.java.packages.theory
org.stepik.alt.java.packages.theory.p1
default package
Access modifiers for members
A class member (a field or a method) can have one of four modifiers:
- private: a member is visible only inside the class;
- package-private: a member is visible only for classes from the same package;
- protected: a member is visible for classes from the same package and for subclasses even from other packages;
- public: a member is visible for all classes everywhere.
A class constructor can also have any of listed access modifiers.
The following table shows access to members grouped by modifiers.
Levels of accessing members grouped by modifiers
Note, in this table, by a subclass we mean only a subclass from another package.
Let's consider member modifiers in more detail.
Private members
Fields are often declared private to control the access to them from the outside. In some cases, the fields are fully private and they are only used internally in the class. In other cases, the fields can be accessed via accessor methods (e.g. getters and setters).
Private methods are used to hidden internal low-level logic implementation from the other code and make public methods more concise and readable.
Here is the class Counter. It has a private field "current". The field is hidden from outside world. The field can be changed only through the method "inc()" and read by the "getCurrent()" method.
public class Counter {
private long current = 0;
public long getCurrent() {
return current;
}
public long inc() {
inc(1L);
return current;
}
private void inc(long val) {
current += val;
}
}
A class constructor can be private too. In this case, it cannot be invoked outside the class. But it can be invoked from other public constructors or from the class methods.
Package-private members
Package-private access modifier has not required any keyword. If a field, a method or a constructor has this modifier then it can be read or changed from any class inside the same package.
Let's see an example. Here are two classes in the same package: SomeClass and AnotherClass.
The class SomeClass has a package-private field and a constructor. The instance of the class can be created and modified inside a method of AnotherClass.
public class SomeClass {
int field;
SomeClass(int field) {
this.field = field;
}
}
public class AnotherClass {
AnotherClass() {
SomeClass clazz = new SomeClass(100);
clazz.field = 540;
}
}
Protected members
If a class member has the protected access modifier, it can be accessed from classes inside the same package and all subclasses of this class (including other packages). Inheritance and subclasses will be studied in the other topics.
Public members
Public access modifier means that a field, a method or a constructor can be accessed from everywhere. It's often used for constructors, methods representing the class API and constant fields (public static final).
As a conclusion, there is an advice - use the most restrictive access level that makes sense for a particular member. Doesn't make all member public.


Nick Jonas Joins 'Gonna Tell My Kids' Trend - Check Out The Post Here.
The latest trend that has gripped the internet is ‘Gonna Tell My Kids’ and social media is flooded with memes. Even celebrities have joined the trend and have been sharing hilarious posts online. Now, the latest star to join the bandwagon is Nick Jonas, husband of our beloved desi girl Priyanka Chopra. The ace singer took to Instagram to share a post that has a special message for his future children.
In the post, he has shared a picture from his ‘Happiness Begins’ tour and wrote a long post about his band and how it got back together which also includes his brothers Kevin Jonas and Joe Jonas. In the long post, he wrote, “I’m gonna tell my kids this is a guy that was really happy because he and his brothers had a band and then they broke up, but then they got back together years later and their lives were enriched artistically and emotionally. He never could have imagined how fortunate he would be to be back on stage with his brothers in front of the world’s greatest fans every night doing what he loves. Thank you to everyone who continues to makes this story so much sweeter every day. May the happiness continue. #happinessbeginstour. (sic)”
Take a look at the post here:
Recently, the Jonas brothers wrapped up their tour which was going on since August this year. The tour also marked their fifth album together after they had reunited.
Recently, the band grabbed the nomination under the category of Best Duo/ Group Performance for their song ‘Sucker‘ at the 62nd Grammy Awards 2020.
For breaking news and live news updates, like us on Facebook or follow us on Twitter and Instagram. Read more on Buzz Latest News on India.com.
Story Timeline
- 08 Nov 2019 Priyanka Chopra-Nick Jonas Wedding Anniversary Plans: Singer Has a Surprise For Our Desi Girl
- 02 Nov 2019 National Diabetes Awareness Month: Nick Jonas Suffering From Type 1 Diabetes, These Complications May Affect H...
- 02 Nov 2019 Nick Jonas Opens up About Suffering From Type 1 Diabetes Since 14 Years
Comments - Join the Discussion


shoaib malik
Born: 1 February 1982 (age 38 years), Sialkot, Pakistan
Read more
shoaib akhtar
Born: 13 August 1975 (age 45 years), Rawalpindi, Pakistan
Read more
inzamam-ul-haq
Born: 3 March 1970 (age 50 years), Multan, Pakistan
Read more


Met Gala 2020 theme and new co-chairs announced
by Jessica NapoliThe Metropolitan Museum of Art of New York City has announced the next theme of its iconic Met Gala: "About Time: Fashion and Duration."
The museum described its choice as a reflection on the ephemeral nature of fashion.
INSIDE MET GALA 2019’S CRAZY UNWRITTEN RULES: FROM SMOKING TO SELFIES
The co-chairs for the gala, which will take place on Monday, May 4, will be Louis Vuitton designer Nicolas Ghesquière, actress Emma Stone, "Hamilton" creator Lin-Manuel Miranda, the iconic Meryl Streep, and longtime Vogue editor Anna Wintour.
"The Costume Institute's spring 2020 exhibition will trace more than a century and a half of fashion — from 1870 to the present — along a disruptive timeline, as part of The Met's 150th-anniversary celebration," the Met announced in a press release.
KIM KARDASHIAN REMOVED FAKE NIPPLES FROM MET GALA DRESS AFTER KANYE WEST VOICED DISPLEASURE
The concept borrows from "Henri Bergson's concept of la durée (duration)" and "will explore how clothes generate temporal associations that conflate past, present, and future."
Virginia Woolf will serve as the "ghost narrator" of the exhibition, the Met revealed.
The gala launches the spring exhibit, which will run from May 7 through Sept. 7.
CLICK HERE TO GET THE FOX NEWS APP
The show is curated, as always, by Andrew Bolton.
In 2019, the Met Gala's theme was "Camp: Notes on Fashion" and was co-chaired by Gucci designer Alessandro Michele, musicians Harry Styles and Lady Gaga, and tennis star Serena Williams.
The Associated Press contributed to this report.


Buhari returns to Nigeria from UK
by Yusuf AkinpeluPresident Muhammadu Buhari has returned to Nigeria after two weeks in London on a private visit.
Mr Buhari arrived the Nnamdi Azikiwe International Airport at about 9:45 p.m. on board a presidential jet, Channels Television reported.
While addressing journalists at the airport, Mr Buhari said he intends to work harder and be accountable to Nigerians.
PREMIUM TIMES reported Mr Buhari’s expected arrival. The president’s flight was said to have taken off from Stansted Airport, London, at about 3:27 p.m. Nigerian time.e
The president has been on a 15–day “private visit” in the United Kingdom since November 2. He was due to return on November 17.
On Thursday, a Nigerian diplomatic car believed to have been carrying the president was booed by an angry mob in the UK.
Many of the protesters carried placards calling for freedom for the detained publisher of Sahara Reporters, Omoyele Sowore. Others condemned the treatment of the leader of the Shiite movement in Nigeria, Ibrahim El-Zakzaky.
“Buhari, Stop Poisoning Sheikh Zakzaky,” one of the placards read.
“Omoyele Sowore is not a criminal,” another placard read.


Transposes a
.
tf.compat.v1.transpose( a, perm=None, name='transpose', conjugate=False )
Permutes the dimensions according to perm
.
The returned tensor's dimension i will correspond to the input dimension
perm[i]
. If perm
is not given, it is set to (n-1...0), where n is
the rank of the input tensor. Hence by default, this operation performs a
regular matrix transpose on 2-D input Tensors. If conjugate is True and
a.dtype
is either complex64
or complex128
then the values of a
are conjugated and transposed.
x = tf.constant([[1, 2, 3], [4, 5, 6]]) tf.transpose(x) # [[1, 4] # [2, 5] # [3, 6]] # Equivalently tf.transpose(x, perm=[1, 0]) # [[1, 4] # [2, 5] # [3, 6]] # If x is complex, setting conjugate=True gives the conjugate transpose x = tf.constant([[1 + 1j, 2 + 2j, 3 + 3j], [4 + 4j, 5 + 5j, 6 + 6j]]) tf.transpose(x, conjugate=True) # [[1 - 1j, 4 - 4j], # [2 - 2j, 5 - 5j], # [3 - 3j, 6 - 6j]] # 'perm' is more useful for n-dimensional tensors, for n > 2 x = tf.constant([[[ 1, 2, 3], [ 4, 5, 6]], [[ 7, 8, 9], [10, 11, 12]]]) # Take the transpose of the matrices in dimension-0 # (this common operation has a shorthand `linalg.matrix_transpose`) tf.transpose(x, perm=[0, 2, 1]) # [[[1, 4], # [2, 5], # [3, 6]], # [[7, 10], # [8, 11], # [9, 12]]]
a
: A Tensor
.perm
: A permutation of the dimensions of a
.name
: A name for the operation (optional).conjugate
: Optional bool. Setting it to True
is mathematically equivalent
to tf.math.conj(tf.transpose(input)).A transposed Tensor
.
In numpy
transposes are memory-efficient constant time operations as they
simply return a new view of the same data with adjusted strides
.
TensorFlow does not support strides, so transpose
returns a new tensor with
the items permuted.


{% extends "base.html" %} {% block content %}
You can replace this with whatever meets your fancy.
Change this file at home/templates/home/index.html


Converting Files To EMDB-SFF¶
Contents
Introduction¶
Converting files to use the EMDB-SFF data model is one of the core functions
of sfftk
. This guide describes in detail how to accomplish conversions.
Synopsis¶
Running
sff convert
sff convert -h
sff convert --help
displays all conversion options.
sff convert
usage: sff convert [-h] [-t] [-D DETAILS] [-R PRIMARY_DESCRIPTOR] [-v] [-x] [--json-indent JSON_INDENT] [--json-sort] [-o OUTPUT | -f FORMAT] [-p CONFIG_PATH] [-b] [-a] [-m] [from_file [from_file ...]]
Perform conversions to EMDB-SFF
positional arguments:
from_file file to convert from
optional arguments:
-h, --help show this help message and exit
-t, --top-level-only convert only the top-level segments [default: False]
-D DETAILS, --details DETAILS
populates <details>...</details> in the XML file
-R PRIMARY_DESCRIPTOR, --primary-descriptor PRIMARY_DESCRIPTOR
populates the <primary_descriptor>...</primary_descriptor> to this value [valid values: three_d_volume, mesh_list, shape_primitive_list]
-v, --verbose verbose output
-x, --exclude-geometry
do not include the geometry in the conversion; geometry is included by default [default: False]
--json-indent JSON_INDENT
size in spaces of the JSON indent [default: 2]
--json-sort output JSON sorted lexicographically [default: False]
-o OUTPUT, --output OUTPUT
file to convert to; the extension (.sff, .hff, .json) determines the output format [default: None]
-f FORMAT, --format FORMAT
output file format; valid options are: sff (XML), hff (HDF5), json (JSON) [default: sff]
-p CONFIG_PATH, --config-path CONFIG_PATH
path to configs file
-b, --shipped-configs
use shipped configs only if config path and user configs fail [default: False]
-a, --all-levels for segments structured hierarchically (e.g. Segger from UCSF Chimera and Chimera X) convert all segment leves in the hierarchy [default: False]
-m, --multi-file enables convert to treat multiple files as individual segments of a single segmentation; only works for the following filetypes: stl, map, mrc, rec [default: False]
Quick Start¶
Output to XML (Default)¶
sff convert file.seg
Specify Output File¶
sff convert file.seg -o file.sff
sff convert file.seg --output /path/to/output/file.sff
sff convert file.seg -o file.hff
sff convert file.seg -o --exclude-geometry file.json # only metadata; no geometrical data
Specify Output Format¶
sff convert file.seg -f hff
sff convert file.seg --format hff
EMDB-SFF Format Interconversion¶
sff convert file.sff --output /path/to/output/file.hff
sff convert file.hff --format json
sff convert file.sff --format sff # reduntant but should work
Verbose Operation¶
sff convert -v file.hff
sff convert --verbose file.hff
Include All Segments¶
When a segmentation is defined hierarchically only the top level of segments (i.e. those just under the root) will
be included by default. Use -a/--all-levels
argument to include all segments. This can lead to very large files.
Segger (.seg
) segmentations are one such example.
sff convert -a file.seg
sff convert --all-levels file.seg
Set Details¶
sff convert -D "Lorem ipsum dolor..." file.seg # strings must be quoted (single/double)
sff convert --details "Lorem ipsum dolor..." file.seg
Change Primary Descriptor¶
sff convert -R shape_primitive_list file.surf # IMOD file
sff convert --primary-descriptor shape_primitive_list file.surf # IMOD file
Input Formats¶
sfftk
can convert several segmentation file formats (see
Supported Formats) into EMDB-SFF files.
Output Formats¶
EMDB-SFF files can be output as XML (.sff
, .xml
), HDF5 (.hff
, .h5
or .hdf5
) or JSON
(.json
).
Both XML and HDF5 are quite compact and in many cases would be smaller than the original segmentation file.
JSON EMDB-SFF files may exclude geometry if created with
-x/--exclude-geometry
flag; they are primarily used as temporary files during annotation for speed.Interconversion of the three formats is lossless (with the exception of geometrical data when converting to JSON - if geometrical data is excluded).
There are two ways to perform conversion:
Specifying the output path with
-o/--output
flagSpecifying the output format with
-f/--format
flag
Specifying the output path with -o/--output
flag¶
Conversion is performed as follows:
sff convert file.seg -o file.sff
sff convert file.seg --output /path/to/output/file.sff
The output file extension determines the output format i.e.
sff convert file.seg -o file.hff
will result in an HDF5 file while
sff convert file.seg --output file.json
will be a JSON file.
Specifying the output format with -f/--format
flag¶
The -f/–format options ensures that the output file will be in the same
directory as the original segmentation file. The -f
flag takes one of three
values:
sff
for XML fileshff
for HDF5 filesjson
for JSON files.
Any other value raises an error.
sff convert file.seg -f hff
sff convert file.seg --format hff
The default format (if none is specified) is sff
(XML).
sff convert file.seg
results in file.sff as output.
EMDB-SFF Format Interconversion¶
It is also possible to perform interconversions between XML, HDF5 and JSON EMDB-SFF files.
sff convert file.sff --output /path/to/output/file.hff
or using --format
sff convert file.hff --format json
Even null conversions are possible:
sff convert file.sff --format sff
Conversions from JSON to XML/HDF5 where the latter excluded the geometry will not reinstate the geometrical description information.
Verbose Operation¶
As with many Linux shell programs the -v/--verbose
option prints status
information on the terminal.
sff convert --verbose file.hff
Tue Sep 12 15:29:18 2017 Seting output file to file.sff
Tue Sep 12 15:29:18 2017 Converting from EMDB-SFF (HDF5) file file.hff
Tue Sep 12 15:30:03 2017 Created SFFSegmentation object
Tue Sep 12 15:30:03 2017 Exporting to file.sff
Tue Sep 12 15:30:07 2017 Done
Including All Segments¶
Segger segmentations include hundreds to thousands of sub-segmentations due to how the algorithm it uses (watershed algorithm) to segment the volume. The segmentations thus form a tree with the root having an ID of zero. Mostly, we are only interested in the children of the root which are in themselves roots of another tree. By default we only transfer the children of the global root into the EMDB-SFF file.
Consider the following tree of segments:
The segmentation contains different levels commencing from the root down, with
children segments contained within parent segments. Specifying
-a/--all-levels
treats all children of the root as segments and
includes all segments. Therefore, running
sff convert --all-levels file.seg
on the above will produce an EMDB-SFF file with hundreds of segments. The default operation results in a more compact file.
Specify Details¶
The EMDB-SFF data model provides for an optional <details/>
tag for
auxilliary information. The contents of this option will be put into
<details/>.
sff convert --details "Lorem ipsum dolor..." file.seg
Todo
Allow a user to pass a file whose contents will be inserted into <details/>
.
Changing The Primary Descriptor¶
The EMDB-SFF data model provides for three possible geometrical descriptors: meshes (mesh_list), shape primitives (shape_primitive_list) and 3D volumes (three_d_volume).
In some cases, such as with IMOD segmentations, more than one geometrical descriptor may have been specified for the same segmentations.
The mandatory <primaryDescriptor/>
field specifies the main geometrical
descriptor to be used when performing conversions and other processing tasks.
Only valid values are allowed; otherwise a ValueError
is raised.
The table below shows valid primary descriptors by file type.
File format |
Valid primary descriptors |
|---|---|
AmiraMesh |
three_d_volume |
AmiraHxSurface |
mesh_list |
SuRVoS |
three_d_volume |
CCP4 masks |
three_d_volume |
IMOD |
mesh_list (default), shape_primitive_list |
Segger |
three_d_volume |
STL |
mesh_list |
Note
IMOD files must have a mesh generated using imodmesh
command. Open contours will need to be converted to
tubes using the -t <obj_list>
option. For example, for an IMOD file file.mod
with three objects all of
which are open contours we can run:
~$ imodmesh -t 1,2,3 -d 10 -E -Z 1.0 file.mod
which convert to tubes objects 1, 2 and 3 (-t 1,2,3
), cap ends (-E
) with domes at a scale of 1.0
(-Z 1.0
) and a diameter of 10 pixels (-d 10
).
You can find out much more about using imodmesh
at its documentation page.
Note that the primary descriptor should only be changed to a value of a geometrical descriptor that is actually present in the EMDB-SFF file.
Working with Multifile Segmentations¶
Some of the segmentation file formats supported are designed to hold one segment per file. Therefore, representing a complete segmentation will require multiple files.
Currently the following file formats are multifile by design:
CCP4 and related files - these files store segments as a 3D volume with segment region marked by specific voxel values (e.g.
1
for in segment voxels and0
for the background. Specific file formats have.mrc
,.map
and.rec
.Stereolithography files - while it is possible to concatenate several STL files into one, STL files do not contain metadata such as segment colour. Therefore, it is best to handle them as multifiles. STL files have a
.stl
extension.
Multifiles utilise the -m/--multi-file
argument followed by all the files each of which should
specify a single segment.
sff convert -m file1.map file2.map file3.map
The above command will use default options and write an EMDB-SFF file to file1.sff
. Alternatively,
the user should specify the output file
sff convert -m file1.map file2.map file3.map --output file.sff
Specifying Configurations To Use¶
sfftk
makes use of persistent configurations which affect how certain operations
are performed. There are three types of configurations detailed in the dedicated
documentation on configs (see Where Configurations Are Stored) in decreasing order of priority:
custom configs defined in a
path/to/sff.conf
file;user configs stored in
~/.sfftk/sff.conf
;shipped configs which will sit with the installed
sfftk
package.
Custom configs are invoked using the -p/--config-path
option:
sff convert -p path/to/configs file.seg
sff convert --config-path path/to/configs file.seg
User configs are default and require no special flags.
Shipped configs use the -b/--shipped-configs
flag with no arguments:
sff convert -b file.am
sff convert --shipped-configs file.am


Instructions
• Left mouse button to add dye to the canvas
• Right mouse button to just move velocities
• Press K to reset the canvas


Please complete your project finances.
If your organisation is not funded by Innovate UK then you do not need to submit organisational or funding details. Please confirm below.
This is a breakdown of your project costs and sources of funding for this project.
You must also state your organisation size in the
| Total project costs | % Grant | Funding sought | Other public sector funding | Contribution to project |
|---|---|---|---|---|
| £ |
£ |
£ |
£ |


We are a locally owned and operated company that supports our community, giving back through taxes and charitable organizations are things we take pride in. Here at Chicago Handy, our friendly, professionally skilled craftsmen are able to provide personalized end-to-end services. We provide exceptional workmanship and site clean-up on a complete range of Whole Home Services and Specialty Services.
- Drywall Repair
- Hardware installation (handles, kitchen pulls)
- Door repair
- Pet Doors
- Hanging paintings, curtains
- Ikea & DIY Furniture assembly
- Closet & Storage Organizers
- Hard to reach light bulbs & fixtures
- Light carpentry
- Custom Shelving & Wall Units
- Fixture replacement & Repair
- Furniture Assembly
- Painting
- Mirror Hanging/Installation
- Childproofing
- Smoke Detector Testing & Installation
- Wall-Mounted Flat Screen TV Installation
- Backsplashes
- Caulking & Grouting
- Plumbing & Electrical Services
- Leak Repair
- Faucet Installation
- Outlet Replacement
- Ceiling Fan & Fixture Installation
- Garage Services
- Storage & Organization Solutions


Peery ID:
CPU Usage:
Memory Usage:
Battery Time:
Battery Level:
CPU Name:
CPU Architecture:
CPU Features:
Memory Capacity:
Battery Status:
Operating System:
Platform:
Chrome Version:
Internal Storage:
External Storage:


Play an animation based on the given key. The animation should previously have been added via animations.add
If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.


7 minuti
7 minuti is a movie starring Cristiana Capotondi, Fiorella Mannoia, and Maria Nazionale. The owners of an Italian textile factory sell the majority of the property to a multinational company. No layoffs are planned, but there's a...


"The results show that DL does not outperform current solutions on structured EM, but it can significantly outperform them on textual and dirty EM"
Deep Learning For Entity Matching: A Design Space ExplorationUsed existing matched data as labels to feed into Deepmatcher model - precision/recall ~ 95%!
Deepmatcher is a layer on top of what already exists - SQL component produces possible matches with very relaxed rules, Deepmatcher fine-tunes
The more you plan, the luckier you get
Pipelined with the old favorite, luigi. Highlights included:
Security measures: Flask OIDC configured with Azure SSO - Azure app registration.


ATEEZ drop dates, cities, & venues for U.S. leg of 'The Fellowship: Map The Treasure' world tour!
by beansssRookie boy group ATEEZ has dropped dates, cities, and venues for their highly-anticipated 1st world tour, 'The Fellowship: Map The Treasure'!
After confirming the world tour's kick-off in Seoul in February of next year, ATEEZ recently announced their Europe leg first, spanning from March 14-29 in a total of 7 cities. Now, ATEEZ have unveiled the 5 cities coming up in the U.S. leg of their tour, including Newark, Chicago, Atlanta, Dallas, and Los Angeles!
Fans in the U.S. can look forward to seeing ATEEZ again from April 17-26 of 2020. Who all is going?


First you need to clone or download our repo. You can do this by typing folowing to Unix-terminal (for Windows will be later):
git clone https://github.com/RikiTikkiTavi/Project_Babylon-1.git
Then you need to change your directory to Project
cd Project_Babylon-1
And run awesome game!
java -jar Babylon.jar
Be happy! ..... and don't forget to press space


Bacon ipsum dolor amet salami pancetta jerky tri-tip cow kevin ham bacon hamburger filet mignon.  Boudin ribeye t-bone tongue shoulder andouille ham ground round chicken ball tip meatball. Chicken fatback alcatra biltong hamburger shoulder sirloin doner pork belly ground round leberkas venison beef ribs landjaeger.
Biltong venison landjaeger pastrami, pork belly cow beef andouille.  Short loin brisket chuck, corned beef chislic ham pig burgdoggen andouille meatball kevin drumstick beef ribs meatloaf. Pork chop beef ribs ham hock beef.


The Dragon Portfolio - implemented
01 Oct 2020The dragon portfolio is a portfolio construction that was presented by Christopher Cole in his 2020 paper “The allegory of the hawk and serpent - How to build a portfolio that lasts 100 years”. If you haven’t read the paper I recommend that you start by doing that. You can read it by going to https://www.artemiscm.com/welcome#research.
This site is not about the content of the paper. This site is about how you can implement the portfolio yourself. Ever since the paper was released, discussions about how a normal retail investor could implement the portfolio has been going on. Some of the components in the dragon portfolio is hard for retail investors to invest in. The problem is amplified by securities law that stops people like Chris Cole to talk much about how to implement the portfolio.
If you are an US investor, I’m sorry I can’t help you. From what I’ve read it’s hard to implement this portfolio unless you are an accredited investor. The good news is that it’s easier to become one these days. From what I understand, you can do a “Series 65” to become an accredited investor: $175 in fees, ~60 hours of study and a 3 hour test.
This implementation of the portfolio is targeted at European investors. We have different laws in Europe and it’s usually fairly simple to invest in hedge funds and other actively managed funds that’s needed to implement the dragon portfolio the correct way. As I’m Swedish I’m mostly using Swedish vehicles. But I believe they should be fairly easy to replace with instruments in your own country.
I, myself, plan to put at least 80% of my net worth in to this portfolio and hold it for 30 years+. So any critique or suggestions for how to improve my implementation of the portfolio is welcome. I am not a professional investor, so this is not investment advise. Do your own research etc. If you want to contact me, feel free to do so @DriftwoodPalace on Twitter.
Lets get going with Portfolio construction. You can select any subject you like in the sidebar (click ☰) to the left.


curl_unescape - URL decodes the given string
SYNOPSIS
#include <curl/curl.h>
char *curl_unescape( char *url, int length );
DESCRIPTION
This function will convert the given URL encoded input
string to a "plain string" and return that as a new allo-
cated string. All input characters that are URL encoded
(%XX where XX is a two-digit hexadecimal number, or +)
will be converted to their plain text versions (up to a ?
letter, no + letters to the right of a ? letter will be
converted).
If the 'length' argument is set to 0, curl_unescape() will
use strlen() on the input 'url' string to find out the
size.
You must curl_free() the returned string when you're done
with it.
RETURN VALUE
A pointer to a zero terminated string or NULL if it
failed.
SEE ALSO
curl_escape(), curl_free(), RFC 2396
Man(1) output converted with
man2html


public class PerformanceTester
extends java.lang.Object
| Constructor and Description |
|---|
PerformanceTester() |
| Modifier and Type | Method and Description |
|---|---|
long |
runPerformanceTest(SearchAlgo searchAlgo,
Graph graph,
int startX,
int startY,
int goalX,
int goalY)
Run a single performance test with the given parameters.
|
void |
runPerformanceTests(java.lang.String filename,
MovementModel movementModel,
int startX,
int startY,
int goalX,
int goalY,
int timesToRun)
Runs the performance test routine with the given parameters.
|
void |
runPerformanceTests1()
Runs set 1 of default performance tests.
|
void |
runPerformanceTests2()
Runs set 2 of default performance tests.
|
void |
runPerformanceTests3()
Runs set 3 of default performance tests.
|
void |
runPerformanceTests4()
Runs set 4 of default performance tests.
|
void |
runPerformanceTests5()
Runs set 5 of default performance tests.
|
void |
runPerformanceTests6()
Runs set 6 of default performance tests.
|
void |
runPerformanceTests7()
Runs set 7 of default performance tests.
|
public void runPerformanceTests1()
public void runPerformanceTests2()
public void runPerformanceTests3()
public void runPerformanceTests4()
public void runPerformanceTests5()
public void runPerformanceTests6()
public void runPerformanceTests7()
public void runPerformanceTests(java.lang.String filename, MovementModel movementModel, int startX, int startY, int goalX, int goalY, int timesToRun)
filename
- The filename of map to be usedmovementModel
- The movement model to be usedstartX
- Start point x coordinatestartY
- Start point y coordinategoalX
- Goal point x coordinategoalY
- Goal point y coordinatetimesToRun
- The amount of times for the searches to be executedpublic long runPerformanceTest(SearchAlgo searchAlgo, Graph graph, int startX, int startY, int goalX, int goalY)
searchAlgo
- The search algorithm to be usedgraph
- The graph of the searchstartX
- Start point x coordinatestartY
- Start point y coordinategoalX
- Goal point x coordinategoalY
- Goal point y coordinate


THE FOURTH PROTOCOL A film review by Mark Brader Copyright 1987 Mark Brader
Frederick Forsyth has written several thrillers, and several of them have been adapted into movies, starting with his first, the excellent THE DAY OF THE JACKAL. THE FOURTH PROTOCOL marks the first time that Forsyth also did the screenplay adaptation.
Pierce Brosnan, who wanted to play James Bond, is now on the other side: he plays a top Russian agent who is sent to England to do a very dirty piece of work against the NATO alliance. (It will violate "the fourth protocol" of a certain treaty, hence the title.) Michael Caine, who has starred in spy movies from THE IPCRESS FILE up to the current THE WHISTLE BLOWER, plays the man who is trying to stop him. Caine's world in this movie is not far removed from that of THE IPCRESS FILE, though perhaps a bit less grotty.
Caine and Brosnan, and the supporting cast also, turn in decent performances; the direction was unspectacular but the story kept moving along. On the whole I found the movie entirely satisfactory -- except for the most important thing, the script. (Some types of movies can stand large-to-middling implausibilities in the script: I loved THE LIVING DAYLIGHTS, rate it $7.50 (Cdn), and recommend it just for fun even to other non-fans of James Bond. But a serious thriller such as THE FOURTH PROTOCOL must meet higher standards.)
I'll be vague about details to avoid any spoilers. But to give you an idea: The premise of the Russian plot made sense, but their implementation did not; it allowed too many chances for the discovery of one piece to tip NATO off to the whole thing. (Just as well, otherwise there would have been no movie, but still...) One piece of tactics is used so many times that by the last time it has become predictable; that scene also contains a silly mistake (I was thinking, "Ah, he's doing it that way so as to avoid that cliche error giving away his plans", and one minute later, the cliche was shown as having occurred anyway.) Also, the ending seemed abrupt, with an explicit unanswered question; I wondered if a sequel is contemplated.
I'll give this one a $5 (Cdn) rating, on a base of $6 regular admission.
Mark Brader utzoo!sq!msb
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


GeoMesa Spark: Basic Analysis¶
This tutorial will show you how to:
- Use GeoMesa with Apache Spark.
- Write custom Scala code for GeoMesa to generate histograms and spatial densities of GDELT event data.
Background¶
Apache Spark is a “fast and general engine for large-scale data processing”. Spark presents an abstraction called a Resilient Distributed Dataset (RDD) that facilitates expressing transformations, filters, and aggregations, and efficiently executes the computation across a distributed set of resources. Spark manages the lineage of a block of transformed data so that if a node goes down, Spark can restart the computation for just the missing blocks.
GeoMesa has support for executing Spark jobs over data stored in GeoMesa. You can initialize a Spark RDD using standard CQL queries and by passing standard CQL functions to transform the data. In the spirit of the obligatory Word Count map-reduce example, we demonstrate two geospatial spins on word count. First, counting features by time resolution to compute a time series of spatial data, and second, aggregating by grid cell to rapidly generate density plots. Apache Spark enables us to express these transformations easily and succinctly.
Prerequisites¶
Warning
You will need access to a Hadoop 2.6 or later installation with Yarn as well as an Accumulo 1.9.1 or later database.
You will need to have ingested GDELT data using GeoMesa. Instructions are available in Map-Reduce Ingest of GDELT.
You will also need:
- a Spark 2.0.0 or later distribution
- an Accumulo user that has appropriate permissions to query your data
- Java JDK 8,
- Apache Maven 3.5.2 or later, and
- a git client
The tutorial example below presumes that Spark is installed and configured, and
that a cluster with Hadoop and Yarn is running. We will use spark-submit
to run
our jobs on the cluster.
Set Up Tutorial Code¶
Clone the geomesa-tutorials project, and go into the geomesa-examples-spark
directory:
$ git clone https://github.com/geomesa/geomesa-tutorials.git $ cd geomesa-tutorials/geomesa-examples-spark
Note
The code in this tutorial is written in Scala.
Count Events by Day of Year¶
You will need to have ingested some GDELT data into Accumulo with GeoMesa, as described in Map-Reduce Ingest of GDELT or Global Database of Events, Language, and Tone (GDELT).
The com.example.geomesa.spark.CountByDay
class in the src/main/scala
directory
is a self-contained example that may be submitted to Spark as an example of analysis.
The libraries used are described in the GeoMesa Spark chapter of the
GeoMesa manual. We describe this example code below.
Example Code¶
First, we set our connection parameters– you will need to modify these settings to match the configuration of your cluster:
val params = Map(
"instanceId" -> "instance",
"zookeepers" -> "zoo1,zoo2,zoo3",
"user" -> "user",
"password" -> "*****",
"auths" -> "USER,ADMIN",
"tableName" -> "geomesa.catalog")
We also define an ECQL filter used to select a subset of GDELT data from
the GeoMesa Accumulo data store. The value of during
should also be edited
to match the range of GDELT data that you have ingested.
// Define a GeoTools Filter here
val typeName = "gdelt"
val geom = "geom"
val date = "dtg"
val bbox = "-80, 35, -79, 36"
val during = "2014-01-01T00:00:00.000Z/2014-01-31T12:00:00.000Z"
val filter = s"bbox($geom, $bbox) AND $date during $during"
Within the main()
method for the class, we create an AccumuloDataStore
:
// Get a handle to the data store
val ds = DataStoreFinder.getDataStore(params).asInstanceOf[AccumuloDataStore]
and create the GeoTools Filter
from the ECQL:
// Construct a CQL query to filter by bounding box
val q = new Query(typeName, ECQL.toFilter(filter))
We set up Spark:
// Configure Spark
val conf = new SparkConf().setAppName("testSpark")
val sc = SparkContext.getOrCreate(conf)
The GeoMesaSpark
object provided by the geomesa-spark-core module
uses the SPI to find an implementation of the SpatialRDDProvider
interface.
In this case, this will be an instance of AccumuloSpatialRDDProvider
from
the geomesa-accumulo-spark module, which will connect to Accumulo with
the parameters provided. (For more information on this interface, see
Spark Core in the GeoMesa manual.)
// Get the appropriate spatial RDD provider
val spatialRDDProvider = GeoMesaSpark(params)
Next, initialize an RDD[SimpleFeature]
using this provider:
// Get an RDD[SimpleFeature] from the spatial RDD provider
val queryRDD = spatialRDDProvider.rdd(new Configuration, sc, params, q)
Finally, we construct our computation which consists of extracting the
SQLDATE
from each SimpleFeature
and truncating it to the day
resolution.
val dayAndFeature = queryRDD.mapPartitions { iter =>
val df = new SimpleDateFormat("yyyyMMdd")
val ff = CommonFactoryFinder.getFilterFactory2
val exp = ff.property("SQLDATE")
iter.map { f => (df.format(exp.evaluate(f).asInstanceOf[java.util.Date]), f) }
}
Then, we group by the day and count up the number of events in each group.
val countByDay = dayAndFeature.map( x => (x._1, 1)).reduceByKey(_ + _)
countByDay.collect().foreach(println)
Run the Tutorial Code¶
If you have not already done so, modify the CountByDay.scala
class so that
the parameter map points to your cloud instance, and ensure that the filter
covers a valid range of your GDELT data.
Build (or rebuild) the JAR. This example JAR is shaded and will contain all of JARs needed to run the appropriate analysis in Spark.
$ mvn clean install
We can submit the job to our Yarn cluster using spark-submit
:
$ /path/to/spark/bin/spark-submit --master yarn \
--class com.example.geomesa.spark.CountByDay \
target/geomesa-examples-spark-$VERSION.jar
Note
Note that $VERSION
is the geomesa-tutorials version, not the GeoMesa version.
Alternatively, you may run the Spark job locally by setting --master 'local[*]
.
You should see a lot of Spark logging, and then the counts:
(20140117,57)
(20140120,38)
(20140113,407)
...
Parallel Computation of Spatial Event Densities¶
In the second demonstration, we compute densities of our feature by discretizing the spatial domain and counting occurrences of the feature in each grid cell. We use GeoHashes as our discretization of the world so that we can configure the resolution of our density by setting the number of bits in the GeoHash.
This code is does not exist in GeoMesa; it’s left as an exercise for the reader.
First, start with a similar RDD[SimpleFeature]
as before but expand
the bounding box.
val f = ff.bbox("geom", -180, -90, 180, 90, "EPSG:4326")
val q = new Query("gdelt", f)
val queryRDD = spatialRDDProvider.rdd(new Configuration, sc, params, q, None)
Project (in the relational sense) the SimpleFeature
to a 2-tuple of
(GeoHash, 1)
.
val discretized = queryRDD.map { f =>
(geomesa.utils.geohash.GeoHash(f.getDefaultGeometry.asInstanceOf[Point], 25), 1)
}
Then, group by grid cell and count the number of features per cell.
val density = discretized.reduceByKey(_ + _)
density.collect.foreach(println)
The resulting density plot is visualized below.


the_random_page help you with whatever you wanted to random! Just type in the choices, hit RANDOM NOW!, you will know what you should do in half a second!
What do you waiting for? RANDOM NOW!
We used a very stricted logical code so they don't break.

We update very frequently to keep things fresh.
And brought to you by love <3
If you're bored and don't know what to do, here are some thing you can get on to right away!
And if you're just lack of ideas you can properly seeing some choices you can consider adding too.
Having a good time using this page? We hope so! If not, be sure to contact us to tell what you are upset with, we are willing to hear. If you ARE having a good time, contact to let us know!
091-347-8978