Batch Payment API
This document lists and describes the properties expected in the request and response objects.
- URL - https://api.na.bambora.com/v1/batchpayments
- Method - POST
Request parameters
The following parameters are passed as a JSON object on a Content-Disposition header (Content-Disposition: form-data; name="criteria"
).
- process_now - Overrides process_date parameter and processes transactions on receipt. Credit card transactions only.
- 1 – Process immediately. Any value passed in the process_date field is ignored.
- 0 – Transactions are processed on the date passed in the process_date field.
- process_date - The date the transactions starts processing. Format YYYYMMDD.
- sub_merchant_id - The merchant account on which to process the transactions. Required only if request is authorized by a partner account.
- addendum - A note associated with the batch file. no max string lengths listed
The API expects a single CSV file with one transaction per row. It does not expect a header row.
The expected format for the data varies according to the transaction type.
Canadian funds transfer (EFT)
For batches of EFT transactions, the API expects the following columns:
- Transaction type - The type of transaction.
- Transaction type
- C – Credit recipient bank accounts
- D – Debit an outside bank account and depositing funds into your own
- Financial institution number - The 3 digit financial institution number
- Bank transit number - The 5 digit bank transit number
- Account number - The 5-12 digit account number
- Amount - Transaction amount in pennies
- Reference number - An optional reference number of up to 19 digits. If you don’t want a reference number, enter “0” (zero).
- Recipient name - Full name of the bank account holder
- Customer code - The 32-character customer code located in the Payment Profile. Do not populate bank account fields in the file when processing against a Payment Profile.
- Dynamic descriptor - By default the Bambora merchant company name will show on your customer’s bank statement. You can override this default by populating the Dynamic Descriptor field.
American finds transfer (ACH)
For batches of ACH transactions, the API expects the following columns:
- Transaction type - The type of transaction.
- Transaction type
- C – Credit recipient bank accounts
- D – Debit an outside bank account and depositing funds into your own
- Transit Routing Number - The 9-digit transit number
- Account Number - The 5-15 digit account number
- Account Code - Designates the type of bank account
- PC – Personal Checking
- PS – Personal Savings
- CC – Corporate Checking
- CS – Corporate Savings
- Amount - Transaction amount in pennies
- Reference number - An optional reference number of up to 19 digits. If you don’t want a reference number, enter “0” (zero).
- Recipient Name - Full name of the bank account holder
- Customer Code - The 32-character customer code located in the Payment Profile. Do not populate bank account fields in the file when processing against a Payment Profile.
- Dynamic Descriptor - By default the Bambora merchant company name will show on your customer’s bank statement. You can override this default by populating the Dynamic Descriptor field.
- Standard Entry Code - Leave black unless your account has SEC code permissions enabled.
- Entry Detail Addenda Record - Leave black unless your account has SEC code permissions enabled.
Credit card
For batches of credit card transactions, the API expects the following columns:
- Transaction type - The type of transaction.
- Transaction type
- P – Purchase
- R – Return
- PA – Pre-authorization
- PAC – Pre auth completion
- VP – Void Purchase
- VR – Void Return
- Transaction ID - The ID of the transaction to be adjusted. Leave this field blank if the transaction type is “P” or “PA”.
- Card Number - The Card number. Leave this field blank if the Transaction ID is populated.
- Expiry - The card expiry date formatted as MMYY. If an Adjustment Id is included, this field is optional.
- Amount - Transaction amount in pennies. Max length: 9 digits.
- Reference - An optional reference number of up to 32 alphanumeric chars.
- Card Owner - Name of card owner. Max length: 32 characters.
- Email - Max length: 64 characters.
- Recurring - Flag to indicate the the bank that you do regular business with the customer. This will not create a transaction that recurs.
- 1 – Recurring transaction
- 0 – Not a recurring transaction
- Dynamic descriptor - By default the Bambora merchant company name will show on your customer’s bank statement. You can override this default by populating the Dynamic Descriptor field.
- Customer code - The 32-character customer code located in the Payment Profile. Do not populate bank account fields in the file when processing against a Payment Profile.
Response object
Success
HTTP Status: 200 OK
- code - See table below.
- message - See table below.
- batch_id - A unique identifier for the batch file.
- process_date - The date the transactions will begin processing.
- process_time_zone - Usually “GMT-08:00”.
- batch_mode - Indicates whether the batch will be processed.
- live - If there are no errors, then the batch will be sent to the bank for processing.
- test - The batch will not be processed. The merchant account is not in a live state.
Error
HTTP Status: 400 Bad Request
- code - See table below.
- category - See table below.
- message - See table below.
- reference - Always NULL.
Response Codes
| Code |
Message |
| 1 |
File successfully received |
| 2 |
Secure connection required |
| 4 |
Authentication failure |
| 5 |
Insufficient user permissions |
| 7 |
Invalid processing date |
| 8 |
Service is busy importing another file. Try again later |
| 9 |
File greater than maximum allowable size |
| 10 |
Unexpected error - Contact support |
| 11 |
Multipart message file content is missing or invalid |
| 14 |
Invalid file type |
| 15 |
Content type must be set to multipart/form-data |
| 16 |
Missing or invalid parameter content |
| 17 |
Invalid multipart message structure |
| 18 |
Invalid merchant_id for sub-merchant |
| 19 |
Addendum contains invalid characters or too long |
| 20 |
Action requires administrator access |
| 21 |
Transmitting merchant account is inactive |
| 22 |
Submitted sub-merchant account is inactive |
| 23 |
Transmitting merchant account is invalid |
Response Categories
Category | Description
———|—–
1 | Technical Problem
2 | Input Data Problem
3 | Business Rule Violation


Spark Streaming
-
Spark Streaming uses a "micro-batch" architecture.
-
Spark Streaming continuously receives live input data streams and
divides the data into batches.
-
New batches are created at regular time intervals called
batch intervals.
-
At the beginning of each time interval a new batch is created.
-
Any data that arrives during that interval gets added to that batch.


I had a brief "mindfull" conversation with my friend the other day, and while I found the intentional listening to be effective and useful, going back and rehashing everything he said wasn't particularly enlightening. It may have been because our conversation wasn't very complex, but there wasn't anything I misunderstood to begin with. It was nice to intentionally speak to him and it was a good conversation but I think just being mindful of your own behavior during a conversation is the most important thing I took from this chapter.
eI think the idea of practicing mindfullness while doing something pleasant sounded like it could be very effective, and I have been using this method while also practicing meditation in a more standard neutral setting. I think that using this combination keeps me from becoming bored with the practice allowing me to do more everyday than I otherwise would have. I liked the idea of being mindful during meals and have been doing that a lot recently as well. I also tried to do the walking meditations although I am usually very distracted by my surroundings and didn't find it to be especially effective.
 While I am not entirely convinced it can have all of the long term effects the author claims, I do believe that its a useful technique for short term happiness and well being. I have been struggling to make a habit of mindfullness, but I am slowly getting better at practicing multiple times a day even if its only for thirty seconds at a time.
Home


Professional Grade Blog
This week I focused most of my time tweaking the look of this blog. I went through a few designs concepts, and ultimately decided on this one:
Here's how it used to look when I first deployed it:
And here's how it looks as of this post, and after getting feedback from others:
Leading up to this week, there were several times I really got into designing the look of my page. Other days I dreaded it, and dreaded the day I would have to do an overhaul on all of my pages. Earlier this week, I spent a whole day rebuilding my blog template html and css files from scratch. After I was done for the day I told my wife "I hate designing web pages." I have a hard time relating to that comment at the time of this post, however. The part that had me stressed out was whether or not I was constructing my site the correct way due to my beginners knowledge of html and css. I'm still not sure about the architecture, but I realize now I learned a ton while reworking the html and css.
What helped me the most in getting over my earlier frustration was having my wife take a look at the site and give me her feedback. What has helped additionally is getting feedback and tips from other web designers who have had more practice at this than myself, including a DBC alumn and a former co-worker of mine. I received technical feedback about fixing a float, adjusting the way I use css to layout the background image, and some visual hierachy advice. I've taken a look at most of this advice and have incorporated most of it as well. I feel that this blog looks way better because of the input of these kind souls; better than it would look had I not reached out. My wife deserves most of the thanks. She actually did the graphic design for the final look. I wish I could take her with me to DBC to help on the layouts I'll be dealing with there!
There are still some improvements I'd like to make to this site. Previous and Next buttons to go through blog posts, and I want to figure out a better way to update the blog posts on my side bar. Right now I have to copy and paste the list into every html file I've created so far.


Click below to see the HTML version of this email.
http://link.cvs.com/r/UUZP78R/RX8U7/4180RD/PRGYJJB/8H4GU/IE/t?a=UUZP78R&b=E0ICG&c=Q3MRXUQ&d=WSPLDZ&e=1&f=16c9c0f6cb5b5bbee3cd
****************************************************
CVS/pharmacy®
****************************************************
LAST DAY! 20% OFF Your Order*
Check out this offer and more >
http://link.cvs.com/r/UUZP78R/RX8U7/4180RD/PRGYJJB/517TP/IE/t?a=UUZP78R&b=E0ICG&c=Q3MRXUQ&d=WSPLDZ&e=1&f=16c9c0f6cb5b5bbee3cd
****************************************************
Add<EMAIL_ADDRESS>to your address book to continue receiving our emails.
****************************************************
* Available online only. Expires 4/16/12 at 11:59 PM ET. You need to use the coupon code OFFER20 to receive the promotion. Your 20% savings will be calculated after any other discounts have been applied. The 20% savings exclude prescriptions and gift cards. No cash back. Tax charged on precoupon price where required. Tax and shipping charges are not applicable towards your order total. This offer not valid for orders placed on CVSphoto.com and CVS/pharmacy Optical.
You are receiving this email because you indicated you wanted to be informed of the latest news and specials from CVS/pharmacy online. If you prefer not to receive future emails, please unsubscribe below. Please note that if you are opted in for other CVS/pharmacy email communications, you will continue to receive them unless you opt-out specifically for those.
http://link.cvs.com/u/UUZP78R/RX8U7/4180RD/PRGYJJB/NS/aHVibGVlcGg2MDZAdHVtYmxyLmNvbQ==/
© Copyright 2013 CVS.com
http://link.cvs.com/r/UUZP78R/RX8U7/4180RD/PRGYJJB/UEB9I/IE/t?a=EM_SPR_041613_20ORDER
One CVS Drive, Woonsocket, RI 02895
[[UUZP78R-E0ICG-RX8U7-4180RD-PRGYJJB-M-M2-20130416-476230da6dad259]]


