Driver errors such as careless and aggressive driving behaviors are one of the key factors contributing to road traffic accidents. It is, therefore, essential that drivers are aware of their actions when they are in control of the wheel responsible for not only their own lives but also passengers and bystanders on the road. Driver monitoring and advanced driver assistance systems have already been utilized in fleet and logistic domain as well as built into high-end vehicles commercially available in the market. However, the majority of drivers on the road today do not have access to such systems. This paper proposes a novel methodology of driving event detection using a time series approximation algorithm known as symbolic aggregate approximation (SAX) on data collected from smartphone sensors. The use of smartphone allows the system to be easily accessible, widely available, and implemented at low cost. In addition, a resource usage exploration on a smartphone platform is conducted in order to demonstrate the flexibility of our proposed algorithm to match different smartphone specifications. Preliminary results from our experiments revealed that the precision of the proposed detection algorithm of aggressive driving events is fairly good as the precision values range from 50% to 100%. In terms of resource usage exploration, it has been found that there is a strong linear relationship between the parameter settings for data compression and the runtime of the algorithm. This is beneficial when a trade-off is required between the accuracy of the algorithm and the resource usage on the smartphone.
Traveling from one place to another in a fastest possible time seems a necessity in our modern society today especially in big cities around the world. Drivers tend to be more aggressive and careless whether to change lanes quickly to avoid traffic or to overtake cars in front to beat the red lights. Consequently, this leads to an increased risk of road traffic accidents. Studies have shown that when a driver is monitored and driving events are recorded, the chances of aggressive and dangerous driving behavior are reduced . An in-vehicle data recorder, similar to a black box on an aircraft, has been well established as a tool to record and store driving data occurring in a journey [2, 3]. A number of commercial products available in the market using in-vehicle data recorders equipped with a wide variety of sensory devices such as Global Positioning System (GPS) receiver and often a video camera are used to monitor drivers . Taxi operators and fleet management systems are some examples that deploy driver monitoring systems where every driver can be traced to ensure that they follow designated routes and do not violate the speed limit [5, 6].
A rich source of data can also be obtained from real-time driving data through a network of sensory devices which can be used to detect possible collisions and crashes [7, 8]. Car manufacturers have taken this idea and developed an advanced driver assistance systems (ADAS) such as collision prevention and avoidance systems . This can only be found in high-end models at present as the sensors required for ADAS system are expensive making it very unlikely to be included in cheaper models.
It is well established that three main contributing factors to road traffic accidents are vehicle conditions, road infrastructures, and driver errors. In terms of driver errors, the fundamental elements leading up to aggressive driving behaviors are from different driving events that occur during a journey. These include sudden braking/acceleration, sudden turn, and sudden lane change. The sudden driving events can be distinguished from their non-sudden counterparts by a measurement of the acceleration rate per second. An acceleration is considered sudden when the acceleration rate is more than 0.3 G per second on a longitudinal axis. Similarly, a brake is sudden with the acceleration rate less than -0.3 G per second on a longitudinal axis. A right turn and a right lane change are sudden when the acceleration is measured on a lateral axis to be more than 0.3 G per second, and a left turn and a left lane change are sudden when the acceleration is measured to be less than -0.3 G per second. Hence, in order to recognize potential crashes, it is essential to be able to detect these fundamental driving events and classify whether or not they are aggressive.
So far, we have discussed about driver monitoring systems available and being deployed in the current market. These are based on in-vehicle data recorders which have the ability to store real-time driving data. The fact that these recorders are attached onto the vehicle means that they cannot be easily removed to be used in other vehicles. Hence, they are not flexible, impractical, and not very easily accessible. Modern smartphones available in the present market now come equipped with multi-sensors onboard which enable the capability similar to in-vehicle data recorder. In addition, they are easily accessible, widely available, and can be implemented at low cost. As a result, this makes smartphone a good candidate to be used as an alternative device to collect, process, and analyze driving data as well as detect and classify aggressive driving behaviors in order to alert drivers when they are being reckless.
Examples of the onboard smartphone sensors are accelerometer, GPS receiver, and gyroscope sensor. Accelerometer data provide an insight into the longitudinal and lateral movement of the phone while the onboard GPS receiver provides us with location data in terms of latitude and longitude. Therefore, these data allow us to infer the vehicle's movement when a smartphone is placed inside a car. The ability to detect these fundamental driving events would be highly advantageous to many application domains in the road safety perspective such as an automated advanced warning system. A number of studies have already deployed smartphones as a device to evaluate a driver's behavior and also road surface conditions in the literature [10, 11]. However, the work proposed in this paper differs from the existing approaches in the literature as we deploy a technique called symbolic aggregate approximation (SAX) as an algorithm to detect driving events as opposed to dynamic time warping technique . SAX offers the ability to efficiently approximate time series data which makes it a good candidate for implementation of real-time algorithm to be implemented on a smartphone. To the best of the authors' knowledge, this is the first time that SAX has been applied to driving data.
Another issue that is required to be considered is the computational power and resource usage on a smartphone platform as smartphones nowadays offer a wide range of hardware specifications with different levels of computing power and battery capacity. It is, therefore, highly beneficial that we are able to control how much resource is required when executing our proposed algorithm. One of the many features of SAX is the ability to vary parameter settings which enables us to control the resource usage for a given smartphone platform.
The paper is organized as follows. Related work is discussed in the section 'Related work' of this paper. Description of data collected from smartphone sensors is given in the section 'Description of sensors and data'. The methodology used in this paper is described in the section 'Methodology'. Experimental setup and results and analysis are presented in the 'Algorithm evaluation' and 'Exploration of smartphone resource usage' sections, respectively. Finally, the last section concludes this paper.
Mohan et al. proposed a system where smartphones are utilized as a means to monitor road and traffic conditions . This was achieved by using sensors onboard smartphones such as accelerometer and GPS sensor to detect potholes, bumps, as well as vehicles braking and honking. The system has been implemented and tested where promising results in terms of the effectiveness of sensing functions have been reported. Similar to , the approach proposed in  deploys a smartphone application which collects data from multi-sensors onboard to analyze road conditions obtaining at the same time high accuracy results in classifying different road defects.
Moreover, the work proposed in  presented a method to analyze a driver's behavior and advise drivers on sudden and harmful situation. Their approach is based on vehicle movements as well as physical road conditions, i.e., road surface roughness. However, their work mainly focused on the physical aspect of the road rather than the driver's behavior. The results from  revealed that their algorithm is able to classify different types of road surface imperfections such as bump and pothole with high accuracy.
Johnson and Trivedi proposed an approach in order to classify different driving styles based on data collected from smartphones . In their approach, driving styles can be in the form of normal, aggressive, and very aggressive. A technique called dynamic time warping algorithm was used to detect driving events. This was achieved by matching incoming time series with the reference patterns of each driving event. The results from their work reveal that various sensors on smartphones can provide good source of information for an accurate measure and classification of different driving styles. Our previous work in  analyzed accelerometer and magnetometer data using pattern matching technique and also dynamic time warping algorithm to detect and classify aggressive driving events. Promising results have been reported with high percentage of precision and detection rate.
Our work proposed in this paper differs from the work in the literature as a novel algorithm based on the use of time series approximation technique called the SAX. SAX offers the ability to efficiently approximate time series data which makes it a good candidate for implementation of real-time algorithm to be implemented on a smartphone.
In this paper, we explore the applicability of SAX on driving event detection. SAX is short for symbolic aggregate approximation. It is a technique which processes long time series into their approximation form. For driving event detection problem, we will have time series data whose values are collected data points from appropriate sensors onboard a smartphone. In addition, we will have pattern samples which represents driving patterns, i.e., sudden acceleration (SA), sudden brake (SB), and so on. By nature, pattern samples are short sections of time series validated by humans to be containing such driving patterns. We can view the driving event detection as a pattern matching problem between these pattern samples and driving episodes which are longer time series. We are interested in detecting driving patterns residing within driving episodes. We choose the SAX algorithm for various reasons.
First, SAX approximates time series into discrete levels of values. For example, a time series of 16 data points long may be approximated into three levels: low level, medium level, and high level. Those 16 sequential values can be analyzed by SAX and found that this time series start with high-level values, then low-level values, followed by middle-level values. The low-level, middle-level, and high-level values are designated as a, b, and c, respectively. Thus, our sample time series produce a SAX string of caab, as illustrated in Figure 1. The approximation technique utilized in SAX makes it a good candidate for real-time implementation on a smartphone as it requires less memory and execution time in comparison to raw time series.
Second, SAX helps to eliminate noise as it is an approximation technique. Therefore, SAX will be fit to use for noise reduction purpose with time series such as in the case of our data which is collected from sensors in a noisy environment, i.e., while driving on different road surfaces. Third, SAX comes ready with its own distance function 'min-dist' which is a lower boundary of the Euclidean distance . For all the above reasons, SAX can be quite readily utilized onto our pattern matching problem of driving event detection.
Three sensors from a smartphone are considered. Firstly, the three-axes accelerometer measures the force of acceleration whether caused by the phone's movement or gravity. The three axes correspond to lateral, longitudinal, and vertical accelerations. In this work, we are only interested in movements along the lateral and longitudinal axes which refers to side-to-side movement and forward and backward movement, respectively. In real-world scenarios, lateral acceleration or side-to-side movements represent driving events such as turning left and right and lane change while longitudinal acceleration corresponds to vehicle braking and accelerating.
The second sensor, magnetometer, measures the strength of magnetic field which can provide us a sense of direction at which the smartphone is pointing towards with respect to the magnetic north. It is a sensor usually found in a compass. Raw data from magnetometer will be utilized as an indicator for the detection of driving events in lateral domain. Our third sensor is a GPS receiver which provides positioning and speed data of the vehicle that the smartphone is attached to. Overall, accelerometer and magnetometer data are sampled at a rate of 5 Hz where one sample is recorded every 200 ms. Data from GPS receiver is sampled at 1 Hz.
Figure 2 shows a typical smartphone with relevant axes in accordance with the measurement from accelerometer. The lateral movement is denoted by the x-axis while the longitudinal movement is denoted by the y-axis.
where C=c1,…,c n and C ¯ = c ¯ 1 , … , c ¯ w . From the equation, the algorithm first divides the original data equally into w frames. Second, it finds the mean value within the i th of w frame. The mean values have been normalized with zero as a mean of the transformed time series; thus, they follow the Gaussian distribution. Third, the mean values are discretized using breakpoints which divide the areas under Gaussian curve equally. The SAX algorithm was provided with a lookup statistical table. Then, each of the mean values in w frames can be mapped to the discretized symbols, producing a string of symbols referred to as word.Figure 3 illustrates the overview of the proposed algorithm. It can be seen from the figure that our methodology of applying SAX comprises of three main steps described as follows.
Overview of the proposed algorithm.
For each pattern and driving episode to be considered a match, the first step requires that both pattern and driving episode data are transformed through the SAX algorithm. The transformation gives an approximated version of both pattern and driving episode, eliminating noise residing in the original patterns and/or driving episodes in the process. We utilized the MATLAB code of SAX downloaded from . By calling the timeseries2symbol function in the MATLAB package, any input time series will be transformed to a string of SAX symbols. The function requires two pieces of information: word size (w) and alphabet size (a). The first parameter, w, dictates the output length of the SAX string. The second parameter, a, dictates the number of ranges the values are discretized into. We may infer the compression ratio that SAX gives if we determine the original length of the input time series, where compression ratio =w/n.
In order to explore the applicability of SAX on driving event detection, we vary the word size parameter to four different compression ratios, that is 1/2, 1/3, 1/4, and 1/5. As for alphabet size, it was explored in  that the alphabet size may vary from the values of 2 to 8 and the best setting is data-dependent. We investigated the nature of driving pattern data by means of visualization. Figures 4, 5, 6, 7 illustrate sudden acceleration, sudden brake, sudden left turn, and sudden right turn driving patterns obtained from data collection. All of sudden acceleration patterns in Figure 4 show approximately the upside-down V or U shape of y-axis accelerometer, while all of sudden brake patterns in Figure 5 show approximately the V or U shape of y-axis accelerometer. All of sudden left turn patterns in Figure 6 show approximately the V or U shape of x-axis accelerometer, while all of sudden right turn patterns in Figure 7 show approximately the upside-down V or U shape of x-axis accelerometer. From manually investigating the shape of all driving patterns, we found that most patterns have at least three levels of values. Hence, the minimum alphabet size was set to 3, and the maximum was set to the software limit of 10 in order to cover all data values.
Sudden left turn driving patterns.
Sudden right turn driving patterns.
After the transformation, both SAX strings of pattern and driving episode will be compared for their similarity to each other using a distance function. A distance function calculates how similar the two SAX strings are. When a distance function returns high values, two SAX strings are dissimilar. On the other hand, when a distance function returns low values, two SAX strings are alike. In general, there are various distance functions. For this study, we use the distance function which is suitable for comparing similarity between SAX strings, min_dist. min_dist is expressed in (2), when the d i s t() function can be looked up from Table 1. Note that the lookup table (Table 1) varies according to the alphabet size (a). Given two strings Q ̂ and C ̂ , min_dist gives the root of sum square of distance values between the symbolic pairs from Q ̂ and C ̂ , normalized by root inverse compression ratio. min_dist distance is proven to be a lower bound approximation of the Euclidean distance between original time series Q and C. Interested audience may refer to  for further implementation details.
The table is calculated for alphabet size (a) = 5.
After calculating the distance between any two SAX strings, we now have distance values between the pair of strings. Distance values are numerical values whose ranges are dependent on the original values of the strings. However, distance values do not yet indicate how much alike two SAX strings are required to be in order to be considered a match. Therefore, a step is required to perform a thresholding of distance values in order to determine if and where the driving event occurs.
In our methodology, we experimented with a threshold variable t. The variable t defines the number of distance data points which gives the value of zero consecutively in order to detect the driving event. For instance, t=5 dictates that the SAX strings of patterns and driving episodes are very similar where distance value equals 0 for 5 time periods. In a situation where a compression ratio is 1/5 and the original data sampling rate is 5 Hz, it has a temporal translation equivalent to that of 5 s.
In this experiment, raw data was collected using a single driver in one vehicle, 2010 Toyota Vigo, where approximately 120 driving events in urban and rural road environments were recorded. The route chosen is approximately 40 km long, from central Bangkok to the outskirt Bangkok, north west of the city. Data was collected using Android-based smartphone with a tailored made application which allows the tester to record driving events in real-time where a corresponding timestamp is noted in order to label our ground truth data.
We run the SAX algorithm according to our methodology described in the previous section. We are interested in two main evaluation measures. First, we evaluate the precision of the driving event detection using SAX. Precision is defined as the accuracy of the detection. It represents the percentage that the algorithm correctly detects the event. Second, we evaluate the detection rate of SAX. Detection rate represents the percentage of observed events which are detected by the algorithm.Figure 8 illustrates an instance of results obtained from using the proposed methodology in driving event detection, which in this case is SA. There are two sections displaying two time series. The time series on top is a section of driving episode, from which we are interested in detecting driving events. The time series on the bottom is a time-aligned section of distance values, which was calculated from the associated driving episode and a driving pattern of sudden acceleration.
Sudden acceleration driving events analysis.
From the ground truth, there are eight sessions of SA event between the following time point intervals: 5654-5670, 6237-6247, 6247-6262, 6262-6272, 6416-6443, 6551-6558, 6613-6622, and 6674-6686. From our method, the algorithm was able to detect three SA driving events at the following time points: 100, 6260, and 6553. Figure 8 presents both ground truths and detection points. Due to page limitation, only the area of plots from time point 5600 to time point 6880 was displayed. All eight ground-truth SA sessions are presented in the figure using opaque colored boxes overlaying the plot of driving event. For a setting of compression ratio = 1/2, alphabet size (a)=4, and threshold (t)=4, the algorithm detected three SA driving events as previously mentioned.
The first detection at time point 100 was out of range in the plot and was not the right detection. However, the other two detections at time points 6260 and 6553 were able to detect SA driving events accurately. The detection was presented using red arrows. As we can see, the red arrows point right at the correct time frame of the ground truth. As part of the evaluation, we allow a lag time of 3 s for the detection later than the driving event for it to be correct. This decision is based on an assumption that the algorithm needs to gather information on the fly. For a driving pattern to be detected, all or almost all of the pattern needs to be seen by the algorithm before the algorithm can make a decision. However, the algorithm cannot take too long to produce the decision, otherwise the feedback of dangerous driving behavior will not be given in time. Therefore, the algorithm detected three instances of the SA driving pattern, two of which are correct. Moreover, from all of eight ground-truth sessions, three of which are detected. The detection at time point 6260 was counted as a detection for two sessions, 6237-6247 and 6247-6262. This gives the precision value of 66.67% and detection rate of 37.5% as presented in Table 2.
Results of all driving pattern detections are presented in Table 2.
From Table 2, each pattern has been detected with the SAX algorithm and the number of detected events is presented in the second column. In the third column, precision values of driving event detection range from 50% to 66.67%, with sudden acceleration and sudden left turn pattern detection having the best accuracy. The parentheses under precision percentages within each precision cell are the number of correctly detected events and the number of detected events. For example, three events were detected for pattern SA, two of which were correctly ground truth events. Even though precision values are mostly 60% and above (with the exception of sudden brake and lane change right pattern), detection rates obtained from the experiment (in the fourth column) are quite low, ranging from 20% to 37.5%. The parentheses under detection rate percentages within each cell are the number of real driving events detected by the algorithm and the number of ground truth events. For example, eight SA events actually occurred during the test, three of which were detected by the algorithm. This low detection rate can be improved with different parameter settings in our proposed algorithm which we will take note for future work.
Due to the nature of SAX, our algorithm has the ability to fine-tune the parameter setting which governs how the driving patterns and episodes are to be approximated. For example, alphabet size represents the discretized ranges of values that our raw data can be approximated into while the compression ratio, which is the ratio of the length of the input signal over that of the output signal, determines how much we would like to approximate the data by. Hence, by adjusting the compression ratio or the alphabet size, we are able to control the computational cost when the algorithm is in operation. This feature is very much suited for deployment on smartphone platform as smartphones are available in a wide range of hardware specifications where lower-end smartphones will possess less computational power and battery resources in comparison to high-end models.
A series of experiments were set up in order to demonstrate and evaluate the flexibility of our proposed algorithm in terms of resource usage on smartphone platform. More specifically, we examine computational time, CPU usage, memory usage, and battery usage of our proposed algorithm when it is in operation.
Our proposed algorithm was implemented on HTC One X smartphone running Android OS 4.1. The phone is equipped with GPS receiver and accelerometer sensor which are the prerequisites for our proposed approach. Similar settings to the previous section was applied in this experiment with the sampling rate of accelerometer set to 5 Hz while GPS data is sampled at 1 Hz. We randomly selected a portion of our driving data for our data set to be used as input for this experiment. The two governing parameters, the alphabet size and the compression ratio, are varied to create a range of algorithm settings. Note that the same data set is used throughout this experiment for all algorithm settings.
A tailored made application was created with our proposed algorithm on board. With this application, we are able to obtain the execution time of the algorithm, CPU usage, memory usage, and battery usage. The definition of each parameter is as follows. Execution time is measured per iteration of the algorithm which is the time taken to process one new data point. CPU usage is the percentage of capacity of CPU required to perform one iteration of the algorithm while memory usage is the amount of memory required for the same task. In this work, battery usage is measured in mA for 100 iterations of algorithm execution. To ensure that other processes and applications have no effect on the obtained resource usage values, the memory is cleared before each execution and no other applications is initiated during the experiment. We have set the length of our driving episode to be 1,000 data points, n=1,000, with our driving event pattern set to have 66 data points, w=66.
In total, 1,000 data points from driving episode were used in this experiment while we selected one driving pattern to be compared with the given driving episode. For a real-time environment, measurements of resource usage that we are interested in were taken after every one new data point has been sampled.Figure 9 illustrates a plot of average execution time per iteration of the algorithm to process a window of one new data point. The execution time includes the three main steps of our proposed algorithm which are transforming a selected portion of the driving episode to a SAX string and then performing a distance calculation with the driving pattern SAX string followed by distance thresholding. The plot shows a strong linear relationship between the average execution time per iteration, the compression ratio, and the alphabet size. From the plot, it can be seen clearly that when the compression ratio is set to 1/2, our algorithm takes the most amount of time to complete one iteration for all ranges of alphabet size as the line is very distinct and well separated from the other compression ratio values. As expected, the average execution time per iteration decreases as the compression ratio decreases since we will have less data points to process after SAX transformation.Another important point to note from Figure 9 is that the effect of compressing more data becomes less significant on the execution time below the compression ratio of 1/5 as the plots seem to saturate at approximately 15 to 35 ms. This is significant because increasing the compression ratio will likely decrease the accuracy of the driving event detection algorithm.Figures 10 and 11 illustrate the plots of average memory usage per iteration and the battery usage per 100 iteration, respectively. It can be seen from both plots that there is no apparent relationship between compression ratio, alphabet size, and either of the memory or battery usage. The data on the graphs are clustered into one area with one or two outliers. One possible reason for these outliers is that Android operating system has other processes which we have no control of running in the background to optimize memory usage.
Plot of average execution time per iteration for a range of compression ratio and alphabet size settings.
Plot of average memory usage per iteration for a range of compression ratio and alphabet size settings.
Plotzof battery usage per 100 iteration for a range of compression ratio and alphabet size settings.
For the memory usage, we can conclude that our proposed algorithm requires approximately 7 to 13 MB of RAM to process one iteration for this given data set. This suggests that our algorithm is suitable for implementation on lower-end smartphones that contain either 256 or 512 MB of RAM. On the other hand, approximately 50 to 160 mA of power is required to execute 100 iterations of our algorithm. The battery on our test device is quoted to be 1,800 mAh. Hence, running our algorithm alone on this test device will last approximately 11 h.
The readings of CPU usage have also been taken. However, they were found to be very small ranging between 0% and 1%. Therefore, it can be concluded that our proposed algorithm is not computationally expensive as less than 1% of CPU usage is reported for all ranges of parameter settings for this given data set.
This paper proposes a novel method of applying a time series approximation technique called the SAX on driving event detection problems. The proposed system utilizes a modern smartphone as a means to collect raw driving data based on the onboard sensors picking up the car's maneuvers when placed inside a vehicle. The use of smartphone allows the system to be easily accessible, widely available, and implemented at low cost. Real-world data is collected through an experiment conducted on a route containing both urban and rural roadways. Preliminary results from our experiments revealed that the precision of the proposed detection algorithm of aggressive driving events is fairly good as the precision values range from 50% to 100%. From the plot in Figure 8, the algorithm can detect driving events which are hard to detect with bare eyes and does so in a timely fashion. A resource usage exploration has also been conducted on a smartphone platform to demonstrate the flexibility of our proposed algorithm. It has been found that there is a strong linear relationship between the parameter settings for data compression and the runtime of the algorithm. This is beneficial when we want to trade-off the accuracy of the algorithm and the resource usage on the smartphone.
Further improvements can be made as our future work on the detection rate of the proposed algorithm. We believe that the low detection rate can be improved from a better understanding and optimization of parameter settings for the approximation of driving patterns and episodes. We hope in the future to execute more repeated tests on a greater number of events in order to provide sufficient test instances of some statistical significance.
This research is jointly funded by National Electronics and Computer Technology Centre (NECTEC) and Asian Transportation Research Society (ATRANS) grant number 12-13/001.
The authors declare having applied for a patent related to the content of this research article.


