Chapter 3 Structuring an Emissions Inventory
The description file of vein says:
Elaboration of vehicular emissions inventories, consisting in four stages,
- pre-processing activity data,
- preparing emissions factors,
- estimating the emissions and
- post-processing of emissions in maps and databases.
This means that vein provide functions to be used in each of the stages. However, in order follow these stages it is needed a structure of directories with scripts with vein functions. Therefore, it was created the function inventory
, to create this structure.
3.1 Overview of emissions inventorying using VEIN
3.2 The inventory
function
The inventory function creates creates a structure of directories and scripts to run vein. This structure is a suggestion and the user can use any other. The following code shows the arguments of the function. This is done using the base function args
with inventory
.
args(inventory)
## function (name, vehcomp = c(PC = 1, LCV = 1, HGV = 1, BUS = 1,
## MC = 1), scripts = TRUE, show.dir = TRUE, show.scripts = FALSE,
## clear = TRUE, rush.hour = FALSE)
## NULL
The arguments are name
, vehcomp
, scripts
, show.dir
, show.scripts
and clear
.
- The argument
name
name is a word to be used as main directory where directories and scripts are stored in. It consists in one word with ascii characters. It is also recommended to be used without any special character or accents, for instance:
name = file.path(tempdir(), "YourCity")
inventory(name = name, show.dir = TRUE, show.scripts = TRUE)
- The argument
vehcomp
This argument is very important and comes from Vehicular Composition, which is the classification of the fleet by type of use, type of fuel, size of engine and gross weight, based on definitions of Corvalán, Osses, and Urrutia (2002). There is also the technological composition of the fleet which relates the technological modifications of the car in order to accomplish the emissions standards. However, in vein uses a distribution by age of use as 4 shows.
The vehicular composition vehcomp
has 5 types of vehicles:
- Passenger Carss (PC).
- Light Commercial Vehicles (LCV).
- Heavy Good Vehicles or trucks (HGV).
- Buses (BUS).
- Motorcycles (MC).
The default value of this argument is: c(PC = 1, LCV = 1, HGV = 1, BUS = 1, MC = 1)
, which means that there are 1 types of PC, 1 of LCV, 1 of trucks, 1 of buses and 1 types of motorcycles. This vehicular composition is only for ilutrasting that the user can chnge these values according its own data. Appendix B shows the vehicular composition from the vehicular emissions inventory of the Environmental Agency of São Paulo, Brazil (CETESB 2015). In Brazil, the fuel used in vehicles is blended with ethanol with and biodiesel. The user can use any vehicular composition that representes its fleet with up-to 99 type of vehicles per category. For instance, if there are 4 types of PC in a fleet, PC = 4
, and each one has a age of use distribution.
- The argument
show.dir
This is a logical argument to decide if the output of the function will return print the new directories or not. The use is:
name = file.path(tempdir(), "YourCity")
inventory(name = name, show.dir = TRUE, show.scripts = FALSE)
## files at /tmp/Rtmp3yqgZh/YourCity
## Directories:
## [1] "/tmp/Rtmp3yqgZh/YourCity"
## [2] "/tmp/Rtmp3yqgZh/YourCity/ef"
## [3] "/tmp/Rtmp3yqgZh/YourCity/emi"
## [4] "/tmp/Rtmp3yqgZh/YourCity/emi/BUS_01"
## [5] "/tmp/Rtmp3yqgZh/YourCity/emi/HGV_01"
## [6] "/tmp/Rtmp3yqgZh/YourCity/emi/LCV_01"
## [7] "/tmp/Rtmp3yqgZh/YourCity/emi/MC_01"
## [8] "/tmp/Rtmp3yqgZh/YourCity/emi/PC_01"
## [9] "/tmp/Rtmp3yqgZh/YourCity/est"
## [10] "/tmp/Rtmp3yqgZh/YourCity/images"
## [11] "/tmp/Rtmp3yqgZh/YourCity/network"
## [12] "/tmp/Rtmp3yqgZh/YourCity/post"
## [13] "/tmp/Rtmp3yqgZh/YourCity/post/df"
## [14] "/tmp/Rtmp3yqgZh/YourCity/post/grids"
## [15] "/tmp/Rtmp3yqgZh/YourCity/post/streets"
## [16] "/tmp/Rtmp3yqgZh/YourCity/profiles"
## [17] "/tmp/Rtmp3yqgZh/YourCity/veh"
inventory
creates the direcrory “YourCity” and the sub directories: daily, ef, emi, est, images, network and veh.
- daily: it is for storing the profiles saved as .csv files. For instance,
data(pc_profile)
is a matrix than could be saved as .csv. - ef: it is for storing the emission factors data-frame, similar to
data(fe2015)
but including one column for each of the categories of the vehicular composition. For instance, if PC = 5, there should be 5 columns with emission factors in this file. If LCV = 5, another 5 columns should be present, and so on. - emi: Directory with subdirectories matching the vehicular composition for saving the estimates. It is suggested to use .rds extension instead of .rda.
- est: Directory with subdirectories matching the vehicular composition for for storing the scripts named
input.R
. - images: Directory for saving images.
- network: Directory for saving the road network with the required attributes. This file will include the vehicular flow per street to be used by functions
age_ldv
,age_hdv
,age_moto
ormy_ldv
. - post: Directory for storing the processed emissions. It includes the directories df for emissions by age of use, hou and other parameters, streets for storing the total emissions by streets and grids for storing total gridded emissions by pollutant.
- veh: Directory for storing the distribution by age of use of each category of the vehicular composition. Those are data-frames with number of columns with the age distribution and the number of rows as the number of streets. The class of these objects is “Vehicles”.
devt - The argument scripts
This argument adds scripts into the directories. The default is TRUE. The type of scrits create are:
- main.R: Adds the
setwd("YourCity")
,library(vein)
,source(traffic.R)
, some comments and a loop for source all inputs. It is recommended not using the loop till it is certain that all scripts are correct. - traffic.R: Includes two lines with exampmles of how to use the
age_ldv
function and saving the output in the directory veh. input.R: Each file has the scripts for reading the network, vehicles, emission factors and estimating emissions.
The argument
show.scripts
This argument prints the scripts created:
name = file.path(tempdir(), "YourCity")
inventory(name = name, show.dir = FALSE, show.scripts = TRUE)
## files at /tmp/Rtmp3yqgZh/YourCity
## Scripts:
## [1] "est/BUS_01_input.R" "est/HGV_01_input.R" "est/LCV_01_input.R"
## [4] "est/MC_01_input.R" "est/PC_01_input.R" "main.R"
## [7] "post.R" "traffic.R"
- The argument
clear
This is a logical argument that deletes recursively when TRUE, or not when FALSE, the directory and created another one. Default is TRUE.
The following chapters show the use of other vein functions inside an structure of directories and scripts with the name inventory("YourCity")
.
Appendix B
Corvalán, Roberto M, Mauricio Osses, and Cristian M Urrutia. 2002. “Hot Emission Model for Mobile Sources: Application to the Metropolitan Region of the City of Santiago, Chile.” Journal of the Air & Waste Management Association 52 (2). Taylor & Francis: 167–74.
CETESB. 2015. “Emissões Veiculares No Estado de São Paulo 2014.”


WITNESS LIST Intergovernmental Relations Committee February 25, 1998-9:00A Interim Charges On: Barr, Kenneth (City of Fort Worth), Fort Worth Holland, Royce (Allegiance Telecom, Inc), Dallas Jeter, Roland (City of Irving), Irving Kirk, Ronald (City of Dallas), Dallas Knight, Donald K. (City of Irving), Irving Muelenbeck, Thomas (City of Plano), Plano Mundy, William G. (GTE), Irving Smiley, Martha (Golden Harbor of Texas), San Marcos Todd, Dynette (Texas Citizen Action), Arlington Turetsky, David (Teligent, Inc.), Vienna Registering, but not testifying: On: Endar, Lynda (State Sen. David Cain), Dallas Humbach, Greg (City of Wichita Falls), Wichita Falls Postell, Donald (City of Grand Prairie), Grand Prairie


Room Service
No matter what you're craving, Restaurant to Room has you covered. Our fast and friendly delivery service brings you hot, fresh food, from a diverse choice of local restaurants.
- Dinner Destiny
- Eat Your Veggies Café
- Food Rendevous
- Jeffrey's on the Square
- Legume Palace
- Pickles & Pepperoni Deli
- Picky Palate
- Simply Safe
- Supreme & Fancy Pizza
- Totally Fishy
Simply fill out the online form below, and we'll have food delivered directly to your room, within an hour, or your meal is free. The only difficult part is choosing. (Sorry, we can't help you with that.)


{% extends "_base.html" %} {% block content %}
Your API key is a token the AcoustID web service uses to identify yourself when you submit fingerprints. The following key can be used in any AcoustID-enabled application:
{{ apikey }}
Generate a new API key


--- layout: default body-class: videos title: Videos – webtwic keywords: whizkydee, Olaolu Olawuyi, webtwic, programming, software, code, tech, computer stuff, games, cheatsheet, html, css, javascript, php, hacking, hack, websites, website development, web development, design, ui, ux ---


{{ campaign?.description }}
{{ campaign?.reject_message }}
Raised {{ campaign?.raised | currency:'Rs. ' }}


This test tests whether we can insert a Thai character after a Thai "prepend" character.
If this test succeeds, you can see a string "succeeded" below.


ESFileManagerProtocol
public protocol ESFileManagerProtocol
Protocol for Manager for write and read file from bundle
-
write data file to disk at directory. For default directory from init set at: nil
Declaration
Swift
func write(file: ESFileModel, at directory: ESFileManagerDirectory?, completion: ((Error?) -> Void)?)
Parameters
completion
completion block with optional Error
file
file to write
directory
directory to write. Set nil for directory from init
-
Read data file from disk at directory. For default directory from init set at: nil
Declaration
Swift
func read(fileStorage: ESFileNameModel, at directory: ESFileManagerDirectory?, completion: ((ESFileModel?, Error?) -> Void)?)
Parameters
completion
completion block with optional data from storage
fileStorage
file name and extension
directory
directory to write. Set nil for directory from init
-
Remove file from disk at directory. For default directory from init set at: nil
Declaration
Swift
func remove(file: ESFileNameModel, at directory: ESFileManagerDirectory?, completion: ((Error?) -> Void)?)
Parameters
completion
completion block with optional Error
file
file to remove
-
Get list files in storage at directory. For default directory from init set at: nil
Declaration
Swift
func listFiles(at directory: ESFileManagerDirectory?, completion: (([ESFileNameModel]?, Error?) -> Void)?)
Parameters
completion
callback block with array of files.
directory
directory. Set nil for directory from init