Boolean expressions and relations
[Direct modelling]
Collaboration diagram for Boolean expressions and relations:
Detailed Description
Boolean expressions can be freely composed of variables with the usual connectives and reified linear expressions.Boolean relations are obtained from Boolean expressions with functions tt (stating that the expression must be true) and ff (stating that the expression must be false).
Namespaces | |
| namespace | Gecode |
| Gecode toplevel namespace. | |
Functions | |
| Gecode::MiniModel::BoolExpr | operator! (const Gecode::MiniModel::BoolExpr &) |
| Negated Boolean expression. | |
| Gecode::MiniModel::BoolExpr | operator && (const Gecode::MiniModel::BoolExpr &, const Gecode::MiniModel::BoolExpr &) |
| Conjunction of Boolean expressions. | |
| Gecode::MiniModel::BoolExpr | operator|| (const Gecode::MiniModel::BoolExpr &, const Gecode::MiniModel::BoolExpr &) |
| Disjunction of Boolean expressions. | |
| Gecode::MiniModel::BoolExpr | operator^ (const Gecode::MiniModel::BoolExpr &, const Gecode::MiniModel::BoolExpr &) |
| Exclusive-or of Boolean expressions. | |
| Gecode::MiniModel::BoolExpr | operator~ (const Gecode::MiniModel::LinExpr &) |
| Reification of linear expression. |
Function Documentation
|
|
Negated Boolean expression.
Definition at line 154 of file bool-expr.icc. |
|
|
Conjunction of Boolean expressions.
Definition at line 125 of file bool-expr.icc. |
|
|
Disjunction of Boolean expressions.
Definition at line 133 of file bool-expr.icc. |
|
|
Exclusive-or of Boolean expressions.
Definition at line 141 of file bool-expr.icc. |
|
|
Reification of linear expression.
|


Try this often to download a server descriptor before giving up. Changing this requires that TestingTorNetwork is set. (Default: 8)
- TestingMicrodescMaxDownloadTries NUM
-
Try this often to download a microdesc descriptor before giving up. Changing this requires that TestingTorNetwork is set. (Default: 8)
- TestingCertMaxDownloadTries NUM
-
Try this often to download a v3 authority certificate before giving up. Changing this requires that TestingTorNetwork is set. (Default: 8)
- TestingDirAuthVoteExit node,node,…
-
A list of identity fingerprints, country codes, and address patterns of nodes to vote Exit for regardless of their uptime, bandwidth, or exit policy. See the ExcludeNodes option for more information on how to specify nodes.
In order for this option to have any effect, TestingTorNetwork has to be set. See the ExcludeNodes option for more information on how to specify nodes. - TestingDirAuthVoteExitIsStrict 0|1
-
If True (1), a node will never receive the Exit flag unless it is specified in the TestingDirAuthVoteExit list, regardless of its uptime, bandwidth, or exit policy.
In order for this option to have any effect, TestingTorNetwork has to be set. - TestingDirAuthVoteGuard node,node,…
-
A list of identity fingerprints and country codes and address patterns of nodes to vote Guard for regardless of their uptime and bandwidth. See the ExcludeNodes option for more information on how to specify nodes.
In order for this option to have any effect, TestingTorNetwork has to be set. - TestingDirAuthVoteGuardIsStrict 0|1
-
If True (1), a node will never receive the Guard flag unless it is specified in the TestingDirAuthVoteGuard list, regardless of its uptime and bandwidth.
In order for this option to have any effect, TestingTorNetwork has to be set. - TestingDirAuthVoteHSDir node,node,…
-
A list of identity fingerprints and country codes and address patterns of nodes to vote HSDir for regardless of their uptime and DirPort. See the ExcludeNodes option for more information on how to specify nodes.
In order for this option to have any effect, TestingTorNetwork must be set. - TestingDirAuthVoteHSDirIsStrict 0|1
-
If True (1), a node will never receive the HSDir flag unless it is specified in the TestingDirAuthVoteHSDir list, regardless of its uptime and DirPort.
In order for this option to have any effect, TestingTorNetwork has to be set. - TestingEnableConnBwEvent 0|1
-
If this option is set, then Tor controllers may register for CONN_BW events. Changing this requires that TestingTorNetwork is set. (Default: 0)
- TestingEnableCellStatsEvent 0|1
-
If this option is set, then Tor controllers may register for CELL_STATS events. Changing this requires that TestingTorNetwork is set. (Default: 0)
- TestingEnableTbEmptyEvent 0|1
-
If this option is set, then Tor controllers may register for TB_EMPTY events. Changing this requires that TestingTorNetwork is set. (Default: 0)
- TestingMinExitFlagThreshold N KBytes|MBytes|GBytes|TBytes|KBits|MBits|GBits|TBits
-
Sets a lower-bound for assigning an exit flag when running as an authority on a testing network. Overrides the usual default lower bound of 4 KB. (Default: 0)
- TestingLinkCertLifetime N seconds|minutes|hours|days|weeks|months
-
Overrides the default lifetime for the certificates used to authenticate our X509 link cert with our ed25519 signing key. (Default: 2 days)
- TestingAuthKeyLifetime N seconds|minutes|hours|days|weeks|months
-
Overrides the default lifetime for a signing Ed25519 TLS Link authentication key. (Default: 2 days)
NON-PERSISTENT OPTIONS
These options are not saved to the torrc file by the "SAVECONF" controller command. Other options of this type are documented in control-spec.txt, section 5.4. End-users should mostly ignore them.
SIGNALS
Tor catches the following signals:
- SIGTERM
-
Tor will catch this, clean up and sync to disk if necessary, and exit.
- SIGINT
-
Tor clients behave as with SIGTERM; but Tor servers will do a controlled slow shutdown, closing listeners and waiting 30 seconds before exiting. (The delay can be configured with the ShutdownWaitLength config option.)
- SIGHUP
-
The signal instructs Tor to reload its configuration (including closing and reopening logs), and kill and restart its helper processes if applicable.
- SIGUSR1
-
Log statistics about current connections, past connections, and throughput.
- SIGUSR2
-
Switch all logs to loglevel debug. You can go back to the old loglevels by sending a SIGHUP.
- SIGCHLD
-
Tor receives this signal when one of its helper processes has exited, so it can clean up.
- SIGPIPE
-
Tor catches this signal and ignores it.
- SIGXFSZ
-
If this signal exists on your platform, Tor catches and ignores it.
FILES
- @CONFDIR@/torrc
-
The configuration file, which contains "option value" pairs.
- $HOME/.torrc
-
Fallback location for torrc, if @CONFDIR@/torrc is not found.
- @LOCALSTATEDIR@/lib/tor/
-
The tor process stores keys and other data here.
- CacheDirectory/cached-certs
-
This file holds downloaded directory key certificates that are used to verify authenticity of documents generated by Tor directory authorities.
- CacheDirectory/cached-consensus and/or cached-microdesc-consensus
-
The most recent consensus network status document we’ve downloaded.
- CacheDirectory/cached-descriptors and cached-descriptors.new
-
These files hold downloaded router statuses. Some routers may appear more than once; if so, the most recently published descriptor is used. Lines beginning with @-signs are annotations that contain more information about a given router. The ".new" file is an append-only journal; when it gets too large, all entries are merged into a new cached-descriptors file.
- CacheDirectory/cached-extrainfo and cached-extrainfo.new
-
As "cached-descriptors", but holds optionally-downloaded "extra-info" documents. Relays use these documents to send inessential information about statistics, bandwidth history, and network health to the authorities. They aren’t fetched by default; see the DownloadExtraInfo option for more info.
- CacheDirectory/cached-microdescs and cached-microdescs.new
-
These files hold downloaded microdescriptors. Lines beginning with @-signs are annotations that contain more information about a given router. The ".new" file is an append-only journal; when it gets too large, all entries are merged into a new cached-microdescs file.
- CacheDirectory/cached-routers and cached-routers.new
-
Obsolete versions of cached-descriptors and cached-descriptors.new. When Tor can’t find the newer files, it looks here instead.
- DataDirectory/state
-
A set of persistent key-value mappings. These are documented in the file. These include:
-
The current entry guards and their status.
-
The current bandwidth accounting values.
-
When the file was last written
-
What version of Tor generated the state file
-
A short history of bandwidth usage, as produced in the server descriptors.
-
- DataDirectory/sr-state
-
Authority only. State file used to record information about the current status of the shared-random-value voting state.
- CacheDirectory/diff-cache
-
Directory cache only. Holds older consensuses, and diffs from older consensuses to the most recent consensus of each type, compressed in various ways. Each file contains a set of key-value arguments decribing its contents, followed by a single NUL byte, followed by the main file contents.
- DataDirectory/bw_accounting
-
Used to track bandwidth accounting values (when the current period starts and ends; how much has been read and written so far this period). This file is obsolete, and the data is now stored in the 'state' file instead.
- DataDirectory/control_auth_cookie
-
Used for cookie authentication with the controller. Location can be overridden by the CookieAuthFile config option. Regenerated on startup. See control-spec.txt in torspec for details. Only used when cookie authentication is enabled.
- DataDirectory/lock
-
This file is used to prevent two Tor instances from using same data directory. If access to this file is locked, data directory is already in use by Tor.
- DataDirectory/key-pinning-journal
-
Used by authorities. A line-based file that records mappings between RSA1024 identity keys and Ed25519 identity keys. Authorities enforce these mappings, so that once a relay has picked an Ed25519 key, stealing or factoring the RSA1024 key will no longer let an attacker impersonate the relay.
- KeyDirectory/authority_identity_key
-
A v3 directory authority’s master identity key, used to authenticate its signing key. Tor doesn’t use this while it’s running. The tor-gencert program uses this. If you’re running an authority, you should keep this key offline, and not actually put it here.
- KeyDirectory/authority_certificate
-
A v3 directory authority’s certificate, which authenticates the authority’s current vote- and consensus-signing key using its master identity key. Only directory authorities use this file.
- KeyDirectory/authority_signing_key
-
A v3 directory authority’s signing key, used to sign votes and consensuses. Only directory authorities use this file. Corresponds to the authority_certificate cert.
- KeyDirectory/legacy_certificate
-
As authority_certificate: used only when V3AuthUseLegacyKey is set. See documentation for V3AuthUseLegacyKey.
- KeyDirectory/legacy_signing_key
-
As authority_signing_key: used only when V3AuthUseLegacyKey is set. See documentation for V3AuthUseLegacyKey.
- KeyDirectory/secret_id_key
-
A relay’s RSA1024 permanent identity key, including private and public components. Used to sign router descriptors, and to sign other keys.
- KeyDirectory/ed25519_master_id_public_key
-
The public part of a relay’s Ed25519 permanent identity key.
- KeyDirectory/ed25519_master_id_secret_key
-
The private part of a relay’s Ed25519 permanent identity key. This key is used to sign the medium-term ed25519 signing key. This file can be kept offline, or kept encrypted. If so, Tor will not be able to generate new signing keys itself; you’ll need to use tor --keygen yourself to do so.
- KeyDirectory/ed25519_signing_secret_key
-
The private and public components of a relay’s medium-term Ed25519 signing key. This key is authenticated by the Ed25519 master key, in turn authenticates other keys (and router descriptors).
- KeyDirectory/ed25519_signing_cert
-
The certificate which authenticates "ed25519_signing_secret_key" as having been signed by the Ed25519 master key.
- KeyDirectory/secret_onion_key and secret_onion_key.old
-
A relay’s RSA1024 short-term onion key. Used to decrypt old-style ("TAP") circuit extension requests. The ".old" file holds the previously generated key, which the relay uses to handle any requests that were made by clients that didn’t have the new one.
- KeyDirectory/secret_onion_key_ntor and secret_onion_key_ntor.old
-
A relay’s Curve25519 short-term onion key. Used to handle modern ("ntor") circuit extension requests. The ".old" file holds the previously generated key, which the relay uses to handle any requests that were made by clients that didn’t have the new one.
- DataDirectory/fingerprint
-
Only used by servers. Holds the fingerprint of the server’s identity key.
- DataDirectory/hashed-fingerprint
-
Only used by bridges. Holds the hashed fingerprint of the bridge’s identity key. (That is, the hash of the hash of the identity key.)
- DataDirectory/approved-routers
-
Only used by authoritative directory servers. This file lists the status of routers by their identity fingerprint. Each line lists a status and a fingerprint separated by whitespace. See your fingerprint file in the DataDirectory for an example line. If the status is !reject then descriptors from the given identity (fingerprint) are rejected by this server. If it is !invalid then descriptors are accepted but marked in the directory as not valid, that is, not recommended.
- DataDirectory/v3-status-votes
-
Only for v3 authoritative directory servers. This file contains status votes from all the authoritative directory servers.
- CacheDirectory/unverified-consensus
-
This file contains a network consensus document that has been downloaded, but which we didn’t have the right certificates to check yet.
- CacheDirectory/unverified-microdesc-consensus
-
This file contains a microdescriptor-flavored network consensus document that has been downloaded, but which we didn’t have the right certificates to check yet.
- DataDirectory/unparseable-desc
-
Onion server descriptors that Tor was unable to parse are dumped to this file. Only used for debugging.
- DataDirectory/router-stability
-
Only used by authoritative directory servers. Tracks measurements for router mean-time-between-failures so that authorities have a good idea of how to set their Stable flags.
- DataDirectory/stats/dirreq-stats
-
Only used by directory caches and authorities. This file is used to collect directory request statistics.
- DataDirectory/stats/entry-stats
-
Only used by servers. This file is used to collect incoming connection statistics by Tor entry nodes.
- DataDirectory/stats/bridge-stats
-
Only used by servers. This file is used to collect incoming connection statistics by Tor bridges.
- DataDirectory/stats/exit-stats
-
Only used by servers. This file is used to collect outgoing connection statistics by Tor exit routers.
- DataDirectory/stats/buffer-stats
-
Only used by servers. This file is used to collect buffer usage history.
- DataDirectory/stats/conn-stats
-
Only used by servers. This file is used to collect approximate connection history (number of active connections over time).
- DataDirectory/stats/hidserv-stats
-
Only used by servers. This file is used to collect approximate counts of what fraction of the traffic is hidden service rendezvous traffic, and approximately how many hidden services the relay has seen.
- DataDirectory/networkstatus-bridges
-
Only used by authoritative bridge directories. Contains information about bridges that have self-reported themselves to the bridge authority.
- DataDirectory/approved-routers
-
Authorities only. This file is used to configure which relays are known to be valid, invalid, and so forth.
- HiddenServiceDirectory/hostname
-
The <base32-encoded-fingerprint>.onion domain name for this hidden service. If the hidden service is restricted to authorized clients only, this file also contains authorization data for all clients.
Note that clients will ignore any extra subdomains prepended to a hidden service hostname. So if you have "xyz.onion" as your hostname, you can tell clients to connect to "www.xyz.onion" or "irc.xyz.onion" for virtual-hosting purposes. - HiddenServiceDirectory/private_key
-
The private key for this hidden service.
- HiddenServiceDirectory/client_keys
-
Authorization data for a hidden service that is only accessible by authorized clients.
- HiddenServiceDirectory/onion_service_non_anonymous
-
This file is present if a hidden service key was created in HiddenServiceNonAnonymousMode.
SEE ALSO
BUGS
Plenty, probably. Tor is still in development. Please report them at https://trac.torproject.org/.
AUTHORS
Roger Dingledine [arma at mit.edu], Nick Mathewson [nickm at alum.mit.edu].