text:
4513 McHenry Avenue
Directions Modesto,	CA	95356
Remaining 2019s!
Modesto TRUCK CENTER
TOOLS & Incentives
Global Incentives
Road to 5 Million Certified Sold
One Minute Finance Application
Perfect Attendance Drive
Corolla vs. Honda Civic
Camry vs. Honda Accord
RAV4 vs. Honda CR-V
Highlander vs. Honda Pilot
Tacoma vs. Honda Ridgeline
Sienna vs. Honda Odyssey
Colleg Grad Rebate
You are viewing all posts for tags: 1500
Used Ram 1500 Modesto CA 95356
Ram 1500 Express
Sensibility and practicality define the 2015 Ram 1500 It features an automatic transmission, rear-wheel drive, and a powerful 8 cylinder engine. This model accommodates 6 passengers comfortably, and provides features such as: delay-off headlights, a tachometer, an automatic dimming rear-view…
Ram 1500 Longhorn
You can expect a lot from the 2016 Ram 1500 This 4 door, 5 passenger truck has just over 80,000 miles. It features an automatic transmission, rear-wheel drive, and a 3 liter 6 cylinder engine. A turbocharger is also…
Ram 1500 ST
Outstanding design defines the 2011 Ram 1500 This 4 door, 6 passenger truck still has less than 90,000 miles! Under the hood you'll find an 8 cylinder engine with more than 300 horsepower, providing a smooth and predictable…
Ram 1500 ST 4x4 Quad 6.4ft
Here's a great deal on a 2012 Ram 1500 This 4 door, 6 passenger truck still has fewer than 70,000 miles! It features four-wheel drive capabilities, a durable automatic transmission, and a powerful 8…
Ram 1500 Laramie
You can expect a lot from the 2016 Ram 1500 With fewer than 35,000 miles on the odometer, this vehicle proves competitive in its price class based on its condition and value. It features four-wheel drive capabilities, a durable…
Take command of the road in the 2016 Ram 1500 This 4 door, 5 passenger truck still has less than 90,000 miles! Under the hood you'll find a 6 cylinder engine with more than 230 horsepower, and load…
Ram 1500 SLT 5.7L V8 HEMI MDS VVT
Get excited about the 2014 Ram 1500 Under the hood you'll find an 8 cylinder engine with more than 350 horsepower, and for added security, dynamic Stability Control supplements the drivetrain. Four wheel…
Discerning drivers will appreciate the 2017 Ram 1500 With less than 20,000 miles on the odometer, this pickup successfully merges advanced capability with comfort and agility, distinguishing itself from the competition with its cargo capacity, towing capacity, and ruggedness…
Ram 1500 ST 4x4 Crew 5.7ft
Step into the 2012 Ram 1500 Smooth gearshifts are achieved thanks to the powerful 8 cylinder engine, providing a spirited, yet composed ride and drive. Four wheel drive allows you to go places you've only…
Ram 1500 SLT
Here's a great deal on a 2016 Ram 1500 Under the hood you'll find an 8 cylinder engine with more than 350 horsepower, providing a smooth and predictable driving experience. It's equipped with tons of terrific amenities…
1500 1500 Classic 2500 300 3500 350Z 4 4Runner 4WD Trucks 5 86 A4 A6 Acadia Altima Armada ATV Audi Avalon Avalon Hybrid Aveo Beetle Buick C-Class C-HR Cadenza CADILLAC Camaro Camry Camry Hybrid
Monday - Sunday 9:00AM-9:00PM
Sunday 9:00AM-9:00PM

