/burl@stx null def /BU.S /burl@stx null def def /BU.SS currentpoint /burl@lly exch def /burl@llx exch def burl@stx null ne burl@endx burl@llx ne BU.FL BU.S if if burl@stx null eq burl@llx dup /burl@stx exch def /burl@endx exch def burl@lly dup /burl@boty exch def /burl@topy exch def if burl@lly burl@boty gt /burl@boty burl@lly def if def /BU.SE cur- rentpoint /burl@ury exch def dup /burl@urx exch def /burl@endx exch def burl@ury burl@topy lt /burl@topy burl@ury def if def /BU.E BU.FL def /BU.FL burl@stx null ne BU.DF if def /BU.DF BU.BB [ /H /I /Border [burl@border] /Color [burl@bordercolor] /Action « /Subtype /URI /URI BU.L » /Subtype /Link BU.B /ANN pdfmark /burl@stx null def def /BU.BB burl@stx HyperBorder sub /burl@stx exch def burl@endx Hyper- Border add /burl@endx exch def burl@boty HyperBorder add /burl@boty exch def burl@topy HyperBorder sub /burl@topy exch def def /BU.B /Rect[burl@stx burl@boty burl@endx burl@topy] def /eop where begin /@ldeopburl /eop load def /eop SDict begin BU.FL end @ldeopburl def end /eop SDict begin BU.FL end def ifelse
Mathematical concepts in systems science and electrical engineering are applied to quantitative finance. Topics explored include moving averages, Wiener Filtering, Kalman Filtering, and linear prediction. Algorithms making use of these topics are devised for the purpose of creating an automated trading strategy to maximize net profit. Trading simulations are executed in the Python programming language.
In 2009, it was estimated that firms that employed quantitative trading strategies, which represented 2% of the number of trading firms operating in US markets, accounted for around 70% of all equity trading volume [WallStreetAndTech]. Although this number has since decreased, it demonstrates the extraordinary growth in quantitative finance that was experienced in the last decade.
Such fast paced growth was facilitated by major advancements in communications systems that took place during the same time period. Computers have vastly decreased communication times and eliminated much of the simple arbitrage that existed since the inception of the capital markets. Firms seeking to take advantage of price discrepancies were forced to turn to advanced computational methods to do so.
Many orders placed by these firms are executed with pre-programmed electronic instructions that are designed by mathematically inclined traders. The content of these instructions is a highly guarded secret within each firm, and it’s often the case that an algorithm has a limited lifetime where it is able to take advantage of discovered arbitrage opportunities before the markets adjust or other firms develop similar strategies and the opportunity is minimized [AlgorithmicTrading].
This project is concerned with how topics in systems science and electrical engineering may be applied to this industry. Many topics such as control theory, signal processing and optimization are relevant to high frequency trading. Engineers who study systems science often seek to discover the signal through the noise or optimize a constrained mathematical model. Similarly, traders seek to optimize their portfolios and discover arbitrage opportunities.
Analyze the effectiveness of various systems science and electrical engineering prediction methods in tracking the price of financial instruments in the stock market.
In this paper, we explore the following systems science and electrical engineering topics:
1. Double Moving Average
The double moving average algorithm is a widely known, simple example of an algorithmic trading strategy. It works by trading an equity when its short and long moving averages cross, thereby indicating momentum.
2. Wiener Filter
The Wiener filter is an algorithm that seeks to filter out noise in order to estimate the true underlying signal. The method assumes the signal is a linear stochastic process with known autocorrelation and seeks to minimize the error between the actual signal and its measurements.
3. The Kalman Filter
The Kalman Filter is a recursive algorithm that uses measurements observed over time to predict the value of future measurements. It has been proven to be an effective estimator for many real world applications. However, the Kalman Filter requires a mathematical model for the system it tracks. In this project we implement a simplified version of the Kalman Filter called the Alpha-Beta-Gamma Filter, which does not require a rigorous mathematical model.
4. Linear Prediction Model
The linear prediction model created for this project uses a user-specified number of previous prices to predict one future price. The model must be trained on historical data to be applied in a real time trading strategy.
For this project, we constructed a trading simulation in Python, a highly versatile dynamically typed programming language. We define a Trade Algorithm as the highest level object in the simulation. Each Trade Algorithm is initialized with an estimator type, price history for a single financial instrument and an empty Portfolio Object with $100,000 of starting capital. Then the simulation is run on the given price history, as if it were trading in real time.
List of Trading Simulation Data Structures
Top level controller for the trading simulation, executes the trading strategy.
Maintains current available capital and a list of assets.
An object unique to each financial instrument that maintains how many units are owned in the Portfolio.
A small data structure to facilitate transactions.
Summarized Simulation Procedure
A moving average is an average taken over a finite window that is updated as new observations are made. Each new observation “pushes” the oldest observation out of the average so that at any given time, the moving average is calculated with a predetermined number of observations. In finance, a plot of the moving average over time can reveal insight about the long term movements of the price of a financial instrument, as opposed to the small random fluctuations observed on a step-by-step basis. Moving averages have been used to analyze financial instruments for quite some time, with a common method being the double moving average.
For a double moving average algorithm, two averages are calculated using windows of different sizes: short and long. When used to track financial instruments, the difference between the two moving averages can indicate general trends in the price. For example, when the short moving average crosses and exceeds the long moving average, this indicates upward momentum; the opposite is true when the long moving average exceeds the short. A simple trading strategy can be devised that buys and sells when these averages cross one another. [Double]
The concepts used in this algorithm may be basic, but they have proven to be successful and are popular in quantitative finance. Although it is not a topic practically seen in systems science or electrical engineering, this algorithm is still worth exploring and is used in this project as a point of comparison.
Implementing the moving average is extremely simple. The algorithm has inputs of long and short windows (Wl and Ws ]), and it continually calculates each moving average as time progresses. Since a trade decision is only made if the moving averages cross, only the averages from the previous step need to be stored in memory. The program calculates the difference between the averages (Wl -Ws ), and if the previous difference was positive and the current is negative, a buy will be ordered. A sell will be ordered under the opposite conditions; nothing occurs under consistent conditions.
Equity price history
1 year at 10 minute resolution. ~9000 data points per equity
Ford (F), Apple (AAPL), Accenture (ACN), Caterpillar (CAT), Macy’s (M), United Parcel Service (UPS), Priceline (PCLN), Campbell Soup Company (CPB)
$100,000 (Ci)
50, 200 steps
25, 100 steps
Many window sizes were initially explored, but the (Wl, Ws) combinations of (25, 50) and (100, 200) consistently showed the most promising results.
Net profit is calculated by taking the value of all cash and equity holdings (A) and subtracting the starting capital ($100,000).
The following graphs are comparisons between the net profit achieved by running the Double Moving Averages algorithm on the two different window sets, (25, 50) and (100, 200).
Graph of Net Profit where (Wl, Ws) = (25, 50)
The only notable success came from AAPL, which gave a return of $245.38. CAT also had a small gain of $15.99. The other stocks all lost a small amount, the most being PCLN at $25.33. Total returns on each of these stocks were $208.81, mostly due to the success from AAPL.
Graph of Total Net Returns where (Wl, Ws) = (100, 200)
Again, AAPL performed well, but not the same performance seen previously as returns shrank to $104.95. CAT also had a smaller gain of $8.51. The other stocks again lost a small amount, except PCLN now lost $98.31. Total returns on each of these stocks were -$20.12; AAPL and PCLN offset each other and the slight losses from the others added up.
Choosing the length of each window is critical to the outcome of each simulation. In addition to the shown simulations of (25, 50) and (100, 200), simulations were done with windows at shorter and longer ranges as well as at different proportions. At a glance, these two achieved the best results, and coincidentally both have a short to long window ratio of 1 : 2. Windows set to a very short distance performed very poorly, while very long lengths were only slightly worse than the ones used.
The Double Moving Average algorithm shows some promising signs, but at its fundamental implementation, it is not something that can consistently make for a good strategy. However, a more thorough implementation could show dramatic improvements.  A very long window can make it slow to react to important changes. Windows of medium length showed the best results.
A Wiener Filter is a type of filter that seeks to filter out noise and give an estimation of the true underlying signal. It is commonly used in audio and image processing to remove the noise from a signal or image, respectively. It was developed in the 1940s by Norbert Wiener and published in 1949, but Andrey Kolmogorov also provided significant additions towards its development. Its success gave rise to many other filters, including the Kaman Filter.[Wiener]
The Wiener Filter was initially developed for use in continuous time and a non causal case, meaning both past and future data needed to be accessible. Some variations of the Wiener filter that make it more valuable are the continuous time causal solution as well as the discrete time causal solution, otherwise known as the finite impulse response (FIR) Wiener Filter. This variation takes in a finite amount of past and present data and can be used to either determine the underlying signal or to make a prediction of the next value. The FIR Wiener Filter assumes that the signal is a linear stochastic process with known autocorrelation and it seeks to minimize the error between the actual signal and its prediction. This error minimization technique makes it very similar to a least squares method.[Fargues, Shimkin, Wunsch, Tcheslavski]
For this experiment, an FIR Wiener Filter will be used to predict the future states of financial instruments. The equation below shows how a prediction will be made at each successive state:
The prediction for the next state is calculated by taking the sum of the product of an ideal weight, ωk, and the kth previous value from the present state. This means that the Wiener Filter has a variable filter length that determines the amount of previous data to consider in calculations. Each ω represents the weighted value that minimized the error in prediction of previous states. Let W be the array that contains each ω going back k values from the current state such that ωk represents the ideal weight for the current state. W can then be calculated as follows:
Where Rx is a k x k Hermitian Toeplitz matix of autocorrelations and rdx is a vector of cross-correlations. Each ω within W is the ideal weight for its respective state in time. The equation below shows that ωk is the value of the weight that produces the smallest value of the squared difference between the prediction and true value.[Wunsch]
The Wiener Filter is implemented in Python and uses the Numpy library. Instead of using the Hermitian Toeplitz matix of autocorrelations and vector of cross-correlations to calculate the ideal value for each ω, an two alternative implementations were devised. These methods were developed solely for a simpler implementation and they still seek to minimize error from predictions in previous states. The program finds the optimal value for ωk that minimizes the prediction error for state t - k + 1 for k = 1 → k. Both of the final prediction calculations use array W, which consists of different valued weights ωk.
Running a prediction with a step size of n at time t will only use points within the range of t - n for generating the values of each ω. This causes the initial summation calculations to use fewer values than the later ones as the step window is strictly defined. As each ωk is calculated, it is continually used in calculating all consecutive values of ω. The program then adjusts the values of a value w and determines which value will continually keep error at a minimum.
In this variation, each ω calculation always uses n points of previous data for calculating the optimal weight. For the previous k states leading up to t, the program incrementally increases the value of an arbitrary variable w multiplied by the j = k previous states. When calculating what these values should be, the same objective function is used, but it uses a fixed weight w across each previous state. For each state of k, w is incrementally increased and the value that produces the least squared error is then assigned to be that respective ωk. This is shown in the equations below:
Both implementations were given a desired level of precision for calculating the desired values of ω, but a heuristic was written to significantly reduce the number of iterations needed.
Equity price history
1 year at 10 minute resolution. ~9000 data points per equity
Ford (F), Apple (AAPL), Accenture (ACN), Caterpillar (CAT), Macy’s (M), United Parcel Service (UPS), Priceline (PCLN), Campbell Soup Company (CPB)
$100,000 (Ci)
10 and 40
Testing performance of both strict and relaxed step length
Net profit is calculated by taking the value of all cash and equity holdings (A) and subtracting the starting capital ($100,000).
The following is a comparison of the net profits achieved from both variations of the Wiener Filter with against nine equities at 2 different step sizes.
Graph of Net Profit where n = 10
The strict step size (blue) did not achieve any profits, but aside from PCLN, it also did not have any huge losses. The relaxed step size (red) was able to achieve a small profit on CAT, but it had huge losses on AAPL, ACN, PCLN, and CPB.
Graph of Net Profit where n = 40
The strict step size (blue) was able to achieve a considerable profit of $10,698.05 on AAPL, but returned a loss of $13,936.80 on PCLN. All other stocks had small losses of a few hundred dollars. The relaxed step size (red) had similar results, but again at a much larger scale. Gains from AAPL were a surprising $27,933.73, while PCLN managed to lose $23,454.91. The other stocks again had less considerable losses, but now were amplified by an order of magnitude.
The ultimate success of this algorithm can be measured by how accurately the filter is able to predict future price movements. This can be affected by the differences between the relaxed and strict step requirements as well as the number of steps used. In this section, a small section of data from the simulation of UPS will be analyzed to understand how accurately the Wiener Filter can predict the next price.
Simulation Results with n = 10
In the graph above, it is very clear that the short, strict step size is able to model the stock price to a high level of accuracy. For the majority of this segment, the prediction is almost exactly equivalent to the actual outcome. There were a few cases when the Wiener Filter overestimates a movement. The blue spikes indicate a time when it predicted a much higher result while the red trench indicates a point when the prediction was much lower than reality. However, there are very few cases when the price moves in the opposite direction of the prediction.
Simulation Results with n = 40
The graph above shows that with a longer step size, the strict step implementation still produces incredible results. Predictions consistently follow the slight fluctuations of the actual price, and only twice in this segment did it overestimate a movement.
Simulation Results with n = 10
In the relaxed implementation with a short step size, it is clear that it does not have the same level of performance as the strict implementation. In addition to inaccurately predicting large movements as seen by the two spikes, it was also consistently slightly above of below the actual price. This data shows that it is slow to pick up on price changes and struggles to have a prediction match the true value, yet alone the direction it will move.
Simulation Results with n = 40
With a larger step size, the results are completely unreliable. The longer step size makes it overcompensate for any slight movement, causing the predicted value to violently shift around. The large blue mountain and red valley represent a predicted increase and decrease that never occurred. This data shows that with a larger step, the relaxed Wiener Filter has much more volatile, inaccurate predictions.
After comparing the figures that showed the predicted versus actual result, it is clear that the strict step size implementation does a much better job at predicting the price movements and future values. Occasionally it predicts the price will move in a more drastic way, but rarely does it predict a movement in the opposite direction. Looking at the entire simulation, the short, strict simulation had 95.6% accuracy and an RMS error of 7.9%. The short, relaxed simulation had an accuracy of 58.0% and an RMS error of 19.8%. Results from the longer step size are roughly the same, except for the long, relaxed RMS error which tops out at 1146.7%!
In the analysis of the relaxed step size implementation, it is obvious that the shorter step gave a more accurate result. The longer step size made the algorithm predict large movements, and it did not provide much value. In the case of the strict step size implementation, the step size did not seem to make too much of a difference. Both simulations produced very accurate results, and each managed to occasionally over predict a movement.
After running simulations and looking at the data, the results of the strict implementation looked too good to be true. It manages to very accurately predict price movements and one would expect to see larger variations from such a simple implementation. The first concern was to verify that the algorithm was in no way gaining access to future information at each prediction, which was confirmed. This implementation was reviewed, debugged, and no mistakes were found. However, that is not to say that this method is ready to be used in accurately predicting all market movements. Extensive testing needs to be done to verify if these finds are true or if there is an unfound mistake in the model.
Despite giving a prediction accuracy of 95%, all simulations of the strict, short implementation lost money, while only AAPL had a positive return in the strict, long simulation. Given that the ability to predict the price movement was so accurate, yet no profits were seen indicates that the primitive trading strategy is inadequate. This trading strategy was simply “buy if it will go up, sell if it is going to decrease”. A trading strategy that uses these predictions and has a better understanding of when to place an order could be wildly successful.
The Kalman Filter is a recursive algorithm that uses system measurements observed over time to predict the value of future measurements. Each measurement is assumed to contain noise created by a random variable in the process measurement. The algorithm has been shown to accurately estimate the true value of such a process by minimizing the error introduced by the random variables [Alpha Beta Filter].
In 1960 Rudolph E. Kalman published a widely read paper about the application of this algorithm in discrete time sequences. Engineers in many fields adopted the algorithm, especially in topics such as navigation and tracking [Brown and Hwang]. In this paper, we are looking to apply the Kalman Filter algorithm in the context of tracking the price of a given security in the stock market.
With this goal in mind, we are presented with a unique challenge, namely that the Kalman Filter algorithm requires a mathematical system model. When used in applications such as navigation or tracking objects in space, kinematic system models can be experimentally designed since the system measurements are governed by the laws of physics. In our case, there is no known mathematical model of capital markets.
As such, we have chosen to instead use a simplified version of the Kalman Filter called the Alpha-Beta-Gamma Filter, which can be applied without the need for a rigorous mathematical model. This algorithm is very similar to the Kalman Filter algorithm in theory. The Alpha-Beta-Gamma Filter uses discrete time system measurements predict the value of future measurements. However, is assumes a linear model, and can thus abstract the need for a more in depth one.
This filter has been shown to predict simple linear kinematic systems precisely, and is categorized as a form of the State Observer in modern control theory. It works by recursively incorporating the previous state measurement to produce a future estimate. After each prediction and post-measurement, there is an update step wherein the algorithm adjusts for the error between what it predicted and what the actual next measurement was [Alpha Beta Filter].
Furthermore, the Alpha-Beta-Gamma Filter is named after the three greek letters which represent algorithm parameters that determine how sensitive the algorithm is to large variations between measurements. α is chosen by the user, then β and γ are calculated from its value using the following equations:
Chosen by the user, determines the sensitivity of the algorithm to error.
2(2 - α) - 4
β2∕(2α)
See below for a detailed breakdown of the Alpha-Beta-Gamma Filter equations.
In this project, we use the Alpha-Beta-Gamma Filter to predict the price of a given security at time t + 1 during a trading simulation. The algorithm works by adapting the price history into a linear model with position, velocity and acceleration: X, V, and A, respectively. These parameters are updated with each iteration and weighted with the α, β, and γ factors to give an estimation of the price for the next time step.
We implemented an Alpha-Beta-Gamma Filter in Python using the Numpy open source library. Numpy is a robust, highly versatile and widely used package for the Python programming language that has functions for manipulating matrices and performing mathematical calculations.
The following are the recursive equations that define the recursive algorithm.
Prediction Equations
Update Equations
In these equations, we can see that a higher alpha value increases the responsiveness of the system to residual error. This implies the system is more sensitive to prediction error, and a higher α value should correspond with a more reactive system.
Equity price history
1 year at 10 minute resolution. ~9000 data points per equity
Ford (F), Apple (AAPL), Accenture (ACN), Caterpillar (CAT), Macy’s (M), United Parcel Service (UPS), Priceline (PCLN), Campbell Soup Company (CPB)
$100,000 (Ci)
Range of [0 to 1]
Applying the Alpha-Beta-Gamma Filter as an estimator in the trading simulation gives mixed results. In some cases the prediction was good enough to ultimately lead to profit, but many other times it led to a net loss.
Net profit is calculated by taking the value of all cash and equity holdings (A) and subtracting the starting capital ($100,000).
The following is a comparison between the net profit achieved by applying the Alpha-Beta-Gamma Filter with two different α values to 8 different securities.
Graph of Net Profit where α = 0.8
In this simulation, the alpha value was set to 0.8, meaning the filter was more sensitive to prediction error. The result was an average net profit of $ 913.42, but the trade simulations for Apple and Priceline yielded significant outliers. Removing these two data points gives an average return of $ -367.43. Therefore, we conclude that the αβγ Filter with an α of 0.8 is not an effective estimator for this dataset.
Graph of Total Net Returns where α = 0.2
In this case the α value was set to 0.2, meaning the filter was less sensitive to prediction error. This simulation yielded an average net profit of $ -180.22. After removing Apple and Priceline, our two outliers, the average profit is calculated to be $ -480.29. Therefore an α = 0.2 is less optimal compared to α = 0.8 for the trading simulation.
Conclusions
Albeit this is a small sample size, the trading simulations above demonstrate that neither 0.8 or 0.2 generate positive net profit consistently. Although is possible that there is a more optimal α value between 0 and 1, these results indicate that it is unlikely an optimal α value exists that will generate profit consistently. The next section will explore the effect of α on the trading simulation in more depth.
The success of this algorithm for all practical purposes can be measured by how well the algorithm predicts price movements. The α value will affect how sensitive the filter is to prediction error. Thus, with a higher α value, we should expect that the filter may track more quickly, at the expense of potentially overshooting the actual values. Conversely, a smaller α should give smoother predictions at the expense of being sensitive to rapid changes.
The following is a comparison of a small section of the simulation between the predicted price vs. actual price with two different α values on the UPS instrument.
Simulation Results with α = 0.8
RMS-Error is found to be 0.1127
Simulation predicted the direction of price fluctuations 85.23% of the time
From the above graph, we can see that the filter closely follows the actual values except for a few significant outliers. The effects of a high α in this case can be seen in how the jaggedness of the red area line. Each time a prediction is significantly different from the actual value, the next prediction makes a large correction.
Interestingly, the simulation with this α value predicted the correct direction of the price change (positive or negative) 85% of the time. With such a high success rate, we conclude that even a small number of failed predictions can lead to significant losses.
Simulation Results with α = 0.2
RMS-Error is found to be 0.1948
Simulation predicted the direction of price fluctuations 63.61% of the time
In this simulation with a low α, the predictions lag behind the actual values. This demonstrates what we expect about α, namely that the low value corresponds with a smoother prediction curve that is less sensitive to changes in the system. Accordingly, we see the red prediction line change once the blue actual line has made a significant change.
Not surprisingly, the lower α value produces a higher root mean square error in the predictions and predicts correctly about 22% of the time.
The choice of α can significantly alter the predictions in the trading simulation. This is because the α value determines how sensitive the algorithm update equations are to the error produced at each time step (see Alpha-Beta-Gamma Filter Equations). The figure below shows α’s effect on net profit for the UPS instrument.
Discovered an optimal α = 0.96
Realized gain is $ 281.95
Predicted the direction of price fluctuations 77.41% of the time
These results show that very low α values create poor estimators in the trading simulation, but, α values of 0.95, 0.96 and 0.97 produce positive net profit. This makes sense because the price of a financial instrument is highly volatile. When a low α is used the estimator is less sensitive and fails to respond quickly to price changes. In contrast, a high α value allows the estimator to track the price more closely. Unfortunately, an α of 1 doesn’t perfectly predict the future instrument prices because in many cases the estimator responds too quickly and too aggressively for an accurate prediction.
Theoretically, this filter is designed to estimate a simple system by modeling position, velocity and acceleration. Empirically, these properties are not inherent to the capital markets, and thus the algorithm struggles to accurately predict price movements.
The Alpha-Beta-Gamma Filter is generally not a very effective estimator for capital market prices. However, in some trading simulations the filter estimation led to net positive profit. We conclude that this can be achieved by a combination of an optimal choice for α and some amount of luck / coincidence.
Linear Prediction is a form of estimation used in linear discrete time systems. Linear prediction models are used in a wide number of applications including predicting the behavior of neural networks in biomedical engineering and digital signal processing in systems engineering. On a high level, this model uses n data points to predict the n + 1 ’th point.
The prediction model can be represented in matrix form as
“Stimulus” m x n matrix
“Response” m x 1 vector
n x 1 Prediction Vector
This is only notationally different from the standard matrix equation Ax = b, which is used commonly in linear algebra. In the linear prediction model, S is referred to as the “stimulant” and R as the “response.” Right side matrix multiplication of S by k gives the vector R. Accordingly, multiplication of any individual row of S, denoted as , by k gives the corresponding row in R, denoted as .
To create a prediction model in this form, we build S and R by taking stimulants and responses from a dataset. In this paper we build this model using the price history of a stock. Each row is constructed by collecting n data points. Each successive row gathers n points shifting forward by a predetermined step length. Each row is constructed by collecting the 1st data point following the n points collected for [Krishnan]
Mathematically where step length = s:
Once we have computed S and R, then finding k is a simple matrix operation. It is possible to use the formula k = S-1R to find k, but we use a more accurate method, which minimizes the error introduced in the calculation. Skipping the derivation of this formula, the equation is as follows:
Then, k can be applied to any n x 1 vector of consecutive data points to compute the corresponding response. In practice, the linear model is constructed based on known training data. Then, it is applied to observed data to predict future measurements. See the “Design” section to see how the filter is applied in this paper.
The design of the linear prediction model for our trading algorithm can be best understood by examining the example below (see sub-section .1).
Implementing the linear prediction model for our trading algorithm required a few design choices. First, we chose our step length to be 1. Generally, unless computation time is a serious problem, linear prediction models should use the smallest possible increment in order to maximize the accuracy of the estimator, k.
 This is the number of data points selected to predict the following single point. For comparison, we chose two lengths: 1000 and 2000. A longer filter length generally corresponds with a longer computation time, but more accurate predictions.
