EL CID A film review by James Berardinelli Copyright 1993 James Berardinelli
Rating (Linear 0 to 10): 7.0
Date Re-released: 8/27/93 (Original release 1961) Running Length: 3:04 (3:12 including 8-minute intermission) Rated: NR (Violence)
Starring: Charlton Heston, Sofia Loren, John Fraser, Genevieve Page, Herbert Lom Director: Anthony Mann Producer: Samuel Bronston Screenplay: Frederic M. Frank and Philip Yordan Music: Miklos Rozsa Re-released by Miramax Films and Martin Scorsese
"EL CID is one of the greatest epic films ever made. Anthony Mann's sense of composition, his use of space, and his graceful camera movements bring to life an ancient tapestry where the transformation of an ordinary man into a legend become almost a mystical experience." Lavish praise from Martin Scorsese, one of the forces behind the restoration and re-release of EL CID. Pardon me if I am not wholly in agreement with him.
The story of EL CID centers around the life of Rodrigo Diaz (Charlton Heston), a Castilian knight in 1060 Spain fighting to keep his country from the brink of civil war so that it will retain the manpower and unity necessary to defend itself against the outside threat of the North African Moors. Diaz, called El Cid by his followers, becomes a living legend to the men of eleventh century Spain, and this film willingly expands upon every myth to surround the name of the legitimate historical figure. EL CID is definitely not a good source for a factual biography (the identity of Diaz' wife and the premise of the finale are a few of the more obvious occasions when the truth is completely ignored).
Using similar methods and equal care to that which was given to LAWRENCE OF ARABIA, the restoration of EL CID is an impressive undertaking. The sound quality on this new print is flawless and, for the most part, the picture is better than one would expect from a thirty-two year old film. There are several frames that are far from mint condition, but the overall effect is impressive, and the colors are never washed-out.
The battle scenes of EL CID are breathtaking, and well worth the effort of seeing on a large screen. Video viewing of the climactic struggle would greatly diminish the impact, and it is in this context that it's possible to understand Scorsese's quote. This is definitely a film meant for theaters. The television screen will serve only to limit the high points and magnify the numerous, often-glaring weaknesses.
That's because beyond the spectacle and pageantry, EL CID's virtues are limited. The costumes and set design are as impressive as the magnificent backdrops against which the turbulent struggles of the armies occur, and the effort necessary to orchestrate the realistic clash of thousands of swords is mind-boggling, but while these things add a great deal to the film, they cannot entirely cover up its shortcomings.
Acting is by far the biggest problem. While both Charlton Heston and Sofia Loren have imposing screen personalities, neither is capable of projecting real emotion or drawing us into a rapport with the characters. Simply put, Heston and Loren are wooden, and there are only a few occasions on which they manage to make Diaz or Chimene real. The chemistry between them is flat, conveying little, if any, passion. "Smouldering" is not a word anyone would use to describe this couple.
The plot is high melodrama with few surprises. Diaz is the hero, and he does all the superhuman things expected from a knight "with God on [his] side." EL CID turns far more often to the ridiculous than the sublime, and the last scenes contain an element that is downright silly. Perhaps if the movie didn't take itself so seriously, there wouldn't be as many opportunities for unintentional laughter, but EL CID is about as self-important as a motion picture can be. It is an epic, after all, but in case we've forgotten, there's always the needlessly florid dialogue and stentorian score to remind us.
Obviously, they don't make movies like this any more, and that's both good and bad. While there's a lot in this film that modern pictures don't need to harken back to, it would be nice to see some of the flair. When recalling great battles in recent films, only a few come to mind (LAST OF THE MOHICANS and GLORY, for example), none of which have the scope or sheer power of what Anthony Mann achieved in EL CID.
So, while I'm personally not ready to anoint EL CID as the timeless epic classic that it has become, I'll not pepper it with arrows of disdain, either. This is a grand movie with tremendous aspirations that are not always realized. Nevertheless, it's an entertaining, if not transcendental way to spend three-plus hours.
- James Berardinelli<EMAIL_ADDRESS>.
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


Car bomb kills 19 in northern Syria: Monitor
The bomb, which struck a bus and taxi station in the town, also wounded 33 people, some of them seriously, the Britain-based Syrian Observatory for Human Rights reported.
A car bomb killed 19 people, 13 of them civilians, in the Turkish-controlled town of Al-Bab in northern Syria on Saturday, a war monitor said.
The bomb, which struck a bus and taxi station in the town, also wounded 33 people, some of them seriously, the Britain-based Syrian Observatory for Human Rights reported.
Turkey and its Syrian proxies control several pockets of territory on the Syrian side of the border as a result of successive incursions in 2016-17, 2018 and 2019.
There was no immediate claim of responsibility for the bombing but the Observatory said there had been persistent security incidents in the town since its capture by Turkish troops from the Islamic State group in February 2017.
The town, some 30 kilometres (20 miles) northeast of Syria's second city Aleppo, was one of the westernmost strongholds of the jihadists' self-styled "caliphate" which was finally eradicated by US-backed Kurdish forces in eastern Syria in March.
Turkey blamed the car bombing on the Kurdish People's Protection Units (YPG) against whom it launched a new invasion further east last month.
Kurdish fighters "continue to target innocent civilians using the same methods as Daesh," the defence ministry said on its official Twitter account using another acronym for IS.
There was no immediate reaction from the YPG, seen by Ankara as a "terrorist offshoot" of the Kurdistan Workers Party which has fought an insurgency inside Turkey for the past 35 years.
The latest Turkish invasion, which was aimed at creating a buffer zone the whole length of the border, sparked an outcry in the West because of the key role the YPG played in the US-led campaign against IS.
It paused after Turkey struck a truce deal with Russia, the main supporter of the Syrian government, to jointly patrol the border area and oversee the withdrawal of Kurdish fighters from a new Turkish-controlled pocket between the towns of Tal Abyad and Ras al-Ain.


by Steve A. Olson
__/__/2003
Heresy: A deliberate deviation from the orthodox doctrine. SQLTags (http://sqltags.org) is, indeed, a deliberate deviation from the orthodoxy of the Model-View-Control (MVC) design pattern; therefore, SQLTags is heresy, but is it necessarily "bad?" In this article, I will introduce the SQLTags toolkit and when it can be successfully employed.
Notwithstanding the recent criticism by N. Alex Rupp in Beyond MVC, the MVC design pattern is, currently, the gold standard for highly complex web applications developed within the Servlet environment. Just subscribe to any of the Struts mailing lists to witness how vibrant this community is. However, as stated on the Struts main page and paraphrased here, Struts and, by extension, MVC are not the best choice for every project. The Struts community asserts that only "very simply applications, with a handful of pages," are candidates for non-MVC implementations, and with this I agree; however, the threshold of "very simple" has been changed by the introduction of SQLTags.
SQLTags implements a very simple concept: Database schema as Tag Library. Each table is represented as a JSP tag, a tag that:
in short, a tag that "knows" the underlying table and how to integrate it into the Servlet environment.
This simple concept extends the realm of "very simple" to what was previously moderately complex, data-driven web applications.
SQLTags, available at www.sqltags.org, is a free, open source, object-relational mapping toolkit that provides a new and innovative approach to data-driven web applications development. At the SQLTags core is a generator that builds a JavaBean and JSP tag for each table within a given JDBC schema. The SQLTags Generator packages everything (including built-in tags and support classes) into a single Java Archive or "jar" file for easy deployment into any Java 1.4/Servlet 2.3/JSP 1.2 (or later) J2EE Application Server. Best of all, SQLTags is quick and easy to learn and understand.
The SQLTags generator accepts a valid (and available) JDBC Driver, JDBC URL, user name, password, schema name, and other options
which are used to reverse-engineer the given database schema into the corresponding jar file.
The resulting jar file can be deployed into any complaint Application Server.
On the target server, the "deployment descriptor" or /WEB-INF/web.xml
file is updated to include "context parameters"
that tell SQLTags how to connect to the same or an identical schema.
Once the generated jar file is successfully deployed into the target Application Server,
JSP pages can use the generated (and built-in) tags contained within the jar file to implement the desired functionality.
Whenever the database is changed, simply use the SQLTags Generator to "re-generate" the jar file.
Additionally, SQLTags works well with other Java and JSP industry standards like:
SQLTags is both application server and database independent.
There are three steps required to use a SQLTags generated jar file:
This section will provide an overview of the functionality available to the JSP developer when using a generated jar file.
SQLTags adds a number of built-in tags to the generated jar file. These can be broken down into three main categories:
first
, last
, next
, and previous
; connection
, commit
, rollback
, exception
,
cursor
, statement
, fetch
, where
, and orderby
authorize
, allow
, and deny
.
The most commonly used built-in tags are connection
, exception
, where
, and fetch
.
The connection
tag is required in every page that needs a connection to the database (almost every page).
Connections can come from the built-in SQLTags connection pool defined within the "deployment descriptor"
or from a container-managed DataSource.
The exception
tag outputs JDBC error messages only when things go awry with database operations.
The where
and fetch
tags are provided as a mechanism to more easily compose complex where clauses
and explicitly iterate through the ResultSets.
The cursor
, statement,
and fetch
tags are available to provide functionality similar to the
JSTL "sql" tag library. (At some point in the future, perhaps, SQLTags will integrate with the JSTL sql tag library.)
As noted above, each table is represented as a tag and each of those tags have common attributes and methods
as well as unique, per-column attributes and methods.
The common attributes available to all generated tags are:
id
,
tableAlias
,
buttonName
,
columns
,
displaySize
,
foreignKey
,
handlerClass
,
hasFetch
,
maxRows
,
operation
,
orderBy
,
parentName
,
paging
,
preInsertSQL
,
preUpdateSQL
,
properties
,
startRowParameter
,
where
,
and
from
.
Additionally, for each column, COL, there are four generated tag attributes:
The "COL" attributes allow the value of the column to be explicitly set, COL_FORMAT provides a mechanism for specifying the display format for date and number columns, COL_SELECT provides a mechanism to override the select-list item for the column, and a COL_BIND provides a mechanism to override the bind expression used in a PreparedStatement (every SQLTags SQL statement uses the PreparedStatement). Some of the more commonly used attributes are:
Some of the more useful methods available to all generated tags are:
insert()
, update()
, delete()
, and delete(where)
.
Additionally, because each table tag is a JavaBean, each column, COL, has setCOL()
and getCOL()
methods and each foreign key, FK, has a getFK()
method — again very useful for EL expressions.
SQLTags makes extensive use of foreign keys. Take a look at any Entity-Relationship Diagram, the glue that holds any database together is the foreign keys. Indeed, in my experience the majority of the navigation within a data-driven web application centers on the foreign keys, either through parent table lookups or through parent-child nesting. For example, given an Employee, "what Department is she assigned to?" or given a Department "who are the Employees contained within it?" or given an Invoice, list the Invoice Line Items and related Product Names. These questions are all answered by foreign keys.
SQLTags provides powerful ways to leverage foreign keys using "declarative access."
For example, imagine two tables EMP
and DEPT
with a foreign key,
FK_DEPTNO
, defined within EMP
referencing DEPT
, as illustrated by Figure 1:
Figure 1. Sample Datamodel
When SQLTags generates our hypothetical EMP
JavaBean,
it would contain a getFK_DEPTNO()
method that returns a DEPT
JavaBean.
Consider the following JSP 2.0 snippet.
<x:emp id="e" where="order by ENAME">
${e.ENAME} belongs to Department
${e.FK_DEPTNO.DNAME}!

</x:emp>
As expected, the column values are easily accessible using EL (beginning of second line)
based on standard JavaBean syntax;
however and perhaps not expected, the foreign keys are also available in exactly the same way!
Need the Department name, DNAME
, for a given Employee?
Simply use the foreign key FK_DEPTNO
as the getter for the related Department. Wow!
SQLTags also provides a mechanism for nesting children records within their parents, again, using foreign keys. Consider the following JSP 2.0 snippet.
<x:dept id="d" where="order by DNAME">

${d.DNAME} has the following employees:
<x:emp id="e" foreignKey="FK_DEPTNO"
parentName="d">
${e.ENAME}
</x:emp>

</x:dept>
Again, note how easily the list of Employees for a given Department can be obtained simply by knowing
the foreign key name and the "id"
of the DEPT
tag.
Finally, consider how simple it is for a programmer (or even a designer, heaven forbid) to look at an Entity-Relationship Diagram and start connecting the dots.
Download the sqltags-1-0-6.war
(or latest version) web application file from the SQLTags web site at
http://sqltags.org/downloads.jsp and deploy it into your favorite J2EE Application Server.
Note: SQLTags requires Java 1.4, Servlet 2.3 or later, JSP 1.2 or later
and a suitable JDBC driver for your specific database.
The SQLTags web application comes with pre-installed JDBC drivers for Oracle, MySQL, and Sybase.
The JDBC Driver for Microsoft SQL Server is also included but is in the
/WEB-INF/extras
directory and must be manually moved into
/WEB-INF/lib
in order to access a SQL Server database.
Note: the javac
executable must be accessible via the PATH variable (by the application server)
in order to compile the generated JavaBean classes.
To deploy the sqltags-1-0-6.war
file into the Tomcat Application Server,
for example, simply copy the "war" file into the CATALINA_HOME/webapps
directory,
restart the server,
and access the /sqltags-1-0-6/
URI on your deployment host using your browser.
For example, if you were running Tomcat on your local workstation on port 8080 you would use the following URL to run the SQLTags web application:
http://localhost:8080/sqltags-1-0-6/
The SQLTags web application contains information and samples for running the generator, deploying the jar files, and building JSP pages.
To execute the generator from your browser,
simply click on the "run ..."
link near the top of the page
(using the above example, the URL would be http://localhost:8080/sqltags-1-0-6/generate.jsp
).
Fill-in all the fields and click on the "Generate!"
button.
That's it, really!
The generate screen contains detailed descriptions for each input field. Basically, you'll need to specify:
Once the generator completes, you should see output in the browser window showing that each table was processed.
The generated jar file is saved into the /WEB-INF/tmp
directory using the file name specified in the "JAR Filename" input field.
Note: future releases of SQLTags will likely place the generated jar file in the /tmp directory under the web application.
Note: SQLTags will not generate foreign key references to tables that are either not contained within the generated jar file due to wildcard exclusion or do not have a primary key.
Deployment of the generated jar file is accomplished in two steps:
/WEB-INF/lib
directory of the target web application and /WEB-INF/web.xml
(deployment descriptor) to define the SQLTags "context parameters." You'll likely need to restart the web application for the changes to take effect.
Context parameters are added to the /WEB-INF/web.xml
deployment descriptor immediately after the <web-app> tag using the following syntax.
<context-param>
<param-name>SQLTags.useCM</param-name>
<param-value>true</param-value>
</context-param>
The list of SQLTags context parameters is as follows:
SQLTags.useCM
: Short for "use internal Connection Manager". Valid values are true
or false
.
When false
SQLTags will use a DataSource and ignore the other SQLTags JDBC context parameters (listed below).
SQLTags.dataSource
: Identifies the default dataSource
to be used by the ConnectionTag
when no dataSource
attribute is supplied and useCM
is false
; default value is jdbc/SQLTagsDS
.
Note: a DataSource is used when useCM
is false
or when a connectionTag
explicitly references a
dataSource
from the dataSource
attribute.
SQLTags.bindStrings
: Should almost always be set of false
; when true
all database
bindings are processed as strings,
when false
all numerical and date data types are processed as the correct native Java type.
Greatly helps with compatibility among different databases.
The following parameters are only used when SQLTags.useCM
is true
.
When useCM
is false
the JDBC parameters are defined externally within a DataSource
.
SQLTags.databaseDriver
: The JDBC database driver as specified by JDBC vendor.
oracle.jdbc.OracleDriver
, org.gjt.mm.mysql.Driver
.
SQLTags.connectionUrl
: The JDBC connection URL as specified by JDBC vendor.
jdbc:mysql://localhost/scott?user=root
, jdbc:oracle:thin:@localhost:1521:ORCL
.
SQLTags.maxPoolSize
: Maximum number of JDBC connections for the connection pool.
SQLTags.poolSize
: Default size of the JDBC connection pool.
SQLTags.userName
: Database user for JDBC connections.
SQLTags.password
: Database user's password.
SQLTags development starts with a well-defined data model. So, for the purposes of this article, I will refer to the "classic" EMP-DEPT data model that was shown above in Figure 1.
In this first example, I will demonstrate a simple JSP page that displays a listing of all rows from the EMP table and their assigned DEPT.
<%@ taglib uri="demoTags.jar" prefix="sqltags" %>
<%@ taglib uri="http://java.sun.com/jstl/core"
prefix="c" %>

<title>JSP Page</title>

<%-- uses configuration from web.xml. --%>
<sqltags:connection id="connect" >
<sqltags:emp id="e" where="order by ename">
<c:out value="${e.ENAME}"/> assigned to
<c:out value="${e.FK_DEPTNO.DNAME}"/>

</sqltags:emp>
</sqltags:connection>

The first two lines introduce the two tag libraries used within the JSP page.
The <sqltags:connection>
tag is used to access the JDBC connection pool which must wrap all of the other SQLTags tags.
The next line introduces the EMP tag and defines a "where clause" that matches all rows and orders the results by ENAME.
The JSTL <c:out> tags are used to output the ENAME
property from the EMP
JavaBean
(ENAME
is a column from the EMP
table).
Finally, the DNAME
property from the related DEPT
table is output for each EMP
in the table.
Viewing the above page from the browser would yield the output shown in Figure 2, provided we have suitable data in the database:
Figure 2. Sample Output: single table query
In the second example, I will demonstrate a simple JSP page that implements the parent-child configuration listing EMPs within each DEPT.
<%@ taglib uri="demoTags.jar" prefix="sqltags" %>
<%@ taglib uri="http://java.sun.com/jstl/core"
prefix="c" %>

<title>JSP Page</title>

<%-- uses configuration from web.xml. --%>
<sqltags:connection id="connect" >
<sqltags:dept id="d" where="order by DNAME">
<c:out value="${d.DNAME}" />

<sqltags:emp id="e" foreignKey="FK_DEPTNO"
parentName="d">
<c:out value="${e.ENAME}"/>

</sqltags:emp>

</sqltags:dept>
</sqltags:connection>

Again,
the first two lines introduce the two tag libraries used within the JSP page.
The <sqltags:connection>
tag is used to access the JDBC connection pool, and must wrap all of the other SQLTags tags.
The DEPT
tag defines a "where clause" that matches all rows and orders the results by DNAME.
The next line outputs the department name (DNAME
)
and the blockquote
provides a visual indentation showing employees that belong to each department.
The EMP
tag provides the mechanism to nest the employees within the related DEPT
.
The foreignKey
attribute tells the EMP
tag
which foreign to use to reference (join to) the DEPT
tag
and the parentName
attribute identifies which DEPT
tag instance should be referenced.
The next line simply outputs each employee name one per line.
Figure 3 shows sample output from this page:
Figure 3. Sample Output: parent-child nesting.
I've just scratched the surface of what is possible with SQLTags. There is a lot more functionality available within the tool set, including:
DataSources
allow
, deny
, and auth
tagsBLOB
and CLOB
column types, paging of results, etc.Hopefully, you've seen enough to whet your interest to investigate further. MVC is a also great design pattern, but SQLTags can be successfully employed when used to develop a data-driven web application that closely follows a well defined data model with limited processing logic.
Basically, for data-in, data-out applications, SQLTags is just the ticket.


Born-Digital Records in Practice at UAlbany
Gregory Wiedeman
University Archivist
Some Background
M.E. Grenander Special Collections & Archives
University at Albany, SUNY
- 4 permanent archivists, 1 on grant funding
- Department Head
- Supervisory Archivist (Manuscripts and Front Desk)
- Curator of Digital Collections
- University Archivist
- 3-4 Graduate students
- Undergraduate work study students
Overview of University Archives
- University Records
- Office of the President
- University Senate
- University Council
- Office of the Provost
- Graduate & Undergraduate Education
- Records of Schools and Colleges
- Records of Academic Departments
- Web Archives
- Student Groups and Manuscripts
- Student Association
- Albany Student Press
- Faculty and Alumni Papers
Collecting Background
- Formal records management program until cut in 1990s
- Very effective collecting in 1970s
- Records Management “distributed” among offices
- Permanent Records should come to me
- Large paper backlog
- Establishment of extensible processing practices
What does this have to do with Born-Digital Records
- Concensus that Disk Imaging is most effective way to preserve born-digital records
- This poses real problems for public records
A Bit about File Systems
- File Allocation Table (FAT)
- New Technology File System (NTFS)
- HFS Plus
- ext4
- exFAT
How File Systems Work
- Not designed for preservation
- Designed for efficiency
- Quick Retrieval
Inefficient Storage
Efficient Storage
File Systems are designed for Efficiency
- Files are abstractions
- Pointers to where data is stored
- Unix systems use Inode pointers
- NTFS uses $MFT (Master File Table)
https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/
Where is a File?
Where do Files Live?
Where do Files Live?
NTFS on Windows
Brian Carrier, File System Forensic Analysis (Addison-Wesley, 2005), p. 283
$MFT (Master File Table)
Carrier, p. 280
$MFT (Master File Table)
Carrier, p. 295
$MFT Timestamps Demo
Deleting Files
Efficiency in Sectors
Efficiency in Sectors
Carrier, p. 188
Slack Space
Carrier, p. 188
Imaging the Disk
-->
Disk Images
- Unix disk dump utility
- FTK Imager
- Guymanger
- ImgBurn
What Can We Learn from a Disk Image?
- File metadata
- Timestamps
- Logs and Journals
- Registries
- Deleted Files not overwritten
- Data in Slack Space
- Corrupted Data
So, What does all this mean?
- Disk imaging keeps all the bits
- More than what you can see on your computer
- Great for manuscripts
- David Baldus Papers
- Maurice Hinchey Papers
Overview of University Archives
- University Records
- Office of the President
- University Senate
- University Council
- Office of the Provost
- Graduate & Undergraduate Education
- Records of Schools and Colleges
- Records of Academic Departments
- Web Archives
- Student Groups and Manuscripts
- Student Association
- Albany Student Press
- Faculty and Alumni Papers
Records Created by the University are Public Records
University Records are subject to FOIL
Born-Digital Records Collecting in Practice
- Files dispersed around the University
- Local Computers
- Network Shares
- Cloud Storage
ANTS issues
- Difficulty to get records creators to commit
- Training
- Required wider commitment
- Availability of network shares
- Maintenance
- Library and packaging issues
- Really an authentication issue
Transfer Scripts
- Network Folder Share
- Archives and creator has access
- Python script run on task scheduler
- Weekly checks for new files
- CSV log files of files transferred
- Creates XML accession metadata file
- Runs createSIP.py command line tool
createSIP.py demo
What is a SIP?
- Different interpretations of SIP, AIP, DIP
Into ArchivesSpace
Born-Digital Photography
Maintenance
- Scripts break over time
- No more ad-hoc approaches
- No more XML data stores
- Network of well-maintained interoperable tools
- ArchivesSpace Migration
Espy Project
Fedora 4 Data Model
Portland Common Data Model
Hydra::Works
Other Projects
Questions


--- title: "TensorFlow tensors" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{TensorFlow tensors} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} type: "docs" menu: main: name: "Tensors" identifier: "custom-basic-tensors" parent: "custom-basic-top" weight: 30 ---
TensorFlow, as the name indicates, is a framework to define and run computations involving tensors. A tensor is a generalization of vectors and matrices to potentially higher dimensions. Internally, TensorFlow represents tensors as n-dimensional arrays of base datatypes.
When writing a TensorFlow program, the main object you manipulate and pass
around is the tf$Tensor
. A tf$Tensor
object represents a partially defined
computation that will eventually produce a value. TensorFlow programs work by
first building a graph of tf$Tensor
objects, detailing how each tensor is
computed based on the other available tensors and then by running parts of this
graph to achieve the desired results.
A tf$Tensor
has the following properties:
float32
, int32
, or string
, for example)Each element in the Tensor has the same data type, and the data type is always known. The shape (that is, the number of dimensions it has and the size of each dimension) might be only partially known. Most operations produce tensors of fully-known shapes if the shapes of their inputs are also fully known, but in some cases it’s only possible to find the shape of a tensor at graph execution time.
Some types of tensors are special, and these will be covered in other units of the TensorFlow guide. The main ones are:
tf$Variable
tf$constant
tf$SparseTensor
With the exception of tf.Variable
, the value of a tensor is immutable, which
means that in the context of a single execution tensors only have a single
value. However, evaluating the same tensor twice can return different values;
for example that tensor can be the result of reading data from disk, or
generating a random number.
The rank of a tf$Tensor
object is its number of dimensions. Synonyms for
rank include order or degree or n-dimension.
Note that rank in TensorFlow is not the same as matrix rank in mathematics.
As the following table shows, each rank in TensorFlow corresponds to a
different mathematical entity:
| Rank | Math entity |
|---|---|
| 0 | Scalar (magnitude only) |
| 1 | Vector (magnitude and direction) |
| 2 | Matrix (table of numbers) |
| 3 | 3-Tensor (cube of numbers) |
| n | n-Tensor (you get the idea) |
The following snippet demonstrates creating a few rank 0 variables:
library(tensorflow)
mammal <- tf$Variable("Elephant", tf$string)
ignition <- tf$Variable(451, tf$int16)
floating <- tf$Variable(3.14159265359, tf$float64)
its_complicated <- tf$Variable(12.3 - 4.85i, tf$complex64)
Note: A string is treated as a single object in TensorFlow, not as a sequence of characters. It is possible to have scalar strings, vectors of strings, etc.
To create a rank 1 tf.Tensor
object, you can pass a list of items as the
initial value. For example:
A rank 2 tf$Tensor
object consists of at least one row and at least
one column:
Higher-rank Tensors, similarly, consist of an n-dimensional array. For example, during image processing, many tensors of rank 4 are used, with dimensions corresponding to example-in-batch, image height, image width, and color channel.
tf$Tensor
object’s rankTo determine the rank of a tf$Tensor
object, call the tf$rank
method.
For example, the following method programmatically determines the rank
of the tf$Tensor
defined in the previous section:
## tf.Tensor(4, shape=(), dtype=int32)
tf$Tensor
slicesTensor elements can be extracted either by using functions like tf$gather()
and tf$slice()
, or by using [
syntax.
Extracting tensor elements with [
in R is similar to extracting elements from standard R arrays, albeit with some minor differences in capabilities. In contrast to most tf$
functions, [
defaults to R style 1-based rather than 0-based indexes. Currently, only numeric indexes in [
are supported (no logical or character indexes)
Extracting works identically to R arrays if the slicing index is missing, supplied as a scalar, or as a sequence (e.g, created by :
or seq_len()
)
x[,1] ) # all rows, first column
x[1:2,] ) # first two rows, all columns
x[,1, drop = FALSE] ) # all rows, first column, but preserving the tensor rank
[
also supports slices with a strided step, which can be specified in traditional R style with seq()
or with a python-style second colon. If you are unfamiliar with python-style strided step syntax, see here for a quick primer
Missing arguments for python syntax are valid, but they must be supplied as NULL or whole expression must by backticked.
[
also accepts tf$newaxis
and all_dims()
as arguments
An important difference between extracting R arrays and tensorflow tensors with [
is how negative numbers are interpreted. For tensorflow tensors, negative numbers are interpreted as selecting elements by counting from tail (e.g, they are interpreted python-style).
Tensors are accepted by [
as well, but note that tensors suplied to [
are not translated from R to python. Meaning that tensors are interpreted as 0-based, and if slicing a range with :
, then the returned arrays is exclusive of the upper bound.
If you are translating existing python code to R, note that you can set an option to have all [
arguments be interpreted pure-python style by setting options(tensorflow.extract.style = "python")
. See ?`[.tensorflow.tensor`
for additional options and details.
The shape of a tensor is the number of elements in each dimension. TensorFlow automatically infers shapes during graph construction. These inferred shapes might have known or unknown rank. If the rank is known, the sizes of each dimension might be known or unknown.
The TensorFlow documentation uses three notational conventions to describe tensor dimensionality: rank, shape, and dimension number. The following table shows how these relate to one another:
| Rank | Shape | Dimension number | Example |
|---|---|---|---|
| 0 | [] | 0-D | A 0-D tensor. A scalar. |
| 1 | [D0] | 1-D | A 1-D tensor with shape [5]. |
| 2 | [D0, D1] | 2-D | A 2-D tensor with shape [3, 4]. |
| 3 | [D0, D1, D2] | 3-D | A 3-D tensor with shape [1, 4, 3]. |
| n | [D0, D1, … Dn-1] | n-D | A tensor with shape [D0, D1, … Dn-1]. |
Shapes can be represented via lists of ints, or with the
tf$TensorShape
.
tf$Tensor
object’s shapeThere are two ways of accessing the shape of a tf$Tensor
. While building the
graph, it is often useful to ask what is already known about a tensor’s
shape. This can be done by reading the shape
property of a tf$Tensor
object.
This method returns a TensorShape
object, which is a convenient way of
representing partially-specified shapes (since, when building the graph, not all
shapes will be fully known).
It is also possible to get a tf$Tensor
that will represent the fully-defined
shape of another tf$Tensor
at runtime. This is done by calling the tf$shape
operation. This way, you can build a graph that manipulates the shapes of
tensors by building other tensors that depend on the dynamic shape of the input
tf$Tensor
.
For example, here is how to make a vector of zeros with the same size as the number of columns in a given matrix:
tf$Tensor
The number of elements of a tensor is the product of the sizes of all its
shapes. The number of elements of a scalar is always 1
. Since there are often
many different shapes that have the same number of elements, it’s often
convenient to be able to change the shape of a tf.Tensor
, keeping its elements
fixed. This can be done with tf.reshape
.
The following examples demonstrate how to reshape tensors:
rank_three_tensor <- tf$ones(shape(3, 4, 5))
matrix <- tf$reshape(rank_three_tensor, shape(6, 10)) # Reshape existing content into
# a 6x10 matrix
matrixB <- tf$reshape(matrix, shape(3, -1)) # Reshape existing content into a 3x20
# matrix. -1 tells reshape to calculate
# the size of this dimension.
matrixAlt <- tf$reshape(matrixB, shape(4, 3, -1)) # Reshape existing content into a
#4x3x5 tensor
# Note that the number of elements of the reshaped Tensors has to match the
# original number of elements. Therefore, the following example generates an
# error because no possible value for the last dimension will match the number
# of elements.
In addition to dimensionality, Tensors have a data type. Refer to the
tf$DType
page for a complete list of the data types.
It is not possible to have a tf$Tensor
with more than one data type. It is
possible, however, to serialize arbitrary data structures as string
s and store
those in tf$Tensor
s.
It is possible to cast tf$Tensor
s from one datatype to another using
tf$cast
:
# Cast a constant integer tensor into floating point.
float_tensor <- tf$cast(tf$constant(c(1L, 2L, 3L)), dtype=tf$float32)
To inspect a tf$Tensor
’s data type use the Tensor.dtype
property.
When creating a tf$Tensor
from an R object you may optionally specify the
datatype. If you don’t, TensorFlow chooses a datatype that can represent your
data. TensorFlow converts R integers to tf$int32
and R floating
point numbers to tf$float32
. Otherwise TensorFlow uses the same rules numpy
uses when converting to arrays.


Start a new text file called nuts.rb. Here’s what you put inside:
Camping.goes :Nuts
Save it. Then, open a command prompt in the same directory. You’ll want to run:
$ camping nuts.rb
And you should get a message which reads:
** Camping running on <IP_ADDRESS>:3301.
This means that right now The Camping Server is running on port 3301 on your machine. Open your browser and visit http://localhost:3301/.
Your browser window should show:
Camping Problem!
/ Not found
No problem with that. The Camping Server is running, but it doesn’t know what to show. Let’s tell him.
So, you’ve got Camping installed and it’s running. Keep it running. You can edit files and The Camping Server will reload automatically. When you need to stop the server, press Control-C.
Let’s show something. At the bottom of nuts.rb add:
module Nuts::Controllers
class Index < R '/'
def get
Time.now.to_s
end
end
end
Save the file and refresh the browser window. Your browser window should show the time, e.g.
Sun Jul 15 12:56:15 +0200 2007
The Camping microframework allows us to separate our code using the MVC (Model-View-Controller) design pattern. Let’s add a view to our Nuts application. Replace the module Nuts::Controllers with:
module Nuts::Controllers
class Index < R '/'
def get
@time = Time.now
render :sundial
end
end
end
module Nuts::Views
def layout
html do
head do
title { "Nuts And GORP" }
end
body { self << yield }
end
end
def sundial
p "The current time is: #{@time}"
end
end
Save the file, refresh your browser window and it should show a message like:
The current time is: Sun Jul 15 13:05:41 +0200 2013
And the window title reads “Nuts And GORP”.
Here you can see we call render :sundial from our controller. This does exactly what it says, and renders our sundial method. We’ve also added a special method called layout which Camping will automatically wrap our sundial output in. If you’re familiar with HTML, you’ll see that our view contains what looks HTML tag names. This is Markaby, which is like writing HTML using Ruby!
Soon enough, you’ll find that you can return anything from the controller, and it will be sent to the browser. But let’s keep that for later and start investigating the routes.
You probably noticed the weird R ‘/’ syntax in the previous page. This is an uncommon feature of Ruby that is used in our favorite microframework, to describe the routes which the controller can be accessed on.
These routes can be very powerful, but we’re going to have look at the simplest ones first.
module Nuts::Controllers
class Words < R '/welcome/to/my/site'
def get
"You got here by: /welcome/to/my/site"
end
end
class Digits < R '/nuts/(\d+)'
def get(number)
"You got here by: /nuts/#{number}"
end
end
class Segment < R '/gorp/([^/]+)'
def get(everything_else_than_a_slash)
"You got here by: /gorp/#{everything_else_than_a_slash}"
end
end
class DigitsAndEverything < R '/nuts/(\d+)/([^/]+)'
def get(number, everything)
"You got here by: /nuts/#{number}/#{everything}"
end
end
end
Add this to nuts.rb
and try if you can hit all of the controllers.
Also notice how everything inside a parenthesis gets passed into the method, and is ready at your disposal.
This just in:
module Nuts::Controllers
class Index
def get
"You got here by: /"
end
end
class WelcomeToMySite
def get
"You got here by: /welcome/to/my/site"
end
end
class NutsN
def get(number)
"You got here by: /nuts/#{number}"
end
end
class GorpX
def get(everything_else_than_a_slash)
"You got here by: /gorp/#{everything_else_than_a_slash}"
end
end
class NutsNX
def get(number, everything)
"You got here by: /nuts/#{number}/#{everything}"
end
end
end
Drop the < R-part and it attemps to read your mind. It won’t always succeed, but it can simplify your application once in a while.
You can get pretty far with what you’ve learned now, and hopefully you’ve been playing a bit off-book, but it’s time to take the next step: Storing data.
Let’s start over again.
Camping.goes :Nuts
module Nuts::Models
class Page < Base
end
end
Obviously, this won’t do anything, since we don’t have any controllers, but let’s rather have a look at what we do have.
We have a model named Page. This means we now can store wiki pages and retrieve them later. In fact, we can have as many models as we want. Need one for your users and one for your blog posts? Well, I think you already know how to do it.
However, our model is missing something essential: a skeleton.
Camping.goes :Nuts
module Nuts::Models
class Page < Base
end
class BasicFields < V 1.0
def self.up
create_table Page.table_name do |t|
t.string :title
t.text :content
# This gives us created_at and updated_at
t.timestamps
end
end
def self.down
drop_table Page.table_name
end
end
end
Now we have our first version of our model. It says:
If you want to migrate up to version one, create the skeleton for the Page model, which should be able to store, “title” which is a string, “content” which is a larger text, “created_at” which is the time it was created, “updated_at” which is the previous time it was updated.
If you want to migrate down from version one, remove the skeleton for the Page model.
This is called a migration. Whenever you want to change or add new models you simply add a new migration below, where you increase the version number. All of these migrations builds upon each other like LEGO blocks. Each new Migrations must have different class’s names, is a good idea name migration’s explicit. For exmaple:
class AddTagColumn < V 1.1
def self.change
add_column Page.table_name, :tag, :string
Page.reset_column_information
end
end
Now we just need to tell Camping to use our migration. Write this at the bottom of nuts.rb
def Nuts.create
Nuts::Models.create_schema
end
When The Camping Server boots up, it will automatically call Nuts.create. You can put all kind of startup-code here, but right now we only want to create our skeleton (or upgrade if needed). Start The Camping Server again and observe:
$ camping nuts.rb
** Starting Mongrel on <IP_ADDRESS>:3301
-- create_table("nuts_schema_infos")
-> 0.1035s
== Nuts::Models::BasicFields: migrating ===================================
-- create_table(:nuts_pages)
-> 0.0033s
== Nuts::Models::BasicFields: migrated (0.0038s) ==========================
Restart it, and enjoy the silence. There’s no point of re-creating the skeleton this time.
Before we go on, there’s one rule you must known: Always place your models before your migrations.
Let’s explore how our model works by going into the console. The console is good way to familiarize with your models. Test your models adding some data by bare hand before addin it to the application.
$ camping -C nuts.rb
** Starting console
>>
Now it’s waiting for your input, and will give you the answer when you press Enter. Here’s what I did, leaving out the boring answers. You should add your own pages.
>> Page = Nuts::Models::Page
>> hiking = Page.new(:title => "Hiking")
>> hiking.content = "You can also set the values like this."
>> hiking.save
>> page = Page.find_by_title("Hiking")
=> #<Nuts::Models::Page id: 1, ... >
>> page = Page.find(1)
=> #<Nuts::Models::Page id: 1, ... >
>> page.title
>> page.content
>> page.created_at
>> page.updated_at
>> Page.find_by_title("Fishing")
=> nil
## Page.create automatically saves the page for you.
>> Page.create(:title => "Fishing", :content => "Go fish!")
>> Page.count
=> 2
Now I have two pages: One about hiking and one about fishing.
Wouldn’t it be nice if we could show this wonderful our pages in a browser? Update nuts.rb so it also contains something like this:
module Nuts::Controllers
class Pages
def get
# Only fetch the titles of the pages.
@pages = Page.all(:select => "title")
render :list
end
end
class PageX
def get(title)
@page = Page.find_by_title(title)
render :view
end
end
end
module Nuts::Views
def list
h1 "All pages"
ul do
@pages.each do |page|
li do
a page.title, :href => R(PageX, page.title)
end
end
end
end
def view
h1 @page.title
self << @page.content
end
end
Here we meet our first helper:
R(PageX, page.title)
This is the reversed router and it generates a URL based on a controller. R takes the controller you want to link to, followed by the router parameters. . Instead of typing:
:href=>'/welcome/to/my/site'
You can let Camping do the hard work for you.
:href=>R(Words)
If the route would have some parameter, you shall write like this:
:href=>R(WordsX,’someword’)
Camping ships with a few, but very useful, helpers, and you can easily add your owns. Have a look at Camping::Helpers for how you use these.
There’s a lot of improvements you could do here. Let me suggest:
Helpers can work generating Markaby’s code. You could write a helper for show some kind of data and call it from your views (Add a layout).
We have one major flaw in our little application. You can’t edit or add new pages. Let’s see if we can fix that:
module Nuts::Controllers
class PageX
def get(title)
if @page = Page.find_by_title(title)
render :view
else
redirect PageXEdit, title
end
end
def post(title)
# If it doesn't exist, initialize it:
@page = Page.find_or_initialize_by_title(title)
# This is the same as:
# @page = Page.find_by_title(title) || Page.new(:title => title)
@page.content = @input.content
@page.save
redirect PageX, title
end
end
class PageXEdit
def get(title)
@page = Page.find_or_initialize_by_title(title)
render :edit
end
end
end
The core of this code lies in the new post method in the PageX controller. When someone types an address or follows a link, they’ll end up at the get method, but you can easily create a form which rather sends you to the post when submitted.
There are other names you can use, but they won’t always work. So for now, don’t be fancy and just stick to get and post. We’ll show you how this really works later.
You might also notice that we use @input.content. The @input-hash contains any extra parameters sent, like those in the forms and those in the URL (/posts?page=50).
Here’s an edit-view, but you can probably do better. See if you can integrate all of this with what you already have.
module Nuts::Views
def edit
h1 @page.title
form :action => R(PageX, @page.title), :method => :post do
textarea @page.content, :name => :content,
:rows => 10, :cols => 50
br
input :type => :submit, :value => "Submit!"
end
end
end
You’ve taken quite a few steps in the last minutes. You deserve a break. But let’s recap for a moment:
If you wanna dive deep, stay reading for a more extended tutorial step by step…
Enjoy the code
In the mean time you may try out the examples like this: camping examples/blog.rb # Mounts Blog at /


| Apache | WS |
Axis C++Welcome to Axis CPPAxis C/C++ (Axis CPP) is a non-Java implementation of Axis. At its core Axis CPP has a C++ runtime engine. The provided tooling allows you to create C++ client-side stubs and server-side skeletons. The server skeletons can be deployed to either a full Apache web server using the supplied apache module or a "simple_axis_server" - which is a simple HTTP listener (designed to help you test your services). The implementation has concentrated on being ws-i profile compliant. The implementation does not have support for ws-* specifications and it is envisaged that this will be provided by Axis2. However, at the current time, Axis CPP is still being actively developed and improved until such times as Axis2 C implementation has progressed far enough to take over its role. ContentsFeatures
Quality AssuranceIn the past two years, the comprehensive test-suite has been created and maintained to a high-level. The suite is run over all the nightly builds. If bugs are found then tests are added to ensure that the code does not regress - this is your assurance of quality. SchedulesAt any time you can get a copy of the latest overnight build and we try to produce a full release at least every 6 months. The current level of Axis CPP that we recommend is 1.6. This has many bug fixes in it for the more complex scenarios that we have seen Axis CPP being used in over recent months. Axis C++ 1.6Download the latest release of Axis C++ Key features of Axis C++ 1.6
Known Issues
We hope you will enjoy using Axis C++. Numerous efforts are currently underway to improve Axis C++ as a whole. We value your feedback very much. Please report any bugs in Jira and feel free to let us know your thoughts and/or problems in<EMAIL_ADDRESS>|


Find my Apartment, A website that filters the craigslist apartments by daily commute time.
- ● Users enter preferences, including commute dest/time. Get the filtered apartments from BE and display them on Mapbox.
- ● Responsive web UI/UX design & implement with Bootstrap in prototyping. Migrated to React w/ Material UI
- ● Write the unit test and integrated test scripts in verification stage.
- ● Demo: CLICK ME initially supporting Bay Area and Los Angeles.
Craigslist Crawler, REST API for front-end to request house info by coordinates/preferences.
- ● Generate an isochrone map specific to certain commute time in the request. e.g. the travel range on map of 30min drive to
UCLA, arriving at 8am. Using this isoline and other criteria to filter the CL listings. Using CSS selector to get the gist of CL listings.
- ● Implemented the REST API for communication b/w Front-end and Back-end.
- ● Wmplemented the web crawler system to continuously monitor the apartment updating on CL; save them into MongoDB.
- ● NWrite the unit test and integrated test scripts in verification stage. Using Travis CI for CI/CD.
Web-based Business Process Management System (ERP) in Full Stack JavaScript
- ● Designed and implemented the core modules of company info, candidate profile and job search with Node.js, React.js and MongoDB, using Redis for caching and Elasticsearch for text search optimization.
- ● Optimized page load time from 2.5s to 0.4s by refactoring React.js/jQuery/CSS/HTML codebase and using reducing requests, caching, minification and lazy loading techniques.
- ● Cut down development cycle time by 20% by using Docker for configuration and deployment.
- ● Sample code: SAMPLE-1 SAMPLE-2 SAMPLE-3
SongFinder: Thread-safe music library with search engine by Java Servlet, Jetty, Tomcat
- ● A thread-safe music library and use a work queue to build the library using multiple threads from Last.fm.
- ● With CSS design, pagination, administrator Interface to manage songs, artists, users and website.
- ● Allow a user to search by artist, title, and tag with search suggestion and partial and case insensitive search.
- ● Allow a user to login, view search history, add favorite song and artists, view trend in SongFinder and Last.fm, integrate with
Youtube API.
- ● GitHub: CLICK ME
RoboBlast: 2D RPG Game with Audio-visual Effects in C++
- ● Develop a real-time RPG video game with image, sound effect and a variety of levels and props setting purely by C++.
- ● Design inheritance hierarchy of 20+ actors, generate wall and props automatically, refactor continuously to improve code.
- ● GitHub: CLICK ME
Interactive Earth Quake Presentation Map Microservice in Java
- ● An interactive map marks earthquakes happened around the world by RESTful API, Java Unfolding Map Lib.
- ● Parse information from public website, create objects and markers based on them and update lively.
- ● GitHub: CLICK ME


Please produce the following graph using the data from this Excel file: http://pythonhow.com/data/verlegenhuken.xlsx
Some notes:
Temperature and pressure values in the Excel file have a scale factor of 10. That means you'll have to divide those values by 10 to get the actual observations.
And yes, you can set your own fonts and colors, but please try to be accurate with the rest of the plot elements.


 %} {% trans "Click here to check it" %}.
{% else %}{% trans "You don't have procedures to be made." %} {% trans "But you can check the careline here" %}.
{% endif %}{% trans "There are no events on the next 7 days" %}.
{% trans "Your last post has no commentaries" %}.


Actress Gong Hyo Jin celebrates 20 years since her debut and personally visits her subway ad by fans
by sl278Actress Gong Hyo Jin is celebrating 20 years since her debut, and her loving fans got her a subway ad to celebrate.
The actress came to visit the ad in person on December 9th and posted the occasion on her personal Instagram.
The post shows the gorgeous actress donning a mask and appearing and taking a commemorative shot with her ad, which states: "Congratulations to Gong Hyo Jin for her 20th anniversary since debut. She came to us like a Christmas present."
Congratulations to Gong Hyo Jin on her anniversary!


[gecode-users] Problems on source tree generated by "make dist"
Christian Schulte
cschulte at kth.se
Wed Oct 3 15:52:04 CEST 2012
I think the dist target is obsolete (Guido: Is it really?). It is safe to
just use the stuff from the svn directly (with svn export). That's how we
build the source packages we distribute.
Cheers
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Andrea Pretto
Sent: Wednesday, October 03, 2012 3:46 PM
To: users at gecode.org list
Subject: [gecode-users] Problems on source tree generated by "make dist"
Hi,
I'm trying to create the .tar.gz dist file using "make dist" (from
release-2.7.3 downloaded from svn)
I guess there are missing files in the generated .tar.gz, cause I get this:
config.status: creating Makefile
config.status: error: cannot find input file: `tools/flatzinc/mzn-gecode.in'
Maybe something is missing from the autotools config stuff.
Cheers.
_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users
More information about the users
mailing list


Company's database server located at Toronto and users from US, India and from other locations are accessing this database. Tablespace TBS1 in a database is full and DBA cannot add any more disk to the containers, DBA decided to move to a different tablespaces with new container storage without making any outages.
To move to a different tablespaces DBA has to offline the database, that will cause the loss of million dollars to the company.
Starting from DB2 9.7 you can move tables by using an online or offline move using the ADMIN_MOVE_TABLE procedure. The ADMIN_MOVE_TABLE stored procedure moves the data in an active table into a new table object with the same name, while the data remains online and available for access. Use an online table move instead of an offline table move if you value availability more than cost, space, move performance, and transaction overhead.
You can move a table online by calling the stored procedure once or multiple times, one call for each operation performed by the procedure. Using multiple calls provides you with additional options, such as cancelling the move or controlling when the target table is taken offline to be updated.
Ensure there is sufficient disk space to accommodate the copies of the table and index, the staging table, and the additional log entries.


Human neutrophils express GH-N gene transcripts and the pituitary transcription factor Pit-1b.
Abstract
Since GH stimulates the development and function of granulocytes, we investigated the expression of GH in granulocyte subsets. By immunocytochemistry, 25 +/- 7 % of the human neutrophils were shown to express immunoreactive GH, whereas eosinophils were negative. Reversed transcription (RT) -PCR analysis demonstrated GH mRNA in neutrophils. Restriction analysis revealed that neutrophils express the GH-N gene but not the GH-V gene. Furthermore, we demonstrated by western blot analysis that neutrophils express an alternatively spliced variant of the pituitary transcription factor Pit-1, designated Pit-1b.


| DOSE: |
25 mg |
insufflated |
2C-I |
(powder / crystals) |
My roommate had recently gotten a 'gift' from a friend of his in Denver. He and I have experimented with several substances in the past and most certainly enjoy tripping together. One night shortly after the semester at school had started, we decided to share the 2c-i he had received.
T + 0:00 I chose to snort 25mg through a Guatemalan Quetzal bill, he chose to mix his in a shot of vodka.
T + 0:15 Nothing yet, significant burning sensation in my sinuses and a good deal of drip down the back of my throat, very bitter tasting.
T + 0:30 Some open eye visuals begin. I started getting the chills pretty bad. I then decided to crank up the thermostat to 78 degrees(which I later regretted in the morning), I also covered myself with a blanket.
T + 0:45 Even though I still had the chills, I could feel I was burning up. My heart was pounding and I began to get very hyper. We had been watching 'Family Guy' as we were waiting for the 2c-i to kick in, and even though it was an episode I'd seen several times, I found it absolutely hilarious and couldn't stop laughing. At one point I looked at the blinds in our living room and they appeared as if they were dancing. My roommate had only just started to come up.
T + 1:00 At this point I decided to retreat to my room and listen to music as I heard that music was very pleasurable while on 2c-i. I put on a techno compilation and proceeded to turn the volume up very high so it was almost pulsing through the apartment. I lay on my bed with the lights off and the music blaring, a lot of the tracks I didn't even like seemed to have a new side to them. Music almost seemed to have another dimension, like I not only heard it, but I felt it.
T + 1:45 At this point I switched the music to my all time favorite album, Nine Inch Nails-The Downward Spiral. Already a very sad and emotional album, the feeling of it was amplified almost 10 fold while on 2c-i.
T + 2:45 After listen to that album, I began to draw. After my pen left the ink on the page, the ink seemed to come alive and crawl around the page. A lot of what I drew tended to be what I thought would look interesting if it crawled!
T + 3:00 After drawing got boring, writing seemed like a good idea. A lot of what I wrote would not make any sense to a sober person, but at the time, it made complete and total sense. Even now I understand what I meant.
 Still having a lot of open eye visuals such as the blinds dancing and the wood grain swirling. A great sensation of awakeness came over me at this point. I felt more awake and alert than I ever had in my entire life.
T + 4:30 I hadn't eaten a lot before the trip so I could be sure to avoid the nauseous side effects, so at this point I was very hungry. I decided to have a grilled cheese sandwich, it almost seemed tasteless. Chewing was very difficult, my jaw almost felt like it was glued shut. After I finally swallowed the first bite, it felt very uncomfortable, almost like I was going to choke. At that point I decided eating was a bad idea.
T + 5:00 Just going on 4am and the visuals are finally starting to wear off. I feel very awake and unable to fall asleep.
In all, it was an enjoyable trip. The feelings felt were very extreme, both emotionally and physically. I next plan on taking it and going to a techno club to see what fun I can have there.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Dortmund held at home by bottom side Paderborn in six-goal thriller
by Pulse News Agency International by AFPBorussia Dortmund captain Marco Reus equalised in added time to salvage a 3-3 draw at home to Bundesliga bottom side Paderborn as Friday's shock result left Dortmund coach Lucien Favre under pressure.
Dortmund, who face Barcelona away on Wednesday in the Champions League, were 3-0 down at half-time at Signal Iduna Park and out-played before launching a second-half fight back.
"We have to apologise to our fans for that performance, especially in the first-half," said Dortmund's visibly shaken captain Marco Reus.
 It's not on."
Paderborn striker Streli Mamba ran riot in the first-half with two goals before left wing Gerrit Holtmann grabbed the visitor's third just before the break.
It was a different story in the second-half as England winger Jadon Sancho gave Dortmund hope before Axel Witsel, then Reus both headed late goals to poach a point.
The draw leaves Dortmund fifth in the table, but they could finish the weekend eight points behind leaders Borussia Moenchengaldbach, who are at mid-table FC Union Berlin on Saturday.
Having been drubbed 4-0 away at Bayern Munich before the international break, Dortnund were again guilty of woeful defending in the first-half to put Favre in a precarious position.
Hosts Dortmund were behind with just five minutes gone when Paderborn winger Kai Proeger out-sprinted, then rode the tackle of Germany international Nico Schulz on the right flank.
With the defence beaten, Proeger passed inside for Mamba to tap home and silence home fans.
In response Dortmund pushed forward, but were punished for defending high up the pitch when Paderborn forward Ben Zolinski lifted the ball over the defence.
Mamba outsprinted Germany defender Julian Weigl to fire Paderborn 2-0 up on 37 minutes.
The visitor's third goal came two minutes before the break when Dortmund's Belgium Axel Witsel lost possession and Holtmann sprinted clear of Weigl to fire past home goalkeeper Roman Buerki.
Stunned Dortmund trudged off to a chorus of whistles from their fans at half-time.
Their CEO Hans-Joachim Watzke, watching in the stands, looked far from happy after such a weak display from his star-studded squad.
Favre reacted by bringing on the attack-minded trio of Julian Brandt, Thorgan Hazard and Achraf Hakimi for the second-half.
Dortmund flew out of the blocks with Sancho firing home after his captain Marco Reus had won back possession to make it 3-1 just two minutes into the second-half.
Paderborn still had plenty of fire and Mamba came within a whisker of grabbing his hat-trick after firing wide on 67 minutes.
With the final whistle approaching, Dortmund defender Mats Hummels hooked the ball across goal for Witsel to header home before Reus spared his side's blushes with the equaliser right at the end.
ryj


So, I was chatting about "helpers" with Ben Bangert on #webware, and thinking about adding stuff to __builtins__, like html_quote and the like. Hey, don't you judge me! Anyway, I think I like string.encode('html') more.
But anyway, I was thinking about how to make this stuff somewhat easier. And I was thinking about a discussion on Py-Dev about adding a dedent method to strings. The rationale was that inline strings that match up with surrounding whitespace need dedenting (ala textwrap.dedent). Why not just use textwrap.dedent? My opinion is that the value is too small for the overhead. And this kind of overhead happens often.
I also think the overhead shouldn't exist. Managing import statements is obnoxious. When they represent real dependencies or namespace operations that's fine -- I'd even say it is good. I like namespaces, really. But managing the imports is annoying.
In this case, I might be 100 lines into a module, and I'm writing a string. If I really want to use textwrap.dedent, I have to go up to the top of the file, add import textwrap and return to my previous location. And, since I know the standard library pretty well now and tend to use it, it is not uncommon for modules to start with 15 lines of imports.
Then I remember about the py-lib which has py.std. Using it I wouldn't have to import textwrap, I'd just use py.std.textwrap.dedent immediately. Does that string seem too long? I don't think so; it's not the length that is bothersome to me (it helps backtracking, and that's good), it's the disturbance of my workflow to add import statements, when I feel like I'm just feeding the compiler. There's good reasons to be explicit, but this is just as explicit as an import (maybe moreso). Unlike an import it is fully localized to the code fragment that uses the module.
Now putting std in __builtins__ is something I could stand behind.
"I have to go up to the top of the file"
No, you don't. If you want a local import, use a local import. Import != include; it's perfectly okay to import things only when and where you need them.
Yeah, but... There is a certain feeling of sequentialness involved in importing, #include-ing, and <!--#include-->ing everything atop the file, so that you can tell, at a glance, exactly which files have to be visible at parse/compile time to make the the code worky-worky.
# Chris
Adding stuff to __builtins__ is bad. BoboPOS, Principia, Zope 1 and 2 all did that - not very much, just a couple of things (maybe even just 1) - like get_transaction(). Not really knowing when or where that statement comes from makes it awfully painful to debug when you've got something breaking there.
A pattern that Zope 3 uses, and which I've started to adopt for my own projects, is a concept of API modules. The main one for Zope 3 is zapi, and it houses many common functions. And it doesn't define them - it pulls them in from other packages. The nice trick that Zope 3 does with zapi and the packages it pulls from is that it uses zope.interface. There's an interface defined for all of the modules an IZAPI sub-interfaces all of them. The zope.interface package then brings other niceties - it's easy to generate an __all__ for zapi so that no extra bits are accidentally included in the zapi namespace; and it ties in to Zope 3's API documentation tool like all other registered interfaces, so it's easy to look up to see the documentation on any of the items in the API. The API doesn't define any new objects - as far as I've found there's no zapi.foo.bar or deeper nesting. It's a flat namespace. Many of the functions are things that are commonly used to query the greater registries of the component architecture.
And lastly - zapi pulls things into it. I can't start pushing my own things in there (well, I probably could without much clever hacking, but it would defeat the purpose). It's nice knowing that its behavior is the same everywhere.
Anyways, I've started implementing something like this in a toolkit that I've been building on top of Zope. I noticed there were some very common functions that I was using - a lot - so I started following the same model. It's a nice solution, I think - I only put items into the API that are proving to be very common. They're well documented. They're all kept in the packages that make sense to them and then collected together by myapi, and now I have easy access to myapi.flash(...) and myapi.getCacheForObject() (Zope 3's getCacheForObject didn't do enough for me, so I wrote my own). Something has to earn its spot in there. So far, it's working out quite nice
But other than that - I honestly don't mind managing the imports. VIM makes it so easy to jump to the top of the document and back to where I was editing; most of the time if I need to do a few imports I just split the frame so I can jump up to the imports in one frame while still seeing my code on the bottom (so I remember what I'm importing). I've also started using its "search for this word exactly" feature (# and * keys) to quickly scan through my imports when the list looks really big and I want to quickly check if I'm still using all the named items. In other editors too, if I need access to my import list, it's no big thing to just split the frame and always keep the imports on top.
Or I just program away and then run the code and go "d'oh!" for every name error that comes from me forgetting to import because I didn't want to interrupt my workflow. But that doesn't happen much.
Anyways - I think that import is one of the best things about Python. It's the first thing that I miss when I have to use just about any other language out there.
I propose this as something that is entirely complimentary to importing, not in conflict with it. If you understand what std means, then it's also just as explicit as importing. It's really just another import mechanism which is more convenient in certain (fairly common) circumstances. One could argue (as the paragraph on py.std does) that this is actually more explicit because it never allows module-relative imports. I think it's only really useful if it is idiomatic, or even better built in (without hacking __builtins__), but it's a very simple idiom. The implementation in the py lib is actually just this:
import sys class Std(object): def __init__(self): self.__dict__ = sys.modules def __getattr__(self, name): try: m = __import__(name) except ImportError: raise AttributeError("py.std: could not import %s" % name) return m std = Std()# Ian Bicking
+1
- Aside: one of the things I hate most (there aren't many) coming to Python from Java is the ability to import a package and then be able to navigate to any subpackage using dot notation. Example:
>>> import PythonCard >>> PythonCard.components.button Traceback (most recent call last): File "<stdin>", line 1, in ? AttributeError: 'module' object has no attribute 'components'- I have a dream of being able to do this (does anyone else hate the from keyword?):
>>> import my.deeply.nested.package.function as func # results in error- Which usually starts out as:
>>> import my.deeply.nested.package as package >>> package.function(...)- And then mutates to this when we realize we're only using a single function in that package:
>>> from my.deeply.nested.package import function as funcAnd that requires me to rearrange the entire line, which is annoying. And as if that weren't enough trouble with Python's import mechanism, why in the heck couldn't they make the __import__ function "just work" like it's supposed to (i.e. col = __import__("sqlobject.col") should have the same effect as import sqlobject.col as col)?
Maybe the "std" object could be enhanced to fix that problem too. The only downside I can see here might be performance (try exploring std in Pyshell--it's a bit slow on my PIII 733 (then again, Eclipse is nearly useless on this machine)). On the positive side, it's much easier to explore the standard library this way, which is another thing I miss from Java. Eclipse allowed me to explore Java api's through the auto-complete feature, providing JavaDoc tooltips when available--very productive. But now I'm asking for a good IDE which is an entirely different subject. I guess I should check out PyDev again sometime.
Wow, I think you hit a sore spot there.


New York Times Search
Search Terms
Keywords:
Number to Retrieve:
Start year:
End year:
Search
Clear
something


public class Student extends HSQLDatabaseObject
| Constructor and Description |
|---|
Student(java.lang.String name) |
Student(java.lang.String[] parts) |
Student(java.lang.String firstName,
java.lang.String lastName)
Constructor for the Student object.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getEmailAddress() |
java.lang.String |
getFirstName() |
java.lang.String |
getLastName() |
java.lang.String |
getMiddleInitial() |
java.lang.String |
getStudentID() |
void |
setEmail(java.lang.String emailAddress) |
void |
setID(java.lang.String uniqueID) |
getID, setID
public Student(java.lang.String firstName, java.lang.String lastName)
firstName
- The student's first name.lastName
- The student's last name.public Student(java.lang.String name)
name
- A string including the student's name. It is split on any
occurrence of whitespace in the standard regular expression
whitespace class (tab, newline, space, vertical tab) and passed
through the Student(String[] name) constructor.public Student(java.lang.String[] parts)
parts
- A string array containing a student's name in parts. The
first String located longer than one character is assumed to be
the first name, the next string longer than one character is
assumed to be the last name, and the first occurrence of any
string exactly one character in length is assumed to be the
Student's middle initial. If at any point a first name, last
name, and middle initial are believed to be found, the constructor
stops processing the array and constructs the object at that point.public java.lang.String getFirstName()
public java.lang.String getLastName()
public java.lang.String getMiddleInitial()
public java.lang.String getStudentID()
public java.lang.String getEmailAddress()
public void setID(java.lang.String uniqueID)
uniqueID
- A new school ID for the student.public void setEmail(java.lang.String emailAddress)
emailAddress
- A new email address for the student.


OpenAPI Automation Framework Support
This add-on supports the Automation Framework.
The add-on will add OpenAPI definitions if they are found while spidering but adding them explicitly via a URL or local file is recommended if they are available.
The targetUrl parameter works in the same way per 'Target URL Format'.
Job: openapi
The openapi job allows you to import OpenAPI definitions via a URL or file.
- type: openapi # OpenAPI definition import
parameters:
apiFile: # String: Local file containing the OpenAPI definition, default: null, no definition will be imported
apiUrl: # String: URL containing the OpenAPI definition, default: null, no definition will be imported
targetUrl: # String: URL which overrides the target defined in the definition, default: null, the target will not be overriden


Yay, the form is valid!
GentleForm
Accessible and user-friendly HTML5 form validation library.
GitHub Repo
-
Tweet!
Name:
This field is required.
Email:
This field is required.
Please enter a valid email address.
Phone number:
Please enter a valid phone number.
Password
(minimum 6 characters)
:
This field is required.
Your password should be at least 6 characters long.


home
|
features
|
getting started
|
FAQ
|
Stone
|
Iron
|
download
|
help
|
about
Features
- Modern C++11 code
- Standard, portable C++ code.
- No dependancies, except for the BWAPI library.
- Provides useful debugging tools (print the map into a file, onto the screen)
- Provides common and expected high level abstractions: areas, choke points, bases.
- Provides relevant, low level representations: tiles and mini-tiles.
- Provides distance to nearest edge, for each mini-tile.
- Provides paths and ground distance.
- Handles blocking mineral patches and blocking static buildings
- Handles stacked mineral patches and stacked static buildings
- Handles minerals that need to be gathered before a base can be built.
- Dynamic: Paths and ground distance are automatically updated when blocking items get destroyed
- Robust: performs well for all the maps tested (including Crystallis.scm)
- Fast analysis: performs in less then 1 second
- Scales: Frozen Sea.scx analysis still performs in less then 1 second
- Fast access: almost all the functionality is O(1), including paths and ground distance.
- Memory used < 128 x number of tiles
- Extensible : provides free-to-use data for main types.
home
|
features
|
getting started
|
FAQ
|
Stone
|
Iron
|
download
|
help
|
about


KKCarPlayManager
KKCarPlayManager provides a simple, clear and declarative way to implement the functionalities of CarPlay.
Requirement
- Xcode
- Swift 4.2 or above
- iOS 8.0 or above
Installation
You can install the package via Swift Package Manager or CocoaPods.
CocoaPods
Add KKCarPlayManager
to your pod file, then run pod install
.
Swift Package Manager
Just add https://github.com/KKBOX/KKCarPlayManager.git
to your Package.swift
file, or, you can add the package in Xcode 11 by selecting File
-> Swift
Packages
-> Add Package Dependency
.
Example
The project has an example project. Go to the Example
folder, run pod install
,
open Example.xcworkspace
, build and run the example app.
Getting Started
Apple does not allow a CarPlay audio app to customize user interface./
KKCarPlayManager helps you to build your contents into a tree to be discovered. KKCarPlayManager already implemented the data source and delegate of MPPlayableContentManager for you, and all you need to do is to give KKCarPlayManager a root node and its subnodes. For example:
// Import required modules.
import KKCarPlayManager
import MediaPlayer
import AVFoundation
// You should set at least one command of MPRemoteCommandCenter, otherwise
// MPPlayableContentManager won't call it data source and delegate.
MPRemoteCommandCenter.shared().playCommand.addTarget { event in
return .success
}
// Create a root node.
let rooNode = KKStaticContainerItem(identifier: "root", title: "Root", children: [
KKStaticContainerItem(identifier: "folder1", title: "Folder 1", children: [
PlayItem(identifier: "Song_1_1", title: "Song name", url: "song URL..."),
PlayItem(identifier: "Song_1_2", title: "Song name", url: "song URL..."),
]),
KKStaticContainerItem(identifier: "folder_2", title: "Folder 2", children: [
PlayItem(identifier: "Song_2_1", title: "Song name", url: "song URL..."),
PlayItem(identifier: "Song_2_2", title: "Song name", url: "song URL...")
]),
]
)
// Create your manager.
manager = KKCarPlayManager(rootNode: rooNode)
// Sets the data source and delegate of MPPlayableContentManager to the manager.
manager?.activate()
Actually these nodes are instances of KKBasicContentItem
. It is a subclass of
MPContentItem
, and you can subclass KKBasicContentItem
for your own need.
Items/Nodes
We added three methods on KKBasicContentItem
:
KKBasicContentItem.children
: A list ofKKBasicContentItem
.KKBasicContentItem.loadChildren(callback:)
: Ask the item to load its children.KKBasicContentItem.play(callback:)
: Play the item.
There are two kinds of items/nodes, one is containers while another is playable items.
Containers
A container could be list a playlist or an album. It has it children. When you
select a container on the CarPlay screen,
KKBasicContentItem.loadChildren(callback:)
would be called and the CarPlay
screen goes to the next level and present its children items in a table UI.
If you want to load children items from a file or from the Internet, subclass a
KKBasicContentItem, set isPlayable
to false and isContainer
to true, do your
loading in KKBasicContentItem.loadChildren(callback:)
and remember to call the
callback closure.
KKCarPlayManager made a built-in container item type, KKStaticContainerItem
. You
can just use the class if you have a static list.
Playable Items
A playable item could be a song track, an audio book and so on. When a playable
item is selected, the KKBasicContentItem.play(callback:)
method would be
called and your app should start playing. You should create your own subclasses
for playable items in your app, since we are hardly to know how your player
works and creates classes for you.
If there is any error while playing, call the callback closure and pass the
error, otherwise you can pass nil
.
A Full CarPlay Experience
When you want to enable CarPlay in your audio app,
- You need to have a valid provision profile/entitlement, otherwise your app won’t appear on the CarPlay screen. Please contact Apple.
- You need to enable some commands of MPRemoteCommandCenter, otherwise
MPPlayableContentManager
won’t call its data source and delegate. - Enable audio background mode and set the current category of AVAudioSession
to
.playback
, in order to enable background playabck. - Set up KKCarPlayManager as we mentioned above.
- Once there are changes in your tree, call
MPPlayableContentManager.shared().beginUpdates()
andMPPlayableContentManager.shared().endUpdates()
. - Provide now playing information to MPNowPlayingInfoCenter.
One More Thing
On Xcode 11, you can use Swift UI like syntax to construct the node after
importing KKCarPlayManagerExtensions
. For example:
let rooNode = KKStaticContainerItem(identifier: "root", title: "Root") {
KKStaticContainerItem(identifier: "folder1", title: "Folder 1") {
PlayItem(identifier: "Song_1_1", title: "Song name", url: "song URL...")
PlayItem(identifier: "Song_1_2", title: "Song name", url: "song URL...")
}
KKStaticContainerItem(identifier: "folder_2", title: "Folder 2") {
PlayItem(identifier: "Song_2_1", title: "Song name", url: "song URL...")
PlayItem(identifier: "Song_2_2", title: "Song name", url: "song URL...")
}
}
Enjoy! 🚗


NOTICE: The information presented here is severely outdated. Blizzard has made numerous changes to the drop rates, introduced per spec Bad Luck Protection™ and added craftable legendaries meaning this calculator is no longer relevant.
I'm leaving this up for entertainment purposes only.


CSS-Sprite-Positionizr
Here you get the positiondata for your sprite piece
Sectionpreview
Normal
Change the values to the correct position.
Retina
You can also use the arrow-keys.
x:
px
y:
px
width:
px
height:
px
x:
px
y:
px
width:
px
height:
px
Spritearea
Click to set the left/top position of your selected piece.
Drag & drop and also use the arrow-keys to positionize the selected piece.
width:
px height:
px
Spriteimage
Absolute pathes are possible too
Generated css
Click to copy the css into clipboard
url:


Actor References, Paths and Addresses
This chapter describes how actors are identified and located within a possibly distributed actor system. It ties into the central idea that Actor Systems form intrinsic supervision hierarchies as well as that communication between actors is transparent with respect to their placement across multiple network nodes.
The above image displays the relationship between the most important entities within an actor system, please read on for the details.
What is an Actor Reference?
An actor reference is a subtype of ActorRef, whose foremost purpose is to support sending messages to the actor it represents. Each actor has access to its canonical (local) reference through the self field; this reference is also included as sender reference by default for all messages sent to other actors. Conversely, during message processing the actor has access to a reference representing the sender of the current message through the sender method.
There are several different types of actor references that are supported depending on the configuration of the actor system:
- Purely local actor references are used by actor systems which are not configured to support networking functions. These actor references will not function if sent across a network connection to a remote JVM.
- Local actor references when remoting is enabled are used by actor systems which support networking functions for those references which represent actors within the same JVM. In order to also be reachable when sent to other network nodes, these references include protocol and remote addressing information.
- There is a subtype of local actor references which is used for routers (i.e. actors mixing in the Router trait). Its logical structure is the same as for the aforementioned local references, but sending a message to them dispatches to one of their children directly instead.
- Remote actor references represent actors which are reachable using remote communication, i.e. sending messages to them will serialize the messages transparently and send them to the remote JVM.
- There are several special types of actor references which behave like local
actor references for all practical purposes:
- PromiseActorRef is the special representation of a Promise for the purpose of being completed by the response from an actor. akka.pattern.ask creates this actor reference.
- DeadLetterActorRef is the default implementation of the dead letters service to which Akka routes all messages whose destinations are shut down or non-existent.
- EmptyLocalActorRef is what Akka returns when looking up a non-existent local actor path: it is equivalent to a DeadLetterActorRef, but it retains its path so that Akka can send it over the network and compare it to other existing actor references for that path, some of which might have been obtained before the actor died.
- And then there are some one-off internal implementations which you should
never really see:
- There is an actor reference which does not represent an actor but acts only as a pseudo-supervisor for the root guardian, we call it “the one who walks the bubbles of space-time”.
- The first logging service started before actually firing up actor creation facilities is a fake actor reference which accepts log events and prints them directly to standard output; it is Logging.StandardOutLogger.
What is an Actor Path?
Since actors are created in a strictly hierarchical fashion, there exists a unique sequence of actor names given by recursively following the supervision links between child and parent down towards the root of the actor system. This sequence can be seen as enclosing folders in a file system, hence we adopted the name “path” to refer to it, although actor hierarchy has some fundamental difference from file system hierarchy.
An actor path consists of an anchor, which identifies the actor system, followed by the concatenation of the path elements, from root guardian to the designated actor; the path elements are the names of the traversed actors and are separated by slashes.
What is the Difference Between Actor Reference and Path?
An actor reference designates a single actor and the life-cycle of the reference matches that actor’s life-cycle; an actor path represents a name which may or may not be inhabited by an actor and the path itself does not have a life-cycle, it never becomes invalid. You can create an actor path without creating an actor, but you cannot create an actor reference without creating corresponding actor.
You can create an actor, terminate it, and then create a new actor with the same actor path. The newly created actor is a new incarnation of the actor. It is not the same actor. An actor reference to the old incarnation is not valid for the new incarnation. Messages sent to the old actor reference will not be delivered to the new incarnation even though they have the same path.
Actor Path Anchors
Each actor path has an address component, describing the protocol and location by which the corresponding actor is reachable, followed by the names of the actors in the hierarchy from the root up. Examples are:
"akka://my-sys/user/service-a/worker1" // purely local
"akka.tcp://my-sys@host.example.com:5678/user/service-b" // remote
Here, akka.tcp is the default remote transport for the 2.4 release; other transports are pluggable. The interpretation of the host and port part (i.e. host.example.com:5678 in the example) depends on the transport mechanism used, but it must abide by the URI structural rules.
Logical Actor Paths
The unique path obtained by following the parental supervision links towards the root guardian is called the logical actor path. This path matches exactly the creation ancestry of an actor, so it is completely deterministic as soon as the actor system’s remoting configuration (and with it the address component of the path) is set.
Physical Actor Paths
While the logical actor path describes the functional location within one actor system, configuration-based remote deployment means that an actor may be created on a different network host than its parent, i.e. within a different actor system. In this case, following the actor path from the root guardian up entails traversing the network, which is a costly operation. Therefore, each actor also has a physical path, starting at the root guardian of the actor system where the actual actor object resides. Using this path as sender reference when querying other actors will let them reply directly to this actor, minimizing delays incurred by routing.
One important aspect is that a physical actor path never spans multiple actor systems or JVMs. This means that the logical path (supervision hierarchy) and the physical path (actor deployment) of an actor may diverge if one of its ancestors is remotely supervised.
Actor path alias or symbolic link?
As in some real file-systems you might think of a “path alias” or “symbolic link” for an actor, i.e. one actor may be reachable using more than one path. However, you should note that actor hierarchy is different from file system hierarchy. You cannot freely create actor paths like symbolic links to refer to arbitrary actors. As described in the above logical and physical actor path sections, an actor path must be either logical path which represents supervision hierarchy, or physical path which represents actor deployment.
How are Actor References obtained?
There are two general categories to how actor references may be obtained: by creating actors or by looking them up, where the latter functionality comes in the two flavours of creating actor references from concrete actor paths and querying the logical actor hierarchy.
Creating Actors
An actor system is typically started by creating actors beneath the guardian actor using the ActorSystem.actorOf method and then using ActorContext.actorOf from within the created actors to spawn the actor tree. These methods return a reference to the newly created actor. Each actor has direct access (through its ActorContext) to references for its parent, itself and its children. These references may be sent within messages to other actors, enabling those to reply directly.
Looking up Actors by Concrete Path
In addition, actor references may be looked up using the ActorSystem.actorSelection method. The selection can be used for communicating with said actor and the actor corresponding to the selection is looked up when delivering each message.
To acquire an ActorRef that is bound to the life-cycle of a specific actor you need to send a message, such as the built-in Identify message, to the actor and use the sender() reference of a reply from the actor.
Absolute vs. Relative Paths
In addition to ActorSystem.actorSelection there is also ActorContext.actorSelection, which is available inside any actor as context.actorSelection. This yields an actor selection much like its twin on ActorSystem, but instead of looking up the path starting from the root of the actor tree it starts out on the current actor. Path elements consisting of two dots ("..") may be used to access the parent actor. You can for example send a message to a specific sibling:
context.actorSelection("../brother") ! msg
Absolute paths may of course also be looked up on context in the usual way, i.e.
context.actorSelection("/user/serviceA") ! msg
will work as expected.
Querying the Logical Actor Hierarchy
Since the actor system forms a file-system like hierarchy, matching on paths is possible in the same way as supported by Unix shells: you may replace (parts of) path element names with wildcards («*» and «?») to formulate a selection which may match zero or more actual actors. Because the result is not a single actor reference, it has a different type ActorSelection and does not support the full set of operations an ActorRef does. Selections may be formulated using the ActorSystem.actorSelection and ActorContext.actorSelection methods and do support sending messages:
context.actorSelection("../*") ! msg
will send msg to all siblings including the current actor. As for references obtained using actorSelection, a traversal of the supervision hierarchy is done in order to perform the message send. As the exact set of actors which match a selection may change even while a message is making its way to the recipients, it is not possible to watch a selection for liveliness changes. In order to do that, resolve the uncertainty by sending a request and gathering all answers, extracting the sender references, and then watch all discovered concrete actors. This scheme of resolving a selection may be improved upon in a future release.
Summary: actorOf vs. actorSelection
Note
What the above sections described in some detail can be summarized and memorized easily as follows:
- actorOf only ever creates a new actor, and it creates it as a direct child of the context on which this method is invoked (which may be any actor or actor system).
- actorSelection only ever looks up existing actors when messages are delivered, i.e. does not create actors, or verify existence of actors when the selection is created.
Actor Reference and Path Equality
Equality of ActorRef match the intention that an ActorRef corresponds to the target actor incarnation. Two actor references are compared equal when they have the same path and point to the same actor incarnation. A reference pointing to a terminated actor does not compare equal to a reference pointing to another (re-created) actor with the same path. Note that a restart of an actor caused by a failure still means that it is the same actor incarnation, i.e. a restart is not visible for the consumer of the ActorRef.
If you need to keep track of actor references in a collection and do not care about the exact actor incarnation you can use the ActorPath as key, because the identifier of the target actor is not taken into account when comparing actor paths.
Reusing Actor Paths
When an actor is terminated, its reference will point to the dead letter mailbox, DeathWatch will publish its final transition and in general it is not expected to come back to life again (since the actor life cycle does not allow this). While it is possible to create an actor at a later time with an identical path—simply due to it being impossible to enforce the opposite without keeping the set of all actors ever created available—this is not good practice: messages sent with actorSelection to an actor which “died” suddenly start to work again, but without any guarantee of ordering between this transition and any other event, hence the new inhabitant of the path may receive messages which were destined for the previous tenant.
It may be the right thing to do in very specific circumstances, but make sure to confine the handling of this precisely to the actor’s supervisor, because that is the only actor which can reliably detect proper deregistration of the name, before which creation of the new child will fail.
It may also be required during testing, when the test subject depends on being instantiated at a specific path. In that case it is best to mock its supervisor so that it will forward the Terminated message to the appropriate point in the test procedure, enabling the latter to await proper deregistration of the name.
The Interplay with Remote Deployment
When an actor creates a child, the actor system’s deployer will decide whether the new actor resides in the same JVM or on another node. In the second case, creation of the actor will be triggered via a network connection to happen in a different JVM and consequently within a different actor system. The remote system will place the new actor below a special path reserved for this purpose and the supervisor of the new actor will be a remote actor reference (representing that actor which triggered its creation). In this case, context.parent (the supervisor reference) and context.path.parent (the parent node in the actor’s path) do not represent the same actor. However, looking up the child’s name within the supervisor will find it on the remote node, preserving logical structure e.g. when sending to an unresolved actor reference.
What is the Address part used for?
When sending an actor reference across the network, it is represented by its path. Hence, the path must fully encode all information necessary to send messages to the underlying actor. This is achieved by encoding protocol, host and port in the address part of the path string. When an actor system receives an actor path from a remote node, it checks whether that path’s address matches the address of this actor system, in which case it will be resolved to the actor’s local reference. Otherwise, it will be represented by a remote actor reference.
Top-Level Scopes for Actor Paths
At the root of the path hierarchy resides the root guardian above which all other actors are found; its name is "/". The next level consists of the following:
- "/user" is the guardian actor for all user-created top-level actors; actors created using ActorSystem.actorOf are found below this one.
- "/system" is the guardian actor for all system-created top-level actors, e.g. logging listeners or actors automatically deployed by configuration at the start of the actor system.
- "/deadLetters" is the dead letter actor, which is where all messages sent to stopped or non-existing actors are re-routed (on a best-effort basis: messages may be lost even within the local JVM).
- "/temp" is the guardian for all short-lived system-created actors, e.g. those which are used in the implementation of ActorRef.ask.
- "/remote" is an artificial path below which all actors reside whose supervisors are remote actor references
The need to structure the name space for actors like this arises from a central and very simple design goal: everything in the hierarchy is an actor, and all actors function in the same way.  This powerful principle means that there are no quirks to remember, it makes the whole system more uniform and consistent.
If you want to read more about the top-level structure of an actor system, have a look at The Top-Level Supervisors.
Contents