redpajama_set_name: RedPajamaCommonCrawl


text:
'use strict';

const msRest = require('ms-rest');
const msRestAzure = require('ms-rest-azure');
const WebResource = msRest.WebResource;

/**
 * Gets all versions of a job.
 *
 * @param {string} resourceGroupName The name of the resource group that
 * contains the resource. You can obtain this value from the Azure Resource
 * Manager API or the portal.
 *
 * @param {string} serverName The name of the server.
 *
 * @param {string} jobAgentName The name of the job agent.
 *
 * @param {string} jobName The name of the job to get.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link JobVersionListResult} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listByJob(resourceGroupName, serverName, jobAgentName, jobName, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let apiVersion = '2017-03-01-preview';
  // Validate
  try {
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') {
      throw new Error('serverName cannot be null or undefined and it must be of type string.');
    }
    if (jobAgentName === null || jobAgentName === undefined || typeof jobAgentName.valueOf() !== 'string') {
      throw new Error('jobAgentName cannot be null or undefined and it must be of type string.');
    }
    if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') {
      throw new Error('jobName cannot be null or undefined and it must be of type string.');
    }
    if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions';
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName));
  requestUrl = requestUrl.replace('{jobAgentName}', encodeURIComponent(jobAgentName));
  requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName));
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['JobVersionListResult']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Gets a job version.
 *
 * @param {string} resourceGroupName The name of the resource group that
 * contains the resource. You can obtain this value from the Azure Resource
 * Manager API or the portal.
 *
 * @param {string} serverName The name of the server.
 *
 * @param {string} jobAgentName The name of the job agent.
 *
 * @param {string} jobName The name of the job.
 *
 * @param {number} jobVersion The version of the job to get.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link JobVersion} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _get(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  let apiVersion = '2017-03-01-preview';
  // Validate
  try {
    if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
      throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.');
    }
    if (serverName === null || serverName === undefined || typeof serverName.valueOf() !== 'string') {
      throw new Error('serverName cannot be null or undefined and it must be of type string.');
    }
    if (jobAgentName === null || jobAgentName === undefined || typeof jobAgentName.valueOf() !== 'string') {
      throw new Error('jobAgentName cannot be null or undefined and it must be of type string.');
    }
    if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') {
      throw new Error('jobName cannot be null or undefined and it must be of type string.');
    }
    if (jobVersion === null || jobVersion === undefined || typeof jobVersion !== 'number') {
      throw new Error('jobVersion cannot be null or undefined and it must be of type number.');
    }
    if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') {
      throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let baseUrl = this.client.baseUri;
  let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}';
  requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
  requestUrl = requestUrl.replace('{serverName}', encodeURIComponent(serverName));
  requestUrl = requestUrl.replace('{jobAgentName}', encodeURIComponent(jobAgentName));
  requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName));
  requestUrl = requestUrl.replace('{jobVersion}', encodeURIComponent(jobVersion.toString()));
  requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId));
  let queryParameters = [];
  queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
  if (queryParameters.length > 0) {
    requestUrl += '?' + queryParameters.join('&');
  }

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['JobVersion']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/**
 * Gets all versions of a job.
 *
 * @param {string} nextPageLink The NextLink from the previous successful call
 * to List operation.
 *
 * @param {object} [options] Optional Parameters.
 *
 * @param {object} [options.customHeaders] Headers that will be added to the
 * request
 *
 * @param {function} callback - The callback.
 *
 * @returns {function} callback(err, result, request, response)
 *
 *                      {Error}  err        - The Error object if an error occurred, null otherwise.
 *
 *                      {object} [result]   - The deserialized result object if an error did not occur.
 *                      See {@link JobVersionListResult} for more information.
 *
 *                      {object} [request]  - The HTTP Request object if an error did not occur.
 *
 *                      {stream} [response] - The HTTP Response stream if an error did not occur.
 */