Lastly, we chose to build the linear prediction model from the first half of the data and trade on the second half. This way, we can most closely simulate a real trading strategy.
Take the following price history for a stock F:
Data: [14.5, 15, 14.8, 15.2, 15.7, 16.5, 15.6, 14.3, 14.0, 14.4, 14.9, 15.9]
Graph:
Take n = 3 and the step length = 1.
S is constructed as follows:
The first row is the first three elements of Data; the second row is the following three elements of Data; etc...
R is constructed as follows:
The first element in R is the fourth element of Data; the second element of R is the fifth element of Data; etc...
We know S and R, and we seek to solve for the value of k.
Then, we can confirm that if we multiply any row of S by k, we will get the corresponding value in R.
Equity price history
1 year at 10 minute resolution. ~9000 data points per equity
Ford (F), Apple (AAPL), Accenture (ACN), Caterpillar (CAT), Macy’s (M), United Parcel Service (UPS), Priceline (PCLN), Campbell Soup Company (CPB)
$100,000 (Ci)
1000 and 2000
1 time step
Net profit is calculated by taking the value of all cash and equity holdings (A) and subtracting the starting capital ($100,000).
Simulation Results with filter length 1000
This simulation yielded an average net profit of $ -1724.28, but the results from Apple and Priceline significantly affected the average. When these two outliers are removed, as they are done for the alpha-beta-gamma filter, the average becomes $ 1.23. This result indicates that the linear prediction model is a decent estimator for the trading simulation. Of course, a larger sample size would offer stronger results, but with the resources at hand, this result is positive.
Simulation Results with filter length 2000
This simulation with a filter length of 2000 yielded an average net profit of $ -1122.52, but similar to the first simulation Apple and Price are outliers. Removing these shows an average profit of $ -55.70. This result is slightly more negative than the filter length of 1000, but still promising.
As for the other algorithms in this paper, the success of any of our estimations can be measured by how well it predicts price movements. The more it does it correctly, the more net profit we gain during a simulation. Based on the theory of the linear prediction model, we expect that a longer filter length leads to more accurate predictions and more net profit.
What follows is a 60 point comparison between the predicted price vs. actual price with two different filter lengths. For the sake of clarity, only a small section of the data is shown.
Simulation Results with filter length 1000
RMS-Error is found to be 0.0671
Simulation predicted the direction of price fluctuations 70.04% of the time
The results from the above simulation show the linear predictions follow the real prices and predict correct price movements 70% of the time. Ultimately, this simulation didn’t break even, but empirically it looks like a modification in the filter length may produce even more accurate results.
Simulation Results with filter length 2000
RMS-Error is found to be 0.1526
Simulation predicted the direction of price fluctuations 60.01% of the time
With a filter length of 2000, this trading simulation performed noticeably worse than the simulation with the shorter filter. The effect of using a longer filter is not surprising since it means that 2000 points are used to predict 1 future point. These results make sense because a longer filter should be less sensitive to small changes in price.
The filter length is the number of points that are used to predict one single point in the future. Intuitively, one may think that the longest possible filter length would yield the greatest results. Our results prove that this is not necessarily the case with financial instruments.
In fact, an analysis of the effect of filter length on four of our financial instruments reveals that short filter length between 200 and 800 are generally more optimal parameters.
An important note to be considered with the linear prediction model is the tradeoff between filter length and time complexity. A longer filter length is directly proportional to a longer time-to-run. This is a result of the intense mathematical calculations that take place performing matrix operations with the large matrices in this problem. Such long runtimes would make this an infeasible option for real time prediction, except that all of the calculation time is pre-processing.
The linear prediction model revealed some of the most promising results of this evaluation. In fact, for UPS and PCLN, this algorithm mostly produced net positive results. However, this is offset by producing equally poor results for other simulations. Further testing may reveal the cause of success or failure for this algorithm, but for the scope of this paper, we are not able to conclude it is either good or bad, only that it is a stronger estimator than some of the other algorithms presented here.
The following table compares the performance of the algorithms in this paper. The results are not optimal cases, rather comparable cases used the in the analysis of net profit in each section.
The Wiener Filter with relaxed step size had incredible performance but also had a very long run time. Despite have good predictions, the strategy did not fare well for it as it had losses on every single equity. The relaxed variation provided very little value in prediction, and its net profit was even worse than the other. After removing the significant spikes from the data set, the Linear Predictor showed a modest performance.
This project’s trading strategy is primitive. At each time step t, a prediction is made for the price of the instrument at time t + 1. If this projected price is greater than the current price, the algorithm purchases the stock at the current price. Likewise, if the projected price is below the current price, the algorithm sells the stock at the current price.
Furthermore, since at each time step the algorithm only places an order for 1 unit, even if correct predictions are made, there is no guarantee that each individual gain is not offset by proportionally larger loss.
Despite some of the algorithms having very consistent predictions of price movement, the trading strategy still caused them to still lose money. It is unlikely that a more sophisticated trading strategy would make decisions as simply.
Creating an optimal trading strategy is not within the scope of this project. If it were, then implementing a more complex algorithm to react more realistically may lead to greater returns.
The data used for trading simulations in this project is limited to eight companies for one year in time. As such, we will not make the claim that our results will be necessarily representative of their application across the financial markets.
For example, the strict implementation of the Winer filter performed very well in a trading simulation on UPS, but results may seem too good to be true. Unfortunately, our options for further testing are limited.
Such high performance is promising for the Wiener Filter, but more thorough analysis is needed. The converse applies to all other algorithms tested. The relaxed Wiener Filter had poor predicting ability, but that has also not been proven to always be the case. Based on the performance of the eleven equities tested, it appears that the trading strategy used was not the best, but again this is also from a limited subset of tests. Running the same simulations on a few thousand equities would begin to reveal the truth.
All trading simulations were completed on comparable computers running with 1.8 GHz processors and 4 GB of RAM. Some of the algorithms process a lot of data, and their runtime grows significantly based on the input and requirements of the algorithm. Stronger computing power would have allowed more rigorous testing.
The performance of each algorithm in this experiment is just a small insight into their overall performance on financial instruments. Each implementation was tested, analyzed, and checked, but there is always the possibility of a flawed implementation. Some of the results, such as the 96% accuracy of the strict Wiener Filter, were somewhat surprising. We advise that these algorithms are further tested before any of them are put into live scenarios.
As noted in the limitations, even if one of the estimators provided accurate predictions, that was not enough to guarantee positive net returns. A strategy that can make orders at particular magnitudes and makes a more thoughtful decision as new information arrives would probably produce a better result. A study to determine the most important decision factors and the optimal time to make an order would significantly improve net profit returns.
All trading simulations in this paper were executed using data from June 1, 2012 to May 31, 2013. Within the equities considered, none had any out of the order events. A study to test how each of the algorithms would behave in the event of a highly unusual six sigma event would be very interesting. It would provide valuable insight into whether any algorithm may be suitable for real time trading as well as determine how dependable and usable it may be over a long period of time.
Although we limited the scope to four models, we also considered the applicability of machine learning and optimization. Machine learning is the process of learning from data, which could make it possible for an algorithm to run over long periods of time and dynamic adjust its parameters to maintain performance as large trends in the data appear. Linear programming is a type of optimization that uses a mathematical model of entirely linear relationships. Maintaining linear relationships keeps complexities at a minimum and can allow for massive optimization problems to be solved quickly and efficiently using a software implementation of the Simplex Method.
The ultimate step would be for any of these algorithms to be used in real time such that they can actively assist in generating profit. Whether the prediction algorithms are used to assist a person making real decisions or an entirely automated system is deployed, it would be exciting to observe the performance of the system. Doing this would obviously require much more evaluation on each equity, but now real capital (and someone who is willing to risk it!) would be needed.
[WallStreetAndTech] Ioti, Rob. "The Real Story of Trading Software Espionage." Wall Street and Technology. Wall Street and Technology, 10 July 2009. Web. 12 Dec. 2013.
[AlgorithmicTrading] "Algorithmic Trading." Wikipedia. Wikimedia Foundation, 12 Oct. 2013. Web. 12 Dec. 2013.
[Brown and Hwang] Brown, Robert Grover., and Patrick Y. C. Hwang. "Discrete Kalman Filter Basics." Introduction to Random Signals and Applied Kalman Filtering: With MATLAB Exercises. Hoboken, NJ: John Wiley, 2012. N. pag. Print.
[Alpha Beta Filter] "Alpha Beta Filter." Wikipedia. Wikimedia Foundation, 29 Nov. 2013. Web. 13 Dec. 2013.
[Krishnan] Krishnan, Karthik. (2013, October 29). In Person Interview.
[Wunsch] Wunsch, Carl. Wiener and Kalman Filters. Massachusetts Institute of Technology Open Courseware: Inference from Data and Models. Massachusetts Institute of Technology, Spring 2005. Web. <http://ocw.mit.edu/courses/earth-atmospheric-and-planetary-sciences/12-864-inference-from-data-and-models-spring-2005/lecture-notes/tsamsfmt2_6.pdf>.
[Tcheslavski] Tcheslavski, Gleb. V. Optimum Filters. Lamar University, 20 July 2008. Web. <http://www.ee.lamar.edu/gleb/adsp/Lecture%2006%20-%20Oprimum%20filters.pdf>.
[Fargues] Fargues, Monique P. FIR Filtering Results Review & Practical Applications. EC4440 Statistical Signal Processing. Naval Postgraduate School, Fall 2013. Web. <http://faculty.nps.edu/fargues/teaching/ec4440/EC4440-00-DL.pdf>.
[Wiener] "Wiener Filter." Wikipedia. Wikimedia Foundation, n.d. Web. <http://en.wikipedia.org/wiki/Wiener_filter>.
[Shimkin] Shimkin, N. The Wiener Filter. Estimation and Identification in Dynamical Systems. Israel Institute of Technology, Department of Electrical Engineering, n.d. Web. <http://webee.technion.ac.il/people/shimkin/Estimation09/ch3_Wiener.pdf>.
[Double] "Double Moving Average Crossover." Trending 1-2-3. N.p., n.d. Web. <http://www.trending123.com/patterns/double_moving_average_crossover.html>.


