Plodac1656.github.io
Page 1. Owner’s Manual Manuel d'utilisation Bedienungsanleitung Manual de usuario. Page 2. AC adapter from the wall outlet. a telephone sale, you must verify that this product is intended to be used in the country Then contact your nearest VOX dealer or the store where the equipment in which you reside. VOX MINI 3 G2 OWNER'S MANUAL Pdf Download. VOX VT20X OWNER'S MANUAL Pdf Download. View and Download Vox VT20X owner's manual online. modeling. VT20X Musical Instrument Amplifier pdf manual download. Also for: Vt40x.


USB Controller definitions for general USB controller management.
More...
Functions, macros, variables, enums and types related to the setup and management of the USB interface.
◆ ENDPOINT_DIR_IN
| #define ENDPOINT_DIR_IN 0x80 |
Endpoint address direction mask for an IN direction (Device to Host) endpoint. This may be ORed with the index of the address within a device to obtain the full endpoint address.
◆ ENDPOINT_DIR_MASK
| #define ENDPOINT_DIR_MASK 0x80 |
Endpoint direction mask, for masking against endpoint addresses to retrieve the endpoint's direction for comparing with the ENDPOINT_DIR_*
masks.
◆ ENDPOINT_DIR_OUT
| #define ENDPOINT_DIR_OUT 0x00 |
Endpoint address direction mask for an OUT direction (Host to Device) endpoint. This may be ORed with the index of the address within a device to obtain the full endpoint address.
◆ EP_TYPE_BULK
| #define EP_TYPE_BULK 0x02 |
◆ EP_TYPE_CONTROL
| #define EP_TYPE_CONTROL 0x00 |
◆ EP_TYPE_INTERRUPT
| #define EP_TYPE_INTERRUPT 0x03 |
◆ EP_TYPE_ISOCHRONOUS
| #define EP_TYPE_ISOCHRONOUS 0x01 |
◆ EP_TYPE_MASK
| #define EP_TYPE_MASK 0x03 |
Mask for determining the type of an endpoint from an endpoint descriptor. This should then be compared with the EP_TYPE_*
masks to determine the exact type of the endpoint.
◆ USB_USBTask()
| void USB_USBTask |
( |
void |
| ) |
|
This is the main USB management task. The USB driver requires this task to be executed continuously when the USB system is active (device attached in host mode, or attached to a host in device mode) in order to manage USB communications. This task may be executed inside an RTOS, fast timer ISR or the main user application loop.
The USB task must be serviced within 30ms while in device mode, or within 1ms while in host mode. The task may be serviced at all times, or (for minimum CPU consumption):
If in device mode (only), the control endpoint can instead be managed via interrupts entirely by the library by defining the INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch.
- See also
- USB Events for more information on the USB events.
◆ USB_ControlRequest
Structure containing the last received Control request when in Device mode (for use in user-applications inside of the EVENT_USB_Device_ControlRequest() event, or for filling up with a control request to issue when in Host mode before calling USB_Host_SendControlRequest().
- Note
- The contents of this structure is automatically endian-corrected for the current CPU architecture.
◆ USB_IsInitialized
| volatile bool USB_IsInitialized |
Indicates if the USB interface is currently initialized but not necessarily connected to a host or device (i.e. if USB_Init() has been run). If this is false, all other library globals related to the USB driver are invalid.
- Note
- This variable should be treated as read-only in the user application, and never manually changed in value.


The DJ Language
William Falk-Wallace
Hila Gutfreund
Emily Lemonier
Thomas Elling
Mission
MUZAK N JUNX
Tools Used
writelatex.com
: real-time co-editing LaTeX documents
git
/
github
: code and documents storage and version control
dropbox
: references files and static/large file transfer and storage
google drive
: coediting, versioning and storage for management documents and notes
google hangouts
: remote meetings, work sessions, and discussions
Deck.js
: presentation javascript library (this presentation)
Twitter Bootstrap
: presentation slide and main webpage styles
Sublime Text 2
: code editor with OCaml, Java, HTML/CSS/JS, and Make extensions
Eclipse
: Java IDE for java output code practice
←
→
/
Go to slide:
#


For over 20 years, X by 2 has worked with industry leaders in healthcare, insurance, retail and more, providing high impact strategy, architecture and implementation services. Bilingual in both business and technology, our experienced team of architects and program leaders deliver pragmatic solutions focused on results. We’re not beholden to technology partners or service providers, instead we choose the tools best-suited to our clients' needs. You’ll never get our B-Team. We don’t have one. Our uncompromising standards apply to our people, our work and our clients' success.
{{ value.description }}


Executing conditional logic using API flow variables
The Apigee API Platform defines a set of predefined variables that are useful for enabling dynamic dynamic behavior in your API flow.
For example, it is extremely useful to execute certain logic on when a request is received from a mobile device, or to customize a response message based on the locale of the requesting app.
Conditions can be used at several levels. Conditions can apply to individual policies, and, by extension, individual code snippets or apps.
Conditions can apply to named flows, and thus to sequences of policies.
Conditions can also be applied to route definitions, enabling you to route requests to different backend services based on values in the request message, the time of day, the IP address of the client, and so on.
It is a useful exercise to read through the complete of predefined variables to imagine how you might optimize the behavior of APIs for your customers.
You are also free to define custom variables. Custom variables are typically based on specific data that you expect in request or response messages. For example, you might create a custom variable that defines the value for forecast in a weather report. You could then modify responses to an end user based on the weather forecast for her locale.
In this example, you conditionally execute a Python script based on the presence of an HTTP header.
response_time = flow.getVariable("target.received.start.timestamp") - flow.getVariable("target.sent.start.timestamp"); response.setVariable("header.X-Apigee-target", flow.getVariable("target.url")); response.setVariable("header.X-Apigee-request-uri", flow.getVariable("request.uri")); response.setVariable("header.X-Apigee-request-verb", flow.getVariable("request.verb")); response.setVariable("header.X-Apigee-start-time", flow.getVariable("target.sent.start.time")); response.setVariable("header.X-Apigee-start-timestamp", flow.getVariable("target.sent.start.timestamp")); response.setVariable("header.X-Apigee-end-time", flow.getVariable("target.sent.end.time")); response.setVariable("header.X-Apigee-end-timestamp", flow.getVariable("target.received.start.timestamp")); response.setVariable("header.X-Apigee-target-responseTime", response_time);


UK police investigating alleged assault on Hong Kong justice secretary in London
LONDON (Reuters) - British police said they are investigating the alleged assault on the Hong Kong justice secretary in London, but so far there have been not been any arrests.
Teresa Cheng, who was in London to promote Hong Kong as a dispute resolution and deal-making hub, was targeted on Thursday by a group of protesters who shouted “murderer” and “shameful”.
“A woman was taken to hospital by London Ambulance Service suffering an injury to her arm,” the police said in a statement.
“Enquiries are ongoing to establish the full circumstances. There has been no arrest at this stage.”


Npt documentation.
Reference: ANSI Common Lisp npt
Prev: 6. Escape Operations
Next: 8. Paper Object
This chapter explains how to start npt in C.
In normal C, the main
function is the start of execution, and in Windows, it is the WinMain
function.
Here’s how npt is initialized in both cases.
To start npt, first execute the following function
void lisp_init(void);
This function initializes a static variable used by the C language in npt and declares it ready to be used.
The corresponding release process is the following functions.
void lisp_free(void);
After the initialization process is executed, the function pointer can be registered. The function pointer registration is a process using the following functions, for example.
void lisp_compiled_rest(int index, lisp_calltype_rest call);
Once the function pointer is executed, it persists until it is released with lisp_free
.
The command argument is the argc
, argv
, and env
of the main
function.
The function used for reading is as follows.
struct lispargv *lispargv_main(int argc, char *argv[], char *env[]);
In case of an error, null is returned.
Since the memory is dynamically allocated, the following release process is required at the time of exit.
void lispargv_free(struct lispargv *ptr);
An example is shown below.
int main(int argc, char *argv[], char *env[])
{
struct lispargv *args;
();
lisp_init= lispargv_main(argc, argv, env);
args if (args == NULL) {
(stderr, "argv error\n");
fprintfreturn 1;
}
/* Here's the code for npt. */
/* free */
(args);
lispargv_free();
lisp_free
return 0;
}
The function lispargv_main
ignores argc
, argv
, and env
on Windows, and forces the following functions to be executed instead.
struct lispargv *lispargv_windows(void);
This function is equivalent to the lispargv_main
, but it gets the arguments and environment variables from the WIN32API.
If the function WinMain
is used, the above function should be used because there is no argument like argc
.
However, it is possible to start the program from the main
function even on Windows.
Even in such a case, it forces the lispargv_windows
function to be used to process the character code correctly.
If you want to run the function from the main
function instead of lispargv_windows
, use the following function.
struct lispargv *lispargv_main_force(int argc, char *argv[], char *env[]);
This function forces reading of arguments, even on Windows.
If argc
, argv
, and env
are not present or you do not want to specify them, perform as follows.
= lispargv_main_force(0, NULL, NULL); args
This section explains how to set up Npt manually instead of from arguments.
Here’s an example of a typical --standalone
mode configuration
->mode_core = 0;
args->mode_degrade = 0;
args->mode_standalone = 1;
args->nocore = 1;
args->noinit = 1;
args->debugger = 1;
args->debuggerp = 0;
args->quit = 1; args
To change the size of the memory, do the following
->heap = 1024UL * 1024UL*1024UL; /* 1G */
args->local = 256UL * 1024UL*1024UL; /* 256M */ args
heap
is the size of the heap area.
local
is the size of the stack region.
Both are allocated by malloc
in the initial stage of npt execution.
To summarize the above, the following is a typical main
function.
int main(int argc, char *argv[], char *env[])
{
int result;
struct lispargv *args;
/* initialize */
();
lisp_init= lispargv_main(argc, argv, env);
args if (args == NULL) {
(stderr, "argv error\n");
fprintfreturn 1;
}
/* main_argv */
->mode_core = 0;
args->mode_degrade = 0;
args->mode_standalone = 1;
args->nocore = 1;
args->noinit = 1;
args->debugger = 1;
args->debuggerp = 0;
args->quit = 1;
args= main_argv(args);
result
/* free */
(args);
lispargv_free();
lisp_free
return result;
}
Next, the function main_argv
is created.
If the argument is something about the display, such as --help
, it prints the information and exits the execution.
static int main_argv(struct lispargv *args)
{
if (args->mode_help)
return lisp_main_help(stdout);
if (args->mode_version)
return lisp_main_version(args, stdout);
if (args->mode_degrade)
return lisp_main_degrade(args);
/* Create the content here in the next chapter. */
return 0
}
The following arguments are now supported
--help
--version
--version-script
--degrade
main_lisp
The next step is to build the npt environment.
The following functions are used.
int lisp_argv_init(struct lispargv *ptr);
int lisp_argv_run(struct lispargv *ptr);
The lisp_argv_init
function is used to prepare and run Lisp by the lisp_argv_run
function.
As shown in the previous examples, set the main_lisp
function to args->call
.
The following is an example.
int main_lisp(void *call_ptr)
{
return 0;
}
static int main_argv(struct lispargv *args)
{
/* mode */
if (args->mode_help)
return lisp_main_help(stdout);
if (args->mode_version)
return lisp_main_version(args, stdout);
if (args->mode_degrade)
return lisp_main_degrade(args);
/* execute */
->call = main_lisp;
args->call_ptr = NULL;
args(args);
lisp_argv_init(args);
lisp_argv_run
return lisp_code? 1: lisp_result;
}
The return value of lisp_argv_init
and lisp_argv_run
is returned whether an error occurred or not. However, since the variable lisp_code
is set to show whether an error occurred or not, you only have to check this value.
The main_lisp
function registered at args->call
is called with args->call_ptr
as an argument.
The reason why you need to register them with function pointers is that you need to set various settings before executing them in order for them to work properly as Common Lisp.
One example is the handling of handler-bind
used in the warn
function.
The main_lisp
function is an escape function, which is a little different from the usual escape function. If the function returns a non-zero value on non-escape, it assumes an abnormal exit and ignores all subsequent operations and exits with the exit code 1
.
To summarize the content, here’s the first example sentence 1. Using Npt in C.
int main_lisp(void *call_ptr)
{
return lisp_format8_(NULL, "Hello~%", NULL);
}
static int main_argv(struct lispargv *args)
{
/* mode */
if (args->mode_help)
return lisp_main_help(stdout);
if (args->mode_version)
return lisp_main_version(args, stdout);
if (args->mode_degrade)
return lisp_main_degrade(args);
/* execute */
->call = main_lisp;
args->call_ptr = NULL;
args(args);
lisp_argv_init(args);
lisp_argv_run
return lisp_code? 1: lisp_result;
}
int main(int argc, char *argv[], char *env[])
{
int result;
struct lispargv *args;
/* initialize */
();
lisp_init= lispargv_main(argc, argv, env);
args if (args == NULL) {
(stderr, "argv error\n");
fprintfreturn 1;
}
/* main_argv */
->mode_core = 0;
args->mode_degrade = 0;
args->mode_standalone = 1;
args->nocore = 1;
args->noinit = 1;
args->debugger = 1;
args->debuggerp = 0;
args->quit = 1;
args= main_argv(args);
result
/* free */
(args);
lispargv_free();
lisp_free
return result;
}
The results are as follows.
Hello


| Sales Order | Sales Channel | Customer Name | Shipment | Payment | Total | Date Created | Action | |
|---|---|---|---|---|---|---|---|---|
| {{item.salesOrderNumber}} | {{item.customerName}} | In Progress Partial Paid Paid Issued | In Progress Delivered Partial Delivered Partially Issued Issued | {{SetFixedToDot(item.total)}} | {{item.dateOrdered | date}} | |||
|
Not Data Found
|


Think of HTML like a plain bowl of porridge - nutritious but boring. CSS are the toppings; brown sugar, banana, golden syrup. Anything you like to add flavour. Combined, the porridge and toppings make a delicious breakfast.
Control flow is the order in which statements in code are executed. If it reaches a loop it will go back to a specified point and run the rest of the code again.
Here’s a real world example of control flow and loops: steps you might follow when washing your car.
DOM is an acronym for Document object model.
Document: your web page/HTML file.
Object: refers to HTML elements e.g. head, h1, img.
Model: the structure of the HTML file. Each of these elements and sub elements in the structure are also referred to as Nodes.
It is an API (Application Programming Interface) for HTML, CSS and JS. It is a tree-like structure representation of your web page code. It is a middleman between you and your web page that lets you talk to your web page through commands and queries and responds with results.
The DOM is accessed through your web broswer by right clicking anywhere on the page and selecting 'Inspect'. The keyboard shortcut for this in Chrome using Windows is CTRL+Shift+I.
You can use the DOM as a testing space essentially by changing element content or changing the colour of a background for example. Rather than altering this data in your HTML or CSS files, you can make these changes directly through the DOM and play around with what looks or works better. Just make sure to save the code of the changes back to the files to make the changes permanent.
Arrays and objects are both used to store information but the way to access data from them is quite different.
Objects
You would use an object to store information for a certain ‘thing’, like attributes of a person, the code consists of keys (firstName) and values ("Ben"). The data is called upon by separating the action and the key with a dot operator ‘.’
Arrays
An array would be used for something like a list of items associated with one thing, like a list of cities of a country. The contents of an array are assigned numbers, starting from zero. To access this data you call upon the number in order of which they appear in the array.
Functions run a set of specified commands that return a result. A function could be something like a simple mathematical equation or extracting data from an array.
Functions allow you to create easily reusable code that can be called upon anywhere else in your work. This saves time and creates convenience.


All incoming requests are placed at the end of the queue. Whatever number that is next in the queue will be the next number served. Using this algorithm doesn't provide the best results. To determine the number of head movements you would simply find the number of tracks it took to move from one request to the next. For this case it went from 50 to 95 to 180 and so on. From 50 to 95 it moved 45 tracks. If you tally up the total number of tracks you will find how many tracks it had to go through before finishing the entire request. In this example, it had a total head movement of 640 tracks. The disadvantage of this algorithm is noted by the oscillation from track 50 to track 180 and then back to track 11 to 123 then to 64. As you will soon see, this is the worse algorithm that one can use.
AdvantagesEXAMPLE : Lets say we are given with the following queue ==> 95, 180, 34, 119, 11, 123, 62, 64 with the Read-write head initially at the track 50 and the tail track being at 199 let us now discuss the different algorithms.


Enter the name:
Enter what u like to order[1 for chicken, 2 for salmon,3 for both]:
Enter how many orders:


Home
Comparison
(current)
API Links:
Home
Comparison
API Links:
Food Name Description
Portions and Weights
Description Category
Category
% Daily Value
Food and Beverage Comparison
Use the interactive charts below to explore the dataset
1.1 Select food:
1.2 Select quantity:
2.1 Select food:
2.2 Select quantity:
Nutrition Info
Nutrition Info


@(title: String)(content: Html)
@title
-
Mon
30°
16°
-
Tue
24°
10°
-
Wed
17°
8°
-
Thu
20°
11°
-
Fri
4°
-5°
-
Sat
0°
-10°
-
765
likes
-
325
retweets
-
56
share
-
Daniel Haim
Hey Stéphanie how are you doing?
-
Stéphanie Walter
Pretty good, browsing themeforest new items.
-
Daniel Haim
Did you find something cool ?
@content


Goals
Getting to know the basics of working with data: collecting, creating, organizing
Software & Other Required Materials
- R
- OCR Engines (https://www.onlineocr.net/)
- Excel, Google Spreadsheets, or any other alternative
In Class I: Theoretical and Conceptual
Ways of obtaining data
- Main format
- Tables; Spreadsheets; CSV / TSV files
- Note: Relational DB is a collection of interconnected tables
- Reusing already produced data
- One may require to mold data into a more fitting structure
- Creating one’s own dataset
- Unique identifiers:
- tables with different data that can be connected via unique identifiers
- Open Linked Data
- Example:
- Table of the growth of cities. One table includes information on population over time; Another table includes coordinates of the cities from the dataset. It is more efficient and practical (reducing error rate from typos) to work on these tables separately, and connect them via unique identifiers of cities which are used in both tables.
- Unique identifiers:
- Digitizing data from printed and/or hand-written sources
Basic principles of organizing data: Tidy Data
Tidy Data
- Each variable is in its own column
- Each observation is in its own row
- Each value is in its own cell
Clean Data
- Column names and row names are easy to use and informative. In general, it is a good practice to avoid
spaces
and special characters.- Good example:
western_cities
- Alternative good example:
WesternCities
- Bad example:
Western Cities (only the largest)
- Good example:
- Obvious mistakes in the data have been removed
- Date format:
YYYY-MM-DD
is the most reliable format. Any thoughts why? - There should be no empty
cells
:- If you have them, it might be that your data is not organized properly.
- If your data is organized properly,
NA
must be used as an explicit indication that data point is not available.
- Each cell must contain only one piece of data.
- Date format:
- Variable values must be internally consistent
- Be consistent in coding your values:
M
andman
are different values computationally, but may be the same in the dataset; - Keep track of your categories: a document where all codes used in the data set are explained.
- Be consistent in coding your values:
- Preserve original values
- If you are working with a historical dataset, it might be inconsistent.
- For example, distances between cities are given in different formats: days of travel, miles, farsaḫs/parasangs, etc.).
- Instead of replacing original values, it is better to create an additional column, where this information will be homogenized according to some principle.
- Keeping original data will allow to honogenize data in multiple ways (example: day of travel).
- Clearly differentiate between the original and modified/modelled values.
- The use of suffixes can be convenient:
Distance_Orig
vsDistance_Modified
.
- The use of suffixes can be convenient:
- If you are working with a historical dataset, it might be inconsistent.
- Most of editing operations should be performed in software other than R; any spreadsheet program will work, unless it cannot export into CSV/TSV format.
- Keep in mind that if you prepare your data in Excel-like program, aby manual highlights, bolds, and italics are not data and they will be lost, when you export your data into CSV/TSV format.
- Note: It might be useful, however, to use rule-based highlighting in order, for example, to identify bad values that need to be fixed.
- Back up your data!
-
is a great place for this, plus it allows to work collaboratively. Google spreadsheets
is a decent alternative, but it lacks version control and detailed tracking of changes.
-
In Class II: Practical
Morris Dataset: the East Vs. the West
| War-making capacity since 4000 BCE (in social development points). Data source: Morris, Ian. 2013. The Measure of Civilization: How Social Development Decides the Fate of Nations. Princeton: Princeton University Press. |
Difficulty: Easy
- Digitize “War-making capacity since 4000 BCE” from this file Morris_2013_Combined.pdf.
- Fix the dataset so that it confirms to the principles of tidy data. What should be corrected?
- Load the data set into R
- Graph chronological changes in war-making capacities for the East and the West.
- When the East was in the lead?
- When the West was in the lead?
- How can you determine that? (Hint: review logical operators and vector comparison).
Difficulty: More complicated
- Digitize “Maximum Settlement Sizes” from this file Morris_2013_Combined.pdf.
- Fix the dataset so that it confirms to the principles of tidy data. What should be corrected?
- The datasets for the East and the West are separate. What would be your strategies to combine them?
- Graph chronological changes in war-making capacities for the East and the West.
- When the East was in the lead? What were the most prominent settlements?
- When the West was in the lead? What were the most prominent settlements?
- How can you determine that? (Hint: review logical operators and vector comparison).
Reference Materials
- Wickham, Hadley. 2014. “Tidy Data.” Journal of Statistical Software 59 (10). https://doi.org/10.18637/jss.v059.i10. (The article in open access)
- Check these slides: A. Ginolhac, E. Koncina, R. Krause. Principles of Tidy Data: tidyr https://lsru.github.io/tv_course/lecture05_tidyr.html (Also check their other lectures/slides: )
- Broman, Karl W., and Kara H. Woo. 2018. “Data Organization in Spreadsheets.” The American Statistician 72 (1): 2–10. https://doi.org/10.1080/00031305.2017.1375989.
Additional
- Morris, Ian. 2013. The Measure of Civilization: How Social Development Decides the Fate of Nations. Princeton: Princeton University Press.
- Note: This book is a methodological companion to: Morris, Ian. 2010. Why the West Rules—for Now: The Patterns of History, and What They Reveal about the Future. New York: Farrar, Straus and Giroux.
Homework
Practical
- Finish the assignment started in class; email report (ideally, as a PDF, since now it will include graphs).
- Find your own small data set published in a book or an article; digitize it using strategies discussed in class; run some analytical tasks (anything from what you have learned so far); create a report.
- Email both reports.
Additional Readings
- Wickham, Hadley. 2014. “Tidy Data.” Journal of Statistical Software 59 (10). https://doi.org/10.18637/jss.v059.i10. (The article in open access)


@* * Copyright 2021 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @this(layout: templates.Layout, h2: components.h2, p: components.p, appConfig: AppConfig ) @(reference: String = "")(implicit request: Request[_], messages: Messages) @layout(pageTitle = messages("confirmation.pageTitle"), showBackLink = false) {


Mouse over a green or red circle to see it's visual test below. If it is red, it has failed. If you want to accept the change, click the red rebase button.


Admission Related Information¶
4.0 Reservation/Relaxation Policy:¶
- The reservation and relaxation policy for SC/ST/OBC candidates is as per the Uttar Pradesh Government rules and Gautam Buddha University rules.
- The sports person providing evidence of participation in National/International level events may be provided 5% relaxation in respective qualifying examination.
5.0 Fee Structure¶
The present fee structure is as follows:
Academic Fee per academic session for:
MBA Programme Rs. 1,95,000/-
- Tech and M. Plan Programme Rs. 95,000/-
Other MA Programme Rs. 10,000/-
MA (Mass Communication) Rs. 24,000/-
MSW (Master in Social Work) Rs. 24,000/-
Master in Disability Rehabilitation Rs. 24,000/-
and Administration (MDRA)
Master in Public Policy and Governance Rs. 10,000/-
- Sc./B. Voc./M. Sc. Programme Rs. 10,000/-
- Phil Programme Rs. 24,000/-
BA, LLB Programme Rs. 85,000/-
BBM-MBA Rs. 95,000/-
B.A. (Hons.)-MA Rs. 12,000/-
Integ. Dual Degree Prog./ B. Arch Rs. 95,000/-
Ph.D. Programmes (All Schools) Rs. 15,000 /-
In addition to the above fee:
- Hostel Charges per academic year will be Rs 30,000/- Per Annum**
- Food Charges per academic year will be Rs. 25500/- Per Annum
- One time Registration Fee will be Rs. 10,000/- (Non Refundable)
- Security Deposit Rs. 10000/- (Refundable)
Note
- Registration fee is not the part of academic fee. Relaxation to SC/ST in the fee is as per UP govt. norms.
- Hostel accommodation is mandatory for all technical programmes.
- Hostel accommodation is optional for BA?MA / B.Sc./M.Sc./ MA/MSW/ MA (MC) programmes.
POLICY FOR REFUND OF FEE:
Voluntary withdrawal from the programme:
- If a student decides to leave within three weeks of the Registration of the programme, fee amount paid (excluding registration) will be refunded after deduction of 20% of total fee.
- No refund will be made, under any circumstances, after the commencement of classes.
- The Hostel charges will be refunded after deducting the amount calculated on pro rata basis.
6.0 Application Procedure - How to Apply¶
Online submission: On-line application form and admission brochure is available on University website: GBU’s Official Website
Application fee is to be submitted through Credit Card/Debit Card/Net Banking/Demand Draft.
| Category | Application fee/programme |
|---|---|
| General/OBC | Rs. 1200 |
| SC/ST (U.P.) | Rs. 600 |
- Candidate must send a copy of the completed application form on the below given address.
- Ph.D. applicants would be required to submit a Tentative Research Proposal in approx. 500 words as per the given area of research. In the title page of the Ph.D. proposal, the discipline and the mode of admission (Full Time/Working professional) should be specified. They may also submit the list of publications or other research credentials (if any).
- The Ph.D. applicants (in working professional mode) are also required to produce a letter of consent from the current employer for providing sufficient facilities and time as required by the University for conducting the research work (only at the time of interview for Ph.D. programme).
- A self attested copy of NATA score (not older than 2 years on the last date of the application form submission, for B.Arch applicants).
The duly signed printout of the completed application form for GPTU-2016 (Integrated Dual Degree Programme B.Tech-M.Tech/MBA (Engg., Biotechnology., Food Processing & Technology), BBA-MBA; BA LLB; B.A. (Hons.)-MA, and all lateral entry programmes); GPT-2016 [For all M.Tech, MBA, M.Phil (Clinical Psychology), Master in Disability Rehabilitation and Administration (MDRA)]; GPTR-2016 for all Ph.D. programmes along with required documents should reach latest by April 5:sup:`th`, 2016. For GPT-2016 (For MA/M.Sc./M.Phil (Buddhist Studies)/ B.Arch, the duly signed printout of the completed application form should reach latest by July 16:sup:`th`, 2016. For Under Graduate/Post Graduate/Doctoral Degree Programmes, please mention ?Application for Under Graduate/Post Graduate/Doctoral Programme (GPTU/GPT/GPTR-2016) on the right top corner of the envelope. Candidate must send the signed printed copy of the filled online application form along with relevant documents to the address given below:
Important
To
The Admission Office
Gautam Buddha University, Near Yamuna Express way,
Greater Noida, Distt. G. B. Nagar, U.P., Pin-201312
7.0 Centres for Entrance Test¶
Attention
(Not applicable for MA/M.Sc./M. Phil (Buddhist), B. Arch, B.A.(Hons.) -MA/ B. Sc. & B. Voc.)
The GPTU-2016, GPT-2016 and GPTR-2016 will be held at following centres. Candidates are advised to give three choices of test centres. The centre may be relocated if the required number of students fails to opt for a particular centre in a specific test. Request of any change in the choice for test centre shall not be entertained under any circumstance.
| Written Examination Centre | Centre Code | Written Examination Centre | Centre Code |
|---|---|---|---|
| Greater Noida (GBU) | 01 | Ranchi | 12 |
| Noida | 02 | Patna | 13 |
| Ghaziabad | 03 | Guwahati | 14 |
| Lucknow | 04 | Hyderabad | 15 |
| Gorakhpur | 05 | Jaipur | 16 |
| Varanasi | 06 | Kanpur | 17 |
| North Delhi | 07 | Bareilly | 18 |
| South Delhi | 08 | Udaipur | 19 |
| Gwalior | 09 | Shillong | 20 |
| Chandigarh | 10 | Jamshedpur | 21 |
| Dehradun | 11 | Pathankot | 22 |


{% extends "format.html" %} {% load static %} {% load filter %} {% block title %}StocksEra | FTD {% endblock %} {% block additional_script %} {% endblock %} {% block onload_properties%}display_data();ftd_graph(48);display_table();restore_dark_mode();{% endblock %} {% block main_nav %} Stocksera / Analysis / FTD [{{ticker_selected}}] {% endblock %} {% block main_content %}
Failure to Deliver (FTD) data is retrieved from the US Securities and Exchange Commission (SEC).
What is the T+35 theory? As quoted from SEC: "If a FTD position results from the sale of a security that a person is deemed to own and that such person
intends to deliver as soon as all restrictions on delivery have been removed, the firm has up to 35 calendar days
following the trade date to close out the failure to deliver position by purchasing securities of like kind and quantity."
In the event of FTD surges (example: FTD Quantity more than 1 million/more than 90th percentile of FTD Amount and at least 100k FTD)
for stocks that are heavily shorted such as AMC and GME, on T+35 date, stocks might experience a surge in price action.
You can refer to this post on Reddit for more information.
High/Consistent FTD: View More


Hong Kong votes the CCP outta town
by Houses and HolesVia SCMP:
Hong Kong’s pro-democracy camp has made huge gains in the early stages of the city’s fiercely contested district council elections on Sunday, taking all but 19 of the first 150 seats to declare.
The elections, held amid an anti-government movement now into its sixth month, are expected to serve as a barometer for how Hongkongers feel about the unprecedented political crisis roiling their city. It is also the first district council elections in which all seats are being contested, with the electorate voting in 452 district councillors.
There are 781 words left in this subscriber-only article.
Start your free 14-day trial today!
Comments are hidden for Membership Subscribers only.


German Enigma Code Machine
Anna Lang (5839881)
Enigma was marketed as the first widespread use of electromechanical device that automated the encryption and decryption process. While the encryption algorithm was not revolutionary the machine that made the process of encrypting and decrypting information was accelerated and allowed a this code and machine to be revolutionary. this machine had more than one iteration that further increase the difficulty of the code.
While the Enigma Machine it is almost no longer important. Today insiders are usually used to protect data and it has become you to impossible to break these encryption. when you look at how to break an encryption the way that the British broke the Enigma Machine will no longer work. That form of decoding is using brute force to you search through all the possible availabilities and find the code. However with the use of current technology the amount of characters and possibilities having increased exponentially causing this type of decryption to no longer be possible.
This means that the Enigma Machine could almost be considered as dead media. As it is not something that we use consistently use within our daily life these days. I think the while this is know as he used every day we can see reflection of it within the technology we do use. Something as simple as our iPhone is a great reflection of how the Enigma Machine has positively impacted our society and allowed us to create new and better technology.
I can personally see connection between even the Enigma machine and the lock on the iPhone. While it does not have the consistently turning rotors that make each letter different as it cycles through its rotation it is a complex code that can use the entire alphabet (including numbers and punctuation) or just the numbers 0-9. These are similar due to the amount of combination that could occur which makes the device much harder to get into.
Furthermore when looking at an iPhone and its password protection the iPhone has increased this technology to give the user a certain amount of tries and then locking it for a certain amount of time. When looking at the Enigma machine this is similar to the reset at midnight has it doesn't always allow the user to remember what codes they've tried and any codes they use again will also not work.
Thank you so much!
Any questions?


◆ VertexBuffer()
| HornetEngine.Graphics.Buffers.VertexBuffer.VertexBuffer |
( |
| ) |
|
◆ Bind()
| void HornetEngine.Graphics.Buffers.VertexBuffer.Bind |
( |
| ) |
|
◆ BufferData()
A function which can be used to initialize the buffer data
- Parameters
-
| attributes | The atrributes which should be bound |
| ptype | The way the data should be interpreted by the GPU |
◆ DestroyBuffers()
| void HornetEngine.Graphics.Buffers.VertexBuffer.DestroyBuffers |
( |
| ) |
|
A function which destroys the buffers
◆ Dispose()
| void HornetEngine.Graphics.Buffers.VertexBuffer.Dispose |
( |
| ) |
|
A function which disposes of the vertex buffers
◆ InitialiseBuffers()
| void HornetEngine.Graphics.Buffers.VertexBuffer.InitialiseBuffers |
( |
| ) |
|
A function which initializes the buffers
◆ SetPrimitiveType()
| void HornetEngine.Graphics.Buffers.VertexBuffer.SetPrimitiveType |
( |
ElementType |
eltype | ) |
|
A function which sets the primitive type
- Parameters
-
◆ Unbind()
| void HornetEngine.Graphics.Buffers.VertexBuffer.Unbind |
( |
| ) |
|
◆ Error
| String HornetEngine.Graphics.Buffers.VertexBuffer.Error |
|
get |
◆ Handle
| uint HornetEngine.Graphics.Buffers.VertexBuffer.Handle |
|
get |
The handle to the VAO data buffer in the GPU
◆ PrimitiveType
| ElementType HornetEngine.Graphics.Buffers.VertexBuffer.PrimitiveType |
|
get |
The type of primitives that make up the mesh
◆ VertexCount
| uint HornetEngine.Graphics.Buffers.VertexBuffer.VertexCount |
|
get |
The documentation for this class was generated from the following file:


This is a portrait of Mark Twain. It is made of his quotes.
Navigation works like in Google Maps. To read quotes use mouse wheel or pinch to zoom in.
This is a portrait of Mark Twain. It is made of his quotes. Pinch or mouse wheel to zoom in. Read more about this project...


Grant posting permission to another account
Username
Private active key
User to be given posting permission
Permission check


REVIEW: Liar Liar by Luke Buckmaster
The rubber faced antics of Jim Carey have delighted and even disgusted audiences worldwide since the dawn of his career. Perhaps impressing more people as an animated "mask" rather than a Pet Detective, Carey has earnt many loyal fans in his short lived in Hollywood spotlight - and expectations were high. For the number one actor in Hollywood, the dismal success of the Cable Guy hurt his career badly, as he plundered down in fame and credibility. Now the stakes have fallen, and it is a great time for a great comeback, which will in turn gain more fans than he ever had before.
Fletcher Reed (Jim Carey) is not your typical lawyer. He isn't afraid to bend evidence to the needs of his case - not to mention lie, hurt and deceive his way to the top of his profession, crushing opponents and even those who care about him along the way. Although some say he indeed fits the description of the typical lawyer, Fletcher's character is definitely appealing to the general population - and Carey is perfect for this role. Fletcher's son Max is the person who is most affected by his unorthodox and inconsiderate life style, he loves his father but hardly gets to spend any quality time with him. So when his birthday comes along, Max makes a simple wish - that his father cannot lie for a day. Surprise surprise, it comes true.
Some hilarious, witty scenes are to follow as Fletcher slowly discovers that he is able to tell nothing but the truth - which spells doom for an involving court case that he must win for the benefit of his career. Reed then finds himself resisting beggars, insulting strangers, smashing into concrete walls and even wrestling a blue pen to discover the error in his ways and ultimately change his life for the better. And after discovering that Max and his ex-wife are moving to Boston, Fletcher is now caught up in a race against time to save his family and his soul.
The critics have has their say against this movie, but at the end of the day the fact remains that it is brilliantly funny and consistent throughout. Really the only major fault I could find in this film was the possibility that you won't hear some of the dialogue due to severe laughter around you, which was true in my case and I'm sure many others too. Jim Carey is nothing but a delight to the film, showing that he can not only do his usual overacting routine but also proving to critics that he can provide genuine heart felt acting. In all honesty, Liar Liar is simply the best of its kind, and I would think twice before I say that Carey will produce a better film later on in his career. Liar Liar has been a worldwide success because this is, simply, brilliant - in all senses of the word.
4 = STARS Jim Carey, a simple yet effective plot and continuous chuckles is the perfect ingredient for success
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Hi,
I'm getting strange results from my CTs on emonCMS giving positive and negative values for a PV single phase system. I was wondering if theres a way to make the feed only show an absolute (always postive, flip sign if negative) value?
http://<IP_ADDRESS>/emoncms/vis/auto?feedid=83
Try the link above to visualize the feed.
Re: emonCMS absolute value for feed
That looks to me as if your values are overflowing. Remember, you can only send signed integers and the range is -32768 to +32767 Watts. So you are generating nearly 65 kW? If that's really the case, I think it means you must scale the value you are sending by 0.5 in the emonTx, and in emonCMS multiply that input by 2 before passing it on to the feed.
Re: emonCMS absolute value for feed
Thanks Robert !
I don't have access to the emonTx it's out on a remote location, what is the best option? I'm thinking I could perhaps change the data type on the database from a signed 16 bit to an unsigned (The PV sites are rated for 50kW). I also have a 200kW site so I might need to go as far as 32bit integer without changing the emontx code!...Or could I take the input and multiply it by 0.5 before storing it as a feed? I'll try this first."On the Arduino Uno (and other ATMega based boards) an int stores a 16-bit (2-byte) value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1)." - http://arduino.cc/en/Reference/int
typedef struct {
int power1;
int power2;
int power3;
int Vrms;
int temperature;
} PayloadTX;
The code on the emonTx will NEED to be changed, I think the best method for me is to send the current for ct's along with the voltage instead of the power.
Re: emonCMS absolute value for feed
But you won't then be recording real power, only apparent power. In the UK (and most places, I believe) you pay for watts, not VA.
You divide your power by 10 (to give you 327 kW max - or any suitable number!) before you fill that struct with the value, then as I wrote restore it at the other end. You will then have your power in increments of decawatts!
If you have your own emoncms, you might be able to change the code to use signed longs, but I don't know emoncms so I can't tell you how hard that would be. It probably still needs to be signed if you go down that route.
Re: emonCMS absolute value for feed
These solar PV sites should have a power factor pretty much at unity (KVAh=KWh), but good point. I could also send the power factor within the payload, or to save on data just use your divide by 10. Note that they are directly tied into the grid from the PV inverters.
Changing the emonCMS data type won't matter since it's the emonTx's code data type that is the root cause of the problem! Unless I changed both the emonTx and emonCMS data type together.
It's interesting to see that a value greater than 32,767 will become negative where generating 50kW will display:
-1 * ( -32,767 + 50,000 )= -17,233
Re: emonCMS absolute value for feed
Changing the emonCMS data type won't matter since it's the emonTx's code data type that is the root cause of the problem! Unless I changed both the emonTx and emonCMS data type together.
Yes, well, they are designed for each other!
It's interesting to see that a value greater than 32,767 will become negative where generating 50kW will display:
-1 * ( -32,767 + 50,000 )= -17,233
That's how signed binary arithmetic works!


Yogyakarta the cultural
Yogyakarta the cultural
Now that we have tasted Yogyakarta’s amazing food, it was time to visit its
incredible cultural heritage. First you need to get there, unfortunately the the two
temple we wanted to visited were an hour away from yogyakarta and of course, an hour
away in different direction… We could have gone there with a wide range of method
but we chose the motorbike way! Cause who does not like to feel the breeze… The nice
part about Yogyakarta is that we found a motorbike rental place that delivered the
motorbike for a small fee (Cheaper than getting there by grab…) In the morning, with
the transportation sorted, we hopped on the bike to our first destination.
The trip to get to Borobudur is more or less an hour long and you need a cooperative
copilote (In our case me) that will hold on the phone with google map. Otherwise you
will get lost. Fortunately for us at this point in our trip I didn’t need to hold on
to Alexis with the full strength of both my arm to feel safe. So I was able to
multitask and keep an eye/hand on the phone along the way. After a few missed turn
(I may not be the best copilote in history….) we finally arrived in Borobudur. For
parking, you need to park in one of the shop along the way… there’s no motorbike
parking in the Borobudur compound, but don’t worry you won’t have problem finding a
shop that will sell you a parking spot (for pretty cheap normally 2000-5000 IDR)
It’s important to mention that there’s two different entrance for the temple. One
for tourist/ foreigners and one for locals. The tourist tickets are more expensive
but I recommend to take the double ticket which allows you to visit Prambanan (It’s
cheaper than buying each ticket individually). It will cost you around 650 000
Rupiah for both temple for one person. In order to visit this temple, you need to be
covered
(Here’s more information
about the dress code in Asia/Indonesia), I was wearing a long dress with a
tank top style top and it was fine. Worst case scenario they lend clothing at the
temple (for free).
Once you have paid, they give you a water bottle (That you will need!) and you are
good to go visit the site. There’s a few temple on the site but the main one is
Borobudur. It’s a huge Buddhist temple that date from the 8/9 Century!
Pretty impressive longevity for a temple, more so when you take into account the
fact that indonesia have a lot of earthquakes. Most people just go up the stairs to
get to the top, but if you take the time to stop at each floor and go around, you
will found out that each sides of the walls have engravings and are sculpted
magnifically and of course, none of them are the same!
They all picture different fable or story with incredible details and precision. I
can’t imagine how long it must have taken to sculpt everything.
An important thing to remember while visiting is that you are exposed to the sun
(directly) during the full length of the visite. So you will get dehydrated if you
are not careful and you will sweat a lot! Once you get to the top of the temple you
will get rewarded with an amazing view and the bell shaped sculpture that
characterise this temple.
The temple are even more special once you realised that each of them are hollow and
continued a sculpture of a praying monk.
Once we finished visiting all of the compound (around 2h) we decided to go back to
the hotel instead of visiting the second temple right away. A lot of website
recommend to get up early to see the sunrise at Borobudur and then visit Prambanan
in the afternoon. (Entries for the sun rise are more expensive…) But we felt like in
order to enjoy our visit of Prambanan, we needed to visit it an another day. (The
tickets that we bought were valid for two days anyway…)
The next day came and we biked to Prambanan, which was a little bit closer than
Borobudur. 40 minute away! That site has parking for motorbike. Once again, you will
need to enter through the foreigner gate and present your ticket to get in. The site
is more vast than the first one, but I have to admit, is a little bit less
impressive.
The Borobudur is higher and more detailed. But in this hindu temple you have the
opportunity to enter in each and every of the smaller temple which is pretty cool.
I’m used to canadian or european historical site where you are barely allowed to
look at the infrastructure. One thing that surprised us and kind of felt odd, is
that in both of the temple there’s big speakers (even inside the temple)
broadcasting the muslim prayer. For us it felt odd visiting an hindu temple with
another religion in the background but hey, different culture.
Second thing we notice was exiting the sites… If you don’t like obligatory gift shop
at the end of a museum, you may dislike the exit doors of those temple... This not a
gift shop, but a maze. Hundred of tiny shops with the least instruction possible on
how to get out. In the Prambanan temple, we got out through the entrance to avoid a
second maze. It literally took us 20 minutes in Borobudur to get out of the vendor
maze.
We felt resourced in Yogyakarta with the culture, the food and some time to cool
off. We were now ready for the next step in our trip; Probolinggo!


Police search for group that pistol-whipped man on Madison's west side and stole his car, phone
by Amy ReidMADISON, Wis. - Madison police are looking for the people responsible for stealing the car of a man they attacked on the city’s west side Thursday evening.
The 27-year-old Milwaukee man had a skull fracture and other non-life-threatening head injuries after he said several men pistol-whipped him after he got into his SUV in the 400 block of Orchard Drive. The man said the group stole his vehicle and phone after the attack.
The victim did not call police, but officers were sent to the hospital after he arrived for treatment.
Detectives believe this was a targeted act.


Draft Day
Draft Day is a movie starring Kevin Costner, Chadwick Boseman, and Jennifer Garner. At the NFL Draft, General Manager Sonny Weaver has the opportunity to rebuild his team when he trades for the number one pick. He must decide what...


A stack is a data structure that stores elements like a vector but in a way that is slightly different. It stores them using the concept of a real life stack. Imagine you had a stack of books, you can add a book to the top of the stack, and you can remove a book from the top of the stack. However, you can't insert a book into the middle/bottom of stack or remove from the middle/bottom of the stack, this is because to insert or remove there you have to move all the books on top of that position, which may be feasible in real life, but for our case is impossible.
This type of storage can be summarized by the acronyms FILO and LIFO, which stand for "first in last out" and "last in first out" respectively. Which basically means that the first book put into the stack will be at the bottom of the stack and thus the last one taken out, and the last book put into the stack will be at the top of the stack and thus the first one taken out. Remember this is given the fact that things can be only added and removed from the top.
A stack in C++ can be instantiated using the following syntax:
stack<T> S;
where T is any datatype you want. This will then create a data structure that acts in the way described above. Originally the stack is empty, but you can add to the top of the stack by using the push(val) method, and you can also remove from the top of the stack using the pop() method, described below.
One thing to realize when dealing with stacks is that because you can only access the top element, there is no such thing as iterators when it comes to stacks. Instead of indexing or going through a stack using iterators, you have to repeatedly print the top element using top(), and then pop the top element to get to the next one below it, and repeat this until the stack is empty. This process is illustrated below:
while (!S.empty()) { cout << S.top() << "\n"; S.pop(); }
One final note about stacks is that in most problems stacks aren't used as an actual data structure and instead is used like a concept. More often than not the problem will discuss the properties of a stack, and then use a vector to represent the stack, instead of using the actual stack itself. This is often because vectors are nicer to use, but can still represent stack behavior.
If you have a vector and an iterator (you could also use an integer variable storing the current index) pointing to the last element of the vector, that more or less represents all the functionality of a stack. The front of the vector is the bottom of the stack, while the back of the vector is the top of the stack. To represent pushing something to the stack, the vector would add an element to the back and increase the iterator/index by one. To represent popping, the vector would remove an element and decrease the iterator/index by one. Finally to get the top of the stack, you would derefence the iterator/V[index] and get the value it is currently pointing at.
Note that this vector representation of a stack does have access to more things that a stack doesn't like vector iterators, but we ignore these things if we are using the vector like a stack. Also note that occasionally the front of a vector will be the top of the stack instead of the back in some problems, so watch out for that.
bool empty()
Returns true if the stack is empty and false otherwise.
void pop()
Removes the top element from the stack, without returning it.
void push(T val)
Inserts a copy of the element val into the stack, placed at the top position.
int size()
Returns the number of elements in the stack.
T top()
Returns the element at the top of the stack, without removing it from the stack.
You can check for more methods for stacks and other data structures here.
string isBalanced(string s) { stack<char> S; for (int i = 0; i < s.size(); i++) { if (s[i] == '(' || s[i] == '[' || s[i] == '{') S.push(s[i]); else { if (S.empty()) return "NO"; if (s[i] == ')' && S.top() == '(') S.pop(); else if (s[i] == ']' && S.top() == '[') S.pop(); else if (s[i] == '}' && S.top() == '{') S.pop(); else return "NO"; } } if (S.empty()) return "YES"; else return "NO"; }
We are going to iterate through the string and check if each of the grouping symbols in the string are matched. Our stack represents the grouping symbols we have to match, so as we iterate through the string, if we see one of ([{ we add it to the stack. Now if we run into one of the closing symbols we have a variety of cases to check.
First, if the stack is empty that means there is no opening symbol to match this closing symbol, so the string is unbalanced and we return NO. If we get past this check, that means there is at least one open symbol in the stack. If that opening symbol matches the closing symbol we have currently, then the pair is valid, and we can remove the opening symbol from the stack and continue on. If they don't match, then we have a case of mismatching grouping symbols and then the string isn't balanced and we return NO.
Now if we get past the entire iteration, we still have one more check to do. If we still have symbols in the stack, then there are opening symbols that haven't been matched and so we return NO. if the stack is empty all symbols have been matched and so we return YES.
int equalStacks(vector<int> h1, vector<int> h2, vector<int> h3) { int sm1 = 0, sm2 = 0, sm3 = 0; int pos1 = 0, pos2 = 0, pos3 = 0; for (int x : h1) sm1 += x; for (int x : h2) sm2 += x; for (int x : h3) sm3 += x; while (sm1 != sm2 || sm1 != sm3) { int mx = max(sm1, max(sm2, sm3)); if (sm1 == mx) { sm1 -= h1[pos1]; pos1++; } else if (sm2 == mx) { sm2 -= h2[pos2]; pos2++; } else { sm3 -= h3[pos3]; pos3++; } } return sm1; }
In this problem the stack concept is represented by a vector with the front of the stack being the front of the vector. And we want to make the sum of all the elements in each stack the same. So first we need to calculate the current sum of each of the stack by iterating through them (note that this is made much easier because the stack is represented by a vector with can be iterated through). Now until these sums are equal, we need to remove something from one of the stacks.
It is optimal to remove the element from the stack with the largest sum at the moment. This is because if we remove from the stack without the largest sum, we are potentially making this stack smaller than it has to be. However, the stack with maximum sum must be removed from because if not then the game would never reach an end, as that maximum sum would never decrease until its equal to the others.
Now that we know its optimal to remove from the stack with the maximum current sum, we have to calculate it, and then simulate removing the top of it, which is done by deleting from the sum and increasing the current index. Now when the sums are equal, we can just return any one of them as our final answer.
#include <bits/stdc++.h> using namespace std; void print(vector<string>& S) { cout << "/"; for (auto x : S) cout << x << "/"; cout << "\n"; } vector<string> split(string path, char delim) { vector<string> V; int prev = 0; for (int i = 0; i < path.size(); i++) { if (path[i] == '/') { V.push_back(path.substr(prev, i-prev)); prev = i+1; } } V.push_back(path.substr(prev, path.size()-prev)); return V; } int main() { int n; cin >> n; vector<string> S; for (int i = 0; i < n; i++) { string s; cin >> s; if (s == "pwd") print(S); else { string path; cin >> path; vector<string> SP = split(path, '/'); for (string x : SP) { if (x == "") S.clear(); else if (x == "..") S.pop_back(); else S.push_back(x); } } } }
The hardest part of this problem is understanding how cd and pwd works. Pwd is the simpler of the two, it starts from the root directory which is '/' and then lists the name of all subfolders until the folder you are currently in. And it separates the names of these folders using '/' as well. Finally is prints a '\n' to end off the directory.
Now we have to worry about the cd command. cd takes a path and then goes into the directory described by the path. Specifically, if the path starts with a '/', that means this is an absolute path (one that starts from the root directory), and then we will recursively go down folders from there. However, if the path starts without a '/', that means this is a relative path and we will start at our current directory, and then we will recursively go down folders from there. Also the .. is a special folder that represents we are going backwards 1 folder instead of going forward.
Now that the functionality for both pwd and cd is described we can represent our current directory using a stack (note I used a vector here instead of a stack because it made printing easier, but I am still using stack concepts). The print function represents all the functionality of the pwd command, and the else statement represents all functionality of the cd command.
To specify the process of the cd command, we are first taking an input string representing the path and then splitting it into a vector of the folder names using a split function (go here to learn more about splitting a string in C++). If there is a "" (an empty string) in the vector, that means that this path is an absolute path, so we clear the stack (representing starting at the root directory). If there is a ".." in the vector, that means that we are going backwards one, so we remove the top of the stack. And if there is a regular folder name in the vector, that means we are going forward one, so add to the top of the stack.
Now that we can simulate these commands, all we got to do is follow whatever the input wants us to do. Remember to watch out for segmentation faults when solving this problem (especially in the split function).


Take the biggest lake in the center of the Lower Mainland. Add sweeping views of the North Shore Mountains, a bird watching area right next door and a 10 km walking/run trail around the lake. Finish it off with a pinch of beavers and a touch of herons and eagles. This is the setting against which we offer paddling programs for all ages and all levels.
BCKC is a non-profit organization that services our community with flatwater canoe and kayak opportunities, in a safe and positive environment lead by nationally certified coaches. We are supported by a committed group of members who volunteer their time and energy to share our passion for paddling. BCKC is a member of the provincial sport organization Canoe Kayak BC and the national sport organization Canoe Kayak Canada.
The Burnaby Canoe and Kayak Club is located at the west end of Burnaby Lake and offers programs for people age 8 and older:
-Spirit Racing Programs
-Adult War Canoe
-School Dragon Boating (grades 4-12)
You can just see the city for the trees in this urban playground in the heart of the Lower Mainland. And that's the way we like it in Burnaby...a little wild, like the verdant landscape of this unique and spirited city. Located on the border of Vancouver, Burnaby features something for everyone. With 25% green space, it's a haven for outdoor activities for everything from running trails to bird-watching. Burnaby is also home to one of the most successful Canoe and Kayak racing clubs in Canada. Yes! the Burnaby Canoe and Kayak Club!
This regional park, right in the heart of Burnaby,is a place to reconnect with the natural world without leaving the city. The area is a stunning wildlife sanctuary where birdwatchers regularly spot great blue herons, bald eagles, belted kingfishers, osprey and even rarer birds such as the small green-backed heron.
The lake was created by a glacier 12,000 years ago, and only a century ago its shores were home to bustling sawmills. Today, a viewing tower on that same shore provides a bird's-eye view for spotting wildlife. You can view the lake from your canoe or kayak to get an up-close look at the busy beavers, diving ducks and turtles feeding in the marsh.
Burnaby Lake has a rowing course suitable for canoeing, kayaking and rowing training. The rowing pavilion at Burnaby Lake Sports Complex has change rooms and a public canoe launch.


Oops Something is wrong!!!! You may have entered wrong username or password!!!!
Click here to try again!


Address: NO.99 West Beijing Road, XinYi Economic Development Park,Xuzhou,Jiangsu Province, China
Tel: 0516-88593698
Fax: 0516-81610389
Email<EMAIL_ADDRESS>Mobile: 0086-13501780552


Help for your New Role
Congratulations on your new role in the Raleigh NC Chapter. Your role gives you the permissions to make changes on the Chapter website. Depending on your role, one of the following pages will help guide you with step by step instructions to successfully make updates.
There are two environments in which to work. The first, the Sandbox environment, is where you should try things out to get comfortable with your new role. Here you can make changes, or try things out, without affecting what members see. Remember, it's best if you first start out by making changes in the sandbox environment until you are comfortable making changes. It is much easier to correct any mistakes in this environment. Also, do not hesitate to contact your webmaster for help. The second, the Production environment, is the website that all chapter members see. This environment is where you make the updates/changes that everyone sees.
The following guides were written for the Raleigh NC Chapter website. Although certain steps may be specific to the Raleigh NC Chapter website the overall steps should be generic enough that other chapters using HOG[SCAN] should be able to follow along with slight modifications.
Use the following guides to help you;
- update/add events to the Event Calendar - Generally this is the Activities Officer role
- update/add Newsletters - Generally this is the Editor role
- update the Financial Reports page - Page created by/for Raleigh NC Chapter, Editor role
- update Elastic Email - No HOG[SCAN] role because Elastic Email is a separate entity


Release Candidate Checker
Home
PHP Info
Users API
Distributed Tracing
Distributed Tracing (Multi)
Distributed Tracing (Guzzle Multi)
Errors
Caught Exception
Uncaught Exception
Fatal Error
PHP Content


Private information
All the user specific information is here. A list of
Personalized Forms
, along with facilities to create and manage them, and a link to list the history of all queries the user has submitted to the database (since the last log file rotation).
Personalized Forms
This system should cater to db novices, intermediate users, and power users. Normal forms work for novices, and DirectQuery works for the power user. What about the average user with special needs? Personalized forms allow people with passing db knowledge, decent domain knowledge, and a general understanding of how the standard forms work to build new forms from any group of available tables The user has a very low level control of what goes on the form so it can be tailored for a very specific use. The resulting form is then shareable with any number of users, or can be adopted as a standard form. There is also an integrated editor so minor changes can be made through the web (though shared froms would have to be re-shared).
Pre-built Forms
This is the location for all the pre-built forms for your users. The forms in this location should aim to satisfy most of the needs of an average user. People with special needs can use the Formbuilder, located in the
Personalized Forms
section, and power users who want to write their own SQL can use the DirectQuery links in the
Special Purpose Forms
section.
Special Purpose Forms
This is the location for special purpose forms. Initially, there is only a link to DirectQuery, where a more advanced user can write their own queries, and a form to upload a text file with many pre-written queries in it - they will all be processed together.
Documentation
Licensing information for MRALD and the included libraries, a users' guide, and acknowledgements.
News
A simple news area where the administrator can announce major new data sets, system upgrade, or other local information. System administrators have facilities for updating and archiving news items. Or it can be modified by directly modifying the news.xml file.
Database review and visualization
Using a heirarchical structure, users can click to review the database structure one table or field at a time. Also provided is a database visualization tool that shows the entire database structure, including the table relationships, in a graphical, manipulatable form. The visualization feature requires the Java 5.0 browser plugin available from
Sun when you install the Jave Runtime Environment.
Keyword Search
The keyword search features a search throughout the entire database for a single word or phrase. The search is case sensitive and checkes only the text fields in the database. The result is a list of all tables where the word appears and all the rows in the table that contain the word.
Care must be taken as this can take a long time on large datasets and may return an unweildly amount of information.
Administration
Certain users can be granted administrative privledges. The following administrative functions are available.
- Update any of the properties files that govern the behavior of MRALD.
- Add a new data source and reload database metadata.
- Automatic publishing of forms for all users.
- Create forms for inserting and updating/deleting data.
- Modifying MRALD configuration files. The changes take effect immediately.
- View log files. This link redirects the user to the log file.
- Manage err files. When an error occurs, a .err file is created which allows administrators and developers to gain insight into the problem and provide fixes quickly. This functionality allows a user to view all the .err files currently on the system and delete files as desired.
- People manager. This allows an administrator to change information on the users registered with the system. Perhaps the most useful change is the ability to set a user to administrator status.
- Edit news. An online way to add, edit, and archive news items.


Courses offered by the ICON College of Computing
Web designing
join it and learn to do magic
Database Management
Create database and learn to design it.
Web development
what do after your static design
Mobile application
Welcome to world of mobtech.
Business Management
Welcome to world of Management.
IT & Engineering
Welcome to world of Information Technology.
Health & Social Care
Welcome to world of Health & Social Care.
Hospitality Management
Welcome to world of Hospitality Management.
Networking Management System
Welcome to world of Network Management.
Security Management
Welcome to world of Security Management.


Directories | |
| directory | solvers |
| directory | stages |
Files | |
| file | container.cpp [code] |
| file | introspection.cpp [code] |
| file | marker_tools.cpp [code] |
| file | merge.cpp [code] |
| file | properties.cpp [code] |
| file | stage.cpp [code] |
| file | storage.cpp [code] |
| file | task.cpp [code] |


SuperAgent
SuperAgent is light-weight progressive ajax API crafted for flexibility, readability, and a low learning curve after being frustrated with many of the existing request APIs. It also works with Node.js!
request
.post('/api/pet')
.send({ name: 'Manny', species: 'cat' })
.set('X-API-Key', 'foobar')
.set('Accept', 'application/json')
.then(res => {
alert('yay got ' + JSON.stringify(res.body));
});
Test documentation
The following test documentation was generated with Mocha's "doc" reporter, and directly reflects the test suite. This provides an additional source of documentation.
Request basics
A request can be initiated by invoking the appropriate method on the request
object, then calling .then()
(or .end()
or await
) to send the request. For example a simple GET request:
request
.get('/search')
.then(res => {
// res.body, res.headers, res.status
})
.catch(err => {
// err.message, err.response
});
HTTP method may also be passed as a string:
request('GET', '/search').then(success, failure);
Old-style callbacks are also supported, but not recommended. Instead of .then()
you can call .end()
:
request('GET', '/search').end(function(err, res){
if (res.ok) {}
});
Absolute URLs can be used. In web browsers absolute URLs work only if the server implements CORS.
request
.get('https://example.com/search')
.then(res => {
});
The Node client supports making requests to Unix Domain Sockets:
// pattern: https?+unix://SOCKET_PATH/REQUEST_PATH
// Use `%2F` as `/` in SOCKET_PATH
try {
const res = await request
.get('http+unix://%2Fabsolute%2Fpath%2Fto%2Funix.sock/search');
// res.body, res.headers, res.status
} catch(err) {
// err.message, err.response
}
DELETE, HEAD, PATCH, POST, and PUT requests can also be used, simply change the method name:
request
.head('/favicon.ico')
.then(res => {
});
DELETE can be also called as .del()
for compatibility with old IE where delete
is a reserved word.
The HTTP method defaults to GET, so if you wish, the following is valid:
request('/search', (err, res) => {
});
Setting header fields
Setting header fields is simple, invoke .set()
with a field name and value:
request
.get('/search')
.set('API-Key', 'foobar')
.set('Accept', 'application/json')
.then(callback);
You may also pass an object to set several fields in a single call:
request
.get('/search')
.set({ 'API-Key': 'foobar', Accept: 'application/json' })
.then(callback);
GET
requests
The .query()
method accepts objects, which when used with the GET method will form a query-string. The following will produce the path /search?query=Manny&range=1..5&order=desc
.
request
.get('/search')
.query({ query: 'Manny' })
.query({ range: '1..5' })
.query({ order: 'desc' })
.then(res => {
});
Or as a single object:
request
.get('/search')
.query({ query: 'Manny', range: '1..5', order: 'desc' })
.then(res => {
});
The .query()
method accepts strings as well:
request
.get('/querystring')
.query('search=Manny&range=1..5')
.then(res => {
});
Or joined:
request
.get('/querystring')
.query('search=Manny')
.query('range=1..5')
.then(res => {
});
HEAD
requests
You can also use the .query()
method for HEAD requests. The following will produce the path<EMAIL_ADDRESS>.
request
.head('/users')
.query({ email<EMAIL_ADDRESS>})
.then(res => {
});
POST
/ PUT
requests
A typical JSON POST request might look a little like the following, where we set the Content-Type header field appropriately, and "write" some data, in this case just a JSON string.
request.post('/user')
.set('Content-Type', 'application/json')
.send('{"name":"tj","pet":"tobi"}')
.then(callback)
.catch(errorCallback)
Since JSON is undoubtedly the most common, it's the default! The following example is equivalent to the previous.
request.post('/user')
.send({ name: 'tj', pet: 'tobi' })
.then(callback, errorCallback)
Or using multiple .send()
calls:
request.post('/user')
.send({ name: 'tj' })
.send({ pet: 'tobi' })
.then(callback, errorCallback)
By default sending strings will set the Content-Type
to application/x-www-form-urlencoded
,
multiple calls will be concatenated with &
, here resulting in name=tj&pet=tobi
:
request.post('/user')
.send('name=tj')
.send('pet=tobi')
.then(callback, errorCallback);
SuperAgent formats are extensible, however by default "json" and "form" are supported. To send the data as application/x-www-form-urlencoded
simply invoke .type()
with "form", where the default is "json". This request will POST the body "name=tj&pet=tobi".
request.post('/user')
.type('form')
.send({ name: 'tj' })
.send({ pet: 'tobi' })
.then(callback, errorCallback)
Sending a FormData
object is also supported. The following example will POST the content of the HTML form identified by id="myForm":
request.post('/user')
.send(new FormData(document.getElementById('myForm')))
.then(callback, errorCallback)
Setting the Content-Type
The obvious solution is to use the .set()
method:
request.post('/user')
.set('Content-Type', 'application/json')
As a short-hand the .type()
method is also available, accepting
the canonicalized MIME type name complete with type/subtype, or
simply the extension name such as "xml", "json", "png", etc:
request.post('/user')
.type('application/json')
request.post('/user')
.type('json')
request.post('/user')
.type('png')
Serializing request body
SuperAgent will automatically serialize JSON and forms. You can setup automatic serialization for other types as well:
request.serialize['application/xml'] = function (obj) {
return 'string generated from obj';
};
// going forward, all requests with a Content-type of
// 'application/xml' will be automatically serialized
If you want to send the payload in a custom format, you can replace
the built-in serialization with the .serialize()
method on a per-request basis:
request
.post('/user')
.send({foo: 'bar'})
.serialize(obj => {
return 'string generated from obj';
});
Retrying requests
When given the .retry()
method, SuperAgent will automatically retry requests, if they fail in a way that is transient or could be due to a flaky Internet connection.
This method has two optional arguments: number of retries (default 1) and a callback. It calls callback(err, res)
before each retry. The callback may return true
/false
to control whether the request should be retried (but the maximum number of retries is always applied).
request
.get('https://example.com/search')
.retry(2) // or:
.retry(2, callback)
.then(finished);
.catch(failed);
Use .retry()
only with requests that are idempotent (i.e. multiple requests reaching the server won't cause undesirable side effects like duplicate purchases).
All request methods are tried by default (which means if you do not want POST requests to be retried, you will need to pass a custom retry callback).
By default the following status codes are retried:
408
413
429
500
502
503
504
521
522
524
By default the following error codes are retried:
'ETIMEDOUT'
'ECONNRESET'
'EADDRINUSE'
'ECONNREFUSED'
'EPIPE'
'ENOTFOUND'
'ENETUNREACH'
'EAI_AGAIN'
Setting Accept
In a similar fashion to the .type()
method it is also possible to set the Accept
header via the short hand method .accept()
. Which references request.types
as well allowing you to specify either the full canonicalized MIME type name as type/subtype
, or the extension suffix form as "xml", "json", "png", etc. for convenience:
request.get('/user')
.accept('application/json')
request.get('/user')
.accept('json')
request.post('/user')
.accept('png')
Facebook and Accept JSON
If you are calling Facebook's API, be sure to send an Accept: application/json
header in your request. If you don't do this, Facebook will respond with Content-Type: text/javascript; charset=UTF-8
, which SuperAgent will not parse and thus res.body
will be undefined. You can do this with either req.accept('json')
or req.header('Accept', 'application/json')
. See issue 1078 for details.
Query strings
req.query(obj)
is a method which may be used to build up a query-string. For example populating ?format=json&dest=/login
on a POST:
request
.post('/')
.query({ format: 'json' })
.query({ dest: '/login' })
.send({ post: 'data', here: 'wahoo' })
.then(callback);
By default the query string is not assembled in any particular order. An asciibetically-sorted query string can be enabled with req.sortQuery()
. You may also provide a custom sorting comparison function with req.sortQuery(myComparisonFn)
. The comparison function should take 2 arguments and return a negative/zero/positive integer.
// default order
request.get('/user')
.query('name=Nick')
.query('search=Manny')
.sortQuery()
.then(callback)
// customized sort function
request.get('/user')
.query('name=Nick')
.query('search=Manny')
.sortQuery((a, b) => a.length - b.length)
.then(callback)
TLS options
In Node.js SuperAgent supports methods to configure HTTPS requests:
.ca()
: Set the CA certificate(s) to trust.cert()
: Set the client certificate chain(s).key()
: Set the client private key(s).pfx()
: Set the client PFX or PKCS12 encoded private key and certificate chain.disableTLSCerts()
: Does not reject expired or invalid TLS certs. Sets internallyrejectUnauthorized=true
. Be warned, this method allows MITM attacks.
For more information, see Node.js https.request docs.
var key = fs.readFileSync('key.pem'),
cert = fs.readFileSync('cert.pem');
request
.post('/client-auth')
.key(key)
.cert(cert)
.then(callback);
var ca = fs.readFileSync('ca.cert.pem');
request
.post('https://localhost/private-ca-server')
.ca(ca)
.then(res => {});
Parsing response bodies
SuperAgent will parse known response-body data for you,
currently supporting application/x-www-form-urlencoded
,
application/json
, and multipart/form-data
. You can setup
automatic parsing for other response-body data as well:
//browser
request.parse['application/xml'] = function (str) {
return {'object': 'parsed from str'};
};
//node
request.parse['application/xml'] = function (res, cb) {
//parse response text and set res.body here
cb(null, res);
};
//going forward, responses of type 'application/xml'
//will be parsed automatically
You can set a custom parser (that takes precedence over built-in parsers) with the .buffer(true).parse(fn)
method. If response buffering is not enabled (.buffer(false)
) then the response
event will be emitted without waiting for the body parser to finish, so response.body
won't be available.
JSON / Urlencoded
The property res.body
is the parsed object, for example if a request responded with the JSON string '{"user":{"name":"tobi"}}', res.body.user.name
would be "tobi". Likewise the x-www-form-urlencoded value of "user[name]=tobi" would yield the same result. Only one level of nesting is supported. If you need more complex data, send JSON instead.
Arrays are sent by repeating the key. .send({color: ['red','blue']})
sends color=red&color=blue
. If you want the array keys to contain []
in their name, you must add it yourself, as SuperAgent doesn't add it automatically.
Multipart
The Node client supports multipart/form-data via the Formidable module. When parsing multipart responses, the object res.files
is also available to you. Suppose for example a request responds with the following multipart body:
--whoop
Content-Disposition: attachment; name="image"; filename="tobi.png"
Content-Type: image/png
... data here ...
--whoop
Content-Disposition: form-data; name="name"
Content-Type: text/plain
Tobi
--whoop--
You would have the values res.body.name
provided as "Tobi", and res.files.image
as a File
object containing the path on disk, filename, and other properties.
Binary
In browsers, you may use .responseType('blob')
to request handling of binary response bodies. This API is unnecessary when running in node.js. The supported argument values for this method are
'blob'
passed through to the XmlHTTPRequestresponseType
property'arraybuffer'
passed through to the XmlHTTPRequestresponseType
property
req.get('/binary.data')
.responseType('blob')
.then(res => {
// res.body will be a browser native Blob type here
});
For more information, see the Mozilla Developer Network xhr.responseType docs.
Response properties
Many helpful flags and properties are set on the Response
object, ranging from the response text, parsed response body, header fields, status flags and more.
Response text
The res.text
property contains the unparsed response body string. This property is always present for the client API, and only when the mime type matches "text/", "/json", or "x-www-form-urlencoded" by default for node. The reasoning is to conserve memory, as buffering text of large bodies such as multipart files or images is extremely inefficient. To force buffering see the "Buffering responses" section.
Response body
Much like SuperAgent can auto-serialize request data, it can also automatically parse it. When a parser is defined for the Content-Type, it is parsed, which by default includes "application/json" and "application/x-www-form-urlencoded". The parsed object is then available via res.body
.
Response header fields
The res.header
contains an object of parsed header fields, lowercasing field names much like node does. For example res.header['content-length']
.
Response Content-Type
The Content-Type response header is special-cased, providing res.type
, which is void of the charset (if any). For example the Content-Type of "text/html; charset=utf8" will provide "text/html" as res.type
, and the res.charset
property would then contain "utf8".
Response status
The response status flags help determine if the request was a success, among other useful information, making SuperAgent ideal for interacting with RESTful web services. These flags are currently defined as:
var type = status / 100 | 0;
// status / class
res.status = status;
res.statusType = type;
// basics
res.info = 1 == type;
res.ok = 2 == type;
res.clientError = 4 == type;
res.serverError = 5 == type;
res.error = 4 == type || 5 == type;
// sugar
res.accepted = 202 == status;
res.noContent = 204 == status || 1223 == status;
res.badRequest = 400 == status;
res.unauthorized = 401 == status;
res.notAcceptable = 406 == status;
res.notFound = 404 == status;
res.forbidden = 403 == status;
Aborting requests
To abort requests simply invoke the req.abort()
method.
Timeouts
Sometimes networks and servers get "stuck" and never respond after accepting a request. Set timeouts to avoid requests waiting forever.
req.timeout({deadline:ms})
orreq.timeout(ms)
(wherems
is a number of milliseconds > 0) sets a deadline for the entire request (including all uploads, redirects, server processing time) to complete. If the response isn't fully downloaded within that time, the request will be aborted.req.timeout({response:ms})
sets maximum time to wait for the first byte to arrive from the server, but it does not limit how long the entire download can take. Response timeout should be at least few seconds longer than just the time it takes the server to respond, because it also includes time to make DNS lookup, TCP/IP and TLS connections, and time to upload request data.
You should use both deadline
and response
timeouts. This way you can use a short response timeout to detect unresponsive networks quickly, and a long deadline to give time for downloads on slow, but reliable, networks. Note that both of these timers limit how long uploads of attached files are allowed to take. Use long timeouts if you're uploading files.
request
.get('/big-file?network=slow')
.timeout({
response: 5000, // Wait 5 seconds for the server to start sending,
deadline: 60000, // but allow 1 minute for the file to finish loading.
})
.then(res => {
/* responded in time */
}, err => {
if (err.timeout) { /* timed out! */ } else { /* other error */ }
});
Timeout errors have a .timeout
property.
Authentication
In both Node and browsers auth available via the .auth()
method:
request
.get('http://local')
.auth('tobi', 'learnboost')
.then(callback);
In the Node client Basic auth can be in the URL as "user:pass":
request.get('http://tobi:learnboost@local').then(callback);
By default only Basic
auth is used. In browser you can add {type:'auto'}
to enable all methods built-in in the browser (Digest, NTLM, etc.):
request.auth('digest', 'secret', {type:'auto'})
The auth
method also supports a type
of bearer
, to specify token-based authentication:
request.auth('my_token', { type: 'bearer' })
Following redirects
By default up to 5 redirects will be followed, however you may specify this with the res.redirects(n)
method:
const response = await request.get('/some.png').redirects(2);
Redirects exceeding the limit are treated as errors. Use .ok(res => res.status < 400)
to read them as successful responses.
Agents for global state
Saving cookies
In Node SuperAgent does not save cookies by default, but you can use the .agent()
method to create a copy of SuperAgent that saves cookies. Each copy has a separate cookie jar.
const agent = request.agent();
agent
.post('/login')
.then(() => {
return agent.get('/cookied-page');
});
In browsers cookies are managed automatically by the browser, so the .agent()
does not isolate cookies.
Default options for multiple requests
Regular request methods called on the agent will be used as defaults for all requests made by that agent.
const agent = request.agent()
.use(plugin)
.auth(shared);
await agent.get('/with-plugin-and-auth');
await agent.get('/also-with-plugin-and-auth');
The complete list of methods that the agent can use to set defaults is: use
, on
, once
, set
, query
, type
, accept
, auth
, withCredentials
, sortQuery
, retry
, ok
, redirects
, timeout
, buffer
, serialize
, parse
, ca
, key
, pfx
, cert
.
Piping data
The Node client allows you to pipe data to and from the request. Please note that .pipe()
is used instead of .end()
/.then()
methods.
For example piping a file's contents as the request:
const request = require('superagent');
const fs = require('fs');
const stream = fs.createReadStream('path/to/my.json');
const req = request.post('/somewhere');
req.type('json');
stream.pipe(req);
Note that when you pipe to a request, superagent sends the piped data with chunked transfer encoding, which isn't supported by all servers (for instance, Python WSGI servers).
Or piping the response to a file:
const stream = fs.createWriteStream('path/to/my.json');
const req = request.get('/some.json');
req.pipe(stream);
It's not possible to mix pipes and callbacks or promises. Note that you should NOT attempt to pipe the result of .end()
or the Response
object:
// Don't do either of these:
const stream = getAWritableStream();
const req = request
.get('/some.json')
// BAD: this pipes garbage to the stream and fails in unexpected ways
.end((err, this_does_not_work) => this_does_not_work.pipe(stream))
const req = request
.get('/some.json')
.end()
// BAD: this is also unsupported, .pipe calls .end for you.
.pipe(nope_its_too_late);
In a future version of superagent, improper calls to pipe()
will fail.
Multipart requests
SuperAgent is also great for building multipart requests for which it provides methods .attach()
and .field()
.
When you use .field()
or .attach()
you can't use .send()
and you must not set Content-Type
(the correct type will be set for you).
Attaching files
To send a file use .attach(name, [file], [options])
. You can attach multiple files by calling .attach
multiple times. The arguments are:
name
— field name in the form.file
— either string with file path orBlob
/Buffer
object.options
— (optional) either string with custom file name or{filename: string}
object. In Node also{contentType: 'mime/type'}
is supported. In browser create aBlob
with an appropriate type instead.
request
.post('/upload')
.attach('image1', 'path/to/felix.jpeg')
.attach('image2', imageBuffer, 'luna.jpeg')
.field('caption', 'My cats')
.then(callback);
Field values
Much like form fields in HTML, you can set field values with .field(name, value)
and .field({name: value})
. Suppose you want to upload a few images with your name and email, your request might look something like this:
request
.post('/upload')
.field('user[name]', 'Tobi')
.field('user[email]'<EMAIL_ADDRESS>.field('friends[]', ['loki', 'jane'])
.attach('image', 'path/to/tobi.png')
.then(callback);
Compression
The node client supports compressed responses, best of all, you don't have to do anything! It just works.
Buffering responses
To force buffering of response bodies as res.text
you may invoke req.buffer()
. To undo the default of buffering for text responses such as "text/plain", "text/html" etc you may invoke req.buffer(false)
.
When buffered the res.buffered
flag is provided, you may use this to handle both buffered and unbuffered responses in the same callback.
CORS
For security reasons, browsers will block cross-origin requests unless the server opts-in using CORS headers. Browsers will also make extra OPTIONS requests to check what HTTP headers and methods are allowed by the server. Read more about CORS.
The .withCredentials()
method enables the ability to send cookies from the origin, however only when Access-Control-Allow-Origin
is not a wildcard ("*"), and Access-Control-Allow-Credentials
is "true".
request
.get('https://api.example.com:4001/')
.withCredentials()
.then(res => {
assert.equal(200, res.status);
assert.equal('tobi', res.text);
})
Error handling
Your callback function will always be passed two arguments: error and response. If no error occurred, the first argument will be null:
request
.post('/upload')
.attach('image', 'path/to/tobi.png')
.then(res => {
});
An "error" event is also emitted, with you can listen for:
request
.post('/upload')
.attach('image', 'path/to/tobi.png')
.on('error', handle)
.then(res => {
});
Note that superagent considers 4xx and 5xx responses (as well as unhandled 3xx responses) errors by default. For example, if you get a 304 Not modified
, 403 Forbidden
or 500 Internal server error
response, this status information will be available via err.status
. Errors from such responses also contain an err.response
field with all of the properties mentioned in "Response properties". The library behaves in this way to handle the common case of wanting success responses and treating HTTP error status codes as errors while still allowing for custom logic around specific error conditions.
Network failures, timeouts, and other errors that produce no response will contain no err.status
or err.response
fields.
If you wish to handle 404 or other HTTP error responses, you can query the err.status
property. When an HTTP error occurs (4xx or 5xx response) the res.error
property is an Error
object, this allows you to perform checks such as:
if (err && err.status === 404) {
alert('oh no ' + res.body.message);
}
else if (err) {
// all other error types we handle generically
}
Alternatively, you can use the .ok(callback)
method to decide whether a response is an error or not. The callback to the ok
function gets a response and returns true
if the response should be interpreted as success.
request.get('/404')
.ok(res => res.status < 500)
.then(response => {
// reads 404 page as a successful response
})
Progress tracking
SuperAgent fires progress
events on upload and download of large files.
request.post(url)
.attach('field_name', file)
.on('progress', event => {
/* the event is:
{
direction: "upload" or "download"
percent: 0 to 100 // may be missing if file size is unknown
total: // total file size, may be missing
loaded: // bytes downloaded or uploaded so far
} */
})
.then()
Testing on localhost
Forcing specific connection IP address
In Node.js it's possible to ignore DNS resolution and direct all requests to a specific IP address using .connect()
method. For example, this request will go to localhost instead of example.com
:
const res = await request.get("http://example.com").connect("<IP_ADDRESS>");
Because the request may be redirected, it's possible to specify multiple hostnames and multiple IPs, as well as a special *
as the fallback (note: other wildcards are not supported). The requests will keep their Host
header with the original value. .connect(undefined)
turns off the feature.
const res = await request.get("http://redir.example.com:555")
.connect({
"redir.example.com": "<IP_ADDRESS>", // redir.example.com:555 will use <IP_ADDRESS>:555
"www.example.com": false, // don't override this one; use DNS as normal
"mapped.example.com": { host: "<IP_ADDRESS>", port: 8080}, // mapped.example.com:* will use <IP_ADDRESS>:8080
"*": "proxy.example.com", // all other requests will go to this host
});
Ignoring broken/insecure HTTPS on localhost
In Node.js, when HTTPS is misconfigured and insecure (e.g. using self-signed certificate without specifying own .ca()
), it's still possible to permit requests to localhost
by calling .trustLocalhost()
:
const res = await request.get("https://localhost").trustLocalhost()
Together with .connect("<IP_ADDRESS>")
this may be used to force HTTPS requests to any domain to be re-routed to localhost
instead.
It's generally safe to ignore broken HTTPS on localhost
, because the loopback interface is not exposed to untrusted networks. Trusting localhost
may become the default in the future. Use .trustLocalhost(false)
to force check of <IP_ADDRESS>
's authenticity.
We intentionally don't support disabling of HTTPS security when making requests to any other IP, because such options end up abused as a quick "fix" for HTTPS problems. You can get free HTTPS certificates from Let's Encrypt or set your own CA (.ca(ca_public_pem)
) to make your self-signed certificates trusted.
Promise and Generator support
SuperAgent's request is a "thenable" object that's compatible with JavaScript promises and the async
/await
syntax.
const res = await request.get(url);
If you're using promises, do not call .end()
or .pipe()
. Any use of .then()
or await
disables all other ways of using the request.
Libraries like co or a web framework like koa can yield
on any SuperAgent method:
const req = request
.get('http://local')
.auth('tobi', 'learnboost');
const res = yield req;
Note that SuperAgent expects the global Promise
object to be present. You'll need a polyfill to use promises in Internet Explorer or Node.js 0.10.
Browser and node versions
SuperAgent has two implementations: one for web browsers (using XHR) and one for Node.JS (using core http module). By default Browserify and WebPack will pick the browser version.
If want to use WebPack to compile code for Node.JS, you must specify node target in its configuration.
Using browser version in electron
Electron developers report if you would prefer to use the browser version of SuperAgent instead of the Node version, you can require('superagent/superagent')
. Your requests will now show up in the Chrome developer tools Network tab. Note this environment is not covered by automated test suite and not officially supported.