The benefits of swapping in axles for the Jeep YJ are definitely worth
the effort. Although I did not do a spring over conversion at the time
of my axle swap, incorporating one would be possible. If you are
planning on an SOA set up in a YJ, swapping in larger axles is an
excellent idea especially considering that most SOA Jeeps I've seen are
running 35 inch tires.
After seeing the size difference in components, as well as the
"effectiveness" of C clip axles, I would make the removal of the
Dana 35C a must in an SOA conversion.
Why swap to Dana 44s? The Dana 44s are significantly stronger than
the stock YJ axles in all ways including shaft diameter, shaft spline
count, ring and pinion size, and axle housing size. Getting rid of
the Dana 35C is one of the best things you can do to a Chrysler
Jeep.
Another advantage of swapping in a Dana 44 up front is it gives you
something no YJ saw from the factory, manual hubs. Not just any hubs
though, beefy 1/2 ton truck hubs. The tie rod is out of the way on
top of the knuckles. The six lug wheel bolt pattern is stronger than
the five and they look cool too. The brakes will see a substantial
increase in size, front and rear.
Beginning The Swap
The swap I did involved a Wagoneer/Cherokee (SJ)
front end, and a Scout II rear end. The widths of both these axles
are compatible and very similar to the dimensions of the stock YJ
axles. There are 2 widths available in the SJs, the narrow track
version is closer to the right width. The narrow track Wagoneer
and Cherokee Jeeps lacked extensions on the fenders. You will
find both right, and left hand drop differentials on these axles.
The stock YJ has the diff on the driver's side. If you are
keeping your original transfer case, a compatible front end must
be found.
When I performed my swap I opted to install the venerable Atlas II
transfer case. If one wishes to incorporate a D300 transfer case
into the swap, and get rid of the NP231, now is decision time. The
CJs had diffs on the passenger side. Benefits include: longer drive
shaft, GEARED Tcase, and IMO a better unit than the 231. As mentioned
I did not install the D300. If you are interested in swapping in a
Dana 300, check out Larry Soo's
axle and transfer case conversion article.
It wasn't until 1974 when Cherokees and Wagoneers started using the
open knuckle Dana 44 that makes good swap material. Open knuckle
axles allow a vehicle to have a better turning radius. The Wagoneers
had disk brakes standard, but they were optional on the Cherokees
until 1976.
The pinion on the D35C axle is not perfectly centered, it is off set
just a bit to the passenger side. Because the use of a CV type drive
shaft is just about guaranteeded on any lifted YJ, this pinion offset
must be copied on the donor axle. The Scout D44 width is close enough
to that of the YJ, and has the same pinion offset. In addition the
axle is built in a way allowing both the left and right side rear
axle shafts to be identical - bonus!
Matching Wheel Bolt Patterns
The descision for matching up the wheel pattern on the two axles had two
possible solutions: make the front match the rear, or make the rear
match the front. On the swap I performed I had the rear lug pattern
re-drilled to match the front.
I sent the shafts to Mosier and they charged $50/pair to weld/redrill
the axle shafts and I guess the round trip cost me another $25 in
shipping. It was quick and painless. I used Scout brake parts and
Drums from a Cherokee. The part number is the same from 78 to 82 for
the rear drums. I used non finned drums. The inside inner edge on the
new drums are raised quite a bit, and contacts the metal edge of the
brake shoes. When you have your drums turned, turn the
bit into this lip a bit.
Swapping The Front Axle
The spring perches on the SJ axle are 1 inch farther apart than the
spring perches on the YJ. This means each spring perch needs to come
1/2 inch inboard. The drivers side is the tricker side sine the spring
perch is integrated into the diff housing. Grind into the differential
housing webbing 1/2 inch as shown in the blurry picture to the
right. Fill in the gap with some steel and fill the king pin hole
with weld. Grind the welds smooth and redrill the king pin hole
1/2" in from the original location.
|
|
The passenger side is easier since there is only a spring perch.
I used some 1/2 inch thick steel plate and welded in next to the
the inner part of the spring perch. The nice part about this
swap is it is not necessary to cut off the spring perch and
remount it. The king pin also gets redrilled 1/2" to the inside,
measure twice and drill once.
|
U-Bolts
Make sure you use rod for cast material when you weld the perch
widening pieces. You also will need to grind at each spring perch to
clear the Ubolts, and drill a hole trough differential webbing on the
inside U-bolt for the U-bolt to go through. You will need to get
larger U-bolts for the drivers side because the U-bolts run over
the cast iron section use SJ U-bolts or have your local spring
shop make you some. The SJ U-bolt plates can be used for the swap
since the U-bolt size is different from the Dana 30 U-bolts, but
the spring width is the same.
Sway Bar, Track Bar, and Shocks
The SJ U-bolt plates are handy because they have the sway bar pins
on them, and your sway bar will match up perfectly when you use
these. The original SJ shock mounts brackets on the D44 work with
the Wrangler shocks.
Steering
The stock YJ pitman arm is retained. The steering linkage will
match up fine if you have the pitman arm machined (conical hole)
to fit the SJ drag link. Because the tie rod is on top of the
knuckles on the D44, a drop pitman arm is not used and the tie
rod is more up out of the way.
 Another guy, Kerry, who did this