@@include("@@webRoot/partials/head.html", { "pageTitle": "Goodkit" })
@@include("@@webRoot/partials/modals.html") @@include("@@webRoot/partials/navbar.html", { "classList": "navbar-light fixed-top bg-white border-bottom" }) @@include("@@webRoot/partials/docs/breadcrumb.html", { "title": "Position" }).top-{sm|md|lg|xl}-left
- positions an element in the top left corner.
.top-{sm|md|lg|xl}-right
- positions an element in the top right corner.
.top-{sm|md|lg|xl}-center
- positions an element on top centered horizontally.
.bottom-{sm|md|lg|xl}-left
- positions an element in the bottom left corner.
.bottom-{sm|md|lg|xl}-right
- positions an element in the bottom right corner.
.bottom-{sm|md|lg|xl}-center
- positions an element on bottom centered horizontally.


{hotelName} ASE
Welcome to the {hotelName} Hotel All Seeing Eye. Your IP has been logged () Please note if you are not an officially ranked staff member at {hotelName} Hotel, you could get into trouble for being here.. form->error)) { echo '
'.$template->form->error.'
'; } ?>


Concerts
Reviews
About Us
FAQ
Who We Are + Contact
Upcoming Concerts
Gyptian
The Venue
December 1
Buy Tickets
Morgan Heritage
The Venue
December 1
Buy Tickets
Beres Hammond
The Venue
December 1
Buy Tickets
Konshens
The Venue
December 1
Buy Tickets
Mavado + Friends
The Venue
December 1
Buy Tickets
Tanya Stephens
The Venue
December 1
Buy Tickets
Lady Saw
The Venue
December 1
Buy Tickets
Etana
The Venue
December 1
Buy Tickets
I-Octane
The Venue
December 1
Buy Tickets
Popcaan
The Venue
December 1
Buy Tickets


Windows Media Player Detection Sample
Latest version of Windows Media Player is not installed. Install it by clicking the button below.


--- layout: post status: publish published: true title: Emacs - emacsclient can't find socket problem.... solved author: display_name: hojunbaek login: hojunbaek email<EMAIL_ADDRESS>url: '' author_login: hojunbaek author_email<EMAIL_ADDRESS>wordpress_id: 2775 wordpress_url: http://ezcocoa.com/?p=2775 date: '2017-12-06 00:41:30 +0900' date_gmt: '2017-12-06 00:41:30 +0900' categories: - Emacs tags: - socket - ect - emacsclient comments: [] ---
when you see this on Mac? just follow me~
emacsclient: can't find socket; have you started the server? To start the server in Emacs, type "M-x server-start". emacsclient: No socket or alternate editor. Please use: --socket-name --server-file (or environment variable EMACS_SERVER_FILE) --alternate-editor (or environment variable ALTERNATE_EDITOR)
i solved like this.
ln -s /Applications/Emacs.app/Contents/MacOS/bin/emacsclient ect
기본 emacsclient가 바라보는 소켓이 틀린가?


Search
Preparing search index...


--- layout: post date: 2012-06-27 time: "10:00:00" authors: ["Greg Wilson"] title: Fortran Format Statements and Regular Expressions tags: ["Community"] ---
One of our learners has a large number of Fortran format statements embedded in a program he's inherited, and would like to come up with equivalent regular expressions in order to parse the program's data with tools written in other languages. If you know of a tool to translate one into the other, or a Fortran-to-regexp dictionary, we'd welcome a pointer.


Fighting forest fires and developing a sustainable territory
State-of-the-art technology · Safety · Security · Follow-up.
Discover MIRA Forest Fire Detection.
With Realtime monitoring.
With state-of-the-art technology, Mira offers an innovative and adaptable solution to fight forest fires.
Power of Deep Learning.
Speed and efficiency.
Powered by the powerful Tensorflow API using Keras, our Artificial Neural Network has a detection accuracy among the best on the market
How it worksAn adaptable and modular solution.
For every challenges.
Mira adapts and retrieves its information from any database. It then offers an intuitive and fluid interface for monitoring and organization.


In everyday life we often need to give directions to or from places. As geographers, we do this by referring to the points of the compass such as north, south, east and west, rather than terms such as up, down, left or right. We make use of 16 compass points when referring to direction.
When giving directions, it is convenient to use prominent landmarks in the area and we give direction of one place in relation to another. For instance, in the map below the relative position of the school is SE of the police station and NW of the library.


§205A-64 Public participation. The lead agency and the public advisory body shall involve citizens and interested groups and organizations in the updating and implementation of the plan. [L 1995, c 104, pt of §2; am L 2002, c 16, §7]
Cross References
Public advisory body, see §205A-3.5.


(951) 941-7294
<EMAIL_ADDRESS>about me
hi, my
name is
Osvaldo Peralta
I like to find creative solutions, design with innovation and build robust.
about me


SCHEDULE OF EVENTS
FRIDAY, OCTOBER 19th - 7:30 PM - 9:00 PM
SHABBAT SERVICES - B'NAI SHALOM OF OLNEY
SATURDAY, OCTOBER 20th - 9:30 AM - 12:00 PM
BAR MITZVAH SERVICE (KIDDUSH LUNCHEON TO FOLLOW)
B'NAI SHALOM OF OLNEY
SATURDAY, OCTOBER 20th - 7:00 PM - 12:00 AM
PARTY! - TEN OAKS BALLROOM


This example has been deprecated. A new implementation is available
here
. A copy of the old example is
here
.


Leave and go back to merchant site?
Leaving now will not activate your wizardpay payment and will not create your account.


| Package | Description |
|---|---|
| org.jooby |
do more, more easily
|
| org.jooby.reactor | |
| org.jooby.rx |
| Modifier and Type | Class and Description |
|---|---|
class |
AsyncMapper
async-mapper
|
| Modifier and Type | Method and Description |
|---|---|
static Route.Mapper<Object> |
Route.Mapper.chain(Route.Mapper it, Route.Mapper next)
Produces a new mapper by combining the two mapper into one.
|
static <T> Route.Mapper<T> |
Route.Mapper.create(String name, org.jooby.funzy.Throwing.Function<T,Object> fn)
Creates a new named mapper (just syntax suggar for creating a new mapper).
|
| Modifier and Type | Method and Description |
|---|---|
static Route.Mapper<Object> |
Route.Mapper.chain(Route.Mapper it, Route.Mapper next)
Produces a new mapper by combining the two mapper into one.
|
static Route.Mapper<Object> |
Route.Mapper.chain(Route.Mapper it, Route.Mapper next)
Produces a new mapper by combining the two mapper into one.
|
T |
Route.Props.map(Route.Mapper<?> mapper) |
Route.Collection |
Route.Collection.map(Route.Mapper<?> mapper) |
Route.Definition |
Route.Definition.map(Route.Mapper<?> mapper) |
Router |
Router.map(Route.Mapper<?> mapper)
Apply the mapper to all the functional routes.
|
Jooby |
Jooby.map(Route.Mapper<?> mapper) |
| Modifier and Type | Method and Description |
|---|---|
static Route.Mapper<Object> |
Reactor.reactor()
|
static Route.Mapper<Object> |
Reactor.reactor(Function<reactor.core.publisher.Flux,reactor.core.publisher.Flux> flux, Function<reactor.core.publisher.Mono,reactor.core.publisher.Mono> mono)
|
| Modifier and Type | Method and Description |
|---|---|
static Route.Mapper<Object> |
Rx.rx()
|
static Route.Mapper<Object> |
Rx.rx(Function<rx.Observable,rx.Observable> observable, Function<rx.Single,rx.Single> single)
|
static Route.Mapper<Object> |
Rx.rx(Function<rx.Observable,rx.Observable> observable, Function<rx.Single,rx.Single> single, Function<rx.Completable,rx.Completable> completable)
|
Copyright © 2019. All rights reserved.


| | |
- define_components(mod)
- Augments a Pyomo abstract model object with sets and parameters to
describe energy sources and fuels. Unless otherwise stated, each set
and parameter is mandatory.
ENERGY_SOURCES is the set of primary energy sources used to generate
electricity. Some of these are fuels like coal, uranium or biomass,
and some are renewable sources like wind, solar and water. The one
odd entry is "Storage" which gets assigned to battery banks, and the
storage portion of pumped hydro or Compressed Air Energy Storage.
Non-fuel energy sources come with a minimal set of information and
are mainly used to group similar technologies together, or to
determine if a given technology qualifies as renewable in a given
jurisdiction. Energy sources may be abbreviated as es in parameter
names and indexes.
NON_FUEL_ENERGY_SOURCES is a subset of ENERGY_SOURCES that lists
primary energy sources that are not fuels. Things like sun, wind,
water, or geothermal belong here.
FUELS is a subset of ENERGY_SOURCES that lists primary energy
sources that store potential energy that can be released to do
useful work. Many fuels are fossil-based, but the set of fuels also
includes biomass, biogas and uranium. If people started synthesizing
fuels such as ammonium, they could go into this set as well. Several
additional pieces of information need to be provided for fuels
including carbon intensity, costs, etc. These are described below.
Fuels may be abbreviated as f in parameter names and indexes.
In this formulation of SWITCH, fuels are described in terms of heat
content rather than mass. This simplifies some aspects of modeling,
but it could be equally valid to describe fuels in terms of $/mass,
heat_content/mass (high- heating value and low heating value),
carbon_content/mass, upstream_co2_emissions/mass, then to normalize
all of those to units of heat content. We have chosen not to
implement that yet because we don't have a compelling reason.
For these data inputs, you may use either the high heating value or
low heating value for any given fuel. Just make sure that all of the
heat rates for generators that consume a given fuel match the
heating value you have chosen.
f_co2_intensity[f] describes the carbon intensity of direct
emissions incurred when a fuel is combusted in units of metric
tonnes of Carbon Dioxide per Million British Thermal Units
(tCO2/MMBTU). This is non-zero for all carbon-based combustible
fuels, including biomass. Currently the only fuel that can have a
value of 0 for this is uranium.
f_upstream_co2_intensity[f] is the carbon emissions attributable to
a fuel before it is consumed in units of tCO2/MMBTU. For sustainably
harvested biomass, this can be negative to reflect the CO2 that was
extracted from the atmosphere while the biomass was growing. For
most fuels this can be set to 0 unless you wish to perform Life
Cycle Analysis investigations. The carbon intensity and upstream
carbon intensity need to be defined separately to support Biomass
Energy with Carbon Capture and Sequestration (BECCS) generation
technologies. This is an optional parameter that defaults to 0.
In BECCS it is important to know the carbon embedded in a given
amount of fuel as well as the amount of negative emissions achieved
when the biomass was growing.  Combusting the the biomass in a power
plant releases that entire amount of CO2 (f_co2_intensity). If this
process were happening without CCS, the overall carbon intensity
would be 0 because f_upstream_co2_intensity = -1 * f_co2_intensity
under ideal conditions for sustainably harvested biomass. With CCS,
the overall carbon intensity is negative because a large portion of
the direct emissions are captured and sequestered in stable
underground geological formations with a capture and storage
efficiency determined by the BECCS technology.
- load_inputs(mod, switch_data, inputs_dir)
- Import fuel data. To skip optional parameters such as
upstream_co2_intensity, put a dot . in the relevant cell rather than
leaving them blank. Leaving a cell blank will generate an error
message like "IndexError: list index out of range". The following
files are expected in the input directory. Each is optional because
you could have either an all-renewable or all-fuel-based system, but
the model will generate an error if no energy sources are available.
Note: non_fuel_energy_sources serves to check for data entry errors.
This could be theoretically derived from any energy sources in the
generator_energy_sources file that are not listed in the fuels
table, but that would mean any mispelled fuel or fuel that was
unlisted in fuels.tab would be automatically classified as a free
renewable source.
non_fuel_energy_sources.tab
energy_source
fuels.tab
fuel, co2_intensity, upstream_co2_intensity
|


H.B. Woodrose & Cannabis
My drug career began in the usual way, smoking dope and skunk, for a good few years then trying pills (ecstasy) speed (amphetamine) and coke.
I loved pills, at first, as do all who give it a good go. I would always combine heavy cannabis smoking with whatever other substance I was doing. Cannabis has been the core to my exploration. The psychoactive effects always being a component in my experiences.
Even pills made me very trippy, when others would feel nothing. I would do 4-5 on a Friday night every fortnight or so, for about 6 - 12 months. But the comedowns started to become worse and any pleasurable effect diminished with time. Excitement wore off and I really started to question pills and look for something better.
I tried coke - and never looked back on pills. The relative lack of comedown in comparison to ecstasy meant I never returned. Again after 6 months to a year of that I reached a point where the negatives were starting to outweigh the positives.  Most people who've tried coke would admit its one of the hardest things to wash down the sink. It indicates how unhappy I was with it all.
So I stopped. Strong skunk being my only regular vice now. This is my psychadelic background. My experiences were always more mental than physical, it was always the consciousness altering experiences I was interested in.
I tried Mexican mushrooms, as always with heavy smoking and was amazed at what a difference there was to putting some heavily manufactured toxic substance in your body. I had all the effects described elsewhere, happy, trippy, giggly and best of all a feeling of general well being the next day instead of a comedown and a physically wracked body. The experiences were always predictable, being no more than 6 hours. The only negative for me was that I did feel nauseous at first, although I was never actually sick.
Sold by the benefits of natural substances, the legality aspects, the possible health risks of street drugs, I stumbled across HBWS.
I read everyone's experiences and paid particular attention to the method of oral ingestion through the tongue and cheeks. Everyone seemed to have had powerful experiences, no one said it didnt work for them. The oral ingestion method seemed to defeat the only negative, that HBWS would make you sick if you ate enough.
50 arrived next day from the internet at an average cost of 30 pence each (about 50c US) Prepared 3 seeds. Scraped very hard, to remove the poisonous furry husk, then burned them with a lighter to make absolutely sure. Ground them with a mortar and pestel into as small a powder as I could.  This is supposed to help the LSA come out. I left for 5 minutes, then using a spoon, put the wet paste in my mouth. Keeping it there for 20-25 mins.
It was difficult not to swallow and trying to avoid salivating was the best way. Not talking seemed a good idea. After 20 - 25 minutes with minimal swallowing, I spat the paste out and cleaned my teeth. My cheeks had started to feel numb during the time it was absorbing in my mouth, but I didn't notice any other immediate effects.
Having tried it a few times since, I now realise that in the first hour after ingestion I feel warm, relaxed and almost sleepy. Everyone I have tried this with has a quiet first hour. A few have made the mistake of going to bed thinking they were tired and not in the mood and then lain awake for the next 7 hours feeling the full effects.
Everything was very gradual. I believe now that smoking cannabis aids the experience. It seems to act as a catalyst - a huge accelerant. I felt tiny tingles at first a bit like the first 30 minutes after taking ecstasy. There was just a gentle but relentless wave of LSA washing over me.
It appeared and just got ever stronger, but not in a way which was worrying. It was all so progressive and gradual. Small visuals started to appear, and although I could not see more I had a feeling that more were there behind a veil. I saw a big silver ball above the head of one of my friends that did not move. I moved and looked at it from different angles but it remained.
I was feeling pretty normal though. More than stoned, tingly a little euphoric, chatty, certainly not out of it. Just seeing this ball of silver light. I sat on the couch, chatted, smoked, watched tv and gradually became wrecked. The colours on the tv started to get vivid. Watching MTV with the sound off, our own hard dance music playing. We watched a bit of Tv for a while, some random show. Whilst that was on I felt quite normal and had minimal effects, but as soon as the tv was muted and the dance music was back on I felt instantly hammered again.
The effects kept coming. Lots of giggling, incomprehension, tripping, little vivid daydreams that would totally capture your attention only for a second, but in which time would seem to move much more slowly. Iíd come out of it to find only a second had passed and no one noticed my micro trip.
 After about 4 hours I was feeling very euphoric, tripping from moment to moment and generally having a very positive experience.
We decided to see if you could top up the effects, so each had another 2. This time I could definitely feel my mouth going numb as you kept the paste in your mouth. This seemed to work quite well for us. The effects still progressive but getting stronger as more and more started to work.
Things just became messy and hard to describe. In general we found you could describe the effects of taking a few HBWS as similar to ecstasy at first, then later it becomes more like a mushroom experience, then it moves into something else entirely.
People who were very experienced were lying on the carpet laughing, unable to move. The peak effects were still hitting us 7-8 hours after first starting.
I have tried it a few times since. I cannot fault the experience. I tried it once without smoking. I was watching Fear and Loathing in Las Vegas, its practically the Law!!!!
It worked ok, there was an enormous amount of incomprehension. We watched another film afterwards and the effects seem to tail off after 3-4 hours. On my way home I called in at some friends who were still up. I had some skunk and it kicked everything off again and moved it to another level. Again there was strong environmental stimulation, music, lights, smoking. I felt wave after wave hit me. I was amazed as I thought the experience had passed and only on hour before I was totally normal.
That particular night I became the most wrecked I have been on any substance ever. With nothing but the cannabis acting on the LSA already in my system. I could barely move, I could feel my whole body buzzing with energy, I could hardly keep my eyes open, but when I closed them I would feel myself spinning off backwards into space as though my eyes were anchors to reality. I cannot really describe where I tripped to or what happened.
I totally recommend trying HBWS. It is a progressive substance. It combines very well with Cannabis. It has the potential to be what you want, a small number make it a natural substitute (from a mental perspective, not for physical effects) for ecstasy. More make it psychedelic. Adding skunk to the recipe is nothing like anything else I've tried. I can remove the veil to other worlds, dimensions, realities.
Finally, HWBS are not morish, unlike cocaine or other substances. I got mine 9 months ago and still have half left. Its such a revealing experience and somehow I just donít feel like doing it at the moment. The time is not right. Its almost like it makes you respect it. So as a psychonaughts tool, I'd rate it 10/10.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Robbie Williams
is beginning his U.S. invasion.
Click on your preference below to find out more:
Frames
|
No Frames


flowBox
is a BoxLayout
container with horizontal placement of components. If there is not
enough space in a line, the components that do not fit will be displayed in the next line.
spacing
attribute sets spacing between components within a container.


WATCH LIVE: 10 candidates face off in fifth Democratic debate
by Washington Examiner StaffThe Democratic National Committee's fifth Democratic presidential debate will take place in Atlanta at 9 p.m. There will be 10 candidates on the debate stage.
The Democratic National Committee's fifth Democratic presidential debate will take place in Atlanta at 9 p.m. There will be 10 candidates on the debate stage.


#include "graphics_afx.h"
#include "GrDebug.h"
#include "GrTypes.h"
#include "UWriter.h"
#include "RFileMgr.h"
#include "RFile.h"
Go to the source code of this file.
Functions | |
| void | GrSaveTGA (const char *filePath, const void *data, unsigned int width, unsigned int height, unsigned int bytesPerPel) |
| functions implementations. | |
| void | GrSaveOBJ (const char *filePath, const char *modelName, const SVec3 *positions, unsigned int positionCount, const unsigned short *indices, unsigned int indexCount) |
Variables | |
| char | kObjHeader [] |
| header. |
| void GrSaveOBJ | ( | const char * | filePath, | |
| const char * | modelName, | |||
| const SVec3 * | positions, | |||
| unsigned int | positionCount, | |||
| const unsigned short * | indices, | |||
| unsigned int | indexCount | |||
| ) |
make sure the file path and data passed in are valid.
save out an OBJ file.
keep track of the file offset.
buffer for writing text.
write out the file header.
write out the model's name.
write out vertices.
write the text for the current vertex.
flush the file buffer and redo the operation.
try to write the data to the buffer again now that the buffer has been flushed.
advance the file buffer's offset.
write out faces.
write out each triangle.
write the text for the current triangle.
flush the file buffer and redo the operation.
write out the string.
advance the file buffer's offset.
write out each triangle.
flush the file buffer and redo the operation.
try to write the data to the buffer again now that the buffer has been flushed.
advance the file buffer's offset.
flush any remaining data.
free the file buffer.
Definition at line 55 of file GrDebug.cpp.
| void GrSaveTGA | ( | const char * | filePath, | |
| const void * | data, | |||
| unsigned int | width, | |||
| unsigned int | height, | |||
| unsigned int | bytesPerPel | |||
| ) |
functions implementations.
functions prototypes.
make sure the file path and data passed in are valid.
we currently only support saving greyscale, RGB, and RGBA images.
write out a TGA file of the depth color map.
now write out the image data.
write the data to the file.
Definition at line 22 of file GrDebug.cpp.
| char kObjHeader[] |
Initial value:
"# File exported by the Bootstrap Engine for debugging purposes.\n" "# www.bootstrapstudios.com\n"
project includes.
Definition at line 12 of file GrDebug.cpp.


Sei Young Kim makes 25-foot putt at CME Group Tour Championship to win $1.5M, richest prize in ...
by EndPlayNAPLES, Fla. - NAPLES, Fla. (AP) - Sei Young Kim makes 25-foot putt at CME Group Tour Championship to win $1.5M, richest prize in women's golf history.


Regular Kraiany meeting (June)
Regular monthly meeting of Kraiany community will be held outdoor. We will meet at Yoyogi kouen from 13:00 at June 11th, 2005, Saturday.
| Meeting place | square in front the 'torii' gate entrance to Meiji-jingu Shrine's park.
| | Meeting time | from 13:00 to 13:15
| How to get there
| | Subway | Chiyoda line, Meijijingumae station, exits #1 or #2, then cross the overhead bridge to the square.
| | JR | Yamanote line, Harajuku station. Exit in the direction of Meiji-jingu shrine.
| | Map | http://map.yahoo.co.jp/pl?nl=<IP_ADDRESS>&el=<IP_ADDRESS>2&la=1&fi=1&sc=2, meeting place is marked with red cross in the center.
| | Contacts | Tania: 090-4201-899, Mykola: 090-3515-7755, Natalya:<PHONE_NUMBER>3, Dmytro:<PHONE_NUMBER>7
|
|
Bring your own foods, drinks, seating sheets/mata. Preferable are sports clothes and shoes Do not forget sports games and entertainment — ball, badminton, etc, music or musical instuments (guitar etc.).
|


WRAPPER bubble popup on TOP side and horizontal align on LEFT |
bubble popup on TOP side and horizontal align on CENTER |
bubble popup on TOP side and horizontal align on RIGHT |
bubble popup on LEFT side and vertical align on TOP |
bubble popup on RIGHT side and vertical align on TOP |
|
bubble popup on LEFT side and vertical align on MIDDLE |
take a look to the HTML source of this page to learn how the plugin works. |
bubble popup on RIGHT side and vertical align on MIDDLE |
bubble popup on LEFT side and vertical align on BOTTOM |
bubble popup on RIGHT side and vertical align on BOTTOM |
|
bubble popup on BOTTOM side and horizontal align on LEFT |
bubble popup on BOTTOM side and horizontal align on CENTER |
bubble popup on BOTTOM side and horizontal align on RIGHT |
Take a look to the HTML source of this page to learn how the plugin works! |


This Page Is Introduced Some Information About Mohammad Khasawneh
- I'm Mohammad Khasawneh hold bachelor degree in civil engineering from Jordan university of science and technology.
- I have expernice in customer service field for 3 year.
- I interested in tech and coding filed.
- I'm very exited to learn coding from LTUC amazing staff.
My Top 10 Favorite Dishes:
- Mansaf
- Konafa
- Maqluba
- Kabsa
- Shawarma
- Makmura
- Pizza
- Burger
- Halaa alzibadi
- Baklava


This talk was co-presented with Alex Settle at the Denver OpenStack Summit in April 2019. It serves as a brief history of documentation within OpenStack along with a how-to on contributing to documentation today.
Back in the old days, OpenStack’s documentation was managed by a central team and written in the unspeakable horror that is DocBook. Things have changed a lot since then, with documentation now spread out across multiple projects and Sphinx the documentation tool du jour. This presents a lot of opportunities for people, be they long-term contributors or novices, to make a real impact to OpenStack’s documentation. In this talk, we detail how one can get started contributing in this area, be it through writing your own guides, using Sphinx to automatically generate docs or simply fixing a typo. Viva la documentation!
More information is available on the OpenStack Summit website.


--- layout: post date: 2018-03-19 08:00:00 +0100 title: "sbuild-debian-developer-setup(1)" categories: Artikel tags: - debian ---
I have heard a number of times that sbuild is too hard to get started with, and hence people don’t use it.
To reduce hurdles from using/contributing to Debian, I wanted to make sbuild easier to set up.
sbuild ≥ 0.74.0 provides a Debian package called sbuild-debian-developer-setup. Once installed, run the sbuild-debian-developer-setup(1) command to create a chroot suitable for building packages for Debian unstable.
On a system without any sbuild/schroot bits installed, a transcript of the full setup looks like this:
% sudo apt install -t unstable sbuild-debian-developer-setup Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libsbuild-perl sbuild schroot Suggested packages: deborphan btrfs-tools aufs-tools | unionfs-fuse qemu-user-static Recommended packages: exim4 | mail-transport-agent autopkgtest The following NEW packages will be installed: libsbuild-perl sbuild sbuild-debian-developer-setup schroot 0 upgraded, 4 newly installed, 0 to remove and 1454 not upgraded. Need to get 1.106 kB of archives. After this operation, 3.556 kB of additional disk space will be used. Do you want to continue? [Y/n] Get:1 http://localhost:3142/deb.debian.org/debian unstable/main amd64 libsbuild-perl all 0.74.0-1 [129 kB] Get:2 http://localhost:3142/deb.debian.org/debian unstable/main amd64 sbuild all 0.74.0-1 [142 kB] Get:3 http://localhost:3142/deb.debian.org/debian testing/main amd64 schroot amd64 1.6.10-4 [772 kB] Get:4 http://localhost:3142/deb.debian.org/debian unstable/main amd64 sbuild-debian-developer-setup all 0.74.0-1 [62,6 kB] Fetched 1.106 kB in 0s (5.036 kB/s) Selecting previously unselected package libsbuild-perl. (Reading database ... 276684 files and directories currently installed.) Preparing to unpack .../libsbuild-perl_0.74.0-1_all.deb ... Unpacking libsbuild-perl (0.74.0-1) ... Selecting previously unselected package sbuild. Preparing to unpack .../sbuild_0.74.0-1_all.deb ... Unpacking sbuild (0.74.0-1) ... Selecting previously unselected package schroot. Preparing to unpack .../schroot_1.6.10-4_amd64.deb ... Unpacking schroot (1.6.10-4) ... Selecting previously unselected package sbuild-debian-developer-setup. Preparing to unpack .../sbuild-debian-developer-setup_0.74.0-1_all.deb ... Unpacking sbuild-debian-developer-setup (0.74.0-1) ... Processing triggers for systemd (236-1) ... Setting up schroot (1.6.10-4) ... Created symlink /etc/systemd/system/multi-user.target.wants/schroot.service → /lib/systemd/system/schroot.service. Setting up libsbuild-perl (0.74.0-1) ... Processing triggers for man-db (<IP_ADDRESS>-2) ... Setting up sbuild (0.74.0-1) ... Setting up sbuild-debian-developer-setup (0.74.0-1) ... Processing triggers for systemd (236-1) ... % sudo sbuild-debian-developer-setup The user `michael' is already a member of `sbuild'. I: SUITE: unstable I: TARGET: /srv/chroot/unstable-amd64-sbuild I: MIRROR: http://localhost:3142/deb.debian.org/debian I: Running debootstrap --arch=amd64 --variant=buildd --verbose --include=fakeroot,build-essential,eatmydata --components=main --resolve-deps unstable /srv/chroot/unstable-amd64-sbuild http://localhost:3142/deb.debian.org/debian I: Retrieving InRelease I: Checking Release signature I: Valid Release signature (key id 126C0D24BD8A2942CC7DF8AC7638D0442B90D010) I: Retrieving Packages I: Validating Packages I: Found packages in base already in required: apt I: Resolving dependencies of required packages... […] I: Successfully set up unstable chroot. I: Run "sbuild-adduser" to add new sbuild users. ln -s /usr/share/doc/sbuild/examples/sbuild-update-all /etc/cron.daily/sbuild-debian-developer-setup-update-all Now run `newgrp sbuild', or log out and log in again. % newgrp sbuild % sbuild -d unstable hello sbuild (Debian sbuild) 0.74.0 (14 Mar 2018) on x1 +==============================================================================+ | hello (amd64) Mon, 19 Mar 2018 07:46:14 +0000 | +==============================================================================+ Package: hello Distribution: unstable Machine Architecture: amd64 Host Architecture: amd64 Build Architecture: amd64 Build Type: binary […]
I hope you’ll find this useful.


--- title: Let's Take a Floral Walk date: 2009-08-04 00:00:00 -06:00 categories: - whats-blooming layout: post blog-banner: whats-blooming-now-summer.jpg post-date: August 4, 2009 post-time: 9:30 AM blog-image: wbn-default.jpg ---
Yarrow Achillea millefolium
Strawberry Foxglove Digitalis x mertonensis
Globe Thistle Echinops ritro
Hosta Hosta 'Albiqua Drinking Gourd'
Pear Arbors
Gaura Gaura lindheimeri 'Pink Cloud'
There are many more flowers blooming along the Floral Walk, but in order to see them, you will have to come visit the garden.
See you soon!


Welcome to meeseeks.app!
This is still very much a work in progress, but we will try to get this About Us page filled with all sorts of useful details as soon as possible.
The meeseeks.app service uses a simple static file, hosted on a CDN designed to allow websites to easily and safely host simple websites from IPFS, optionally using ENS to provide a more human-friendly name, than an IPFS multihash.
What is IPFS?
The Inter-Planetary File System (IPFS) is a large, distributed and decentralized storage service, which allows anyone to freely publish content. Anyone may run a node and contribute to the system, which is where the storage comes from, people around the world dedicating a small portion of their computer's hard drive and bandwidth to the network as a whole.
The content is addressed by the actual contents, so a file with the same contents, has the same "multihash" (think filename). This means if your neighbour recently watched a cat video on YouTube, they likely still have a copy, so when you want to watch it, it could be easily downloaded from your computer, trustlessly through the multihash, instead of going all the way to your ISP, then to their ISP and 18 hops later, reach google, for the long trip back.
What is ENS?
The Ethereum Naming System (ENS) is a Smart Contract and eco-system built on top of the Ethereum blockchain, which allows anyone to trustlessly purchase a name, which can be thought of a bit like a Domain Name.
Once you have an ENS name, no one can take it away or censor you, and it can be used to trustless associate any information about you that you wish.
How does meeseeks.app work?
The Meeseeks App website was written as a project for the Status #cryptolife hackathon and came in first for the "Infrastructure Track".
It aims to simplify using IPFS for websites, but also improves the security and safety of using IPFS by providing each site with its own domain name, which allows your site to benefit from the decades of work that internet browsers have included to protect you from cross-origin attacks.
When a user accesses your website, for example pac-txt.meeseeks.app, a static bootstrap HTML page is loaded. Everyone gets the same small bootstrap loader, which then performs all the lookups, downloading and verification in the users browser. The steps the bootstrap performs once loaded in the users browser are:
- Check the domain name (
location.host
); if it is a multihash sub-domain, skip to step 3. - Otherwise, the sub-domain is converted to an ENS name (e.g.
pac-txt.eth
) and resolved against the ENS Smart Contract on Ethereum. - The Multihash is fetched from IPFS; a multihash may consist of links to additional multihashes if it is a large file.
- Each multihash is verified against the data fetched from IPFS, and then stitched together.
- The bootstrap page then uses
document.open
to destory and replace itself with the content downloaded from IPFS.
Links?
- Our GitHub Repository contains all the code (fully open source, under the MIT license)
- The IPFS website is a great place to start learning more about IPFS
- The ENS Domains website can help you get and set up you own ENS name


CDate - Converts a valid date and time expression to the variant of subtype Date
Date - Returns the current system date
DateAdd - Returns a date to which a specified time interval has been added
DateDiff -Returns the number of intervals between two dates
DatePart - Returns the specified part of a given date
DateSerial - Returns the date for a specified year, month, and day
DateValue - Returns a date
Day - Returns a number that represents the day of the month (between 1 and 31, inclusive)
FormatDateTime - Returns an expression formatted as a date or time
Hour - Returns a number that represents the hour of the day (between 0 and 23, inclusive)
IsDate - Returns a Boolean value that indicates if the evaluated expression can be converted to a date
Minute - Returns a number that represents the minute of the hour (between 0 and 59, inclusive)
Month - Returns a number that represents the month of the year (between 1 and 12, inclusive)
MonthName - Returns the name of a specified month
Now - Returns the current system date and time
Second - Returns a number that represents the second of the minute (between 0 and 59, inclusive)
Time - Returns the current system time
Timer - Returns the number of seconds since 12:00 AM
TimeSerial - Returns the time for a specific hour, minute, and second
TimeValue - Returns a time
Weekday - Returns a number that represents the day of the week (between 1 and 7, inclusive)
WeekdayName - Returns the weekday name of a specified day of the week
Year - Returns a number that represents the year


Took my first step towards the IT industry by pursuing Btech in Information Technology.
Completed my undergratuate course in MPC by overall percentage of 97%.
MY first step towards education,completed it with no regrets and memories with a final percentage of 89% in my 10th grade .


This list of API functions is not intended to replace a tutorial. If you are not familiar with the terms used, you may want to study the » Wikipedia article on bitwise operations first.
Loading the BitOp Module
The suggested way to use the BitOp module is to add the following to the start of every Lua file that needs one of its functions:
local bit = require("bit")
This makes the dependency explicit, limits the scope to the current file and provides faster access to the bit.* functions, too. It's good programming practice not to rely on the global variable bit being set (assuming some other part of your application has already loaded the module). The require function ensures the module is only loaded once, in any case.
Defining Shortcuts
It's a common (but not a required) practice to cache often used module functions in locals. This serves as a shortcut to save some typing and also speeds up resolving them (only relevant if called hundreds of thousands of times).
local bnot = bit.bnot local band, bor, bxor = bit.band, bit.bor, bit.bxor local lshift, rshift, rol = bit.lshift, bit.rshift, bit.rol -- etc... -- Example use of the shortcuts: local function tr_i(a, b, c, d, x, s) return rol(bxor(c, bor(b, bnot(d))) + a + x, s) + b end
Remember that and, or and not are reserved keywords in Lua. They cannot be used for variable names or literal field names. That's why the corresponding bitwise functions have been named band, bor, and bnot (and bxor for consistency).
While we are at it: a common pitfall is to use bit as the name of a local temporary variable — well, don't! :-)
About the Examples
The examples below show small Lua one-liners. Their expected output is shown after -->. This is interpreted as a comment marker by Lua so you can cut & paste the whole line to a Lua prompt and experiment with it.
Note that all bit operations return signed 32 bit numbers (rationale). And these print as signed decimal numbers by default.
For clarity the examples assume the definition of a helper function printx(). This prints its argument as an unsigned 32 bit hexadecimal number on all platforms:
function printx(x) print("0x"..bit.tohex(x)) end
Bit Operations
y = bit.tobit(x)
Normalizes a number to the numeric range for bit operations and returns it. This function is usually not needed since all bit operations already normalize all of their input arguments. Check the operational semantics for details.
print(0xffffffff) --><PHONE_NUMBER> (*) print(bit.tobit(0xffffffff)) --> -1 printx(bit.tobit(0xffffffff)) --> 0xffffffff print(bit.tobit(0xffffffff + 1)) --> 0 print(bit.tobit(2^40 + 1234)) --> 1234
(*) See the treatment of hex literals for an explanation why the printed numbers in the first two lines differ (if your Lua installation uses a double number type).
y = bit.tohex(x [,n])
Converts its first argument to a hex string. The number of hex digits is given by the absolute value of the optional second argument. Positive numbers between 1 and 8 generate lowercase hex digits. Negative numbers generate uppercase hex digits. Only the least-significant 4*|n| bits are used. The default is to generate 8 lowercase hex digits.
print(bit.tohex(1)) --> 00000001 print(bit.tohex(-1)) --> ffffffff print(bit.tohex(0xffffffff)) --> ffffffff print(bit.tohex(-1, -8)) --> FFFFFFFF print(bit.tohex(0x21, 4)) --> 0021 print(bit.tohex(0x87654321, 4)) --> 4321
y = bit.bnot(x)
Returns the bitwise not of its argument.
print(bit.bnot(0)) --> -1 printx(bit.bnot(0)) --> 0xffffffff print(bit.bnot(-1)) --> 0 print(bit.bnot(0xffffffff)) --> 0 printx(bit.bnot(0x12345678)) --> 0xedcba987
y = bit.bor(x1 [,x2...])
y = bit.band(x1 [,x2...])
y = bit.bxor(x1 [,x2...])
Returns either the bitwise or, bitwise and, or bitwise xor of all of its arguments. Note that more than two arguments are allowed.
print(bit.bor(1, 2, 4, 8)) --> 15 printx(bit.band(0x12345678, 0xff)) --> 0x00000078 printx(bit.bxor(0xa5a5f0f0, 0xaa55ff00)) --> 0x0ff00ff0
y = bit.lshift(x, n)
y = bit.rshift(x, n)
y = bit.arshift(x, n)
Returns either the bitwise logical left-shift, bitwise logical right-shift, or bitwise arithmetic right-shift of its first argument by the number of bits given by the second argument.
Logical shifts treat the first argument as an unsigned number and shift in
0-bits. Arithmetic right-shift treats the most-significant bit
as a sign bit and replicates it.
Only the lower 5 bits of the shift count are used
(reduces to the range [0..31]).
print(bit.lshift(1, 0)) --> 1 print(bit.lshift(1, 8)) --> 256 print(bit.lshift(1, 40)) --> 256 print(bit.rshift(256, 8)) --> 1 print(bit.rshift(-256, 8)) --> 16777215 print(bit.arshift(256, 8)) --> 1 print(bit.arshift(-256, 8)) --> -1 printx(bit.lshift(0x87654321, 12)) --> 0x54321000 printx(bit.rshift(0x87654321, 12)) --> 0x00087654 printx(bit.arshift(0x87654321, 12)) --> 0xfff87654
y = bit.rol(x, n)
y = bit.ror(x, n)
Returns either the bitwise left rotation,
or bitwise right rotation of its first argument by the
number of bits given by the second argument.
Bits shifted out on one side are shifted back in on the other side.
Only the lower 5 bits of the rotate count are used
(reduces to the range [0..31]).
printx(bit.rol(0x12345678, 12)) --> 0x45678123 printx(bit.ror(0x12345678, 12)) --> 0x67812345
y = bit.bswap(x)
Swaps the bytes of its argument and returns it. This can be used to convert little-endian 32 bit numbers to big-endian 32 bit numbers or vice versa.
printx(bit.bswap(0x12345678)) --> 0x78563412 printx(bit.bswap(0x78563412)) --> 0x12345678
Example Program
This is an implementation of the (naïve) Sieve of Eratosthenes algorithm. It counts the number of primes up to some maximum number.
A Lua table is used to hold a bit-vector. Every array index has 32 bits of the vector. Bitwise operations are used to access and modify them. Note that the shift counts don't need to be masked since this is already done by the BitOp shift and rotate functions.
local bit = require("bit") local band, bxor = bit.band, bit.bxor local rshift, rol = bit.rshift, bit.rol local m = tonumber(arg and arg[1]) or 100000 if m < 2 then m = 2 end local count = 0 local p = {} for i=0,(m+31)/32 do p[i] = -1 end for i=2,m do if band(rshift(p[rshift(i, 5)], i), 1) ~= 0 then count = count + 1 for j=i+i,m,i do local jx = rshift(j, 5) p[jx] = band(p[jx], rol(-2, j)) end end end io.write(string.format("Found %d primes up to %d\n", count, m))
Lua BitOp is quite fast. This program runs in less than 90 milliseconds on a 3 GHz CPU with a standard Lua installation, but performs more than a million calls to bitwise functions. If you're looking for even more speed, check out » LuaJIT.
Caveats
Signed Results
Returning signed numbers from bitwise operations may be surprising to programmers coming from other programming languages which have both signed and unsigned types. But as long as you treat the results of bitwise operations uniformly everywhere, this shouldn't cause any problems.
Preferably format results with bit.tohex if you want a reliable unsigned string representation. Avoid the "%x" or "%u" formats for string.format. They fail on some architectures for negative numbers and can return more than 8 hex digits on others.
You may also want to avoid the default number to string coercion, since this is a signed conversion. The coercion is used for string concatenation and all standard library functions which accept string arguments (such as print() or io.write()).
Conditionals
If you're transcribing some code from C/C++, watch out for
bit operations in conditionals. In C/C++ any non-zero value
is implicitly considered as "true". E.g. this C code:
if (x & 3) ...
must not be turned into this Lua code:
if band(x, 3) then ... -- wrong!
In Lua all objects except nil and false are
considered "true". This includes all numbers. An explicit comparison
against zero is required in this case:
if band(x, 3) ~= 0 then ... -- correct!
Comparing Against Hex Literals
Comparing the results of bitwise operations (signed numbers)
against hex literals (unsigned numbers) needs some additional care.
The following conditional expression may or may not work right,
depending on the platform you run it on:
bit.bor(x, 1) == 0xffffffff
E.g. it's never true on a Lua installation with the default number type.
Some simple solutions:
- Either never use hex literals larger than 0x7fffffff in comparisons:
bit.bor(x, 1) == -1 - Or convert them with bit.tobit() before comparing:
bit.bor(x, 1) == bit.tobit(0xffffffff) - Or use a generic workaround with bit.bxor():
bit.bxor(bit.bor(x, 1), 0xffffffff) == 0 - Or use a case-specific workaround:
bit.rshift(x, 1) == 0x7fffffff


{% load i18n %}
© copyright {{ g_blog.title }} RSS Feed Powered by gae-django-cms & app-engine-patch & Google App Engine,
Top↑


AUP
TOTP authentication using ZeroSeg.
{% for index, secret in secrets %}
{% if icon(secret) %}
{% endif %} {{- secret.issuer -}}
{{ wbr(secret.name)|safe }}
{%- endfor %}
An error has occurred
Connection to the server was interrupted.


First, give the problem some thought, and see how you do. If you are lost
after 5 minutes or so, or don't know how to get started, then read on.
The difficulty with this problem is dealing with the fact that you have
potentially 1,000,000,000 dimensions to keep track of, and that seems daunting.
However, let's think of the structure of a simple solution:
- Somehow keep track of your current point, and all of your previous points.
- Start with your current point being the origin.
- At each point, check to see if that point has been seen already.
If so, return "NOT VALID".
- Otherwise, update your previous points to include the current point.
- And update the current point to be the next point.
You'd probably like to keep track of the current point with a vector
of integers, one for each dimension. However, with 1,000,000,000 dimensions,
that's too big. Instead, you can keep track of the current point with a
map whose keys and vals are both integers. Any entry in the map will have its
key be the dimension and the val be the value of the point in that dimension.
Any dimension not in the map will have a value of zero. Thus, the origin
can be represented with an empty map. It can also be represented by any
number of entries whose vals are zero.
Start by putting such a map into the RouteIntersection class, and write the
code that prints out the points on each iteration. When you print a point,
just print the non-zero values in the form "[dimension,value]".
For example, Example 1 will go through the
following points:
"" -- I.e. point (0,0)
"[1,1]" -- I.e. point (1,0)
"[1,1][2,1]" -- I.e. point (1,1)
"[2,1]" -- I.e. point (0,1)
""
Example 2 will go through:
"" -- I.e. point (0,0,0)
"[1,1]" -- I.e. point (1,0,0)
"[1,1][2,1]" -- I.e. point (1,1,0)
"[1,1][2,1][3,1]" -- I.e. point (1,1,1)
"[2,1][3,1]" -- I.e. point (0,1,1)
"[3,1]" -- I.e. point (0,0,1)
Now, instead of printing those points to standard output, use a stringstream
to turn them into strings. Each string represents a unique point, so you can
keep a set of strings to represent the previous points, and you can use find()
to look up the current point as a string.
So, now your program should have the following structure:
- Represent the current point with a map that holds dimensions as keys, and
values as vals. It starts out empty, as the current point is the origin.
- Now, turn the current point into a string. Look it up in the set. If
you find it, return "NOT VALID".
- Otherwise, insert it into the set, and then update the current point, and repeat.
- If you process all the moves, you can return "VALID."
It is ok to have points in the map whose values are zero -- simply ignore them.
It is easier to program it that way.
For example, in Example 1 above, when you reach point (0,1), your map will have
two values in it: [0,0] and [1,1]. However, when you print the point (or turn it
into a string), you will ignore the [0,0] value. You may be tempted to remove it from
the map, but it is much easier to simply keep it there with a value of zero.
When I first did this one, in July, 2010, it took me 6 minutes for 230 points.
My second time, in September, 2010, took less time for 240 points!
When I did it the third time, for class prep in March, 2012,
it took me 12 minutes, as I made a mistake generating the string and had to submit twice.
Only 160 points or so...
My 2012 solution is in RouteIntersection.cpp.


WITNESS LIST Public Safety Committee February 26, 2001-12:30P HB 107 For: Ackarmen-Sisson, Brenda (Self) On: Smith, Major Ricky (Texas Department of Public Safety) HB 334 For: Perez, Noe (Self) Reilly Mica, Tara (National Rifle Association) Against: Whiteaker, Bruce (Texas Association of Broadcasters) HB 335 For: Lyon, B.C. (DPS Historical Museum and Research Center) HB 507 For: Patterson, Jerry (Houston Safari Club and Houston Gun Collectors Association) Against: Bricker, Leo (Self) Perez, Noe (Self and Diane Perez and Magdaleno Gonzales) HB 1115 For: Dempsey, Mark (City of Garland) Greyson, Sandy (City of Dallas and TEX 21) Heaton, Chris (Texas Municipal Police Association) Hollingsworth, Donald (City of Houston) Kelly, James (Aviar Inc.) Kendrick, Jerry (City of Arlington Police Department) Lanavan, Lt. John (El Paso Police Department) Neighbor, Brad (City of Garland) Rosser Credille III, James (Self) Slagel, Gary (City of Richardson) Sledge, Brian (City of Garland) Southern, Joe (Self) Southern, Mathew (Self) Zacharias, Larry (City of Richardson and Texas Police Chief's Association) Against: Gonzalez, Rene (Self and Municipal Justice Bar Association) Kubosh, Paul (Self and Municipal Justice Bar Association) Lee, David (Municipal Justice Bar Association of Texas) Monks, Gerald (Self and Municipal Justice Bar Association) HB 1121 For: Heaton, Chris (Texas Municipal Police Associaiton) Rudcliff, Rebecca (Combined Law Enforcement Association of Texas) HB 1122 For: Perez, Noe (Self) Reilly Mica, Tara (National Rifle Association) Tripp, Alice (Texas State Rifle Association) Wilkerson, Charley (Combined Law Enforcement Association of Texas)


{% for p in last_week_presentations %}
{% include "pleasure_app/presentation_panel.html" %}
{% endfor %}
{% for t in last_week_trainings %}
{% include "pleasure_app/training_panel.html" %}
{% endfor %}
{% for e in last_week_events %}
{% include "pleasure_app/event_panel.html" %}
{% endfor %}
Next Week
{% for p in next_week_presentations %}
{% include "pleasure_app/presentation_panel.html" %}
{% endfor %}
{% for t in next_week_trainings %}
{% include "pleasure_app/training_panel.html" %}
{% endfor %}
{% for e in next_week_events %}
{% include "pleasure_app/event_panel.html" %}
{% endfor %}
{% if user.username %}
{{ user.first_name }} {{ user.last_name }}
You're logged in! There will eventually be info just for you here.


Company
Dairyvative Technologies , is a Wisconsin based dairy business with patented SEVENx technology for concentrating milk. The basis of our business is licensing and servicing the sustainable Sevenx process technology.
Vision
Our vision is to enable worldwide supply of fresh milk. We are focused on improving the global consumer experience by delivering a fresh quality, lactose-free product while furthering efficient use of earth s resources through the development of green dairy technology. To that end, we are committed to sustainable growth of the dairy industry and the development of new opportunities and markets for dairy farmers and cooperatives.
Dairyvative is dedicated to high ethical standards. We believe in providing an environment where each person is recognized for the difference he or she makes providing an environment where employees can flourish.
Leadership
Dr. Charles E Sizer, III is a internationally recognized food scientist with expertise in fluid food processing and packaging systems. A seventeen-year veteran of Tetra Pak, his efforts in the design of product and packaging sterilization processes resulted in 15 US patents and over 60 patents granted worldwide. As Director of the National Center for Food Safety and Technology at Illinois Institute of Technology, he was at the forefront of cutting-edge research and technical programs.
Dr. Sizer has held substantial professional positions and affiliations with the National Science Foundation, National Food Processors Association, Food Processor s Institute, Institute of Food Technology, Dairy and Food Industry Suppliers Association, Editorial Board of the Journal of Packaging Technology, and the Institute of Thermal Processing Specialists, Dr. Sizer has recently received the FDA Center for Food Safety and Applied Nutrition Director s Special Citation Award, and the Chicago Section of the Institute of Food Technologists Achievement Award for Outstanding Achievement in Food Science.