function _listByJobNext(nextPageLink, options, callback) {
   /* jshint validthis: true */
  let client = this.client;
  if(!callback && typeof options === 'function') {
    callback = options;
    options = null;
  }
  if (!callback) {
    throw new Error('callback cannot be null.');
  }
  // Validate
  try {
    if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') {
      throw new Error('nextPageLink cannot be null or undefined and it must be of type string.');
    }
    if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') {
      throw new Error('this.client.acceptLanguage must be of type string.');
    }
  } catch (error) {
    return callback(error);
  }

  // Construct URL
  let requestUrl = '{nextLink}';
  requestUrl = requestUrl.replace('{nextLink}', nextPageLink);

  // Create HTTP transport objects
  let httpRequest = new WebResource();
  httpRequest.method = 'GET';
  httpRequest.url = requestUrl;
  httpRequest.headers = {};
  // Set Headers
  httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8';
  if (this.client.generateClientRequestId) {
      httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid();
  }
  if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) {
    httpRequest.headers['accept-language'] = this.client.acceptLanguage;
  }
  if(options) {
    for(let headerName in options['customHeaders']) {
      if (options['customHeaders'].hasOwnProperty(headerName)) {
        httpRequest.headers[headerName] = options['customHeaders'][headerName];
      }
    }
  }
  httpRequest.body = null;
  // Send Request
  return client.pipeline(httpRequest, (err, response, responseBody) => {
    if (err) {
      return callback(err);
    }
    let statusCode = response.statusCode;
    if (statusCode !== 200) {
      let error = new Error(responseBody);
      error.statusCode = response.statusCode;
      error.request = msRest.stripRequest(httpRequest);
      error.response = msRest.stripResponse(response);
      if (responseBody === '') responseBody = null;
      let parsedErrorResponse;
      try {
        parsedErrorResponse = JSON.parse(responseBody);
        if (parsedErrorResponse) {
          if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error;
          if (parsedErrorResponse.code) error.code = parsedErrorResponse.code;
          if (parsedErrorResponse.message) error.message = parsedErrorResponse.message;
        }
        if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) {
          let resultMapper = new client.models['CloudError']().mapper();
          error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body');
        }
      } catch (defaultError) {
        error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` +
                         `- "${responseBody}" for the default response.`;
        return callback(error);
      }
      return callback(error);
    }
    // Create Result
    let result = null;
    if (responseBody === '') responseBody = null;
    // Deserialize Response
    if (statusCode === 200) {
      let parsedResponse = null;
      try {
        parsedResponse = JSON.parse(responseBody);
        result = JSON.parse(responseBody);
        if (parsedResponse !== null && parsedResponse !== undefined) {
          let resultMapper = new client.models['JobVersionListResult']().mapper();
          result = client.deserialize(resultMapper, parsedResponse, 'result');
        }
      } catch (error) {
        let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`);
        deserializationError.request = msRest.stripRequest(httpRequest);
        deserializationError.response = msRest.stripResponse(response);
        return callback(deserializationError);
      }
    }

    return callback(null, result, httpRequest, response);
  });
}