swap without doing the shackle reversal said that the front
driveshaft from a 2.5L AX5 YJ is the perfect length - it's
about an inch shorter than the 4.0L AX15 driveshaft. Depending
on your suspension you may not need drive shaft modifications.
Brakes
I used all the brakes hardware from the SJ the axle, but the lines
on my YJ were not compatible.  It took longer to throw new pads then to replace the
lines. The YJ master cylinder works well enough, but it has
more travele and they are harder to bleed. I'm running my stock
master cylinder until I can find a bolt-in replacement with a
larger bore.
Swapping in the rear axle:
The rear axle is simple, remove the old spring perches and weld the
new ones on. I obtained some inexpensive Confer perches from my
local 4x4 shop. One can also use adjustable perches, but these are
cheaper. With the Jeep raised, I installed the axle sitting loosely
on the spring perches and loosely bolted to the springs. I made sure
the axle was centered by measuring from the axle end to the outside
edge of the spring. When the numbers matched, I set the pinion angle
and welded it up. If you are using a CV style drive shaft, point the
pinion just below the center of the output on the transfercase. One
can use special tools, but My eyeball job worked well. I haven't
had any drive line vibration and you could use shims to fine-tune it
if there is a problem.
Shocks
I removed the original shock mounts from the Dana 35c axle and welded
them onto the D44 tubes. This works well or I could have bought some
generic shock mounts and welded them on.
U-Bolts
I will be flipping my rear U-bolts using Toyota Spring plates and
square U-bolts. For now, I used the Scout U-bolt plates and Scout
size U-bolts.
Brakes
I used the YJ hard lines and brake hose on the Scout II axle. The
side which the hard-line drops from the frame rail to the axle is
opposite from the Scout, so a hole was drilled and tapped on the
correct side of the axle tube. The YJ hard-line on the D44 axle
threaded into the wheel cylinders. The Dana 35c emergency brake
cables were used.
Rear Drive Shaft
Since I installed an Atlas transfercase at the same time, I had a
rear CV type driveshaft custom made. If you were to keep the NP231
transfer case, it all depends on what year YJ you have. Some Wranglers
use the same size U-joint as the Scout and some use a different size.
I'm unsure when the change occured.
Conclusion
I have a 4 inch Rubicon Express lift with the UpWarrior shackle
reversal. I have no wander, bump steer, or tire wear that I have
noticed. I left out the trac bar and have had no problems.
Other things need to be considered when making the swap such as
gearing, wheels, oil, and all the other odds and ends.
Please keep in mind that the opinions expressed are my own. I
also would like to warn the reader that an axle swap is not as
easy a bolting on nerf bars. This task requires fabrication
and welding skills, a good eye, time and money. What else you
incorporate into the swap also affects all these factors. I
am simply providing information regarding my experiences while
swapping the axles.