--- title: Getting ZeroMQ and jzmq running on Mac OS X layout: post ---
From: http://blog.pmorelli.com/getting-zeromq-and-jzmq-running-on-mac-os-x
I found the install to be a tad onerous, with enough gaps and issues to be worth documenting, so here are the steps.
I'm on Mac OS X Snow Leopard, 10.6.5. I use Homebrew as my package installer (on top of RVM, which I love.) At some point, I should create a Homebrew formula for this.
Credit to these links for the fixing the problems I ran into.
- https://github.com/zeromq/jzmq/issues/issue/6
- http://stackoverflow.com/questions/3522248/how-do-i-compile-jzmq-for-zeromq-o...
- https://github.com/yawn/jzmq/blob/master/README
1. Install ZeroMQ.
brew install zeromq
2. Install pkg-config. you'll need it for the jzmq build.
brew install pkg-config
3. You'll have to symlink pkg.m4 into /usr/share/aclocal, also for the jzmq build.
sudo ln -s /usr/local/share/aclocal/pkg.m4 /usr/share/aclocal/pkg.m4
4. Install the Java Developer Package from Apple's ADC site: http://connect.apple.com/. You'll need it because for whatever reason, the included JDK install on Mac OS X moved the /include directory, which contains the jni.h file, to some other location besides the directory containing /bin and /lib. I suppose I could have symlinked it, but this seemed cleaner. From their docs:
The Java Developer package puts an additional copy of the Java SE 6 bundle in
/Library/Java/JavaVirtualMachines/
. This copy is installable without disturbing the existing system JDK.The download, since Apple doesn't like direct links, is under Downloads > Java. I used the Java for Mac OS X 10.6 Update 3 Developer Package download.
5. Set your JAVA_HOME to point to the new JDK. I usually stick this in .bash_profile.
export JAVA_HOME=$(/usr/libexec/java_home)
6. Download jzmq, the java JNI lib for zmq. Uncompress and cd into that dir, and build it:
./autogen.sh ./configure make make installYou'll end up with the zmq.jar in /usr/local/share/java/ and the native lib in /usr/local/lib
7. Fire up your favorite IDE (I use Intellij), create a new project, and add the zmq.jar to your project.
8. However you run your code, you'll want to pass the following flag to the VM as an arg. It tells it where to find the native lib
-Djava.library.path=/usr/local/libIn Intellij, this is in Run > Edit Configurations > New > VM Parameters
9. Finally, paste the code from the article into a new class, and run. Yay.
That should be it, let me know if you run into any issues.
This is a handy reference for getting 0MQ for Java working on OS X. This works on both Snow Leopard and Lion.
I would suggest using "./configure --prefix=/usr" in step 6 so as not to require step 8 at all, but its up to you.


Diff View
Show same files
Show added files
Show deleted files
Show changed files
Show files with diff
Name
Original version
Revised version
Action
<#list deltas as delta>
${delta.path}
${delta.originalVersion}
${delta.revisedVersion}
${delta.diff}
#list>


What the Software Does
Our software has been coded using a machine learning algorithim, which predicts the likelyhood of fire outbreaks in risk areas. Working alongside our arduino device, we gather temperature, humidity, wind speed and other measurements then run this data against our test set to predict the possibility of a fire.


Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
C
__jmp_buf_tag
C
__sbuf
C
__sFILE_fake
C
_G_fpos64_t
C
Akind
C
Bigint
C
div_t
Division type for integers
C
FPI
C
imaxdiv_t
Division type for maximal integer storage
C
lconv
C
ldiv_t
Division type for long integers
C
lldiv_t
Division type for long long integers
C
mbstate_t
C
timespec
C
timeval
C
tm
C
U
Generated by
1.8.15


Earn practical, modern web development, through expert screencasts. Video tutorials are often boring. These aren't.
Earn practical, modern web development, through expert screencasts. Video tutorials are often boring. These aren't.
Earn practical, modern web development, through expert screencasts. Video tutorials are often boring. These aren't.
Earn practical, modern web development, through expert screencasts. Video tutorials are often boring. These aren't.


FROM:VUYO GWALA
TEL : 27-73349-1086
FAX: 27-76197-0308
DEAR SIR,
STRICTLY PRIVATE AND CONFIDENTIAL
You may be surprised to recieve this letter from me, since
you don't know me personally.Thus, I have to introduce
myself.I am MR.Vuyo Gwala ,the first son of Late MR.Tijani
gwala a farmer and leader movement for democratic
change[MDC] in Zimbabwe until recently, he was murdered in
the land dispute in Zimbabwe.
I was furnished with viable information from the
International Trade Centre here in Johannesburg and I
decided to write to you. Before the death of my father, he
had taken me to Johannesburg to deposit the sum of
USD$15,000,000(FIFTEEN MILLION UNITED STATES DOLLARS),in a
Security Company, as if he foresaw the looming danger in
Zimbabwe. This amount was meant for
the purchase of new
machines and chemicals for the farms and the establishment
of the new farms in Swaziland. This land problem came when
Zimbabwean President MR.ROBERT MUGABE introduced a new Land
Act which wholly affected the rich white farmers and some
few black farmers. This resulted to the killing and mob
action by Zimbabwean war veterans and some lunatics in the
society.
Infact, alot of people have been killed because of this
land reformed Act for which my father was one of the
victims. It is against this background, that I and my
family who are currently staying in South Africa decided to
transfer my father's money to foreign account since the law
of South Africa prohibits a refugee (asylum seeker) to open
any bank account or to be involved in any financial
transaction.
As the eldest son of my father, I am saddled with the
responsibility of seeking a genuine foreign account where
this money could be transferred
without the knowledge of my
government who are bent on taking everything we have got. I
am faced with the dilemma of investing this amount of money
in South Africa for fear of going through the same
experience in future since both countries have similar
political history. Moreover,the South African Foreign
Exchange policy does not allow such investment as an asylum
seeker. As a businessman, whom I have entrusted my future
and of my family in his hands,I must let you know that this
transaction is risk free. If you accept to assist me and my
family,all I need you to do for me is to make arrangement
and come to Johannesburg -South Africa so that you can open
a non-resident account which will aid us in transferring
the money into any account you will nominate overseas.
This money I intend to use for investment. I have two
options for you,firstly you can choose to have a certain
percentage of the money for nominating your account
for
this transaction. Or you can go into partnership with me
for the proper profitable investment of the money in your
country. Which ever the option you want,feel free to notify
me as I have also mapped out5% of this money for all kinds
of expences incurred in the proccess of this transaction.If
you do not prefer a partnership I am willing to give you
20% of the money while the remaining 75% will be for my
investment in your country.
Contact me with the above telephone number while I implore
you to maintain the absolute secrecy required in this
transaction. And no matter the level of transaction we are,
you must call me on phone first before sending a
reply.Please, You should keep this transaction secret and
confidential.
Best regards and God bless
Mr Vuyo Gwala
(For the family)
Want to be your own boss? Learn how on Yahoo! Small Business.


Copier Reduction
问题描述 :
What do you do if you need to copy a 560x400mm image onto a standard sheet of US letter-size paper (which is about 216x280mm), while keeping the image as large as possible? You can rotate the image 90 degrees (so that it is in “landscape” mode), then reduce it to 50% of its original size so that it is 200x280mm. Then it will fit on the paper without overlapping any edges. Your job is to solve this problem in general.
输入:
The input consists of one or more test cases, each of which is a single line containing four positive integers A, B, C, and D, separated by a space, representing an AxBmm image and a CxDmm piece of paper. All inputs will be less than one thousand. Following the test cases is a line containing four zeros that signals the end of the input.
输出:
For each test case, if the image fits on the sheet of paper without changing its size (but rotating it if necessary), then the output is 100%. If the image must be reduced in order to fit, the output is the largest integer percentage of its original size that will fit (rotating it if necessary). Output the percentage exactly as shown in the examples below. You can assume that no image will need to be reduced to less than 1% of its original size, so the answer will always be an integer percentage between 1% and 100%, inclusive.
样例输入:
560 400 218 280 10 25 88 10 8 13 5 1 9 13 10 6 199 333 40 2 75 90 218 280 999 99 1 10 0 0 0 0
样例输出:
50% 100% 12% 66% 1% 100% 1%
解题代码:
//* @author popop0p0popo import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner scanner=new Scanner(new BufferedReader(new InputStreamReader(System.in))); int a,b,c,d; int z,nz; while (true){ a=scanner.nextInt(); b=scanner.nextInt(); c=scanner.nextInt(); d=scanner.nextInt(); if (a+b+c+d==0){ break; } if (a*d>b*c){ z=getN(a,c); } else{ z=getN(b,d); } if (a*c>b*d){ nz=getN(a,d); } else{ nz=getN(b,c); } if (z< nz){ if (nz>100){ nz=100; } System.out.println(nz+"%"); } else{ if (z>100){ z=100; } System.out.println(z+"%"); } } } public static int getN(int a,int c){ return 100*c/a; } }
(adsbygoogle = window.adsbygoogle || []).push({});
不错，感谢分享。
很好的方法，学习了
int L[m+1][n+1];这样定义出错，这个在gcc上可以编译通过 在VS上不行 应该改为new 或者vector
因为是要把从字符串s的start位到当前位在hash中重置，修改提交后能accept，但是不修改居然也能accept
学习了！！
红绯鱼：
这模板神了
感觉这里的评分标准没啥作用阿，反而显得显得赘余，还不如直接去掉好了。
很好的思路，可以借鉴
很全很强大！
不太懂呀，乡亲们。原理知道代码不会
有谁知道直接遍历的方法中第8行是什么意思嘛？
有限自动机在ACM中是必须掌握的算法，实际上在面试当中几乎不可能让你单独的去实现这个算法，如果有题目要用到有限自动机来降低时间复杂度，那么这种面试题应该属于很难的级别了。
程序是对的。有些地方用了C++的写法
已更正。


Class information for:
Notes:
Textbooks:
- General Chemistry Textbook by John Doe and Jane Doe
- General Chemistry Textbook Solutions by John Doe and Jane Doe
Faculty teaching this course:
General Description:
General chemistry is a course aimed at teaching you the basics in what chemistry means, lab procedure, chemistry oriented problem solving, and expectations in the department of chemistry.
Required for this course:
Courses this is a requirement for:


SEVEN A film review by Christopher Null Copyright 1995 Christopher Null
Would somebody turn on the lights already? Geez ... in the nameless city that is the setting of SEVEN, it seems you can only get a ten-watt bulb, and that's when the power works at all. I liked the film, but with the constant thunderclouds, rain, and shadows, it's terribly difficult to tell what's going on.
The title refers to the Seven Deadly Sins--and a serial killer who is planning to knock off one "evil person" for each vice. The first to go is "gluttony," an obese man whom the killer force-feeds until he pops. And trust me, after that, it only gets worse.
On the case is veteran detective Somerset (Morgan Freeman) and new-to-town Mills (Brad Pitt). After 30 minutes of wry chit-chat, the pair finally get down to business, as two more victims are found. After that, it's a perfectly choreographed game of cat and mouse, culminating in a horrific finale that will have you on the edge of your seat. I won't reveal the identity of the killer, but I will say he's very well cast.
The story (written by schlock horror veteran Andrew Kevin Walker) is excellent. Some unfortunate problems get in the way, especially the constant lack of light and the use of quick-image shock photography, which make things all the harder to follow. But I suppose with Pitt sleepwalking through the opening of the film, at least that gives you something to watch instead of his droll acting. I guess when he breaks his hand (both the character and Pitt himself) during the movie's dynamic foot chase, the adrenaline finally starts to flow, and Pitt appears much more alive.
Also, while the "suspense" is great, watch out for the touchy-feely family scenes with Mrs. Mills (Gwyneth Paltrow) and the occasional soliloquies the characters get into about the nightmares of city life and the evils of the world. None of this is very well done, but it is rather important to the film, and thankfully, there's always another gruesome murder around the corner to distract us.
Despite its faults, SEVEN remains a worthwhile and very watchable film, but don't look for a lot of deep social commentary. Lean back, peer into the darkness, oh, and hold on to your popcorn and your date exceptionally tight when they get to "sloth."
RATING: ***1/2
\-------------------------------\ |* Unquestionably awful | |** Sub-par on many levels | |*** Average, hits and misses | |**** Good, memorable film | |***** Perfection | \-------------------------------\
-Christopher Null /<EMAIL_ADDRESS>-Screenwriter & Novelist -Contributing Editor, Mike's FEEDBACK / Film Critic, Texas Business Weekly -E-mail request to join the movie review mailing list
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


| 1 | package fr.sii.ogham.core.util; | |
| 2 | ||
| 3 | import static fr.sii.ogham.core.util.StringUtils.capitalize; | |
| 4 | ||
| 5 | import java.lang.reflect.Field; | |
| 6 | import java.lang.reflect.InvocationTargetException; | |
| 7 | import java.lang.reflect.Method; | |
| 8 | ||
| 9 | import fr.sii.ogham.core.exception.util.FieldAccessException; | |
| 10 | ||
| 11 | /** | |
| 12 | *
 | |
| 13 | * Assists in implementing Object.equals(Object) methods. This code is an | |
| 14 | * abstraction of {@link org.apache.commons.lang3.builder.EqualsBuilder} | |
| 15 | * provided by Apache Commons Lang. The aim is not to be sticked with Apache | |
| 16 | * Commons Lang and to be able to use another library or to adapt the library to | |
| 17 | * use according of libraries that are in the classpath. | |
| 18 | *
 | |
| 19 | * | |
| 20 | *
 | |
| 21 | * This class provides methods to build a good equals method for any class. It | |
| 22 | * follows rules laid out in Effective Java , by Joshua Bloch. In particular the | |
| 23 | * rule for comparing doubles, floats, and arrays can be tricky. Also, making | |
| 24 | * sure that equals() and hashCode() are consistent can be difficult. | |
| 25 | *
 | |
| 26 | * | |
| 27 | *
 | |
| 28 | * Two Objects that compare as equals must generate the same hash code, but two | |
| 29 | * Objects with the same hash code do not have to be equal. | |
| 30 | *
 | |
| 31 | * | |
| 32 | *
 | |
| 33 | * All relevant fields should be included in the calculation of equals. Derived | |
| 34 | * fields may be ignored. In particular, any field used in generating a hash | |
| 35 | * code must be used in the equals method, and vice versa. | |
| 36 | *
 | |
| 37 | * | |
| 38 | *
 | |
| 39 | * Typical use for the code is as follows: | |
| 40 | *
 | |
| 41 | * | |
| 42 | *
 | |
| 43 | * public boolean equals(Object obj) { | |
| 44 | * return new EqualsBuilder(this, obj) | |
| 45 | * .appendSuper(super.equals(obj)) | |
| 46 | * .appendFields("field1", "field2", "field3") | |
| 47 | * .equals(); | |
| 48 | * } | |
| 49 | *  | |
| 50 | *
 | |
| 51 | *
 | |
| 52 | * Alternatively, there is a method that uses reflection to determine the fields | |
| 53 | * to test. Because these fields are usually private, the method, | |
| 54 | * reflectionEquals, uses AccessibleObject.setAccessible to change the | |
| 55 | * visibility of the fields. This will fail under a security manager, unless the | |
| 56 | * appropriate permissions are set up correctly. It is also slower than testing | |
| 57 | * explicitly. Non-primitive fields are compared using equals(). | |
| 58 | *
 | |
| 59 | *
 | |
| 60 | * A typical invocation for this method would look like: | |
| 61 | *
 | |
| 62 | * | |
| 63 | *
 | |
| 64 | * public boolean equals(Object obj) { | |
| 65 | * return EqualsBuilder.reflectionEquals(this, obj); | |
| 66 | * } | |
| 67 | *
 | |
| 68 | * | |
| 69 | * @author Aurélien Baudet | |
| 70 | * | |
| 71 | */ | |
| 72 | public class EqualsBuilder { | |
| 73 | /** | |
| 74 | * The current object | |
| 75 | */ | |
| 76 | private Object object; | |
| 77 | ||
| 78 | /** | |
| 79 | * The other object to compare the object | |
| 80 | */ | |
| 81 | private Object other; | |
| 82 | ||
| 83 | /** | |
| 84 | * The equality result | |
| 85 | */ | |
| 86 | private boolean equals; | |
| 87 | ||
| 88 | /** | |
| 89 | * The delegate implementation (currently Apache Commons but could be | |
| 90 | * anything) | |
| 91 | */ | |
| 92 | private org.apache.commons.lang3.builder.EqualsBuilder delegate; | |
| 93 | ||
| 94 | /** | |
| 95 | * Are the two objects referencing the same instance | |
| 96 | */ | |
| 97 | private boolean same; | |
| 98 | ||
| 99 | /** | |
| 100 | * Initialize the builder. This version doesn't check if: | |
| 101 | *
 | |
| 102 | *
the other object is null
 | |
| 103 | *
the other object is the same as the current object
 | |
| 104 | *
the two object classes are identical
 | |
| 105 | *
 | |
| 106 | */ | |
| 107 | public EqualsBuilder() { | |
| 108 | super(); | |
| 109 | delegate = new org.apache.commons.lang3.builder.EqualsBuilder(); | |
| 110 | equals = true; | |
| 111 | same = false; | |
| 112 | } | |
| 113 | ||
| 114 | /** | |
| 115 | * Initialize the builder. This version checks if: | |
| 116 | *
 | |
| 117 | *
the other object is null
 | |
| 118 | *
the other object is the same as the current object
 | |
| 119 | *
the two object classes are identical
 | |
| 120 | *
 | |
| 121 | * | |
| 122 | *
 | |
| 123 | * Using this version lets you use the shortcut | |
| 124 | * {@link #appendFields(String...)} | |
| 125 | *
 | |
| 126 | * | |
| 127 | * @param object | |
| 128 | * the current object | |
| 129 | * @param other | |
| 130 | * the other object | |
| 131 | */ | |
| 132 | public EqualsBuilder(Object object, Object other) { | |
| 133 | super(); | |
| 134 | this.object = object; | |
| 135 | this.other = other; | |
| 136 |
1
1. <init> : negated conditional → RUN_ERROR |
same = object == other; |
| 137 |
3
1. <init> : negated conditional → RUN_ERROR 2. <init> : negated conditional → RUN_ERROR 3. <init> : negated conditional → RUN_ERROR |
equals = same || (other != null && object.getClass() == other.getClass()); |
| 138 | delegate = new org.apache.commons.lang3.builder.EqualsBuilder(); | |
| 139 | } | |
| 140 | ||
| 141 | /** | |
| 142 | * Test if two Objects are equal using their equals method. | |
| 143 | * | |
| 144 | * @param objectFieldValue | |
| 145 | * the value of a field of the object | |
| 146 | * @param otherFieldValue | |
| 147 | * the value of a field of the other object | |
| 148 | * @return used to chain calls | |
| 149 | */ | |
| 150 | public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) { | |
| 151 |
2
1. append : negated conditional → NO_COVERAGE 2. append : negated conditional → NO_COVERAGE |
if (equals && !same) { |
| 152 | delegate.append(objectFieldValue, otherFieldValue); | |
| 153 | } | |
| 154 |
1
1. append : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::append → NO_COVERAGE |
return this; |
| 155 | } | |
| 156 | ||
| 157 | /** | |
| 158 | *
 | |
| 159 | * Test if the two previously registered objects have the same value for | |
| 160 | * each provided field name. | |
| 161 | *
 | |
| 162 | * | |
| 163 | *
 | |
| 164 | * Because these fields are usually private, this method uses | |
| 165 | * AccessibleObject.setAccessible to change the visibility of the fields. | |
| 166 | * This will fail under a security manager, unless the appropriate | |
| 167 | * permissions are set up correctly. It is also slower than testing | |
| 168 | * explicitly. Non-primitive fields are compared using equals(). | |
| 169 | *
 | |
| 170 | * | |
| 171 | * @param fields | |
| 172 | * the name of fields to compare between the previously | |
| 173 | * registered objects | |
| 174 | * @return used to chain calls | |
| 175 | * @throws IllegalStateException | |
| 176 | * when calling this method but you haven't used the constructor | |
| 177 | * {@link #EqualsBuilder(Object, Object)} | |
| 178 | * @throws FieldAccessException | |
| 179 | * when the field is not accessible or cannot be read | |
| 180 | */ | |
| 181 | public EqualsBuilder appendFields(String... fields) { | |
| 182 |
1
1. appendFields : negated conditional → RUN_ERROR |
if (object == null) { |
| 183 | throw new IllegalStateException("You can't use this method if you didn't use the constructor with object and other parameters"); | |
| 184 | } | |
| 185 |
2
1. appendFields : negated conditional → RUN_ERROR 2. appendFields : negated conditional → RUN_ERROR |
if (equals && !same) { |
| 186 | for (String field : fields) { | |
| 187 | try { | |
| 188 | delegate.append(getFieldValue(object, field), getFieldValue(other, field)); | |
| 189 | } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException | InvocationTargetException e) { | |
| 190 | throw new FieldAccessException("Failed to access field " + field, e); | |
| 191 | } | |
| 192 | } | |
| 193 | } | |
| 194 |
1
1. appendFields : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::appendFields → RUN_ERROR |
return this; |
| 195 | } | |
| 196 | ||
| 197 | /** | |
| 198 | * Adds the result of super.equals() to this builder. | |
| 199 | * | |
| 200 | * @param superEquals | |
| 201 | * the result of calling super.equals() | |
| 202 | * @return used to chain calls | |
| 203 | */ | |
| 204 | public EqualsBuilder appendSuper(boolean superEquals) { | |
| 205 |
2
1. appendSuper : negated conditional → NO_COVERAGE 2. appendSuper : negated conditional → NO_COVERAGE |
if (equals && !same) { |
| 206 | delegate.appendSuper(superEquals); | |
| 207 | } | |
| 208 |
1
1. appendSuper : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::appendSuper → NO_COVERAGE |
return this; |
| 209 | } | |
| 210 | ||
| 211 | /** | |
| 212 | * Returns true if the fields that have been checked are all equal. | |
| 213 | * | |
| 214 | * @return true if objects are equal, false otherwise | |
| 215 | */ | |
| 216 | public boolean isEqual() { | |
| 217 |
4
1. isEqual : negated conditional → RUN_ERROR 2. isEqual : negated conditional → RUN_ERROR 3. isEqual : negated conditional → RUN_ERROR 4. isEqual : replaced boolean return with true for fr/sii/ogham/core/util/EqualsBuilder::isEqual → RUN_ERROR |
return same || (equals && delegate.isEquals()); |
| 218 | } | |
| 219 | ||
| 220 | /** | |
| 221 | *
 | |
| 222 | * This method uses reflection to determine if the two Objects are equal. | |
| 223 | *
 | |
| 224 | * | |
| 225 | *
 | |
| 226 | * If a getter exists, it uses the getter otherwise direct access to the | |
| 227 | * field is used. It uses AccessibleObject.setAccessible to gain access to | |
| 228 | * private fields. This means that it will throw a security exception if run | |
| 229 | * under a security manager, if the permissions are not set up correctly. It | |
| 230 | * is also not as efficient as testing explicitly. Non-primitive fields are | |
| 231 | * compared using equals(). | |
| 232 | *
 | |
| 233 | * | |
| 234 | *
 | |
| 235 | * Transient members will be not be tested, as they are likely derived | |
| 236 | * fields, and not part of the value of the Object. | |
| 237 | *
 | |
| 238 | * | |
| 239 | *
 | |
| 240 | * Static fields will not be tested. Superclass fields will be included. | |
| 241 | *
 | |
| 242 | * | |
| 243 | * @param object | |
| 244 | * this object | |
| 245 | * @param other | |
| 246 | * the other object | |
| 247 | * @param excludeFields | |
| 248 | * array of field names to exclude from testing | |
| 249 | * @return true if the two Objects have tested equals. | |
| 250 | */ | |
| 251 | public static boolean reflectionsEquals(Object object, Object other, String... excludeFields) { | |
| 252 |
2
1. reflectionsEquals : replaced boolean return with true for fr/sii/ogham/core/util/EqualsBuilder::reflectionsEquals → NO_COVERAGE 2. reflectionsEquals : replaced boolean return with false for fr/sii/ogham/core/util/EqualsBuilder::reflectionsEquals → NO_COVERAGE |
return org.apache.commons.lang3.builder.EqualsBuilder.reflectionEquals(object, other, excludeFields); |
| 253 | } | |
| 254 | ||
| 255 | private static Object getFieldValue(Object object, String fieldName) throws IllegalAccessException, NoSuchFieldException, InvocationTargetException { | |
| 256 | Method getter = findMethod(object, "is" + capitalize(fieldName)); | |
| 257 |
1
1. getFieldValue : negated conditional → RUN_ERROR |
if (getter == null) { |
| 258 | getter = findMethod(object, "get" + capitalize(fieldName)); | |
| 259 | } | |
| 260 |
1
1. getFieldValue : negated conditional → RUN_ERROR |
if (getter != null) { |
| 261 |
1
1. getFieldValue : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::getFieldValue → RUN_ERROR |
return getter.invoke(object); |
| 262 | } | |
| 263 | Field field = getField(object, fieldName); | |
| 264 |
1
1. getFieldValue : removed call to java/lang/reflect/Field::setAccessible → RUN_ERROR |
field.setAccessible(true); |
| 265 |
1
1. getFieldValue : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::getFieldValue → RUN_ERROR |
return field.get(object); |
| 266 | } | |
| 267 | ||
| 268 | private static Method findMethod(Object object, String methodName) { | |
| 269 | try { | |
| 270 |
1
1. findMethod : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::findMethod → RUN_ERROR |
return object.getClass().getMethod(methodName); |
| 271 | } catch (NoSuchMethodException e) { | |
| 272 | return null; | |
| 273 | } | |
| 274 | } | |
| 275 | ||
| 276 | private static Field getField(Object object, String fieldName) throws NoSuchFieldException { | |
| 277 | Class<?> clazz = object.getClass(); | |
| 278 |
1
1. getField : negated conditional → RUN_ERROR |
while (clazz != null) { |
| 279 | Field[] fields = clazz.getDeclaredFields(); | |
| 280 | for (Field f : fields) { | |
| 281 |
1
1. getField : negated conditional → RUN_ERROR |
if (fieldName.equals(f.getName())) { |
| 282 |
1
1. getField : replaced return value with null for fr/sii/ogham/core/util/EqualsBuilder::getField → RUN_ERROR |
return f; |
| 283 | } | |
| 284 | } | |
| 285 | clazz = clazz.getSuperclass(); | |
| 286 | } | |
| 287 | throw new NoSuchFieldException("Field " + fieldName + " not found on object " + object.getClass()); | |
| 288 | } | |
| 289 | } | |
Mutations | ||
| 136 |
1.1 |
|
| 137 |
1.1 2.2 3.3 |
|
| 151 |
1.1 2.2 |
|
| 154 |
1.1 |
|
| 182 |
1.1 |
|
| 185 |
1.1 2.2 |
|
| 194 |
1.1 |
|
| 205 |
1.1 2.2 |
|
| 208 |
1.1 |
|
| 217 |
1.1 2.2 3.3 4.4 |
|
| 252 |
1.1 2.2 |
|
| 257 |
1.1 |
|
| 260 |
1.1 |
|
| 261 |
1.1 |
|
| 264 |
1.1 |
|
| 265 |
1.1 |
|
| 270 |
1.1 |
|
| 278 |
1.1 |
|
| 281 |
1.1 |
|
| 282 |
1.1 |