/** Class representing a JobVersions. */
class JobVersions {
  /**
   * Create a JobVersions.
   * @param {SqlManagementClient} client Reference to the service client.
   */
  constructor(client) {
    this.client = client;
    this._listByJob = _listByJob;
    this._get = _get;
    this._listByJobNext = _listByJobNext;
  }

  /**
   * Gets all versions of a job.
   *
   * @param {string} resourceGroupName The name of the resource group that
   * contains the resource. You can obtain this value from the Azure Resource
   * Manager API or the portal.
   *
   * @param {string} serverName The name of the server.
   *
   * @param {string} jobAgentName The name of the job agent.
   *
   * @param {string} jobName The name of the job to get.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<JobVersionListResult>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listByJobWithHttpOperationResponse(resourceGroupName, serverName, jobAgentName, jobName, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listByJob(resourceGroupName, serverName, jobAgentName, jobName, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Gets all versions of a job.
   *
   * @param {string} resourceGroupName The name of the resource group that
   * contains the resource. You can obtain this value from the Azure Resource
   * Manager API or the portal.
   *
   * @param {string} serverName The name of the server.
   *
   * @param {string} jobAgentName The name of the job agent.
   *
   * @param {string} jobName The name of the job to get.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {JobVersionListResult} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link JobVersionListResult} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listByJob(resourceGroupName, serverName, jobAgentName, jobName, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listByJob(resourceGroupName, serverName, jobAgentName, jobName, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listByJob(resourceGroupName, serverName, jobAgentName, jobName, options, optionalCallback);
    }
  }

  /**
   * Gets a job version.
   *
   * @param {string} resourceGroupName The name of the resource group that
   * contains the resource. You can obtain this value from the Azure Resource
   * Manager API or the portal.
   *
   * @param {string} serverName The name of the server.
   *
   * @param {string} jobAgentName The name of the job agent.
   *
   * @param {string} jobName The name of the job.
   *
   * @param {number} jobVersion The version of the job to get.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<JobVersion>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  getWithHttpOperationResponse(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._get(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Gets a job version.
   *
   * @param {string} resourceGroupName The name of the resource group that
   * contains the resource. You can obtain this value from the Azure Resource
   * Manager API or the portal.
   *
   * @param {string} serverName The name of the server.
   *
   * @param {string} jobAgentName The name of the job agent.
   *
   * @param {string} jobName The name of the job.
   *
   * @param {number} jobVersion The version of the job to get.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {JobVersion} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link JobVersion} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  get(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._get(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._get(resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options, optionalCallback);
    }
  }

  /**
   * Gets all versions of a job.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @returns {Promise} A promise is returned
   *
   * @resolve {HttpOperationResponse<JobVersionListResult>} - The deserialized result object.
   *
   * @reject {Error} - The error object.
   */
  listByJobNextWithHttpOperationResponse(nextPageLink, options) {
    let client = this.client;
    let self = this;
    return new Promise((resolve, reject) => {
      self._listByJobNext(nextPageLink, options, (err, result, request, response) => {
        let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
        httpOperationResponse.body = result;
        if (err) { reject(err); }
        else { resolve(httpOperationResponse); }
        return;
      });
    });
  }