-
Escape format, negative_format and units options of number helpers
Fixes: CVE-2014-0081
Rails 4.0.2 (December 02, 2013)
-
Ensure simple_format escapes its html attributes. This fixes CVE-2013-6416
-
Deep Munge the parameters for GET and POST Fixes CVE-2013-6417
-
Stop using i18n's built in HTML error handling. Fixes: CVE-2013-4491
-
Escape the unit value provided to number_to_currency Fixes CVE-2013-6415
-
Only use valid mime type symbols as cache keys CVE-2013-6414
Rails 4.0.1 (November 01, 2013)
-
Respect
SCRIPT_NAME
when usingredirect
with a relative pathExample: # application routes.rb mount BlogEngine => '/blog'
# engine routes.rb get '/admin' => redirect('admin/dashboard')
This now redirects to the path
/blog/admin/dashboard
, whereas before it would've generated an invalid url because there would be no slash between the host name and the path. It also allows redirects to work where the application is deployed to a subdirectory of a website.Fixes #7977.
Andrew White
-
Fix
ActionDispatch::RemoteIp::GetIp#calculate_ip
to only check for spoofing attacks if bothHTTP_CLIENT_IP
andHTTP_X_FORWARDED_FOR
are set.Fixes #10844.
Tamir Duberstein
-
Strong parameters should permit nested number as key.
Fixes #12293.
kennyj
-
Fix
collection_check_boxes
generated hidden input to use the name attribute provided in the options hash.Angel N. Sciortino
-
Fix some edge cases for AV
select
helper with:selected
optionBogdan Gusiev
-
Handle
:namespace
form option in collection labelsVasiliy Ermolovich
-
Fix an issue where router can't recognize downcased url encoding path.
Fixes #12269.
kennyj
-
Fix custom flash type definition. Misusage of the
_flash_types
class variable caused an error when reloading controllers with custom flash types.Fixes #12057.
Ricardo de Cillo
-
Do not break params filtering on
nil
values.Fixes #12149.
Vasiliy Ermolovich
-
Fix
excerpt
when:separator
isnil
.Paul Nikitochkin
-
Make Live Streaming work with basic authentication or builder.
Fixes #10984.
Aaron Patterson
-
Always use
Rack::Sendfile
to make possible to it be automatically configured by the webserver.Fixes #11440.
Martin Schürrer
-
Flag cookies as secure with ignore case in
ActionDispatch::SSL
.Yamagishi Kazutoshi
-
Don't include STS header in non-HTTPS responses.
Geoff Buesing
-
Fix an issue where rails raise exception about missing helper where it should throw
LoadError
. When helper file exists and only loaded file from this helper does not exist rails should throw LoadError instead ofMissingHelperError
.Piotr Niełacny
-
Only cache template digests if
config.cache_template_loading
is true.Josh Lauer, Justin Ridgewell
-
Fix an issue where
:if
and:unless
controller action procs were being run before checking for the correct action in the:only
and:unless
options.Fixes #11799.
Nicholas Jakobsen
-
Fix an issue where
assert_dom_equal
andassert_dom_not_equal
were ignoring the passed failure message argument.Fixes #11751.
Ryan McGeary
-
Fix
current_page?
when the URL contains escaped characters and the original URL is using the hexadecimal lowercased.Rafael Mendonça França
-
Allow
REMOTE_ADDR
,HTTP_HOST
andHTTP_USER_AGENT
to be overridden from the environment passed intoActionDispatch::TestRequest.new
.Fixes #11590.
Andrew White
-
Fix
text_area
to behave liketext_field
whennil
is given as value.Before:
f.text_field :field, value: nil #=> <input value=""> f.text_area :field, value: nil #=> <textarea>value of field</textarea>
After:
f.text_area :field, value: nil #=> <textarea></textarea>
Joel Cogen
-
Fix an issue where Journey was failing to clear the named routes hash when the routes were reloaded and since it doesn't overwrite existing routes then if a route changed but wasn't renamed it kept the old definition. This was being masked by the optimised url helpers so it only became apparent when passing an options hash to the url helper.
Andrew White
-
Skip routes pointing to a redirect or mounted application when generating urls using an options hash as they aren't relevant and generate incorrect urls.
Fixes #8018.
Andrew White
-
Fix default rendered format problem when calling
render
without:content_type
option. It should return:html
.Fixes #11393.
Gleb Mazovetskiy, Oleg, kennyj
-
Fix
ActionDispatch::ParamsParser#parse_formatted_parameters
to rewind body input stream on parsing json params.Fixes #11345.
Yuri Bol, Paul Nikitochkin
-
Fix
link_to
with block and url hashes.Before:
link_to(action: 'bar', controller: 'foo') { content_tag(:span, 'Example site') } # => "Example site"
After:
link_to(action: 'bar', controller: 'foo') { content_tag(:span, 'Example site') } # => "Example site"
Murahashi Sanemat Kenichi
-
Fix "Stack Level Too Deep" error when redering recursive partials.
Fixes #11340.
Rafael Mendonça França
-
Pick
DateField
DateTimeField
andColorField
values from stringified options allowing use of symbol keys with helpers.Jon Rowe
-
Fix
Mime::Type.parse
when bad accepts header is looked up. Previously it was settingrequest.formats
with an array containing anil
value, which raised an error when setting the controller formats.Fixes #10965.
Becker
-
Always escape the result of
link_to_unless
method.Before:
link_to_unless(true, 'Showing', 'github.com') # => "Showing"
After:
link_to_unless(true, 'Showing', 'github.com') # => "Showing"
dtaniwaki
Rails 4.0.0 (June 25, 2013)
-
Merge
:action
from routing scope and assign endpoint if both:controller
and:action
are present. The endpoint assignment only occurs if there is no:to
present in the options hash so should only affect routes using the shorthand syntax (i.e. endpoint is inferred from the the path).Fixes #9856
Yves Senn, Andrew White
-
Use a case insensitive URI Regexp for asset_path.
This fix a problem where the same asset path using different case are generating different URIs.
Before:
image_tag("HTTP://google.com") # => "" image_tag("http://google.com") # => ""
After:
image_tag("HTTP://google.com") # => "" image_tag("http://google.com") # => ""
David Celis
-
Add
has_named_route?(route_name)
to the mapper API.José Valim
-
Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
Bryan Ricker
-
Add support for passing custom url options other than
:host
and custom status and flash options toforce_ssl
.Andrew White
-
The
force_ssl
command now builds the redirect url fromrequest.fullpath
. This ensures that the format is maintained and it doesn't redirect to a route that has the same parameters but is defined earlier inroutes.rb
. Also any optional segments are maintained.Fixes #7528, #9061, #10305.
Andrew White
-
Return a 405 Method Not Allowed response when a request contains an unknown HTTP method.
Lewis Marshall
-
Add support for extracting the port from the
:host
option passed tourl_for
.Andrew White
-
Add support for removing the subdomain from a url by passing
nil
,false
or''
. Fixes #10180.Derek Watson + Andrew White
-
Element of the collection for
options_from_collection_for_select
helper can optionally contain html attributes as the last element of the array asoptions_for_select
helper.Vasiliy Ermolovich
-
Fix explicit names on multiple file fields. If a file field tag has the multiple option, it is turned into an array field (appending
[]
), but if an explicit name is passed tofile_field
the[]
is not appended. Fixes #9830.Ryan McGeary
-
Add block support for the
mail_to
helper, similar to thelink_to
helper.Sam Pohlenz
-
Automatically configure cookie-based sessions to be encrypted if
secret_key_base
is set, falling back to signed if onlysecret_token
is set. Automatically upgrade existing signed cookie-based sessions from Rails 3.x to be encrypted if bothsecret_key_base
andsecret_token
are set, or signed with the new key generator if onlysecret_token
is set. This leaves only theconfig.session_store :cookie_store
option and removes the two new options introduced in 4.0.0.beta1:encrypted_cookie_store
andupgrade_signature_to_encryption_cookie_store
.Trevor Turk
-
Ensure consistent fallback to the default layout lookup for layouts set using symbols or procs that return
nil
.All of the following layouts will result in the default layout lookup:
layout nil layout proc { nil } layout :returns_nil def returns_nil nil end
Previously symbols and procs which returned
nil
resulted in no layout which differed from thelayout nil
behavior. To get the "no layout" behavior just returnfalse
instead ofnil
forlayout
.Chris Nicola
-
Create
UpgradeLegacySignedCookieJar
to transparently upgrade existing signed cookies generated by Rails 3.x to avoid invalidating them when upgrading to Rails 4.x.Trevor Turk + Neeraj Singh
-
Raise an
ArgumentError
when a clashing named route is defined.Trevor Turk
-
Allow default url options to accept host with protocol such as
http://
config.action_mailer.default_url_options = { host: "http://mydomain.com" }
Richard Schneeman
-
Ensure that digest authentication responds with a 401 status when a basic header is received.
Brad Dunbar
-
Include I18n locale fallbacks in view lookup. Fixes #3512.
Juan Barreneche
-
Integration and functional tests allow headers and rack env variables to be passed when performing requests. Fixes #6513.
Example:
# integration test get "/success", {}, "HTTP_REFERER" => "http://test.com/", "Accepts" => "text/plain, text/html" # functional test @request.headers["Accepts"] = "text/plain, text/html"
Yves Senn
-
Http::Headers respects headers that are not prefixed with HTTP_
Yves Senn
-
Fix incorrectly appended square brackets to a multiple select box if an explicit name has been given and it already ends with "[]"
Before:
select(:category, [], {}, multiple: true, name: "post[category][]") # => <select name="post[category][][]" ...>
After:
select(:category, [], {}, multiple: true, name: "post[category][]") # => <select name="post[category][]" ...>
Olek Janiszewski
-
Fixed regression when using
assert_template
to verify files sent usingrender file: 'README.md'
. Fixes #9464.Justin Coyne
-
Fixed
ActionView::Helpers::CaptureHelper#content_for
regression when trying to use it in a boolean statement. Fixes #9360.Nikolay Shebanov
-
format: true
does not override existing format constraints. Fixes #9466.Example:
# This will force the .json extension. get '/json_only', to: ok, format: true, constraints: { format: /json/ }
Yves Senn
-
Skip valid encoding checks for non-String parameters that come from the matched route's defaults. Fixes #9435.
Example:
root to: 'main#posts', page: 1
Yves Senn
-
Don't verify Regexp requirements for non-Regexp
:constraints
. Fixes #9432.Example:
get '/photos.:format' => 'feeds#photos', constraints: {format: 'xml'}
Yves Senn
-
Make
ActionDispatch::Journey::Path::Pattern#new
raise more meaningful exception message.Thierry Zires
-
Fix
respond_to
not using formats that have no block if all is present. Michael Grosser -
New applications use an encrypted session store by default.
Santiago Pastorino
-
Determine the controller#action from only the matched path when using the shorthand syntax. Previously the complete path was used, which led to problems with nesting (scopes and namespaces). Fixes #7554.
Example:
# This will route to questions#new. scope ':locale' do get 'questions/new' end
Yves Senn
-
Remove support for parsing XML parameters from request. If you still want to parse XML parameters, please install `actionpack-xml_parser' gem.
Prem Sichanugrist
-
Remove support for parsing YAML parameters from request.
Aaron Patterson
-
Add a message when you have no routes defined to both
rake routes
and GET “/rails/info/routes” that lets you know you have none defined and links to the Rails guide on the topic.Steve Klabnik
-
Change
image_alt
method to replace underscores/hyphens to spaces in filenames.Previously, underscored filenames became
alt="A_long_file_name_with_underscores"
in HTML, which is poor for accessibility. For instance, Apple's VoiceOver Utility pronounces each underscore.A_long_file_name
thus would be read asA underscore long underscore file underscore name.
Now underscored or hyphenated filenames (both of which are very popular naming conventions) read more naturally in screen readers by converting both hyphens and underscores to spaces.Before:
image_tag('underscored_file_name.png') # =>
After:
image_tag('underscored_file_name.png') # =>
Nick Cox
-
We don't support Ruby constant notation in the
:controller
option for route definitions. So, this raises anArgumentError
now:resources :posts, controller: "Admin::Posts" # WRONG
Use path notation instead:
resources :posts, controller: "admin/posts" # RIGHT
Yves Senn
-
assert_template
can be used to verify the locals of partials, which live inside a directory.# Prefixed partials inside directories worked and still work. assert_template partial: 'directory/_partial', locals: {name: 'John'} # This did not work but does now. assert_template partial: 'directory/partial', locals: {name: 'John'}
Fixes #8516.
Yves Senn
-
Fix
content_tag_for
with array HTML option. It would embed array as string instead of joining it likecontent_tag
does:content_tag(:td, class: ["foo", "bar"]){} # =>
Before:
content_tag_for(:td, item, class: ["foo", "bar"]) # =>
After:
content_tag_for(:td, item, class: ["foo", "bar"]) # =>
Semyon Perepelitsa
-
Remove
BestStandardsSupport
middleware, !DOCTYPE html already triggers standards mode per msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx and ChromeFrame header has been moved toconfig.action_dispatch.default_headers
Guillermo Iguaran
-
Fix CSRF protection and
current_url?
helper to work with HEAD requests now thatActionDispatch::Head
has been removed in favor ofRack::Head
.Michiel Sikkes
-
Change
asset_path
to not includeSCRIPT_NAME
when it's used from a mounted engine. Fixes #8119.Piotr Sarnacki
-
Add JavaScript based routing path matcher to
/rails/info/routes
. Routes can now be filtered by whether or not they match a path.Richard Schneeman
-
Change the behavior of route defaults so that explicit defaults are no longer required where the key is not part of the path. For example:
resources :posts, bucket_type: 'posts'
will be required whenever constructing the url from a hash such as a functional test or using
url_for
directly. However using the explicit form alters the behavior so it's not required:resources :projects, defaults: { bucket_type: 'projects' }
This changes existing behavior slightly in that any routes which only differ in their defaults will match the first route rather than the closest match.
Andrew White
-
Add support for routing constraints other than Regexp and String. For example this now allows the use of arrays like this:
get '/foo/:action', to: 'foo', constraints: { subdomain: %w[www admin] }
or constraints where the request method returns an Fixnum like this:
get '/foo', to: 'foo#index', constraints: { port: 8080 }
Note that this only applies to constraints on the request - path constraints still need to be specified as Regexps as the various constraints are compiled into a single Regexp.
Andrew White
-
Fix a bug in integration tests where setting the port via a url passed to the process method was ignored when constructing the request environment.
Andrew White
-
Allow
:selected
to be set ondate_select
tag helper.Colin Burn-Murdoch
-
Fixed JSON params parsing regression for non-object JSON content.
Dylan Smith
-
Extract
ActionDispatch::PerformanceTest
into github.com/rails/rails-perftest You can add the gem to your Gemfile to keep using performance tests.gem 'rails-perftest'
Yves Senn
-
Added view_cache_dependency API for declaring dependencies that affect cache digest computation.
Jamis Buck
-
image_submit_tag
will setalt
attribute from image source if not specified.Nihad Abbasov
-
Do not generate local variables for partials without object or collection. Previously rendering a partial without giving
:object
or:collection
would generate a local variable with the partial name by default.Carlos Antonio da Silva
-
Return the last valid, non-private IP address from the X-Forwarded-For, Client-IP and Remote-Addr headers, in that order. Document the rationale for that decision, and describe the options that can be passed to the RemoteIp middleware to change it. Fixes #7979.
André Arko, Steve Klabnik, Alexey Gaziev
-
Do not append second slash to
root_url
when usingtrailing_slash: true
Fixes #8700.Before:
root_url(trailing_slash: true) # => http://test.host//
After:
root_url(trailing_slash: true) # => http://test.host/
Yves Senn
-
Allow to toggle dumps on error pages.
Gosha Arinich
-
Fix a bug in
content_tag_for
that prevents it from working without a block.Jasl
-
Change the stylesheet of exception pages for development mode. Additionally display also the line of code and fragment that raised the exception in all exceptions pages.
Guillermo Iguaran + Jorge Cuadrado
-
Do not append
charset=
parameter whenhead
is called with a:content_type
option. Fixes #8661.Yves Senn
-
Added
Mime::NullType
class. This allows to usehtml?
,xml?
,json?
, etc. when the format of the request is unknown, without raising an exception.Angelo Capilleri
-
Integrate the Journey gem into Action Dispatch so that the global namespace is not polluted with names that may be used as models.
Andrew White
-
Extract support for email address obfuscation via
:encode
,:replace_at
, andreplace_dot
options from themail_to
helper into theactionview-encoded_mail_to
gem.Nick Reed + DHH
-
Handle
:protocol
option instylesheet_link_tag
andjavascript_include_tag
Vasiliy Ermolovich
-
Clear url helper methods when routes are reloaded. Andrew White
-
Fix a bug in
ActionDispatch::Request#raw_post
that causedenv['rack.input']
to be read but not rewound.Matt Venables
-
Prevent raising
EOFError
on multipart GET request (IE issue). Adam Stankiewicz -
Rename all action callbacks from *filter to *action to avoid the misconception that these callbacks are only suited for transforming or halting the response. With the new style, it's more inviting to use them as they were intended, like setting shared ivars for views.
Example:
class PeopleController < ActionController::Base before_action :set_person, except: [:index, :new, :create] before_action :ensure_permission, only: [:edit, :update] ... private def set_person @person = current_account.people.find(params[:id]) end def ensure_permission current_person.can_change?(@person) end end
The old *_filter methods still work with no deprecation notice.
DHH
-
Add
cache_if
andcache_unless
for conditional fragment caching:Example:
<%= cache_if condition, project do %> All the topics on this project <%= render project.topics %> <% end %> # and <%= cache_unless condition, project do %> All the topics on this project <%= render project.topics %> <% end %>
Stephen Ausman + Fabrizio Regini + Angelo Capilleri
-
Add logging filter capability for redirect URLs:
config.filter_redirect << 'http://please.hide.it/'
Fabrizio Regini
-
Fixed a bug that ignores constraints on a glob route. This was caused because the constraint regular expression is overwritten when the
routes.rb
file is processed. Fixes #7924Maura Fitzgerald
-
More descriptive error messages when calling
render :partial
with an invalid:layout
argument.Fixes #8376.
render partial: 'partial', layout: true # results in ActionView::MissingTemplate: Missing partial /true
Yves Senn
-
Sweepers was extracted from Action Controller as
rails-observers
gem.Rafael Mendonça França
-
Add option flag to
CacheHelper#cache
to manually bypass automatic template digests:<% cache project, skip_digest: true do %> ... <% end %>
Drew Ulmer
-
Do not sort Hash options in
grouped_options_for_select
. Sergey Kojin -
Accept symbols as
send_data :disposition
value Elia Schito -
Add i18n scope to
distance_of_time_in_words
. Steve Klabnik -
assert_template
:-
is no more passing with empty string.
-
is now validating option keys. It accepts:
:layout
,:partial
,:locals
and:count
.
Roberto Soares
-
-
Allow setting a symbol as path in scope on routes. This is now allowed:
scope :api do resources :users end
It is also possible to pass multiple symbols to scope to shorten multiple nested scopes:
scope :api do scope :v1 do resources :users end end
can be rewritten as:
scope :api, :v1 do resources :users end
Guillermo Iguaran + Amparo Luna
-
Fix error when using a non-hash query argument named "params" in
url_for
.Before:
url_for(params: "") # => undefined method `reject!' for "":String
After:
url_for(params: "") # => http://www.example.com?params=
tumayun + Carlos Antonio da Silva
-
Render every partial with a new
ActionView::PartialRenderer
. This resolves issues when rendering nested partials. Fixes #8197.Yves Senn
-
Introduce
ActionView::Template::Handlers::ERB.escape_whitelist
. This is a list of mime types where template text is not html escaped by default. It preventsJack & Joe
from rendering asJack & Joe
for the whitelisted mime types. The default whitelist containstext/plain
. Fixes #7976.Joost Baaij
-
Fix input name when
multiple: true
and:index
are set.Before:
check_box("post", "comment_ids", { multiple: true, index: "foo" }, 1) # => <input name=\"post[foo][comment_ids]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids]\" type=\"checkbox\" value=\"1\" />
After:
check_box("post", "comment_ids", { multiple: true, index: "foo" }, 1) # => <input name=\"post[foo][comment_ids][]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids][]\" type=\"checkbox\" value=\"1\" />
Fixes #8108.
Daniel Fox, Grant Hutchins & Trace Wax
-
date_select
helper acceptswith_css_classes: true
to add css classes similar with type of generated select tags.Pavel Nikitin
-
Only non-js/css under
app/assets
path will be included in defaultconfig.assets.precompile
.Josh Peek
-
Remove support for the
RAILS_ASSET_ID
environment configuration (no longer needed now that we have the asset pipeline).Josh Peek
-
Remove old
asset_path
configuration (no longer needed now that we have the asset pipeline).Josh Peek
-
assert_template
can be used to assert on the same template with different locals Fixes #3675.Yves Senn
-
Remove old asset tag concatenation (no longer needed now that we have the asset pipeline).
Josh Peek
-
Accept
:remote
as symbolic option forlink_to
helper. Riley Lynch -
Warn when the
:locals
option is passed toassert_template
outside of a view test case Fixes #3415.Yves Senn
-
The
Rack::Cache
middleware is now disabled by default. To enable it, setconfig.action_dispatch.rack_cache = true
and addgem rack-cache
to your Gemfile.Guillermo Iguaran
-
ActionController::Base.page_cache_extension
option is deprecated in favour ofActionController::Base.default_static_extension
.Francesco Rodriguez
-
Action and Page caching has been extracted from Action Dispatch as
actionpack-action_caching
andactionpack-page_caching
gems. Please read theREADME.md
file on both gems for the usage.Francesco Rodriguez
-
Failsafe exception returns
text/plain
. Steve Klabnik -
Rename internal variables on
ActionController::TemplateAssertions
to prevent naming collisions.@partials
,@templates
and@layouts
are now prefixed with an underscore. Fixes #7459.Yves Senn
-
resource
andresources
don't modify the passed options hash. Fixes #7777.Yves Senn
-
Precompiled assets include aliases from
foo.js
tofoo/index.js
and vice versa.# Precompiles phone-<digest>.css and aliases phone/index.css to phone.css. config.assets.precompile = [ 'phone.css' ] # Precompiles phone/index-<digest>.css and aliases phone.css to phone/index.css. config.assets.precompile = [ 'phone/index.css' ] # Both of these work with either precompile thanks to their aliases. <%= stylesheet_link_tag 'phone', media: 'all' %> <%= stylesheet_link_tag 'phone/index', media: 'all' %>
Jeremy Kemper
-
assert_template
is no more passing with what ever string that matches with the template name.Before when we have a template
/layout/hello.html.erb
,assert_template
was passing with any string that matches. This behavior allowed false positive like:assert_template "layout" assert_template "out/hello"
Now it only passes with:
assert_template "layout/hello" assert_template "hello"
Fixes #3849.
Hugolnx
-
image_tag
will set the same width and height for image if numerical value passed tosize
option.Nihad Abbasov
-
Deprecate
Mime::Type#verify_request?
andMime::Type.browser_generated_types
, since they are no longer used inside of Rails, they will be removed in Rails 4.1.Michael Grosser
-
ActionDispatch::Http::UploadedFile
now delegatesclose
to its tempfile. Sergio Gil -
Add
ActionController::StrongParameters
, this module convertsparams
hash into an instance of ActionController::Parameters that allows whitelisting of permitted parameters. Non-permitted parameters are forbidden to be used in Active Model by default For more details check the documentation of the module or the strong_parameters gemDHH + Guillermo Iguaran
-
Remove Integration between
attr_accessible
/attr_protected
andActionController::ParamsWrapper
. ParamWrapper now wraps all the parameters returned by the class methodattribute_names
.Guillermo Iguaran
-
Log now displays the correct status code when an exception is raised. Fixes #7646.
Yves Senn
-
Allow pass couple extensions to
ActionView::Template.register_template_handler
call.Tima Maslyuchenko
-
Sprockets integration has been extracted from Action Pack to the
sprockets-rails
gem.rails
gem is depending onsprockets-rails
by default.Guillermo Iguaran
-
ActionDispatch::Session::MemCacheStore
now usesdalli
instead of the deprecatedmemcache-client
gem.Arun Agrawal + Guillermo Iguaran
-
Support multiple etags in If-None-Match header. Travis Warlick
-
Allow to configure how unverified request will be handled using
:with
option inprotect_from_forgery
method.Valid unverified request handling methods are:
-
:exception
- Raises ActionController::InvalidAuthenticityToken exception. -
:reset_session
- Resets the session. -
:null_session
- Provides an empty session during request but doesn't reset it completely. Used as default if:with
option is not specified.
New applications are generated with:
protect_from_forgery with: :exception
Sergey Nartimov
-
-
Add
.ruby
template handler, this handler simply allows arbitrary Ruby code as a template. Guillermo Iguaran -
Add
separator
option forActionView::Helpers::TextHelper#excerpt
:excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1) # => ...a very beautiful...
Guirec Corbel
-
Added controller-level etag additions that will be part of the action etag computation Jeremy Kemper/DHH
class InvoicesController < ApplicationController etag { current_user.try :id } def show # Etag will differ even for the same invoice when it's viewed by a different current_user @invoice = Invoice.find(params[:id]) fresh_when(@invoice) end end
-
Add automatic template digests to all
CacheHelper#cache
calls (originally spiked in thecache_digests
plugin) DHH -
When building a URL fails, add missing keys provided by Journey. Failed URL generation now returns a 500 status instead of a 404.
Richard Schneeman
-
Deprecate availability of
ActionView::RecordIdentifier
in controllers by default. It's view specific and can be easily included in controllers manually if someone really needs it. Also deprecate callingActionController::RecordIdentifier.dom_id
anddom_class
directly, in favor ofActionView::RecordIdentifier.dom_id
anddom_class
.RecordIdentifier
will be removed fromActionController::Base
in Rails 4.1.Piotr Sarnacki
-
Fix
ActionView::RecordIdentifier
to work as a singleton. Piotr Sarnacki -
Deprecate
Template#mime_type
, it will be removed in Rails 4.1 in favor of#type
. Piotr Sarnacki -
Move vendored html-scanner from
action_controller
toaction_view
directory. If you require it directly, please use 'action_view/vendor/html-scanner', reference to 'action_controller/vendor/html-scanner' will be removed in Rails 4.1. Piot Sarnacki -
Fix handling of date selects when using both disabled and discard options. Fixes #7431.
Vasiliy Ermolovich
-
ActiveRecord::SessionStore
is extracted out of Rails into a gemactiverecord-session_store
. Settingconfig.session_store
to:active_record_store
will no longer work and will break if theactiverecord-session_store
gem isn't available. Prem Sichanugrist -
Fix
select_tag
whenoption_tags
is nil. Fixes #7404.Sandeep Ravichandran
-
Add
Request#formats=(extensions)
that lets you set multiple formats directly in a prioritized order.Example of using this for custom iphone views with an HTML fallback:
class ApplicationController < ActionController::Base before_filter :adjust_format_for_iphone_with_html_fallback private def adjust_format_for_iphone_with_html_fallback request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/] end end
DHH
-
Add Routing Concerns to declare common routes that can be reused inside others resources and routes.
Code before:
resources :messages do resources :comments end resources :posts do resources :comments resources :images, only: :index end
Code after:
concern :commentable do resources :comments end concern :image_attachable do resources :images, only: :index end resources :messages, concerns: :commentable resources :posts, concerns: [:commentable, :image_attachable]
DHH + Rafael Mendonça França
-
Add
start_hour
andend_hour
options to theselect_hour
helper. Evan Tann -
Raises an
ArgumentError
when the first argument inform_for
containnil
or is empty.Richard Schneeman
-
Add 'X-Frame-Options' => 'SAMEORIGIN' 'X-XSS-Protection' => '1; mode=block' and 'X-Content-Type-Options' => 'nosniff' as default headers.
Egor Homakov
-
Allow data attributes to be set as a first-level option for
form_for
, so you can writeform_for @record, data: { behavior: 'autosave' }
instead ofform_for @record, html: { data: { behavior: 'autosave' } }
DHH -
Deprecate
button_to_function
andlink_to_function
helpers.We recommend the use of Unobtrusive JavaScript instead. For example:
link_to "Greeting", "#", class: "nav_link" $(function() { $('.nav_link').click(function() { // Some complex code return false; }); });
or
link_to "Greeting", '#', onclick: "alert('Hello world!'); return false", class: "nav_link"
for simple cases.
Rafael Mendonça França
-
javascript_include_tag :all
will now not includeapplication.js
if the file does not exists. Prem Sichanugrist -
Send an empty response body when call
head
with status between 100 and 199, 204, 205 or 304.Armand du Plessis
-
Fixed issue with where digest authentication would not work behind a proxy. Arthur Smith
-
Added
ActionController::Live
. Mix it in to your controller and you can stream data to the client live. For example:class FooController < ActionController::Base include ActionController::Live def index 100.times { # Client will see this as it's written response.stream.write "hello world\n" sleep 1 } response.stream.close end end
Aaron Patterson
-
Remove
ActionDispatch::Head
middleware in favor ofRack::Head
. Santiago Pastorino -
Deprecate
:confirm
in favor ofdata: { confirm: "Text" }
option forbutton_to
,button_tag
,image_submit_tag
,link_to
andsubmit_tag
helpers.Carlos Galdino + Rafael Mendonça França
-
Show routes in exception page while debugging a
RoutingError
in development.Richard Schneeman + Mattt Thompson + Yves Senn
-
Add
ActionController::Flash.add_flash_types
method to allow people to register their own flash types. e.g.:class ApplicationController add_flash_types :error, :warning end
If you add the above code, you can use
<%= error %>
in an erb, andredirect_to /foo, error: 'message'
in a controller.kennyj
-
Remove Active Model dependency from Action Pack. Guillermo Iguaran
-
Support unicode characters in routes. Route will be automatically escaped, so instead of manually escaping:
get Rack::Utils.escape('こんにちは') => 'home#index'
You just have to write the unicode route:
get 'こんにちは' => 'home#index'
kennyj
-
Return proper format on exceptions. Santiago Pastorino
-
Allow to use
mounted_helpers
(helpers for accessing mounted engines) inActionView::TestCase
. Piotr Sarnacki -
Include
mounted_helpers
(helpers for accessing mounted engines) inActionDispatch::IntegrationTest
by default. Piotr Sarnacki -
Extracted redirect logic from
ActionController::ForceSSL::ClassMethods.force_ssl
intoActionController::ForceSSL#force_ssl_redirect
Jeremy Friesen
-
Make possible to use a block in
button_to
if the button text is hard to fit into the name parameter, e.g.:<%= button_to [:make_happy, @user] do %> Make happy <%= @user.name %> <% end %> # => "<form method="post" action="/users/1/make_happy" class="button_to"> #
 # <button type="submit"> # Make happy Name # </button> #
 # </form>"
Sergey Nartimov
-
Change a way of ordering helpers from several directories. Previously, when loading helpers from multiple paths, all of the helpers files were gathered into one array an then they were sorted. Helpers from different directories should not be mixed before loading them to make loading more predictable. The most common use case for such behavior is loading helpers from engines. When you load helpers from application and engine Foo, in that order, first rails will load all of the helpers from application, sorted alphabetically and then it will do the same for Foo engine.
Piotr Sarnacki
-
truncate
now always returns an escaped HTML-safe string. The option:escape
can be used as false to not escape the result.Li Ellis Gallardo + Rafael Mendonça França
-
truncate
now accepts a block to show extra content when the text is truncated. Li Ellis Gallardo -
Add
week_field
,week_field_tag
,month_field
,month_field_tag
,datetime_local_field
,datetime_local_field_tag
,datetime_field
anddatetime_field_tag
helpers. Carlos Galdino -
Add
color_field
andcolor_field_tag
helpers. Carlos Galdino -
assert_generates
,assert_recognizes
, andassert_routing
all raiseAssertion
instead ofRoutingError
David Chelimsky -
URL path parameters with invalid encoding now raise
ActionController::BadRequest
. Andrew White -
Malformed query and request parameter hashes now raise
ActionController::BadRequest
. Andrew White -
Add
divider
option togrouped_options_for_select
to generate a separatoroptgroup
automatically, and deprecateprompt
as third argument, in favor of using an options hash. Nicholas Greenfield -
Add
time_field
andtime_field_tag
helpers which render aninput[type="time"]
tag. Alex Soulim -
Removed old text helper apis from
highlight
,excerpt
andword_wrap
. Jeremy Walker -
Templates without a handler extension now raises a deprecation warning but still defaults to ERB. In future releases, it will simply return the template contents. Steve Klabnik
-
Deprecate
:disable_with
in favor ofdata: { disable_with: "Text" }
option fromsubmit_tag
,button_tag
andbutton_to
helpers.Carlos Galdino + Rafael Mendonça França
-
Remove
:mouseover
option fromimage_tag
helper. Rafael Mendonça França -
The
select
method (select tag) forces:include_blank
ifrequired
is true anddisplay size
is one andmultiple
is not true. Angelo Capilleri -
Copy literal route constraints to defaults so that url generation know about them. The copied constraints are
:protocol
,:subdomain
,:domain
,:host
and:port
.Andrew White
-
respond_to
andrespond_with
now raiseActionController::UnknownFormat
instead of directly returning head 406. The exception is rescued and converted to 406 in the exception handling middleware. Steven Soroka -
Allows
assert_redirected_to
to match against a regular expression. Andy Lindeman -
Add backtrace to development routing error page. Richard Schneeman
-
Replace
include_seconds
boolean argument withinclude_seconds: true
option indistance_of_time_in_words
andtime_ago_in_words
signature. Dmitriy Kiriyenko -
Make current object and counter (when it applies) variables accessible when rendering templates with :object / :collection. Carlos Antonio da Silva
-
JSONP now uses mimetype
text/javascript
instead ofapplication/json
. omjokine -
Allow to lazy load
default_form_builder
by passing aString
instead of a constant. Piotr Sarnacki -
Session arguments passed to
process
calls in functional tests are now merged into the existing session, whereas previously they would replace the existing session. This change may break some existing tests if they are asserting the exact contents of the session but should not break existing tests that only assert individual keys.Andrew White
-
In the routes DSL the
:via
option ofmatch
is now mandatory.For routes that respond to one single verb it is recommended to use the more specific macros
get
,post
, etc. instead. You can still map all HTTP verbs to one action withmatch
, but it has to be explictly configured using:via => :all
.José Valim and Yehuda Katz
-
Add
index
method to FormBuilder class. Jorge Bejar -
Remove the leading n added by textarea on
assert_select
. Santiago Pastorino -
Changed default value for
config.action_view.embed_authenticity_token_in_remote_forms
tofalse
. This change breaks remote forms that need to work also without JavaScript, so if you need such behavior, you can either set it totrue
or explicitly passauthenticity_token: true
in form options. -
Added
ActionDispatch::SSL
middleware that when included force all the requests to be under HTTPS protocol. Rafael Mendonça França -
Add
include_hidden
option to select tag. Withinclude_hidden: false
select withmultiple
attribute doesn't generate hidden input with blank value. Vasiliy Ermolovich -
Removed default
size
option from thetext_field
,search_field
,telephone_field
,url_field
,email_field
helpers. Philip Arndt -
Removed default
cols
androws
options from thetext_area
helper. Philip Arndt -
Adds support for layouts when rendering a partial with a given collection. serabe
-
Allows the route helper
root
to take a string argument. For example,root 'pages#main'
. bcardarella -
Forms of persisted records use always PATCH (via the
_method
hack). fxn -
For resources, both PATCH and PUT are routed to the
update
action. fxn -
Don't ignore
force_ssl
in development. This is a change of behavior - use a:if
condition to recreate the old behavior.class AccountsController < ApplicationController force_ssl if: :ssl_configured? def ssl_configured? !Rails.env.development? end end
Pat Allan
-
Adds support for the PATCH verb:
-
Request objects respond to
patch?
. -
Routes have a new
patch
method, and understand:patch
in the existing places where a verb is configured, like:via
. -
New method
patch
available in functional tests. -
If
:patch
is the default verb for updates, edits are tunneled as PATCH rather than as PUT, and routing acts accordingly. -
New method
patch_via_redirect
available in integration tests.
dlee
-
-
expires_in
accepts amust_revalidate
flag. If true, “must-revalidate” is added to the Cache-Control header. fxn -
Add
date_field
anddate_field_tag
helpers which render aninput[type="date"]
tag Olek Janiszewski -
Adds
image_url
,javascript_url
,stylesheet_url
,audio_url
,video_url
, andfont_url
to assets tag helper. These URL helpers will return the full path to your assets. This is useful when you are going to reference this asset from external host. Prem Sichanugrist -
Default responder will now always use your overridden block in
respond_with
to render your response. Prem Sichanugrist -
Allow
value_method
andtext_method
arguments fromcollection_select
andoptions_from_collection_for_select
to receive an object that responds to:call
, such as aproc
, to evaluate the option in the current element context. This works the same way withcollection_radio_buttons
andcollection_check_boxes
.Carlos Antonio da Silva + Rafael Mendonça França
-
Add
collection_check_boxes
form helper, similar tocollection_select
: Example:collection_check_boxes :post, :author_ids, Author.all, :id, :name # Outputs something like: <input id="post_author_ids_1" name="post[author_ids][]" type="checkbox" value="1" /> D. Heinemeier Hansson <input id="post_author_ids_2" name="post[author_ids][]" type="checkbox" value="2" /> D. Thomas <input name="post[author_ids][]" type="hidden" value="" />
The label/check_box pairs can be customized with a block.
Carlos Antonio da Silva + Rafael Mendonça França
-
Add
collection_radio_buttons
form helper, similar tocollection_select
: Example:collection_radio_buttons :post, :author_id, Author.all, :id, :name # Outputs something like: <input id="post_author_id_1" name="post[author_id]" type="radio" value="1" /> D. Heinemeier Hansson <input id="post_author_id_2" name="post[author_id]" type="radio" value="2" /> D. Thomas
The label/radio_button pairs can be customized with a block.
Carlos Antonio da Silva + Rafael Mendonça França
-
check_box
with:form
html5 attribute will now replicate the:form
attribute to the hidden field as well. Carlos Antonio da Silva -
label
form helper acceptsfor: nil
to not generate the attribute. Carlos Antonio da Silva -
Add
:format
option tonumber_to_percentage
. Rodrigo Flores -
Add
config.action_view.logger
to configure logger for Action View. Rafael Mendonça França -
Deprecated
ActionController::Integration
in favour ofActionDispatch::Integration
. -
Deprecated
ActionController::IntegrationTest
in favour ofActionDispatch::IntegrationTest
. -
Deprecated
ActionController::PerformanceTest
in favour ofActionDispatch::PerformanceTest
. -
Deprecated
ActionController::AbstractRequest
in favour ofActionDispatch::Request
. -
Deprecated
ActionController::Request
in favour ofActionDispatch::Request
. -
Deprecated
ActionController::AbstractResponse
in favour ofActionDispatch::Response
. -
Deprecated
ActionController::Response
in favour ofActionDispatch::Response
. -
Deprecated
ActionController::Routing
in favour ofActionDispatch::Routing
. -
check_box helper
withdisabled: true
will generate a disabled hidden field to conform with the HTML convention where disabled fields are not submitted with the form. This is a behavior change, previously the hidden tag had a value of the disabled checkbox. Tadas Tamosauskas -
favicon_link_tag
helper will now use the favicon in app/assets by default. Lucas Caton -
ActionView::Helpers::TextHelper#highlight
now defaults to the HTML5mark
element. Brian Cardarella
Please check 3-2-stable for previous changes.


Lesson 1 Introduction
teaching: 25
exercises: 15
adapted from: https://datacarpentry.org/r-socialsci/00-intro/index.html
& http://swcarpentry.github.io/r-novice-gapminder/02-project-intro/index.html
questions:
- How to find your way around RStudio?
- How to interact with R?
objectives:
- Install latest version of R.
- Install latest version of RStudio.
- Navigate the RStudio GUI.
- Create self-contained projects in RStudio
keypoints:
- Use RStudio to write and run R programs.
1.1 What is R? What is RStudio?
The term “R
” is used to refer to both the programming language and the software that interprets the scripts written using it.
RStudio is currently a very popular way to not only write your R scripts but also to interact with the R software. To function correctly, RStudio needs R and therefore both need to be installed on your computer.
To make it easier to interact with R, we will use RStudio. RStudio is the most popular IDE (Integrated Development Interface) for R. An IDE is a piece of software that provides tools to make programming easier.
1.2 Why learn R?
1.2.1 R does not involve lots of pointing and clicking, and that’s a good thing
The learning curve might be steeper than with other software, but with R, the results of your analysis do not rely on remembering a succession of pointing and clicking, but instead on a series of written commands, and that’s a good thing!
Working with scripts makes the steps you used in your analysis clear, and the code you write can be inspected by someone else who can give you feedback and spot mistakes.
Working with scripts forces you to have a deeper understanding of what you are doing, and facilitates your learning and comprehension of the methods you use.
1.2.2 R code is great for reproducibility
Reproducibility is when someone else (including your future self) can obtain the same results from the same dataset when using the same analysis.
R integrates with other tools to generate manuscripts from your code. If you collect more data, or fix a mistake in your dataset, the figures and the statistical tests in your manuscript are updated automatically.
An increasing number of journals and funding agencies expect analyses to be reproducible, so knowing R will give you an edge with these requirements.
1.2.3 R is interdisciplinary and extensible
With 10,000+ packages that can be installed to extend its capabilities, R provides a framework that allows you to combine statistical approaches from many scientific disciplines to best suit the analytical framework you need to analyze your data. For instance, R has packages for image analysis, GIS, time series, population genetics, and a lot more.
1.2.4 R works on data of all shapes and sizes
The skills you learn with R scale easily with the size of your dataset. Whether your dataset has hundreds or millions of lines, it won’t make much difference to you.
R is designed for data analysis. It comes with special data structures and data types that make handling of missing data and statistical factors convenient.
R can connect to spreadsheets, databases, and many other data formats, on your computer or on the web.
1.2.5 R produces high-quality graphics
The plotting functionalities in R are endless, and allow you to adjust any aspect of your graph to convey most effectively the message from your data.
1.2.6 R has a large and welcoming community
Thousands of people use R daily. Many of them are willing to help you through mailing lists and websites such as Stack Overflow, or on the RStudio community. Questions which are backed up with short, reproducible code snippets are more likely to attract knowledgeable responses.
1.2.7 Not only is R free, but it is also open-source and cross-platform
Anyone can inspect the source code to see how R works. Because of this transparency, there is less chance for mistakes, and if you (or someone else) find some, you can report and fix bugs.
Because R is open source and is supported by a large community of developers and users, there is a very large selection of third-party add-on packages which are freely available to extend R’s native capabilities.
RStudio extends what R can do, and makes it easier to write R code and interact with R
1.3 Knowing your way around RStudio
Let’s start by learning about RStudio, which is an Integrated Development Environment (IDE) for working with R.
The RStudio IDE open-source product is free under the Affero General Public License (AGPL) v3. The RStudio IDE is also available with a commercial license and priority email support from RStudio, Inc.
We will use the RStudio IDE to write code, navigate the files on our computer, inspect the variables we create, and visualize the plots we generate. RStudio can also be used for other things (e.g., version control, developing packages, writing Shiny apps) that we will not cover during the workshop.
One of the advantages of using RStudio is that all the information you need to write code is available in a single window. Additionally, RStudio provides many shortcuts, autocompletion, and highlighting for the major file types you use while developing in R. RStudio makes typing easier and less error-prone.
1.4 Getting set up
The scientific process is naturally incremental, and many projects start life as random notes, some code, then a manuscript, and eventually everything is a bit mixed together.
Most people tend to organize their projects like this:
There are many reasons why we should ALWAYS avoid this:
- It is really hard to tell which version of your data is the original and which is the modified;
- It gets really messy because it mixes files with various extensions together;
- It probably takes you a lot of time to actually find things, and relate the correct figures to the exact code that has been used to generate it;
A good project layout will ultimately make your life easier:
- It will help ensure the integrity of your data;
- It makes it simpler to share your code with someone else (a lab-mate, collaborator, or supervisor);
- It allows you to easily upload your code with your manuscript submission;
- It makes it easier to pick the project back up after a break.
It is good practice to keep a set of related data, analyses, and text self-contained in a single folder called the working directory. All of the scripts within this folder can then use relative paths to files. Relative paths indicate where inside the project a file is located (as opposed to absolute paths, which point to where a file is on a specific computer). Working this way makes it a lot easier to move your project around on your computer and share it with others without having to directly modify file paths in the individual scripts.
RStudio provides a helpful set of tools to do this through its “Projects” interface, which not only creates a working directory for you but also remembers its location (allowing you to quickly navigate to it). The interface also (optionally) preserves custom settings and open files to make it easier to resume work after a break.
1.4.1 Create a new project
- Under the
File
menu, click onNew project
, chooseNew directory
, thenNew project
- Enter a name for this new folder (or “directory”) and choose a convenient location for it. This will be your working directory for the rest of the day (e.g.,
~/data-carpentry
) - Click on
Create project
- Create a new file where we will type our scripts. Go to File > New File > R script. Click the save icon on your toolbar and save your script as “
script.R
”.
Now when we start R in this project directory, or open this project with RStudio, all of our work on this project will be entirely self-contained in this directory.
1.4.2 The RStudio Interface
Let’s take a quick tour of RStudio. RStudio is divided into four “panes”. The placement of these panes and their content can be customized (see menu, Tools -> Global Options -> Pane Layout).
The Default Layout is: - Top Left - Source: your scripts and documents - Bottom Left - Console: what R would look and be like without RStudio - Top Right - Enviornment/History: look here to see what you have done - Bottom Right - Files and more: see the contents of the project/working directory here, like your Script.R file
1.4.3 Organizing your working directory
Using a consistent folder structure across your projects will help keep things organized and make it easy to find/file things in the future. This can be especially helpful when you have multiple projects. In general, you might create directories (folders) for scripts, data, and documents. Here are some examples of suggested directories:
data/
Use this folder to store your raw data and intermediate datasets. For the sake of transparency and provenance, you should always keep a copy of your raw data accessible and do as much of your data cleanup and preprocessing programmatically (i.e., with scripts, rather than manually) as possible.data_output/
When you need to modify your raw data, it might be useful to store the modified versions of the datasets in a different folder.documents/
Used for outlines, drafts, and other text.fig_output/
This folder can store the graphics that are generated by your scripts.scripts/
A place to keep your R scripts for different analyses or plotting.
You may want additional directories or subdirectories depending on your project needs, but these should form the backbone of your working directory.
1.4.4 The working directory
The working directory is an important concept to understand. It is the place where R will look for and save files. When you write code for your project, your scripts should refer to files in relation to the root of your working directory and only to files within this structure.
Using RStudio projects makes this easy and ensures that your working directory is set up properly. If you need to check it, you can use getwd()
. If for some reason your working directory is not what it should be, you can change it in the RStudio interface by navigating in the file browser to where your working directory should be, clicking on the blue gear icon “More”, and selecting “Set As Working Directory”. Alternatively, you can use setwd("/path/to/working/directory")
to reset your working directory. However, your scripts should not include this line, because it will fail on someone else’s computer.
1.5 Interacting with R
The basis of programming is that we write down instructions for the computer to follow, and then we tell the computer to follow those instructions. We write, or code, instructions in R because it is a common language that both the computer and we can understand. We call the instructions commands and we tell the computer to follow the instructions by executing (also called running) those commands.
There are two main ways of interacting with R: by using the console or by using script files (plain text files that contain your code). The console pane (in RStudio, the bottom left panel) is the place where commands written in the R language can be typed and executed immediately by the computer. It is also where the results will be shown for commands that have been executed. You can type commands directly into the console and press Enter to execute those commands, but they will be forgotten when you close the session.
Because we want our code and workflow to be reproducible, it is better to type the commands we want in the script editor and save the script. This way, there is a complete record of what we did, and anyone (including our future selves!) can easily replicate the results on their computer.
RStudio allows you to execute commands directly from the script editor by using the Ctrl + Enter shortcut (on Mac, Cmd + Return will work). The command on the current line in the script (indicated by the cursor) or all of the commands in selected text will be sent to the console and executed when you press Ctrl + Enter. If there is information in the console you do not need anymore, you can clear it with Ctrl + L.
You can find other keyboard shortcuts in this RStudio cheatsheet about the RStudio IDE.
At some point in your analysis, you may want to check the content of a variable or the structure of an object without necessarily keeping a record of it in your script. You can type these commands and execute them directly in the console. RStudio provides the Ctrl + 1 and Ctrl + 2 shortcuts allow you to jump between the script and the console panes.
If R is ready to accept commands, the R console shows a >
prompt. If R receives a command (by typing, copy-pasting, or sent from the script editor using Ctrl + Enter), R will try to execute it and, when ready, will show the results and come back with a new >
prompt to wait for new commands.
If R is still waiting for you to enter more text, the console will show a +
prompt. It means that you haven’t finished entering a complete command. This is likely because you have not ‘closed’ a parenthesis or quotation, i.e. you don’t have the same number of left-parentheses as right-parentheses or the same number of opening and closing quotation marks.
When this happens, and you thought you finished typing your command, click inside the console window and press Esc; this will cancel the incomplete command and return you to the >
prompt. You can then proofread the command(s) you entered and correct the error.


--- title: Pads the 2nd and 3rd dimensions of a 4D tensor. type: docs repo: https://github.com/rstudio/keras menu: main: name: Pads the 2nd and 3rd dimensions of a 4D tensor. - keras parent: keras-reference aliases: - /reference/keras/k_spatial_2d_padding.html - /keras/reference/k_spatial_2d_padding.html - /guide/keras/reference/k_spatial_2d_padding.html - /tools/tools/keras/reference/k_spatial_2d_padding.html - /installation/keras/reference/k_spatial_2d_padding.html - /tutorials/keras/reference/k_spatial_2d_padding.html - /guide/tools/keras/reference/k_spatial_2d_padding.html - /deploy/keras/reference/k_spatial_2d_padding.html - /tools/keras/reference/k_spatial_2d_padding.html - /tutorials/tools/keras/reference/k_spatial_2d_padding.html ---
Pads the 2nd and 3rd dimensions of a 4D tensor.
| x | Tensor or variable. |
| padding | Tuple of 2 lists, padding pattern. |
| data_format | string, |
A padded 4D tensor.
This function is part of a set of Keras backend functions that enable lower level access to the core operations of the backend tensor engine (e.g. TensorFlow, CNTK, Theano, etc.).
You can see a list of all available backend functions here: https://keras.rstudio.com/articles/backend.html#backend-functions.


|
WUT Velma robot API
|
Functions | |
| def | strFrame (T) |
| def | printFrame (T) |
| def | testFK (arm_name) |
| def | generateTestQ () |
| def | testIk1 () |
| def | testIk2 (arm_name, T_A0_A7d, ampl) |
| def | randomOrientation () |
| def | testIk3 (arm_name) |
| def | main () |
| def test_velma_ik_geom.generateTestQ | ( | ) |
Definition at line 93 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.main | ( | ) |
Definition at line 262 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.printFrame | ( | T | ) |
Definition at line 53 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.randomOrientation | ( | ) |
Definition at line 193 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.strFrame | ( | T | ) |
Definition at line 49 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.testFK | ( | arm_name | ) |
Definition at line 56 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.testIk1 | ( | ) |
Definition at line 114 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.testIk2 | ( | arm_name, | |
| T_A0_A7d, | |||
| ampl | |||
| ) |
Definition at line 138 of file test_velma_ik_geom.py.
| def test_velma_ik_geom.testIk3 | ( | arm_name | ) |
Definition at line 207 of file test_velma_ik_geom.py.


@(activities: List[Activity], user: User) @main("Dashboard") { @dashboard_menu() @* hidden field to get user id *@
| Type | Location | Distance Km | Date | Duration minutes |
|---|---|---|---|---|
| @activities(i).activityType | @activities(i).location | @activities(i).distance | @activities(i).date | @activities(i).duration |