EXO's Suho faces his doppelganger in 'Obsession' teasers
by germainejEXO's Suho is facing his doppelganger in the latest 'Obsession' teasers.
It's now Suho's turn to face off against his darker persona, who also rocks a daring, red hairstyle. As previously reported, the EXO members are facing their doppelgangers "X-EXO" for their comeback.
Stay tuned for more EXO teasers!


- c
- <RET>
- creep causes the debugger to single-step to the very next
port and print a message. Then if the port is leashed
(see Basic Debug), the user is prompted for further interaction.
Otherwise, it continues creeping. If leashing is off,
creep is the same as leap (see below) except that a complete
trace is printed on the standard error stream.
- l
- leap causes the debugger to resume running your program,
only stopping when a spypoint is reached (or when the
program terminates). Leaping can thus be used to follow the
execution at a higher level than exhaustive tracing. All you need to do
is to set spypoints on an evenly spread set of pertinent
predicates, and then follow the control flow through these by
leaping from one to the other. Debugging information is collected
while leaping, so when a spypoint is reached, it is possible
to inspect the ancestor goals, or creep into them upon
entry to Redo ports.
- z
- zip is like leap, except no debugging information is being
collected while zipping, resulting in significant savings in
memory and execution time.
- s
- skip is only valid for Call and Redo ports. It skips over
the entire execution of the predicate. That is, you will not see
anything until control comes back to this predicate (at either the
Exit port or the Fail port). Skip is particularly useful
while creeping since it guarantees that control will be returned
after the (possibly complex) execution within the box. If you skip,
no message at all will appear until control returns. This includes
calls to predicates with spypoints set; they will be masked
out during the skip. No debugging information is being collected while
skipping.
If you supply an integer argument, this should denote an
invocation number of an ancestral goal. The system tries to
get you to the Exit or Fail port of the invocation box you
have specified.
- o
- out is a shorthand for skipping to the Exit or Fail port of
the immediate ancestor goal. If you supply an integer
argument n, it denotes skipping to the Exit or Fail
port of the nth ancestor goal.
- q
- quasi-skip is like a combination of zip and skip:
execution stops when either control comes back to this predicate,
or a spypoint is reached. No debugging information is being
collected while quasi-skipping.
An integer argument can be supplied as for skip.
- r
- retry can be used at any port (although at the Call
port it has no effect). It transfers control back to the Call
port of the box. This allows you to restart an invocation when,
for example, you find yourself leaving with some weird result. The
state of execution is exactly the same as when you originally called,
(unless you use side-effects in your program; i.e. asserts
etc. will not be undone). When a retry is performed the invocation
counter is reset so that counting will continue from the current
invocation number regardless of what happened before the retry. This is
in accord with the fact that you have, in executional terms, returned to
the state before anything else was called.
If you supply an integer argument, this should denote an
invocation number of an ancestral goal. The system tries to
get you to the Call port of the box you have specified. It does
this by continuously failing until it reaches the right place.
Unfortunately this process cannot be guaranteed: it may be the case that
the invocation you are looking for has been cut out of the search
space by cuts (!
) in your program. In this case the
system fails to the latest surviving Call port before the correct
one.
- f
- fail can be used at any of the four ports (although at the
Fail port it has no effect). It transfers control to the Fail
port of the box, forcing the invocation to fail prematurely.
If you supply an integer after the command, this is taken as
specifying an invocation number and the system tries to get you to the
Fail port of the invocation box you have specified. It does
this by continuously failing until it reaches the right place.
Unfortunately this process cannot be guaranteed: it may be the case that
the invocation you are looking for has been cut out of the search
space by cuts (!
) in your program. In this case the
system fails to the latest surviving Fail port before the correct
one.
- j<p>
- jump to port transfers control back to the prescribed
port <p>. Here, <p> is one of: `c', `e',
`r', `f', standing for Call, Exit, Redo and Fail
ports. Takes an optional integer argument, an invocation
number.
Jumping to a Call port is the same as retrying it, i.e.
`jc' is the same as the `r' debugger command; and similarly
`jf' is the same as `f'.
The `je' jump to Exit port command transfers control
back to the Exit port of the box. It can be used at a Redo or an
Exit port (although at the latter it has no effect).  If you supply an integer
argument, this should denote an exact invocation
number of an exited invocation present in the backtrace, and then
the system will get you to the specified Exit port. The debugger
requires here an exact invocation number so that it does not jump too
far back in the execution (if an Exit port is not present in the
backtrace, it may be be a better choice to jump to the preceding
Call port, rather than to continue looking for another Exit
port).
The `jr' jump to Redo port command transfers control
back to the Redo port of the box. It can be used at an Exit or a
Redo port (although at the latter it has no effect). This allows
you to force the goal in question to try to deliver another
solution. If you supply an integer argument, this should
denote an exact invocation number of an exited invocation present
in the backtrace, and then the system will get you to the
specified Redo port.
- d
- display goal displays the current goal using
display/1
. See Write (below).
- p
- print goal displays the current goal using
print/1
.
An argument will override the default printdepth, treating 0 as
infinity.
- w
- write goal displays the current goal using
writeq/1
.
- g
- print ancestor goals provides you with a list of ancestors
to the current goal, i.e. all goals that are
hierarchically above the current goal in the calling sequence.
You can always be sure of jumping to the Call or Fail port of any
goal in the ancestor list (by using retry etc). If you
supply an integer n, only that number of ancestors will
be printed. That is to say, the last n ancestors will be
printed counting back from the current goal. Each entry is
displayed just as they would be in a trace message.
- t
- print backtrace is the same as the above, but also shows any
goals that have exited nondeterminately and their
ancestors. This information shows where there are outstanding
choices that the program could backtrack to. If you supply
an integer n, only that number of goals will be
printed.
Ancestors to the current goal are annotated with the
`Call:' port, as they have not yet exited, whereas
goals that have exited are annotated with the `Exit:'
port. You can always be sure of jumping to the Exit or Redo
port of any goal shown to be exited in the backtrace
listing.
The backtrace is a tree rather than a stack: to find the
parent of a given goal with depth indicator d, look
for the closest goal above it with depth indicator d-1.
- &
- print blocked goals prints a list of the goals that are
currently blocked in the current debugging session together with
the variable that each such goal is blocked on
(see ref-sem-sec). The goals are enumerated from 1 and up. If
you supply an integer n, only that goal will be
printed. Each entry is preceded by the goal number followed by
the variable name.
- n
- nodebug switches the debugger off. Note that this is the correct way
to switch debugging off at a trace point. You cannot use the @ or
b commands because they always return to the debugger.
- =
- debugging outputs information concerning the status of the
debugging package. See the built-in predicate
debugging/0
.
- +
- spy this sets a plain spypoint on the current goal.
- *
- spy this conditionally sets a conditional spypoint on the
current goal. Prompts for the Conditions, and calls the
spy(Func, Conditions)
goal, where Func is the predicate spec of the current
invocation. For spy/2
, see Breakpoint Predicates.
- -
- nospy this removes all spypoints applicable to the current
goal. Equivalent to
nospy
Func, where Func is
the predicate spec of the current invocation.
- \
- remove this removes the spypoint that caused the debugger to
interact at the current port. With an argument n, it
removes the breakpoint with identifier n. Equivalent to
remove_breakpoints(
BID)
, where BID is the current
breakpoint identifier, or the supplied argument
(see Breakpoint Predicates).
- D
- disable this disables the spypoint that caused the debugger
to interact at the current port. With an argument n,
it disables the breakpoint with identifier n. Equivalent to
disable_breakpoints(
BID)
, where BID is the current
breakpoint identifier, or the supplied argument
(see Breakpoint Predicates).
- E
- enable this enables all specific spypoints for the
predicate at the current port. With an argument
n, it enables the breakpoint with identifier
n. Equivalent to
enable_breakpoints(
BID)
, where
BID is the breakpoint identifiers for the current
predicate, or the supplied argument (see Breakpoint Predicates).
- .
- find this outputs information about where the predicate
being called is defined.
- a
- abort causes an abort of the current execution. All the execution
states built so far are destroyed and you are put right back at the
top-level. (This is the same as the built-in predicate
abort/0
.)
- b
- break calls the built-in predicate
break/0
, thus
putting you at a recursive top-level with the execution so far sitting
underneath you. When you end the break (^D) you will be
reprompted at the port at which you broke. The new execution is
completely separate from the suspended one; the invocation numbers will
start again from 1 during the break. The debugger is temporarily
switched off as you call the break and will be re-switched on when you
finish the break and go back to the old execution. However, any changes
to the leashing or to spypoints will remain in effect.
- @
- command gives you the ability to call arbitrary Prolog
goals. It is effectively a one-off break (see above). The
initial message `| :- ' will be output on the standard error
stream, and a command is then read from the standard input stream
and executed as if you were at top-level. If the term read is of
form Pattern
^
Body, Pattern is
unified with the current goal and Body is executed.
- u
- unify is available at the Call port and gives you the option
of providing a solution to the goal from the standard input
stream rather than executing the goal. This is convenient
e.g. for providing a “stub” for a predicate that has not yet
been written. A prompt will be output on the standard error
stream, and the solution is then read from the standard input
stream and unified with the goal. If the term
read in is of the form Head
:-
Body, Head
will be unified with the current goal, and Body will
be executed in its place.
- e
- raise exception is available at all ports. A prompt will be
output on the standard error stream, and an exception term
is then read from the standard input stream and raised in the
program being debugged.
- <
- This command, without arguments, resets the printdepth to 10.
With an argument of n, the printdepth is set to n,
treating 0 as infinity. This command works by changing the value of the
debugger_print_options
Prolog flag.
- ^
- While at a particular port, a current subterm of the current
goal is maintained. It is the current subterm that is
displayed, printed, or written when prompting for a debugger command.
Used in combination with the printdepth, this provides a means for
navigating in the current goal for focusing on the part of
interest. The current subterm is set to the current goal
when arriving at a new port. This command, without
arguments, resets the current subterm to the current
goal. With an argument of n (> 0), the current
subterm is replaced by its n:th subterm. With an
argument of 0, the current subterm is replaced by its
parent term. With a list of arguments, the arguments
are applied from left to right.
- ?
- h
- help displays the table of commands given above.
The user can define new debugger commands or modify the behavior of the
above ones using the user:debugger_command_hook/2
hook predicate,
see Breakpoint Predicates.


vectorNorm3d
PURPOSE
VECTORNORM3D compute norm of vector or of set of 3D vectors
SYNOPSIS
function n = vectorNorm3d(v)
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
- distancePointLine3d DISTANCEPOINTLINE3D compute euclidean distance between 3D point and line
- isParallel3d ISPARALLEL3D check parallelism of two vectors
- meshReduce MESHREDUCE return mesh with minimal number of faces
- minConvexHull MINCONVEXHULL return the unique minimal convex hull in 3D
- planePosition PLANEPOSITION compute position of a point on a plane
Generated on Fri 05-Feb-2010 11:20:41 by m2html © 2003


Dashboard
Plan
ISRL
BIO-EC-PH
RAMAN
VIS-NIR
SENSOR
Export Chart
Export Chart
Export Chart
Export Chart
Add Data to Chart
Delete Last Data
Export Chart
Add Data to Chart
Delete Last Data
Export Chart


| Cost | Result Options |
|---|---|
| or |
Recover 1 strain. Add to the next allied character’s check. Notice a single important point in the ongoing conflict, such as the location of a door’s control panel or a weak point on an armored car. Inflict a Critical Injury with a successful attack that deals damage past soak ( cost may vary). Activate an item quality ( cost may vary). |
| or |
Perform an immediate free maneuver that does not exceed the limit of two maneuvers per turn. Add to the targeted character’s next check. Add to any allied character’s next check, including that of the active character. |
| or |
Negate the targeted enemy’s defense (such as the defense gained from cover, equipment, or performing the guarded stance maneuver) until the end of the current round. Ignore penalizing environmental effects such as inclement weather, zero gravity, or similar circumstances until the end of the active character’s next turn. When dealing damage to a target, have the attack disable the opponent or one piece of gear rather than dealing wounds or strain. This could include hobbling them temporarily with a shot to the leg, or disabling their radio. Gain +1 melee or ranged defense until the end of the active character’s next turn. Force the target to drop a melee or ranged weapon they are wielding. |
|
Upgrade the difficulty of the targeted character’s next check. Upgrade the ability of any allied character’s next check, including that of the current active character. Do something vital, such as shooting the controls to the nearby blast doors to seal them shut. On an Initiative check, perform an immediate free maneuver before combat begins. |
|
|
When dealing damage to a target, have the attack destroy a piece of equipment the target is using, such as blowing up their assault rifle or slicing their sword in half. |
| Cost | Result Options |
|---|---|
| or |
The active character suffers 1 strain. The active character loses the benefits of a prior maneuver (such as from taking cover or assuming a guarded stance) until they perform the maneuver again. |
| or |
An opponent may immediately perform one free maneuver as an incidental in response to the active character’s check. Add to the targeted character’s next check. The active character or an allied character suffers on their next action. |
| or |
The active character falls prone. The active character grants the enemy a significant advantage in the ongoing encounter, such as accidentally blasting the controls to a bridge the active character was planning to use for their escape. |
|
The character’s weapon immediately runs out of ammunition and may not be used for the remainder of the encounter. Upgrade the difficulty of an allied character’s next check or the next check of the current active character. The tool, Brawl, or Melee weapon the active character is using becomes damaged (see page 89). |
| Cost | Result Options |
|---|---|
| or |
Recover 1 strain. This cannot be applied to the 2 strain suffered from casting this spell. Add to the next allied character’s check. Notice a single important point in the ongoing conflict, such as the location of a door’s control panel or a weak point on an armored car. Activate a spell effect ( cost may vary). |
| or |
Perform an immediate free maneuver that does not exceed the limit of two maneuvers per turn. Add to the targeted character’s next check. Add to any allied character’s next check, including that of the active character. |
| or |
Negate the targeted enemy’s defense (such as the defense gained from cover, equipment, or performing the guarded stance maneuver) until the end of the current round. Ignore penalizing environmental effects such as inclement weather, zero gravity, or similar circumstances until the end of the active character’s next turn. When dealing damage to a target, have the attack disable the opponent or one piece of gear rather than dealing wounds or strain. This could include hobbling them temporarily with a ice shard to the leg, or disabling their radio with an electric shock. Gain +1 melee or ranged defense until the end of the active character’s next turn. Force the target to drop a melee or ranged weapon they are wielding. |
|
Upgrade the difficulty of the targeted character’s next check. Upgrade the ability of any allied character’s next check, including that of the current active character. Do something vital, such as shooting the controls to the nearby blast doors to seal them shut. Inflict a Critical Injury with a successful Attack spell that deals damage past soak. |
|
|
When dealing damage to a target, have the attack destroy a piece of equipment the target is using, such as melting their assault rifle or shattering their sword with frozen air. |
| Cost | Result Options |
|---|---|
| or |
The magical energies exhaust the character, and they suffer 2 strain or 1 wound (controlling player's choice). This character and all allied spellcasters in the encounter add to any attempts to cast spells until the end of the controlling player's next turn. |
| or |
The spell doesn’t take effect until the start of the next round, or after a minute in narrative gameplay. If the character is using a magical item, it becomes damaged one step. Until the end of the encounter, enemy spellcasters add when casting a spell that targets this character. |
| or |
The spell is slightly more powerful than expected. One character of the GM's choice is targeted or otherwise affected by the spell as well. All other spellcasters and creatures attuned to magical energies within a day's travel become aware of the character (and depending on their disposition, may be very interested in finding them and doing them harm). |
|
The character overexerts themself or loses their magical connection and is unable to cast spells for the rest of the encounter or scene. The GM picks the target of the character's spell. If the caster is an NPC, the controlling player picks the target of the spell instead. The tool, Brawl, or Melee weapon the active character is using becomes damaged (see page 89). |
|
|
The character completely lose control of their magical energies or draws the ire of their deity, suffering one Critical Injury (at the GM's discretion, this may instead take the form of some of terrible or hilarious misfortune, such as temporarily being turned into a small woodland creature, being struck by lightning on a clear day, swapping bodies with someone else in the encounter for the remainder of the day, or summoning an avatar of divine or infernal wrath). If the character is using a magical item, it is completely destroyed. |
| Cost | Result Options |
|---|---|
| or |
Opportunity Identified: The character finds a useful system exploit. Add to the character’s next Computers check in this system. Thorough Override: If the runner successfully broke a piece of ice, it cannot be reactivated for one additional round. |
| or |
Quick Commands: The character may immediately perform an additional enact command maneuver as an incidental. Cover Tracks: The runner hides their presence, adding to the sysop’s next trace user action this encounter. Dynamic Code: The sysop modifies the coding on a piece of ice, adding to all break ice checks targeting it. |
| or |
Trolling: The character takes a few moments to mock their opponent. Inflict 3 strain on one other user in the system. Permanent Back Door: The runner sets up a permanent means of accessing the system without needing to deal with its verification protocols. The difficulty of the access system action becomes Easy () as long as the runner can access the back door. Successful Trace: The sysop successfully traces the runner once (in addition to the other results of the check). |
|
Hard Shutdown: If the runner successfully broke a piece of ice, it is so thoroughly disabled that it cannot be reactivated for the remainder of the encounter. Blurred Sig: The runner obscures their online identity and masks the origins of their signal, canceling one successful trace against them. Scouting Ahead: The runner learns the type, strength, and rules of one un-encountered piece of ice on the system. Backup Ice: The sysop activates their emergency defensive protocols. A system immediately gains an active Ice Wall barrier. Identified Exploit: The sysop spots a back door in the system, removing one permanent back door of their choice. |
| Cost | Result Options |
|---|---|
| or |
Disorganized System: The user gets lost in a maze of poorly named sub-folders. Add to the character’s next Computerscheck in this system. Online Distractions: The user gets too focused on the online world. Add to any non-Computers checks the user makes next turn. |
| or |
Limited Access: The runner may only perform one Network action or one Network maneuver during their next turn. I Know You!: A sysop on the system recognizes the runner’s style. The next time they successfully perform the trace user action, they successfully trace the runner one additional time. Careless Protocols: Reduce the strength of one active piece of ice (runner’s choice) by 1, to a minimum of 1. |
| or |
Major Alert: All users with access to the system become aware of the presence of an intruder on the network. Permanent Back Door: As the sysop attempts to lock the system down, they leave a portion vulnerable. The runner gains a means of accessing the system without needing to deal with its verification protocols. The difficulty of the access system action becomes Easy () as long as the runner can access the back door. |
|
Successful Trace: Sloppy work allows one sysop on the system to successfully trace the runner once. Wrong Person: As the sysop traces the runner, they get one crucial element of the runner’s identity completely wrong. This does not negate a successful trace, but it does mean that they may have the wrong name, apartment number, or exact location of the runner, which guarantees that the runner avoids any real-world retaliation and probably embarrasses the sysop in front of their superiors. |
| Cost | Result Options |
|---|---|
| but no or |
Steady Nerves: The character keeps their nerve and suffers no ill effects. |
| or |
Stand with Me: The character’s steadfast response emboldens their allies. Any allied characters forced to make a fear check from the same source add to their check. |
|
Fearless: The character faces the source of fear and finds that it no longer has a hold on them. They automatically pass any further fear checks from that source. You should not apply these results if the source is the character’s Fear motivation (see page 48). Remove one mental trauma that has an associated severity level (see page 244) that is the same or less than the difficulty of the fear check. |
| Cost | Result Options |
|---|---|
| but no or |
Aversion: The character is unnerved and distracted, and is disoriented for the rest of the encounter. |
| or |
Adrenaline Rush: Momentary panic gives the character a rush of adrenalin, but at a cost. The character adds to their next check, but suffers 3 strain. |
| or |
Flee in Terror: The character has to spend their next turn doing nothing but fleeing the source of the fear check (this includes downgrading their actions to maneuvers to move farther away). |
| or |
Frozen in Terror: The character is immobilized and staggered during their next turn. |
| or |
Character gains a mental trauma with the severity equal to the difficulty of the fear check. (See page 244). |
| Cost | Result Options |
|---|---|
| or |
Reduce the time to craft the item by one day, to a minimum of one. (You may select this option multiple times.) Your character adds to their next check using the same skill. |
| or |
Your character saves enough materials to reduce the cost of the next similar item they craft by half. Decrease the item’s encumbrance by one, to a minimum of 0. If the item has the Limited Ammo 1 quality or is otherwise limited to a single use, craft one additional identical item. (You may select this option multiple times.) |
| or |
Increase the item’s hard points by one. Reduce the difficulty of future checks to craft the item by one (to a minimum of Simple (–). |
|
The item gains the Superior quality Increase the value of one numerical benefit of the item by one or increase the rating of one quality the item possesses by one, excluding damage, critical rating, soak, and defense (e.g., the extra encumbrance capacity a backpack adds). Increase the narrative benefit of the item, or add a new narrative effect, as approved by your GM. |
|
|
The item gains one other item quality, subject to your GM’s approval. (You may only select this option once.) |
| Cost | Result Options |
|---|---|
| or |
Increase the time to craft the item by one day. (You may select this option multiple times.) Add to the next crafting check the character makes. |
| or |
Increase the item’s encumbrance by one. Your character must purchase additional materials worth half of the original component cost. |
| or |
If the item is a weapon, it gains the Inaccurate 1 quality. Decrease the item’s hard points by one, to a minimum of 0. Your character’s tools are ruined in the process and must be replaced. |
|
The item gains the Inferior quality. Whenever the item is damaged, it is damaged one additional step. |
|
|
There is a terrible accident, and your character suffers a Critical Injury or, at the GM's discretion, some related narrative event can occur of equal distress (your character's anvil explodes, the smithy catches on fire, poison gases spread into village, etc.). |
| Cost | Result Options |
|---|---|
| or |
A character who uses the potion heals 1 strain or 1 wound (as determined by your character) in addition to its normal effects. Your character adds to their next Alchemy check. |
| or |
Your character prepares one additional dose of the potion. (You may select this option multiple times.) Reduce the time to prepare the potion by half. |
| or |
Your character has enough ingredients left to craft another batch of the potion. Increase the duration of the potion’s effects by one round (if applicable). |
|
Upgrade the difficulty of checks to resist the poison’s effects once (poison only.) The potion is more effective than normal, as determined by your GM, when a character uses the potion. |
|
|
Choose one other potion of lower rarity and add its effects to this potion. |
| Cost | Result Options |
|---|---|
| or |
If the potion is beneficial, a character suffers 2 strain after using the potion and benefiting from its effects. The potion (or poison) has a strong smell that adds to all checks made to detect its presence, including in food or drink. |
| or |
When used, the potion doesn’t take effect for one minute, or one round in structured time. Your character must purchase additional ingredients worth half of the original component cost. |
| or |
If the potion is beneficial, a character suffers 1 wound after using the potion and benefiting from its effects. Reduce the duration of the potion’s effects by one round, to a minimum of one round (if applicable). If the effects would last until the end of the encounter, they last for two rounds instead. |
|
A character who uses the potion is disoriented for two rounds. If the potion is beneficial, a character who uses the potion must succeed on an Average () Resilience check; if they fail, their body rejects the potion and it doesn’t take effect. If the potion is harmful, a character who uses the potion must succeed on a Hard () Resilience check; if they succeed, their body rejects the potion and it doesn’t take effect. If there is already a check for the potion to take effect, reduce the difficulty by 1, instead. |
|
|
If the potion is beneficial, the user also suffers the effects of poison (see page 102) after resolving the normal effects of the potion. If the potion is harmful, the user also suffers the effects of a Regeneration Elixir (see page 103) after resolving the normal effects of the potion. |
| Cost | Result Options |
|---|---|
| or |
Reduce the time to craft the item by one day, to a minimum of one. (You may select this option multiple times.) Your character adds to their next check using the same skill. Add to any check to determine the item's true purpose. |
| or |
Your character saves enough materials to reduce the cost of the next similar item they craft by half. When the user uses the Charm, they regain 1 Strain. Once per encounter, when using the Focus, you may suffer 1 fewer Strain when casting a spell. You find a shortcut and create an additional Charm from the same materials. (You may select this option multiple times.) |
| or |
If this Focus grants additional damage using Attack spells, increase that value by 1. You thoroughly document the process and create a blueprint. You are able to reduce the difficulty when making this particular focus or charm in the future by 1 (to a minimum of Simple(~)). |
|
If the focus says the GM determines an effect, you, as the crafter, can choose instead. The item gains the Superior quality Increase the value of one numerical benefit of the item by one or increase the rating of one quality the item possesses by one, excluding damage, critical rating, soak, and defense. Increase the narrative benefit of the item, or add a new narrative effect, as approved by your GM. |
|
|
The item gains one other item quality, subject to your GM’s approval. (You may only select this option once.) If the focus includes decreasing the difficulty of a check, decrease by an additional difficulty, down to a minimum of Simple (-). |
| Cost | Result Options |
|---|---|
| or |
Increase the time to craft the item by one day. (You may select this option multiple times.) Add to the next Enchanting check the character makes. It is more obvious this focus or charm is magical. Add to checks to determine its’ true purpose. |
| or |
Increase the item’s encumbrance by one. Your character must purchase additional materials worth half of the original component cost. User suffers 2 Strain when using the charm. |
| or |
As part of activating the Charm, the user must succeed at an Average() Discipline check, or the Charm fails to activate. User suffers an additional Strain when casting a spell through this Focus. If this Focus grants additional damage using Attack spells, decrease that value by 1. |
|
The item gains the Inferior quality. Whenever the item is damaged, it is damaged one additional step. Using this Focus or Charm for the first time causes the user to suffer 8 strain. |
|
|
There is a terrible accident, and your character suffers a Critical Injury or, at the GM's discretion, some related narrative event can occur of equal distress. User must spend a Story Point to activate the charm or gain benefit of the Focus. Item seems cursed. When the user wants to use the Talisman or Focus, the GM may spend 2 Story Points to cause it to fail to work. If you used a Blueprint during this check, it is proven useless and it resets back to the base difficulty. |
| Cost | Result Options |
|---|---|
| or |
State of subject’s health. Current emotional state. Mundane or Awakened. Presence and location of Cyberware. Spell type of active magic. |
| or |
General diagnosis of health issue. Location of bioware. Amount of Essence left. Technomancer or not. |
| or |
Accurate diagnosis of malady or disease. |
| or |
Recover 1 strain. Learn astral signature of a spell/spirit/Awakened aura. |
| or |
Analyze the signature. If you've learned the signature before, you recognize it. Gain when tracking the signature for the next 24 hours. |
| or |
Upgrade your checks once when tracking or Assensing for next 24 hours. Gain a permanent when tracking or recognizing this signature. |
|
Permanently upgrade all checks related to tracking or recognizing this signature. |
| Cost | Result Options |
|---|---|
| or |
The active character suffers 1 strain. The active character gains a on their next Assensing check. |
| or |
If the aura you are assensing is active on the Astral plane, they notice your interest. |
| or |
Downgrade your next Astral action. An astral entity determines your own signature. |
|
Gain a permanent when tracking or recognizing this signature. Downgrade all checks related to tracking or recognizing this signature for the next 24 hours. |
Social
Source: Genesys Core Rulebook
Recover 1 strain.
Add to the next allied character’s check.
Notice a single important point in the ongoing encounter, such as an overly curious waiter or some drapes your character can stand behind to avoid being recognized.
Learn the Strength or Flaw of the targeted character.
Add to the targeted character’s next check.
Add to any allied character’s next check, including that of the active character.
Learn the Desire or Fear of the targeted character.
Successfully conceal your true goal in the encounter.
Learn the true goal of your target, if your target has one.
Learn any one Motivation facet of any character in the encounter (with the GM’s approval).
Upgrade the ability of any allied character’s next check, including that of the current active character.
Upgrade the difficulty of the targeted character’s next check.
Do something vital, such as getting everyone’s attention, or distracting all the guards so your character’s friends have a chance to do something important.
The active character suffers 1 strain.
The active character gets distracted or sidetracked momentarily. This can result in their being unable to activate an ability that requires spending a maneuver on their next turn, or it may just result in their being dragged into a lengthy and boring conversation.
The active character accidentally reveals their own Strength or Flaw.
Add to the targeted character’s next check.
The active character or an allied character suffers on their next action.
The active character accidentally reveals their own Desire or Fear.
The active character accidentally reveals their true goal in the encounter.
The active character accidentally reveals a Motivation facet of one of their allies.
Learn one false Motivation facet of the target character (the active character believes it to be true).
Upgrade the difficulty of an allied character’s next check or the next check of the current active character.
The active character becomes so embroiled in irrelevant events in the encounter that they cannot do anything important during the next round.


The Chase 'proper shake-up' confirmed by ITV with new mega quiz Beat The Chasers
The Chase will be turning itself up to 11 as Bradley Walsh and the gang return for a brand-new quiz based on the hit gameshow.
After host Bradley teased a ‘major shake-up for the show’, it’s been confirmed by ITV that the five beloved quizmasters will be forming a team for new series, Beat The Chasers.
Basically…good luck to everyone who wants to take part!
Anne Hegerty, Mark Labbett, Jenny Ryan, Paul Sinha and Shaun Wallace have all be confirmed to be appearing on the show, competing together as contestants play against them.
Earning some major cash in the process, obviously.
So it doesn’t disrupt the usual fun of The Chase weekday instalments, Beat The Chasers will be taken for a test-run across one week next year.
Michael Kelpie, Managing Director of production company Potato, said of the news: ‘For quiz fans, this is the equivalent of competing in the Olympics or playing in an FA Cup Final. It’s the ultimate challenge against the greatest quiz team ever assembled.
Advertisement Advertisement
‘In this brand new format, anyone who thinks they’re clever enough can take on the nation’s favourite quizzers.’
Katie Rawcliffe, Head of Entertainment, ITV added: ‘It’s so exciting to be expanding the award-winning The Chase format.
‘Chasers and contestants alike will really need to hold their nerve to come out victorious in this new spin on the quizzing format.’
The announcement comes as fans demanded to know where the show had gone, after it was replaced earlier this month with another Bradley-led quiz, Cash Trapped.
The team were quick to assure it was only for five weeks though, and then the gameshow will be back for another round.
When the normal series returns, it looks like there might be a new face to be dealing with after it was revealed there would be a new quizmaster joining the ranks.
Currently, Jenny Ryan – aka the Vixen from the show – has traded in her killer knowledge to show off her singing voice on X Factor Celebrity, making it to the semi finals.
We know she said she wanted a Chase supergroup…but we don’t think this is what she had in mind!
Advertisement Advertisement
Beat The Chasers starts early 2020 on ITV.
Got a showbiz story? If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


{% extends 'radiotracking/base.html' %} {% block content %}
{{ station }}
Website: {{ station.website }}
Stream: {{ station.stream_url }}
Frequency: {{ station.band }} {{ station.freq }}
Location: {{ station.location }}
edit


Lecture 1: Linked Lists
Lecture 2: Implementing a Doubly Linked List
Lecture 3: BST and Heaps
Lecture 4: Heaps & Interview Practice
If you found these notes helpful and want to show appreciation to the author, coffee donations are much loved.
Data Structures, like tools, have a best use case that they are each optimal for. We could hammer in a nail using a wrench or a screwdriver instead of a hammer – but the tool that best handles nails is a hammer.
Learning about the strengths and pitfalls of each data structure will help us use them most appropriately when writing code.
Just because something can get the job done, doesn’t mean it will do it efficiently. Choosing the best use type helps improve run time or space efficiency.
Some types have more use cases than others, even if they are rarer in real life implementation (heaps v arrays and hash tables).
In interviews, it’s common to be asked about more niche implementations of data structures or accurately choosing the most efficient data structure to solve an algorithm.
An optimized way of storing data sets.
Outside of programming, we use storage structures like cabinets and drawers. Some are more appropriate for certain types of items versus others. While a cabinet is great for plates or glasses, it might not be great for storing piles of papers.
We also use data storage in lists like for grocery shopping or recipes, or a calendar for associating items with days of the week.
In the same way, we need to know how data structures work to understand what the best implementation for solving problems is based on the anticipated data. Developers are problem solvers who often solves things that have not been done before or don’t have a simple online tutorial for.


Pick size and topping
Ok
Pizza Shop
Pepperoni
Chesse
Sausage
Bacon
Black Olives
Small
Medium
Large
Place The Order
Reset The Order
Place Another Order


public
php_adt\Arr
|
#
__construct( mixed... $elements )
Constructor.
Parameters
Returns
|
public static
php_adt\Arr
|
#
from_iterable( Iterator $iterable, boolean $recursive = true )
Creates a new instance from an iterable.
Creates a new instance from an iterable.
Parameters
Returns
|
public static
php_adt\Arr
|
#
fill( integer $count, mixed $value = null )
Creates a new instance that's filled with $count entries of the value of the $value parameter.
Creates a new instance that's filled with $count entries of the value of the $value parameter.
Parameters
Returns
|
public static
php_adt\Arr
|
#
range( mixed $start, mixed $end, number $step = 1 )
Creates a new instance that's filled with values according to the defined range. Letters are allowed.
Creates a new instance that's filled with values according to the defined range. Letters are allowed.
Parameters
- $start
- $end
- Inclusive.
- $step
Returns
|
public
string
|
#
__toString( )
Stringifies the Arr instance.
Stringifies the Arr instance.
Returns
string
|
public
array
|
#
elements( )
Reveals the internal array of elements. This should be used rarely.
Reveals the internal array of elements. This should be used rarely.
Returns
array
|
public
array
|
#
to_a( )
Converts this Arr instance to a native array.
Converts this Arr instance to a native array.
Returns
array
|
public
php_adt\Arr
|
#
to_arr( )
Creates a copy of the Arr instance.
Creates a copy of the Arr instance.
Returns
|
public
php_adt\Dict
|
#
to_dict( )
Converts the Arr instance to an instance of Dict (indices become the keys).
Converts the Arr instance to an instance of Dict (indices become the keys).
Returns
|
public
Str
|
#
to_str( )
Converts the Arr instance to an instance of Str.
Converts the Arr instance to an instance of Str.
Returns
Str
|
public
php_adt\Set
|
#
to_set( )
Converts the Arr instance to an instance of Set.
Converts the Arr instance to an instance of Set.
Returns
|
public
mixed
|
#
first( mixed $default_val = null )
Returns the first element of the Arr instance.
Returns the first element of the Arr instance.
Parameters
- $default_val
- An optional argument that (if given) is returned if there is no first element. If not given an exception may be thrown.
Returns
mixed
Throws
Exception
|
public
mixed
|
#
second( mixed $default_val = null )
Returns the second element of the Arr instance.
Returns the second element of the Arr instance.
Parameters
- $default_val
- An optional argument that (if given) is returned if there is no second element. If not given an exception may be thrown.
Returns
mixed
Throws
Exception
|
public
mixed
|
#
third( mixed $default_val = null )
Returns the third element of the Arr instance.
Returns the third element of the Arr instance.
Parameters
- $default_val
- An optional argument that (if given) is returned if there is no third element. If not given an exception may be thrown.
Returns
mixed
Throws
Exception
|
public
mixed
|
#
penultimate( mixed $default_val = null )
Returns the penultimate element of the Arr instance.
Returns the penultimate element of the Arr instance.
Parameters
- $default_val
- An optional argument that (if given) is returned if there is no penultimate element. If not given an exception may be thrown.
Returns
mixed
Throws
Exception
|
public
mixed
|
#
last( mixed $default_val = null )
Returns the last element of the Arr instance.
Returns the last element of the Arr instance.
Parameters
- $default_val
- An optional argument that (if given) is returned if there is no last element. If not given an exception may be thrown.
Returns
mixed
Throws
Exception
|
public
|
#
slice( $start = 0, $length = null )
|
public
php_adt\Arr
|
#
add( mixed... $elements )
Adds one or more elements to the Arr instance. Chainable
Adds one or more elements to the Arr instance. Chainable
Parameters
- $elements
- The elements to be added.
Returns
|
public
php_adt\Arr
|
#
copy( boolean $deep = false )
Creates a (potentially deep) copy of the Arr instance.
Creates a (potentially deep) copy of the Arr instance.
Parameters
- $deep
- Whether to copy recursively.
Returns
|
public
php_adt\Arr
|
#
clear( )
Removes all elements from the Arr instance. Chainable
Removes all elements from the Arr instance. Chainable
Returns
|
public
boolean
|
#
equals( mixed $arr )
Indicates whether the Arr instance is equals to another object.
Indicates whether the Arr instance is equals to another object.
Parameters
Returns
boolean
|
public
boolean
|
#
has( mixed $object, callable $equality = '__equals' )
Indicates whether an object is containted in the Arr instance.
Indicates whether an object is containted in the Arr instance.
Parameters
- $object
- $equality
- This optional parameter can be used to define how objects are considered equal.
Returns
boolean
|
public
integer
|
#
hash( )
Calculates a hash value of the Arr instance.
Calculates a hash value of the Arr instance.
Returns
integer
|
public
boolean
|
#
remove( mixed $object, callable $equality = '__equals' )
Removes an object from the Arr instance if it exists.
Removes an object from the Arr instance if it exists.
Parameters
- $object
- $equality
- This optional parameter can be used to define how objects are considered equal.
Returns
boolean
|
public
php_adt\Arr
|
#
remove_at( integer $index )
Removes an object from the Arr instance at a given index.
Removes an object from the Arr instance at a given index.
Parameters
Returns
php_adt\Arr An Arr instance containing the removed element.
|
public
integer
|
#
size( )
Returns the current size of the Arr instance.
Returns the current size of the Arr instance.
Returns
integer
Overrides
|
public
mixed
|
#
current( )
Returns the current element.
Returns the current element.
Returns
mixed
Implementation of
Iterator::current()
|
public
php_adt\Arr
|
#
end( )
Moves the cursor to the last element. Chainable
Moves the cursor to the last element. Chainable
Returns
|
public
integer
|
#
key( )
Returns the index of the current element.
Returns the index of the current element.
Returns
integer
Implementation of
Iterator::key()
|
public
|
#
next( )
Moves the cursor to the next element (the one after the current element).
Moves the cursor to the next element (the one after the current element).
Implementation of
Iterator::next()
|
public
|
#
rewind( )
Moves the cursor to the first element.
Moves the cursor to the first element.
Implementation of
Iterator::rewind()
|
public
php_adt\Arr
|
#
concat( mixed... $arrs )
Concatenates the Arr instance with one or more Arr instances.
Concatenates the Arr instance with one or more Arr instances.
Parameters
- $arrs
- The Arr instance(s) to be concatenated.
Returns
|
public
php_adt\Dict
|
#
count_values( callable $group_func = null )
Counts how often each element occurs in the Arr instance and returns a dictionary in which each an elements maps to the number of its occurences.
Counts how often each element occurs in the Arr instance and returns a dictionary in which each an elements maps to the number of its occurences.
Parameters
- $group_func
- Optionally, a function can be passed to define how the dictionary is built. See 'group_by()' for more details.
Returns
|
public
php_adt\Arr
|
#
diff( php_adt\Arr $arr, callable $equality = '__equals' )
Calculates the difference between this Arr instance and the given one. The resulting Arr instance contains all the old elements except the ones also contained in the given instance.
Calculates the difference between this Arr instance and the given one. The resulting Arr instance contains all the old elements except the ones also contained in the given instance.
Parameters
- $arr
- The Arr instance whose elements are excepted.
- $equality
- This optional parameter can be used to define how objects are considered equal.
Returns
|
public
|
|
public
php_adt\Dict
|
#
group_by( callable $group_func = null )
Groups the elements where each element is associated with what's returned by the 'group_func' parameter. Each group is an instance of Arr.
Groups the elements where each element is associated with what's returned by the 'group_func' parameter. Each group is an instance of Arr.
Parameters
- $group_func
The argument is called with the currently iterated element.
mixed $group_func(mixed $current_element)
If no callable is passed the elements are grouped by whatever is considered equal.
Returns
php_adt\Dict TODO: pass equality function to Dict constructor
|
public
php_adt\Arr
|
#
flatten( boolean $deep = false )
Flattens the list of contained elements.
Flattens the list of contained elements.
Parameters
- $deep
- Indicates whether to flatten all levels or just the first.
Returns
|
public
mixed
|
#
get( integer|string|array $index )
Gets an elements at a given index (negative numeric indices are possible).
Gets an elements at a given index (negative numeric indices are possible).
Parameters
- $index
- Positive integer -> normal index, negative integer -> counting from the end, string 'idx1:(idx2)' -> slicing, array [idx1,idx2] -> slicing
Returns
mixed
|
public
php_adt\Arr
|
#
intersect( php_adt\Arr $arr, callable $equality = '__equals' )
Returns the intersection of this and the given Arr instance.
Returns the intersection of this and the given Arr instance.
Parameters
Returns
|
public
Str
|
#
join( Str $glue = '' )
Joins all elements with $glue as delimiter.
Joins all elements with $glue as delimiter.
Parameters
Returns
Str
|
public
php_adt\Arr
|
#
map( callable $callback )
Returns a new Arr instance with each element mapped to (potentially) another value.
Returns a new Arr instance with each element mapped to (potentially) another value.
Parameters
- $callback
The parameter is called like this:
$callback($element, $idx)
Returns
|
public
php_adt\Arr
|
#
merge( Iterator... $iterables )
Merges the given iterable(s) into this Arr. Chainable
Merges the given iterable(s) into this Arr. Chainable
Parameters
Returns
|
public
php_adt\Arr
|
#
merge_recursive( php_adt\Arr $arr )
Merges the given instance of Arr recursively into this Arr. Chainable
Merges the given instance of Arr recursively into this Arr. Chainable
Parameters
Returns
|
public
mixed
|
#
pop( integer $index = null )
Removes an element from this Arr and returns that element. If an index is specified the according element will be removed. Otherwise the last element will be removed.
Removes an element from this Arr and returns that element. If an index is specified the according element will be removed. Otherwise the last element will be removed.
Parameters
Returns
mixed
|
public
mixed
|
#
popfirst( )
Removes the first element from this Arr and returns that element.
Removes the first element from this Arr and returns that element.
Returns
mixed
|
public
|
|
public
|
|
public
|
#
prev( )
Opposite of 'next()'.
Throws
Exception
|
public
php_adt\Arr
|
#
push( mixed... $args )
Adds one or more element to the end of this Arr. Chainable
Adds one or more element to the end of this Arr. Chainable
Parameters
Returns
|
public
mixed
|
#
rand( integer $count = 1 )
Picks one or more random elements out of this Arr.
Picks one or more random elements out of this Arr.
Parameters
Returns
mixed
|
public
php_adt\Arr
|
#
replace( php_adt\Dict $replacements )
Replaces all occurences of the keys of the $replacements argument with the according value (of $replacements). Chainable
Replaces all occurences of the keys of the $replacements argument with the according value (of $replacements). Chainable
Parameters
- $replacements
- An instance of Dict mapping old to new values.
Returns
|
public
php_adt\Arr
|
#
reset( )
Synonym for 'rewind()' but chainable. Chainable
Synonym for 'rewind()' but chainable. Chainable
Returns
|
public
php_adt\Arr
|
#
reversed( )
Returns a new Arr instance with reversed elements.
Returns a new Arr instance with reversed elements.
Returns
|
public
php_adt\Arr
|
#
reverse( )
Reverses the elements of this. Chainable
Reverses the elements of this. Chainable
Returns
|
public
|
|
public
mixed
|
#
shift( )
Shifts the first value off and returns it, shortening the Arr by one element and moving everything down. Also resets the cursor.
Shifts the first value off and returns it, shortening the Arr by one element and moving everything down. Also resets the cursor.
Returns
mixed
|
public
php_adt\Arr
|
#
shuffle( )
Randomizes the order of the elements of this. Chainable
Randomizes the order of the elements of this. Chainable
Returns
Throws
Exception
|
public
php_adt\Arr
|
#
sort( callable $cmp_function = '__mergesort_compare' )
Sorts the elements of this. Chainable
Sorts the elements of this. Chainable
Parameters
- $cmp_function
- This optional parameter can be used to define how two elements compare.
Returns
|
public
php_adt\Arr
|
#
splice( integer $offset, integer $length, mixed... $new_elements )
Removes $length elements at an $offset from this Arr and adds the given $new_elements at that $offset. The removed elements are returned as an instance of Arr.
Removes $length elements at an $offset from this Arr and adds the given $new_elements at that $offset. The removed elements are returned as an instance of Arr.
Parameters
- $offset
- Where to remove/insert.
- $length
- How many elements to remove (optional).
- $new_elements
- Elements to insert (optional).
Returns
|
public
php_adt\Arr
|
#
unique( callable $equality = '__equals' )
Returns a new Arr instance that has no duplicates (according to $equality).
Returns a new Arr instance that has no duplicates (according to $equality).
Parameters
- $equality
- This optional parameter can be used to define equality of elements.
Returns
|
public
php_adt\Arr
|
#
unshift( mixed... $elements )
Add $elements to the beginning of this Arr. Chainable
Add $elements to the beginning of this Arr. Chainable
Parameters
Returns
|
public
php_adt\Arr
|
#
without( mixed... $elements )
Returns a new Arr that does not contain any element of $elements. This method does the same as 'diff()' but takes the elements as separate arguments instead of an Arr.
Returns a new Arr that does not contain any element of $elements. This method does the same as 'diff()' but takes the elements as separate arguments instead of an Arr.
Parameters
Returns
|
public
php_adt\Arr
|
#
append( mixed... $elements )
Synonym for 'push()'. Chainable
Synonym for 'push()'. Chainable
Parameters
Returns
|
public
php_adt\Arr
|
#
extend( Iterator... $iterables )
Synonym for 'merge()'. Chainable
Synonym for 'merge()'. Chainable
Parameters
Returns
|
public
integer
|
#
index( mixed $needle, integer $start = 0, integer $stop = null, callable $equality = '__equals' )
Returns the first index of given $needle or null if the $needle is not found.
Returns the first index of given $needle or null if the $needle is not found.
Parameters
- $needle
- $start
- Where to start searching (inclusive).
- $stop
- Where to stop searching (exclusive).
- $equality
- This optional parameter can be used to define what elements is considered a match.
Returns
integer
|
public
php_adt\Arr
|
#
insert( integer $index, mixed... $elements )
Inserts one or more elements into this at a given $index. Chainable
Inserts one or more elements into this at a given $index. Chainable
Parameters
- $index
- Where to insert.
- $elements
- The element(s) to insert.
Returns
|


 Create An Account {% if socialaccount_providers %} Sign in with third party Social Account {% include "socialaccount/snippets/provider_list.html" with process="login" %} {% include "socialaccount/snippets/login_extra.html" %} {% else %} {% blocktrans %}If you have not created an account yet, then please sign up first.{% endblocktrans %} {% endif %} {% endblock %} {% block js %} {% include "utils/js-refs.html" %} {% endblock js %} {{form.login|as_crispy_field}} {{form.password|as_crispy_field}}
Don't Have An Account Yet? Create An Account
Sign in with third party Social Account
{% blocktrans %}If you have not created an account yet, then please sign up first.{% endblocktrans %}


Hello I am Liz Nderitu.
A GIS consultant in the Environmental field
who also doubles up as Software Engineer
For more information send a mail @
nderituliz@gmail.com