  /**
   * Gets all versions of a job.
   *
   * @param {string} nextPageLink The NextLink from the previous successful call
   * to List operation.
   *
   * @param {object} [options] Optional Parameters.
   *
   * @param {object} [options.customHeaders] Headers that will be added to the
   * request
   *
   * @param {function} [optionalCallback] - The optional callback.
   *
   * @returns {function|Promise} If a callback was passed as the last parameter
   * then it returns the callback else returns a Promise.
   *
   * {Promise} A promise is returned
   *
   *                      @resolve {JobVersionListResult} - The deserialized result object.
   *
   *                      @reject {Error} - The error object.
   *
   * {function} optionalCallback(err, result, request, response)
   *
   *                      {Error}  err        - The Error object if an error occurred, null otherwise.
   *
   *                      {object} [result]   - The deserialized result object if an error did not occur.
   *                      See {@link JobVersionListResult} for more information.
   *
   *                      {object} [request]  - The HTTP Request object if an error did not occur.
   *
   *                      {stream} [response] - The HTTP Response stream if an error did not occur.
   */
  listByJobNext(nextPageLink, options, optionalCallback) {
    let client = this.client;
    let self = this;
    if (!optionalCallback && typeof options === 'function') {
      optionalCallback = options;
      options = null;
    }
    if (!optionalCallback) {
      return new Promise((resolve, reject) => {
        self._listByJobNext(nextPageLink, options, (err, result, request, response) => {
          if (err) { reject(err); }
          else { resolve(result); }
          return;
        });
      });
    } else {
      return self._listByJobNext(nextPageLink, options, optionalCallback);
    }
  }

}

module.exports = JobVersions;

redpajama_set_name: RedPajamaGithub


Students who have appeared for the Karnataka First Year PUC examination can now check their result using their registration number and date of birth.
Karnataka PUC Result 2019: The Karnataka first-year pre-university course PUC examination result for South Bengaluru students released on Tuesday.
Students who have appeared for the First Year PUC examination can now check their result using their registration number and date of birth.
Step 1: Check the portal releasing the Karnataka PUC Result.
Step 2: Enter your registration number and date of birth.
Step 4: Take a print out for future use.
It may be noted that students can also check their result on the mobile phone using these same steps.
A total of 56,250 students appeared for the first year PUC examination in South Bengaluru out of which 50,694 students passed in the examination. As per reports, the overall pass percentage in the first PUC Result 2019 stands at 90.12 per cent. Reportedly, stream-wise pass percentage for different academic streams has also been released.
Arts stream pass percentage: 83.40 per cent.
Commerce stream pass percentage: 88.46 per cent.
Science stream pass percentage: 94.18 per cent.
Students must note that one who passes in the first year will be promoted to second year PUC which is equivalent to class 12th.
The supplementary exam will be conducted from April 26 to May 10, 2019. Students who have failed in the first PUC exam may appear for the supplementary examination. The date sheet for the first PUC supplementary exam is available on the website.


text:
Observers criticize Russian elections
By David M. Herszenhorn THE NEW YORK TIMES
Western election monitors said on Monday that they had observed blatant fraud, including the brazen stuffing of ballot boxes, in the parliamentary elections that delivered surprisingly big losses to United Russia, the party led by Prime Minister Vladimir V. Putin.
The election on Sunday left United Russia clinging to a slim majority, and while the monitors declined to draw firm conclusions, it was clear from their report that vote stealing and other alleged malfeasance could have shifted the outcome in United Russia�s favor.
The scathing report by international observers, combined with dramatic, mostly amateur, footage posted on the Web, made clear that the authorities would face continuing questions about the fairness of the vote despite the main party�s steep losses.
On Monday evening, thousands of demonstrators gathered in central Moscow and voiced their opposition to the government. There was a heavy police presence, and some protesters were detained.
With more than 95 percent of the votes processed, United Russia led with a shade under 50 percent, trailed by the Communists with 19 percent, Just Russia with 13 percent and the Liberal Democrats with nearly 12 percent, according to the Central Election Commission.
After the redistribution of votes for parties that did not clear a minimum threshold to enter the Duma, Russia�s lower house of parliament, United Russia will have 238 seats, or just under 53 percent, down from the 315, or 70 percent, that it holds now.
The observers, from the Organization for Security and Cooperation in Europe, said their main concerns were about an overall flawed framework that marred the campaign, including no separation between the government and the main political party; the lack of independence for election administrators and the absence of a free, independent mass media.
Some opposition parties were prohibited from running in the elections at all, the observers said. Those that could run faced huge disadvantages as United Russia employed government resources in support of its political aim, the observers said.
President Dmitry Medvedev said the vote showed the vibrancy of Russia�s democracy.
�Democracy is in action,� Medvedev said, standing with Putin at United Russia�s campaign headquarters on Sunday night, where both appeared a bit shaken. �The party performed worthily; it essentially represents 50 percent of our population � the final number will be determined � and the result is real democracy.�


Chips cut to resemble the shapes of leaves.
Colors match the flavors. Yellow = plain, orange = cheese, red = barbecue, green = onion. Mix and match.
I like this idea - a bowl of salted leaf-shaped crisps, mixed with nuts, would look very autumnal. You could even serve them with Twiglets (link) for the full woodland experience.
I think the obvious choice for packaging would have to be a tree trunk container.
This would be a better appreciation of nature than folk get stumbling around a world of pointy sticks.


In 2015, the USDA's National Institute of Food and Agriculture and Purdue University published a report indicating a great demand for college graduates with agricultural degrees to fill the estimated 57,900 high-skill job opportunities available annually in the agriculture, environmental, food and natural resource fields in the United States. The Department of Agriculture at SFA offers multiple specialized academic tracks to prepare students for these career opportunities and ensure they are equipped to face the challenges of a growing, globalized world. Students may hone their specialties in agribusiness, agricultural development, agricultural engineering technology, animal science, horticulture and poultry science. Furthermore, students obtain firsthand experience in their designated field throughout their undergraduate career, a characteristic that distinguishes our program from many others.


text:
Suspect charged, victim identified in deadly shooting at Walmart in Whitehall Township
Police investigating shooting at Walmart in Whitehall Township
Police are on the scene of a shooting at a Walmart in Whitehall Township, Lehigh County.
LEHIGH COUNTY, Pa. - A Lehigh County man is facing a number of charges following a deadly double shooting in the parking lot of a Walmart in Whitehall Township last week.
Edward Joel Rosario-Jimenez, 23, was charged Sunday with first-degree felony counts of criminal homicide, attempted criminal homicide and aggravated assault. He is also facing weapons charges.
Officers responded to reports of a shooting in the parking lot of the store located on the 2600 block of MacArthur Road shortly before 7 p.m. Friday.
According to police, two victims were taken to the hospital. One person, later identified as 20-year-old Nicolette Law, has since died from her injuries. The other remains hospitalized but their condition is unknown.
A witness told police she arrived in the Toyota with Rosario-Jimenez and two other people and that Rosario-Jimenez got into an argument with one of the victims. According to investigators she heard gunshots and left in the Toyota, but Rosario-Jimenez remained in the parking lot.
Police found a handgun hidden in a snowbank adjacent to where the shooting occurred.


text:
I love FTL
I'm unemployed. I refuse to spend money on games while this is the case. Hearing that, a friend stepped up and bought me a game he was loving, FTL. I can't thank him enough, because it's awesome.
Does FTL make you a space-faring bringer of death, or a kamikaze pilot flying a rickety death trap? Yes. Is it worth playing? Absolutely. Dying hasn't been this fun since Dwarf Fortress. Killing hasn't been this surgical since Fallout 3's VATS system, this easy since you first picked up the BFG, or this difficult since you spec'd completely opposite the way you should have for a RPG boss fight. Each play has the potential to serve up a wildly different game due to the game's elements being so randomly generated, that each play will bring many stories of harrowing success and escape, telling friends how you barely did this, and almost got killed while doing that, and each story will almost certainly punctuated by the full stop of your death. It's billed as a "a spaceship simulation real-time rogue-like", but what does that mean? Let's start with the basics.
The Salad (Before the game.)
In Subset Games' FTL (yes, it means Faster Than Light,) you fight for the Federation against rebel forces and other nefarious tropes amassing weapons and crew for the big showdown. This is done by plotting your own course through eight sectors full of nodes as a wave of enemies chase you. Each node providing an event. Events range from battle, a social opportunity, an environmental threat, a store, to empty space. Sometimes you'll even get combination of those things, or they're made more intricate as the game reacts to your crew, your ship upgrades, or some of the (simple) quest lines you've previously opened. As if those combinations didn't offer enough replay, the nodes of each sector, and the available paths between sectors, are generated freshly with each play through. Each event allows a chance to gain resources along the way.
The Potatoes (The good.)
Ship management shines. It's what every RPG wishes its management was, simple and robust. It's so intuitive you can become good at it by accident. You start with one ship available, but more begin to open quickly. You acquire a crew of up to eight from the seven different races, each with special abilities. You choose from six different weapon types, each with strengths/strategies. There are also five different automated drone types you can deploy, not to mention the option to board your enemies' ships. And on top of it all as you progress you can equip your ship with up to three of twenty-one augmentations that vary wildly in effect.
Upgrading your ship in FTL is micromanagement heaven as you spend scrap (the in-game currency) upgrade your ship. All ships have a reactor. As you spend money to upgrade it, more energy is produced. It's from this common pool that most of your ship's systems are powered. Each ship has several systems (weapons, shields, medical bay, life support, etc.) which can be upgraded, and extras that can be purchased. As you upgrade a system, it opens a slot in which you can route an extra cell of energy. It gets frantic when you realize that energy is hot-swappable, meaning you can power and de-power items as needed. So while you'll likely always want your life support system working, if you don't plant to run from a fight, you can take energy from your engine and fight your battle with stronger weapons, shields, or what have you!
The Steak (The great.)
Battle is superb for a player like me. FTL offers the perfect amount of control. In most games either the developer has very stupid AI and is too easy, the game cheats to make things interesting, or the player simply can't match the AI in accuracy/quickness and things are too hard. This is a known problem in nearly any game from Madden to Tetris. This is not the case here. Enemies operate at maximum efficiency (minus a little dumb AI in asphyxiation created by simple logic, not cheating or intentional dumbing down,) because FTL lets the player pause the game at any time with a tap of the space bar.
This makes every meaningful choice available at any time, and you can change strategy instantly on a whim. Pausing time, issuing commands, changing attack patterns, and resuming the battle in a single moment allows you to match the AI move for move. Earlier I mentioned VATS, Fallout 3's method of giving players a refined control in battle, but it was limited in making the player wait until your endurance was recharged. Captaining your own ship in FTL, giving out orders is expected to come instantly, and pausing time works perfectly to that effect.
Just Desserts (The self-indulgent run-through.)
I load up on offensive slots, going light on reactor energy, and rerouting power from my meager engine and medical bay and give that extra bump to weaponry. Toss a few Zoltan crew members (who add energy to the ship systems they're assigned to) and you're boxing above your weight class. My starting ship is the Red-Tail (Kestral B), which comes with one Zoltan (who add one energy to your reactor), one Mantis (excellent fighters), and two humans. It also starts with four single shot lasers.
The first thing I do is invest in blast doors to asphyxiate boarding enemies, expand my crew with as many Zoltans as possible, and invest heavily in laser weapons. Soon I've got an opening volley of lasers that rips through enemy shields and begins taking apart a system of my choice. Worst case scenario, I use the lasers to tear at an enemy's shield and then use a beam weapon to do my damage in a line drawn across the enemy ship with my mouse. Either way, I have a good chance of jetting straight to the final sector in no time as long as things go decently well for me, but I only really get a chance of beating the final boss if I'm lucky and a certain few augments and the right weaponry come my way. To ensure that, I take my time, scouring as many nodes as I can in each sector. I'm a man on a mission, people!
But before I leave the second sector, I die. That happens often. You'll have bad luck, you'll not get awesome items by the time you expect to. You'll need to spend your scrap repairing your ship, instead of buying upgrades. You will die very often in this game. Here, let me go back and underline that for silly comedic effect. And you'll quit the game, and you'll start something else, and you'll instantly want to start it back up and play again. I actually wrote all of this in a relatively short time, I just kept starting the damn game back up and playing again… In fact, I think I'll go play it now!
Armchair Quarterback: OnLive
Is armchair quarterbacking useful? I don't know. Probably not. But it's fun. So I wrote this long expansive article that I'm not going to bother publishing here because it's cumbersome. Let me hit the bullet points.
OnLive's business plan emphasized streaming, which was an open-ended cost, but did not actively make money after a game's purchase. Their CEO Steve Perlman? He was human, and seems to have made some really bad decisions, like kicking EA's games off the service before launch, and others. Virtualization was not uniform, meaning some games actually requires one real GPU for each instance generated by a player. Finally, latency was a threefold problem: The perception that the Internet was too slow for this, the reality of broadband penetration, and then monitor/kbm/gamepad latency, which people generally don't acknowledge, and assume it's your service. That part really sucks. But the key in latency is that it's not as bad as you think. It's actually playable.
Income/Cost
I'm not even going to factor in set-top boxes. I'm focusing on PC here, so let me state that now. Retailers generally make about $12.00 per game, but the average gamer, if they did all their gaming on OnLive, would cost about $33.80 annually for streaming. ($0.10 for two hours of HD footage for Netflix as a baseline. Then figure 13 hours a week gaming.) So you'd need to sell three games per year at $60.00, and then you'd only make $2.20 per year per gamer. What does this mean? Streaming will not be a top priority out of the gates.
Controllers can be found for a buck each on Alibaba.com, but we want a good one, so, let's throw $8.00 at each one. (They cost Microsoft $11.00 in 2006, and I assume the price has gone down. But we don't want shit controllers, and we want our own brand, so let's say $8.00. If you can find a hardware manufacturer that wants in with you, then you can save money and feature their brand.
Then you have to worry about salaries, hardware, rent, and other costs of business. I have no idea what that's going to cost, but, it'll be a lot.
The Armchair
I like the idea of OnLive. Very much. No more upgrading your PC, no more buying console after console, any device, just games. Let me repeat that. Just games. But we have to build to that. I think the (a?) problem is that they pushed themselves as a console competitor first, with a set top box, when they should have framed themselves as a Steam competitor and expanded from there. GOG launched to much fanfare when they came out, and they had an angle, "Good, old games, DRM free!" Simple and great!
No streaming. Not at first. First I launch as a store with easily navigable social features (Steam hasn't done that yet) and integration to FB, Twitter, G+, whatever. The client should offer screenshots, an integrated XMPP IM client (Jabber, Google Talk/gchat), and the ability to record videos. Try to be lightweight as much as possible. But the key is to be the Apple to Valve's Linux. Be stylish.
My OnLive's sales angle? A free controller with your first $60.00 purchase. Given the $12.00 profit from the purchase, and the $8.00 controller cost, that gives us $4.00 for shipping (which is a little over $1.00, but we'll call it $2.00). So, on our first sale to each address/credit card/email we make roughly $2.00.
With each controller, pack in a coupon for a free indie game that makes good use of the controller, and has DLC available now, and more coming soon in the pipeline. For each copy you give away, pay the developer $3.00. They make less on each copy, but likely get a lot of interested parties to try to sell DLC to. It's probably worth it for them. (And it's definitely cheaper than my other idea for a controller pack-in, a $5.00 coupon on your next $60.00 purchase. A free game with DLC has the opportunity to net you extra cash that way.) So with our second purchase we make $9.00, plus a cut of DLC.
So now gamers have two games in your client, and a spiffy controller. At least one game has DLC on the regular. How do you keep that going?
Cloud gaming, and Mac/Linux/iOS/Android clients. For $10.00 a month, you offer a cloud streaming of any game you own through the client for any platform. Click purchase and play. For $15.00 you get a digital locker too. For $25.00, add a cloud server for any game you want. It doesn't even have to be one you own with the service. We install it for you.
Maybe, a year into it, we move to the TV with a set top box. Six months maybe, but that's only if we're a success. Until then, open a community to help people best make their own TV media servers.
And if you ran OnLive?
Armchair Quarterback
Gaming's future


Turns out, we need entrepreneurs, now more than ever. And from everywhere.
Let's be clear about what we mean. This is not about promulgating entrepreneurs with an emphasis on value-extraction and short term financial profit to the exclusion of all other considerations. World leaders seem to be coming to terms with notions of responsibility, sustainability, and stewardship, (but that's another blog post…) The point is, we need to support entrepreneurs who are improving communities.
It is only very recently that we associate entrepreneur with business. It really means to step up, take it on, shoulder the burden, accept the challenge, lead. Sometimes the challenge is an obvious need – we say, "a gap in the marketplace" – but sometimes it is a community ill, something that needs someone to step up and take it on. It is often something everyone else sees as unchangeable, but the entrepreneur sees it as malleable, fixable – an opportunity.
One thing is certain, entrepreneurs are catalysts for communities, and without them, we're in trouble.
Fostering an entrepreneurial culture is a critical component for successful, resilient, strong communities. Without the force of ideas, the determination of entrepreneurs, and the outcomes of enterprise, communities have no real engines for solving their own problems, generating innovation, and sharing wealth. An entrepreneurial culture not only nurtures existing entrepreneurs but nudges new ones into existence.
So, what feeds entrepreneurs? What attracts a wide variety, helping plant them across a community in the local soil like so many colored seeds?
I know a market is important, and talent and mentors are key. Sure. But people with ideas need early support, like stakes for young trees, or greenhouses for tender plants. Even if you are a "serial entrepreneur" everyone started as a first-time entrepreneur at some point. And every single idea, solution, invention that we know of had some kind of financing behind it. Money doesn't guarantee a good idea, but I can guarantee that a great idea goes nowhere without money.
"Angel" funding is hard to come by, and venture capital is scarcer still. You can read about the few successes in the papers, like unusual animals you hear about and rarely see, but the vast majority of businesses are self-funded (savings account, a personal loan, a second mortgage, or the 401K. Ten percent of businesses will use a personal credit card). Banks rarely loan to start-ups.
So, what's a city to do that wants to foster a strong entrepreneurial culture? Or, actually attract entrepreneurs? Or, more challenging yet, create them from populations or areas where their greatest identifying feature is that they're under-served? The World Bank is working out what programs work well to help with some of this, but I contend that it is money that will attract, foster, and strengthen entrepreneurs. Nothing says "Grow here" than ready capital, community backing, and shared risk.
We've got an opportunity in this country to shape entrepreneurial ecosystems as a result of the changes in finance law. Intrastate laws are spreading across the country such that by 2020 I predict there will be one in every state. The new JOBS Act change in Reg A finally announced last week enabling corporations to offer securities across the country (interstate) to ordinary citizens will also free up capital for enterprise development.
This money is community capital. It will come from community members who aren't defined as holding any other class title such as "wealthy", "accredited" or "sophisticated." The inclusion of this new "investor class", (the 99%) has opened up opportunities for local economic and community development, but only if they realize their power, and open up their checkbooks.
The citizens of this country now hold the key to the growth of their community's entrepreneurial ecosystems, and therefore, the key to the health of their local economies.
About 60 percent of the private-sector net new jobs are from existing establishments and about 40 percent from the churn of startups minus closures in the last two decades (Bureau of Labor Statistics, Business Employment Dynamics).
The bottom line for community health and real resilience is a lot of people trying lots of ideas, in many kinds of enterprises. Think of it as the R&D division of large corporations (though less common these days frankly because these corporations do count on the market to do their idea testing for them). Teams iterating, building on failures, splitting off with better ideas, strategies, and yet another enterprise. This churn of innovation is the stuff of healthy economies.
Investing in the entrepreneurial practice, process, and people is needed. Risk should be shared, minimized, and mediated by community supports such as shared ownership with vested interests. We have the capacity to draw entrepreneurs to us, to reward them for stepping up and assuming the risk.
My organization proposes to promote this kind of community resilience, inviting people to conferences, panels, workshops, and other events around the state and country. It's a learning process for us all. Everyone has a role, and everyone is invited to be a part of the program.
Join us. Buy tickets. Come learn what this is all about.


Caviar of Switzerland values its customers, distributors and affiliates of any kind, so it is important to us to keep in touch with everyone. Please let us know what you need and your message will be forwarded to the appropriate department. A member of our team will respond as soon as possible.


text:
HARRY POTTER IN CONCERT
SERIES OPTIONS
BEAUTIFUL - THE CAROLE KING MUSICAL
OCTOBER 22 & 23 , 2019 • 7:30 PM
BEAUTIFUL – The Carole King Musical the inspiring true story of King's remarkable rise to stardom, from being part of a hit songwriting team with her husband Gerry Goffin, to her relationship with fellow writers and best friends Cynthia Weil and Barry Mann, to becoming one of the most successful solo acts in popular music history. Along the way, she made more than beautiful music, she wrote the soundtrack to a generation.
Featuring a stunning array of beloved songs written by Gerry Goffin/Carole King and Barry Mann/Cynthia Weil, including "I Feel The Earth Move," "One Fine Day," "(You Make Me Feel Like) A Natural Woman," "You've Got A Friend" and the title song, BEAUTIFUL has a book by and Tony® Award-nominee and Academy® Award-nominated writer Douglas McGrath, direction by Marc Bruni, choreography by Josh Prince, and took home two 2014 Tony® Awards and a 2015 Grammy® Award.
START.CA PERFORMANCE STAGE AT BUDWEISER GARDENS
99 Dundas St. London, Ontario, N6A 6K1
10AM - 5PM M-F


hi while i was in the hospital someone was using my card and now i have an overdraft of 220 dollars and my account was closed. what should i do please help?
Welcome to the TD Helps Community, Mentoria. We can certainly point you in the right direction. If your account has become closed due to the balance owed, you may reach our Recovery Department directly instead at 800-354-9769. That department can be reached Monday through Friday, 8:00 am to 9:00 pm, and Saturday, 8:00 am – 5:00 pm for your convenience. Please understand that even though we would like to help you directly, because TD Helps is considered an unsecured forum, we do not have access to your personal or business account information. Additionally, you may visit any TD Bank Store for assistance in person. For a listing of TD Bank Stores please see here: http://bit.ly/TDStores. Thanks for stopping by, Mentoria and take care.