When you start writing your code in C, C++ or any other programming language, your first objective might be to write a program that works.
After you accomplished that, the following are few things you should consider to enhance your program.
- Security of the program
- Memory consumption
- Speed of the program (Performance Improvement)
This article will give some high-level ideas on how to improve the speed of your program.
Few general points to keep in mind:
- You could optimize your code for performance using all possible techniques, but this might generate a bigger file with bigger memory footprint.
- You might have two different optimization goals, that might sometimes conflict with each other. For example, to optimize the code for performance might conflict with optimize the code for less memory footprint and size. You might have to find a balance.
- Performance optimization is a never-ending process.  There is always more room for improvement to make your code run faster.
- Sometime we can use certain programming tricks to make a code run faster at the expense of not following best practices such as coding standards, etc. Try to avoid implementing cheap tricks to make your code run faster.
1. Optimize your Code using Appropriate Algorithm
For any code you write, you should always take some time to think through and pick the right algorithm to use for your specific scenario.
The problem we are going to analyze for this example is to find a maximum value of the function in a two dimensional segment.
We’ll consider only whole numbers.
First we’ll write the program without consider performance. Then, we’ll discuss few ways to boost the performance of this program.
Our Scenario: We have interval for x [-100…100] and interval for y [-100…100]. Now in these two intervals we are looking for a maximum of the function (x*x + y*y)/(y*y + b).
This is a function of two variables: x and y. There is one more constant which could be different and user will enter it. This constant b is always greater than 0 and also lesser than 1000.
In our program ,we will not use function pow() that is implemented in math.h library. It would be interesting exercise to figure out which approach would create faster code.
Example code:
#include <iostream> #define LEFT_MARGINE_FOR_X -100.0 #define RIGHT_MARGINE_FOR_X 100.0 #define LEFT_MARGINE_FOR_Y -100.0 #define RIGHT_MARGINE_FOR_Y 100.0 using namespace std; int main(void) { //Get the constant value cout<<"Enter the constant value b>0"<<endl; cout<<"b->"; double dB; cin>>dB; if(dB<=0) return EXIT_FAILURE; if(dB>1000) return EXIT_FAILURE; //This is the potential maximum value of the function //and all other values could be bigger or smaller double dMaximumValue = (LEFT_MARGINE_FOR_X*LEFT_MARGINE_FOR_X+LEFT_MARGINE_FOR_Y*LEFT_MARGINE_FOR_Y)/ (LEFT_MARGINE_FOR_Y*LEFT_MARGINE_FOR_Y+dB); double dMaximumX = LEFT_MARGINE_FOR_X; double dMaximumY = LEFT_MARGINE_FOR_Y; for(double dX=LEFT_MARGINE_FOR_X; dX<=RIGHT_MARGINE_FOR_X; dX+=1.0) for(double dY=LEFT_MARGINE_FOR_Y; dY<=RIGHT_MARGINE_FOR_Y; dY+=1.0) if( dMaximumValue<((dX*dX+dY*dY)/(dY*dY+dB))) { dMaximumValue=((dX*dX+dY*dY)/(dY*dY+dB)); dMaximumX=dX; dMaximumY=dY; } cout<<"Maximum value of the function is="<< dMaximumValue<<endl; cout<<endl<<endl; cout<<"Value for x="<<dMaximumX<<endl <<"Value for y="<<dMaximumY<<endl; return EXIT_SUCCESS; }
Now, if we analyze the code more carefully, we notice that the part for dX*dX is calculated more times than it should, in this case it is calculated 200 times and this is a was of CPU time. What we could do?
One of the trick is to create one variable dX_Squer = dX*dX, and calculate after first for repetition, then we could use that in all calculations afterwards. You just need to add one more brackets.
There are few more optimizations you can do in the above code, just try to spot them.
The next point we could consider is how general our algorithm is, versus how optimal is it from speed point of view.
In that case we could apply few algorithms depending on the size of input set. What do we mean by that?
For example, in one our earlier c++ articles, we discussed about binary numbers that have only two ones in many zeros.
We could use MVA algorithm that could outperform the original algorithm from speed point of view on smaller numbers, the ones that are fit for unsigned long long int, but if you use my algorithm combined with vectors it could be used in some problems where you try to pick two objects that are in set.
So, in order to create the best possible solution you could merge two algorithms and apply one according to the size of the problem. So, if the number used is smaller than unsigned long long int, you could use first algorithm and if number will not fit already mentioned type of data you could use vectors or some other data structures.
Similar to this would be addition of numbers, where it is simple to consider case of long long int, but in case we need to add to big numbers that are in size way bigger than unsigned long long int you could use vectors to store them and apply operation of addition with your algorithm. If you prefer classes you could use them to, but if you don’t need OOP approach you could just use double linked list or arrays or some other more appropriate data structure.
2. Optimize Your Code for Memory
Now we will look how you could optimize your code from point of memory consumption.
Let us take a simple example. Let us try to swap two values in the memory, which is done in many sorting algorithms.
Some people like to think of this as two people sitting on two chairs and adding one more chair as temporary holder for one of them during the swap.
int nFirstOne =1, nSecondOne=2; int nTemp = nFirstOne; nFirstOne = nSecondOne; nSecondOne = nTemp;
This is nice. But usage of nTemp which in memory reserves some place that will be used for copy of one variable.
This could be done without nTemp like this:
int nFirsOne = 3, nSecondOne = 7; nFirstOne += nSecondOne; nSecondOne = nFirstOne ? nSecondOne; nFirstOne -= nSecondOne;
In some cases you could have large objects in memory that need to swap their places. So, what could you do? Instead of coping to many memory locations you could use their addresses and instead of replacing all of the memory locations you could just change their address.
How do you know if your code is faster and how do you calculate it?
Well, when you finish your code it will translate in some assembler and then into something that is called machine code. Each operation is performed in processor or in some other part of computer like mathematical coprocessor or in graphic card or something similar.
One operation could be done in one clock circle or few, this is the reason why it could be faster to multiply than to divide, but it could be also important did you pick some optimization done by your compiler.
Sometimes, the task of optimization could be left to compiler. For all available C++ compiler, check this GCC Optimization Options.
To understand how fast program is, you should know the architecture of a device you are working with. Sometimes things become faster because your program is in the cache memory or you use mathematical coprocessor or because branch predictor got it right most of the times.
Now let’s consider these numbers O(n), O(log(n) *n), n*n, n!. To estimate the algorithm according to the size of the input set you use this numbers.
If you have an algorithm of size n and you input 10 elements you get time t, and if you input 100 elements you will end up with time 10 times longer than t. If you deal with a program that has equivalent to n*n and you increase the size of set from 10 to 100, the program will not be 10 times slower but rather approximately 10*10 times. You should be aware of these types of limits a number can have on your algorithm.
Some people think that they could time the code and have good idea how fast the algorithm is. Ok, let us think. Most of the programs you write are not in kernel mode, which means that they could be stopped by operating system and processor could be given to another task and so on. This means that your program will be stopped and started many times. It could be even tougher to figure out what could happen to program if you have few cores or even processors.
Idea of measuring the speed of algorithm is pretty iffy. Well, the results are just useful as a snowflake on a North Pole or like hand of sand in desert.
The only good results are if you find a way to prevent your program from losing the core he is in, or perhaps to stop the counter of time and then continue, but you need to eliminate interrupt time that will be added each time you stop your program, as well as the starting initializations.
There are also differences you will notice due to the fact that same code will not be transformed into machine code if you apply different optimization, and as you should know that already one product could translate code in different way than some other version, by the way it is important what architecture is it executed as well and also due to installed amount of memory, cache memory, prediction methods, etc.
3. printf and scanf Vs cout and cin
Sometimes, if you use different functions for same task you will get faster code.
Those first two functions are mostly used in C style of programming, but you could use it sometimes with file manipulation and small difference in speed could add up a lot saved time.
For example, let us assume that you have numbers in a file to read.
From point of security, cout and cin would be considered as better option for files, as you would have adequate instructions in fstream header.
If you use C or printf in C++ you should consider some other functions that could even more increase the speed of your program.
For strings you could use puts, gets or their equivalents for file operations. Well they are not formatted and to write data in one way takes some time.
4. Using Operators
Most basic operations like +=, -=, and *=, when applied on basic data types could slow down the program as well. To be sure you will need to know how it gets transformed into assembler on your computer.
One interesting idea is to replace postfix increment and decrement with their prefix versions.
Sometimes you could try to use operators >> or << instead of multiplication or division, but be very careful, you could end up with bad mistake this way, and then to fix it you could add some range estimations and that will be way slower than original code you have started with.
Bit operators, and tricks that go with them could increase the speed of program, but you should be very careful because you could end up with machine dependant code and that is something to avoid. To be sure, you could still code with add move from assembler in C++.
It is important to understand that this is hybrid language and it will support assembler coding, problem orientated solutions, the object orientated solutions, and if you add some additional libraries you could use some more advanced tricks that are not commonly used.
5. if Condition Optimization
If you use if in your code, when possible, it is a good idea to replace if with switch. In “if”, you usually have tests and that could produce code that is bit slower.
One good fact to know about if command is to know that it has some of the optimizations built in. Well, if you have few conditions that are connected with && or || it could be evaluated that this is true or false without calculating complete expression.
Let us illustrate this with two condition that are connected with && operator. If you have expression p and q, as soon as you have p equal to false you know that there is no way to get true as a result, this is used in C/C++ and sometimes it could be reason why people do get wrong code.
If you have situations in which you could say that something could occur more often put it before, because there is a better chance to say that expression is false or true. If you have many conditions to calculate, and if they could be sorted, consider splitting that range into few sub ranges first.
One bad thing that could happen is that you create the branch that will never be used or even few lines of the code that could be added and you will never use those cases.
Sometimes you will have a very long expression composed of many conditions, one could use function that will return true or false, but functions are expensive, they use stack and few copies could be created, if possible you could use a macro or a macro with a variable to increase the speed and create code that will be more easy to maintain.
Also, don’t forget that negation is an operation too.
6. Problems with Functions
While using functions, if you are not careful, you might end-up creating a bad code.
For example, if you have a code like this, it might be a bad thing.
for(int i=1; i<=10; ++i) DoSomething(i);
Why? As soon as you code something like this you will have to call DoSomething 10 times, and we have mentioned that function calls could be expensive.
To implement this better, you could do it like this, and implement that for repetition in your function.
DoSomething(n);
Next thing to consider is inline functions. There is a chance that they will be used like macros if they are small. This way you benefit from point of speed, from point of better organization, and as well as reusability.
When passing a big object to a function, you could use pointers or references. Prefer to use references because they would create the code that is way easier to read.
If you are not worried about the changing the value that is passed to the function, use references. If you use object that is constant, it could be useful to use const, which will save some time.
When you use C that will support C99 standard you have option to use restrict on pointers to.
In certain situations casting in function might increase the speed of the code. You should consider this depending on your specific situation.
Creating temporary objects in the function could slow the program. I have already shown how you could avoid using temp variable in some situations.
Also, while recursion is extremely helpful in certain specific scenarios, in general, it will generate a slow performing code. If possible, try to avoid recursion, when you don’t need to use it to solve your problem.
7. Optimizing Loops
If you like to check if a number is lower than 10 or greater than zero, pick the second option.
It is faster to test if something is equal to zero than to compare two different numbers.
In other words, the following is slower when compared to the alternative option shown below:
for( i =0; i<10; i++)
The following is faster when compared to the above for loop. But, this might be harder to read for beginners.
for(i=10; i--; )
Similar to this is case if you are in a situation where you could pick form !=0 and <=n, use the first one it will be faster. For example, when you try to calculate factorial in the separate function.
It is better to avoid loop in situations where you have few functions called with different arguments that are ranging from 1 to 5, it is better to use linear calls with five calls.
If you are in the situation to use: one loop and few tasks or few loops with one task in each loop. Pick the first option. It is a trick that could generate faster code. I am not sure, but compiler probably could not optimize this still.
8. Data Structure Optimization
Is the data structure that we use affect the performance of the code?
The answer this this question is not simple, that you could expect from simple math. It is rather vague and hard to formulate.
To illustrate my statement, we will analyze one example. If your task is to create permutations that are like the following, then you could use array or linked list.
1, 2, 3, 4, 2, 3, 4, 1, 3, 4, 1, 2, 4, 1, 2, 3,
If you use array, you could copy first element and move all others toward first element and then move the first element at the last place. This would create so many not needed operations that your program or a function would be very slow.
If you keep your data in the list, you could very easy create the program that will outperform one with array we have mentioned.
Sometimes, if you save your data in some form of tree you could create program that will perform faster than the one without adequate data structure.
Be careful when using data structure. Sometimes a problem could be solved without keeping all elements of array or using any data structure at all.
To elaborate on this subject, refer to the discussion we had on the Fibonacci algorithm. If you look at the Fibonacci elements you could be tricked in applying the vector in combination with recursion, but instead you could use some trick from applied math to create very fast code.
9. Binary Search or Sequential Search
Should we use binary search or sequential search to solve a problem?
One of the common tasks we need to do when we program is to search for some value in some data structure. Yes, it is basis for a hash tables, multi-level hash tables, etc.
If you are trying to find one number in an array of numbers you could have two strategies.
The first strategy is very simple. You have your array and value you are looking for. From beginning of the array you start to look for the value and if you find it you stop the search, and if you don’t find the value you will be at the end of the array. There are many improvements to this strategy.
The second strategy requires the array to be sorted. If array is not sorted you will not get the results that you wish for. If the array is sorted you split it in two half. In the first half, the elements of array are smaller than the middle one in another half the elements are bigger than the middle one. If you get yourself in situation that two markers are not situated the way they should you know that you don’t have the value you have been looking for.
What is the dilemma here? If you sort elements of array you will lose some time, but if you invest in that you could benefit from faster binary search.
This is one of situations where you would need to understand the problem well and act according to best possible situation based on your specific scenario.
10. Optimizing Arrays
The array is one of the most basic data structures that occupy some space in memory for its elements.
To understand how these optimizations work, you should be aware of the arrays structure. Ok, what do I mean by this. The name of array is a constant pointer that points at first element of an array. This means that you could use pointers and pointer arithmetic.
If you access members of array like this:
for(int i=0; i<n; i++) nArray[i]=nSomeValue;
Instead of the above code, the following is better:
for(int* ptrInt = nArray; ptrInt< nArray+n; ptrInt++) *ptrInt=nSomeValue;
The reason for this is in the operations with pointers. In the above example, we have pointer to int data type that takes address from the name of the array. In this case, it is nArray, and we increase that address for one element, and the pointer is moved toward the end of the array for size of int data type.
If you have used double, your compiler would know how far it should move the address.
It is way harder to read code this way, but it will increase the speed of program. In other words, when you don’t use better algorithm, but your program still runs faster, the increased speed might be due to better syntax that will generate faster code.
If you use matrix, and you have chance to approach the elements of matrix row by row or in some other manner you should always pick to go row after the row in your matrix. The matrix is an array of arrays it will be stored in memory row after the row, so the most natural way to do approach the array members is to go row by row.
Avoid initialization of large portions of memory with some element. If you could not avoid this type of situation, consider memset and similar commands.
When you use array of chars, these are sometimes called strings in style of language C, you could create faster code if you use pointers trick as well. If you use string as instance from C++ class, you might feel more comfortable, but you could create slower code and sometime even the a bigger file size.
If you use new to create your array, your program could perform badly because you use a lot of growth in memory at one moment, which is the reason why you should use vectors. They will add some space in memory and grow in better way.
If you try to move large set of data in memory, you could use array of pointers. This way, you will not move the real data in memory, but replace the addresses instead.
{ 23 comments… add one }
using inline functions cautiously can improve performance.
declare constants value holding variables as constants, so that compiler can optimize accessing those values,
This one is promising.
In my opinion, optimisation is best left to the compiler. Picking the optimal algorithm and implementing it wisely is of course up to the programmer, but ‘microoptimization’, e.g Your for-loop example and array access using pointers is best left to the compiler. In the case of array access, the (good) compiler will use pointers anyway.
One useful ‘hand optimization’ however is to use the appropriate data type for the job at hand. Don’t use float or dpuble if an integer type will do, use unsigned insted of integer if possible.
Just my two cents.
@santosh ydv
is this some improvement for encryption thing, I mean ydv, or U just hate: a,e, i, o, u ?
Nice comment it is useful in some situations. THX!
@Erlo Haugen it would be best to create computer that wold make programs. So, there would not be dissccusions about this.
Some compilers would be able to use one thing and some not, it might be problem for people that don’t understand the pointer syntax.
It is worth investing into it.
Appropriate data type for pro is bid different than this data types used like, but it is not an issue to use them, however I would like to have them changed even in C++ standard, …
Stingy from you ….
I have not covered all tricks, I hope people would contribute with some of they own, that would be point of C++ and open source, wouldn’t it?
‘And nice picture to go with it>
http://osborne-friends-hannover.de/Stiere/toro_06.jpg-for-web-LARGE.jpg
Ok!
This one is for swap of addresses>
int* ptrTemp= i;
i = j;
j = ptrTemp;
This way you only exchange the addresses. It is basis for exchange of pointers that are in an array.
There are few more C++ optimization tutorials: 1. here 2. here 3. here 4. here 5. here
Yeah, like after party!
>> nSecondOne = nFirstOne ? nSecondOne;
This line should be
nSecondOne = nFirstOne – nSecondOne;
One thing that could be influenced by operating system.
If you have connection to the Internet you would need more security.
If you are not connected to the internet you would not need complete safety thing.
One idea to consider if it is not implemented already.
Yeah!
One thing I am sure about do. I will never write the article that will try to persue the programmer to trust their compiler any way…
It is just not my kind of compiler, we have open source we could trust to!
Obvious difference, for real!
HI!
One thing I know, I will never write the article that has purpose to convince people to use optimizations by their compiler.
If you don’t believe you could check it and you could double check with source code as well.
Have nice day!!!
Yes this is ok, as well
http://en.wikipedia.org/wiki/International_Women%27s_Day
to all woman that celebrate that!
how can i optimize this code snippet
result = 1
for (int32_t x = 1, pxcount = 0; primes[x] <= n; ++x, pxcount = 0) {
for (int32_t y = primes[x]; y <= n; y *= primes[x])
pxcount += n / y;
result = (1ll * result * (pxcount + 1)) % m;
}
Here,
I am trying to find the total no of divisors of n! but a sqrt(n) approach is possible i think which i am not able to find out
@Kiran nice job!
@Avinish, yes sqrt(n) works, however in your case I would recommend you to check some results from number theory, it would generate way faster code.
For this one, I am not 100% sure.
Have nice time!
1. Optimize your Code using Appropriate Algorithm
Don’t use the ::pow() function. This is right.
The other optimization hints are done by compilers when they are not older than 20 years. Or 25 years.
It is called Common Subexpression Elimination. It becomes common in the 32 bit era.
Also note that floating point is faster than integer, so avoiding floating point often slows down programm. 25 years ago this was different.
When you really want to optimize the code, use mathematics.
1st:
Traversing from -100 to +100 is not necessary. f(x,y)=f(x,-y)=f(-x,y)=f(-x,-y).
Traversing from 0 to 100 is sufficient.
2nd:
The maximum of (X*X + Y*Y)/(dB + Y*Y) if found on the maximum of |X|.
Traversing Y from 0 to 100 with a constant X of 100 is sufficient.
3rd:
For dB > 0 f(x,y) is monotonic. The maximum is found on the boundary of the range.
You need only to check f(100,0) and f(100,100).
4th:
Even this you can reduce to
const int maxX = MAX_ABS_X
const int maxY = (dB < maxX) ? 0 : MAX_ABS_Y
const double max = f(maxX, maxY)
This is the easiest way to speed up code by a factor of nearly 10^5.
This is the ratio between the frequency of modern CPUs and frequency of visible light.
This is the ratio between a modern dual socket Workstation and the fastest computer in the world, the Tianhe-2.
Most of the other hints are also outdated by 20 to 25 years. They reduce readability and have absolutely no effect (10) or slow down code (2,4,5,6,7).
You could use this.
and then you could look for the ….
or if you know the outcome before it happened it would be very fast to write it right now…
…newer gonna get it…
Your suggestions are insulting to …. primary school student…
Hmh.
It could be done in multi threading fashion and I don’t like things that are …
The fastest approach is to know where to expect the maximum or minimum and look at those areas not all the way around…
Some of your suggestions are not usable …. they require some of the knowledge that is best explored by AI stuff, and that is beyond this thing ….
Some of them are valid, and it is due to the problems that arise due to the bad documentation of translation…
Leaving it all to compiler to optimize?!?
…I talk to Frank…
your comment is obsolete! Have no time for ….
For those who code in Java, Pascal, Visual Basic and other stuff they do reduce readability, but for those who code in C/C++ and know how to use vectors and stuff…
generality of the algorithm is what you lose with your suggestions …
by the way it is not 100% clear because some compiler do optimize in one way and due to some other switches it will go another way….
sometimes it is good to make it do what you would need im to to do…
that is a long list of …. like you add some more butter and it is Ok, or you have more light and it is ok…
In order to say that thing that you say you would need to use compilers that are different and compare it all to …
which make you the one that is …
All points from 1 to 4 will be useles unles you use some of the artificial inteligence with it. If you know what is the outcome there is no need to use this program at all.
Your sugestions could be capitalized on when you have some math pharser and then it will not bring speed ups like that…
Well, float is very usefull,… tell that to your enemies…
Sometimes, you need to have more control over compiling and then you would need those optimizations…
Some compilers use different optimizations, and it is not the best idea to leave it all to coputer and compiler…
Frank your comments and insights are very usefull!
I guess no, then.
Okay!
Your suggestions could be observed from two points.
Firs is when you try to use some math and in order to use that you would need to calculate values and use calculator and stuff… That make it not useful at all.
From second point of view it should have some AI parser that will be able to analyze the code and then capitalize on it, and then calculations that are performed are not correct…
About your comment on” Common Subexpression Elimination “, I will not use my time it is too valued to … spent on explaining it all to, …
in would take too long to explain what is not correct in your comment.
Will all respect to deep C++ knowledge, you need to understand that you code is compilable. which means that it will be parsed once and then its up to compiler how to optimize it best. and believe me – it knows what its doing. for so many years it did as we ask and NEVER turn us (at least me) down.
1. optimize architecture first then algorithm.
2. optimize algorithm first then code
3. prefer better readability than optimization.
 “Code for developers. Not for machines”
Anyway – good article to read but it conflicts with “keep it simple” paradigm in many places 🙁
A lot of your points are very likely optimizable very easily by the compiler – e.g. I don’t see how *= can get beaten by <<= unless your handling a weirdly developed wrapper class, or function inlining making the for tip irrelevant.
It is a bad thing to advice to sacrifice readability for mere optimizations that probably aren't even a thing or are quite trivial if they're really not mandatory in the spot they are in.


Police investigating hit and run involving crossing guard in Waterloo
It happened Thursday afternoon near Cedarbrae Public School
by Erin AndersonPolice are investigating after a crossing guard was hit by a vehicle near a public school in Waterloo.
The incident happened at Cedarbrae Avenue and Sunnydale Place on Thursday, around 3:40 p.m.
According to Waterloo Regional Police, a crossing guard was hit by a pick-up truck while helping students cross the road.
A 55-year-old woman suffered serious, but non-life threatening injuries. No kids were injured.
Police say the involved truck didn’t stop and fled the area.
Anyone with information, including witnesses, should call police or Crime Stoppers.


{# ------------------------------------------------------- #} {# LIST VIEW OF ALL COMPANIES #} {# ------------------------------------------------------- #} {% extends "templates/partials/base.html" %} {% block title %}{% parent %} / The Scene / Companies{% endblock %} {% block content %}{% spaceless %} {% set data = cms.companies %} {% set data = data|sort('name', false) %}
We know you love to keep tabs on your favourite companies in the opera game (that's okay, we do too). To help you with that, below are all the companies we have written about on Schmopera!
We work hard to keep this list up to date and with all current information, but sometimes we make mistakes. If you spot something, if your name is on the list and you'd like us to tweak something, or if you have been done a great injustice and your name is not on the list, just email us at<EMAIL_ADDRESS>and we'll make it right as rain.
Either search for a company's name, or search for a type of company to get started. Try searching for Opera or Theatre, for example.


---
layout: post
title: The etiology of "The shrimp fucks the cabbage"
date: '2008-05-15T23:54:00.001+08:00'
author: Fabian R. Lischka (利飛鵬)
tags:
- Chinese
modified_time: '2008-05-15T23:57:23.788+08:00'
blogger_id: tag:blogger.com,1999:blog-6901078363746377142.post-499519488525116470
blogger_orig_url: http://wheresfab.blogspot.com/2008/05/etiology-of-shrimp-fucks-cabbage.html
---
here at the wonderful Language Log.


-[ background ]-
This is the sixth year that I’ve participated in NaNoWriMo, and (at least) the third year that I have used a spreadsheet to track my word count. Given that, as any WriMo knows, half (or more) of NaNoWriMo is spent avoiding actually writing one’s novel, I’ve spent far too long on this. The version from 2007 is lost, I’m afraid, but the sheet I created in 2008 has survived (and been tweaked incessantly so far this year). And that, dear reader/writer, is what I’m bringing to you. Behold!
Why am I “releasing” this? After all, there are over 300,000 hits when one googles “nanowrimo word count.” Not all of these are trackers, but you get the idea. There are web-based trackers and there are other Excel-based trackers.
Why, you ask? I figured that someone somewhere might find a use for it. Maybe I should have googled this before I built my own, though…but I still like it. Besides, it has given me a way to procrastinate during the past two Novembers.
Using it should be pretty intuitive, I think, but comment if you need help. It makes several assumptions (ie., dates are for November, total word count goal is 50,000, etc.), though these should be easy to change if you’re familiar with Excel. Perhaps there will be another version later that allows these to be variable. We shall see!
-[ features ]-
-[ screenshots ]-
Check out these screenshots! See how far behind I am!
The Tracker Itself
Summary Statistics
Total Chart, showing wordcount relative to goal for the month
Daily Chart, showing wordcount relative to goal on a daily basis
-[ license ]- NaNoWriMo Tracker v.02 by Scumdog Steev is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
-[ download ]-
| [ releases ] | [ all files ] | [ Excel 2003 version ] | [ Excel 2007 version ] |


Zoom to marker
When clicked we will zoom down to a marker, spiderfying if required to show it and then open its popup


{% extends 'base_responsive.html' %} {% load staticfiles %} {% load humanize %} {% block title %}Consumer Complaint Database{% endblock %} {% block content %}
We're currently experiencing technical issues that have delayed the refresh of data in the Consumer Complaint database.
We're currently experiencing technical issues that have delayed the refresh of consumer complaint narratives in the Consumer Complaint database.
We expect to refresh the data in the next few days.
Each week we send thousands of consumers’ complaints about financial products and services to companies for response. Those complaints are published here after the company responds or after 15 days, whichever comes first. By adding their voice, consumers help improve the financial marketplace.
Consumers have let us know they want to share their complaint descriptions so others can learn from their experience.
View, sort, and filter data right in your browser.
All complaint data we publish is freely available for anyone to use, analyze, and build on.
{{ timely_responses|intcomma }} company responses to consumer complaints
{{ stats.percent_timely|floatformat|add:"%" }} of complaints sent to companies get timely responses
By submitting a complaint, consumers can be heard by financial companies, get help with their own issues, and help others avoid similar ones. Every complaint provides insight into problems that people are experiencing, helping us identify inappropriate practices and allowing us to stop them before they become major issues. The result: better outcomes for consumers, and a better financial marketplace for everyone.
Have an issue with a financial product or service? Add your voice. Submit a complaint
{{ timely_responses|intcomma }} company responses to consumer complaints
{{ stats.percent_timely|floatformat|add:"%" }} of complaints sent to companies get timely responses
These are real complaints from consumers who have opted to share their descriptions of what happened. The complaints were pulled randomly from the database.
Consumer complaint narrative is the consumer-submitted description of “what happened” from the complaint. Consumers must opt-in to share their narrative. We will not publish the narrative unless the consumer consents and consumers can opt-out at any time. The CFPB takes reasonable steps to scrub personal information from each complaint that could be used to identify the consumer.
The company's optional, public-facing response to a consumer's complaint. Companies provide a public response to the CFPB, for posting on the public database, by selecting a response from a set list of options.
The type of sub-product the consumer identified in the complaint. For example, “Checking account” or “Non-federal student loan”
Data that supports easier searching and sorting of complaints submitted by or on behalf of consumers. For example, complaints where the submitter reports the age of the consumer as 62 years or older are tagged, ‘Older American.’ Complaints submitted by or on behalf of a servicemember or the spouse or dependent of a servicemember are tagged, ‘Servicemember.’ Servicemember includes anyone who is active duty, National Guard, or Reservist, as well as anyone who previously served and is a Veteran or retiree.
The issue the consumer identified in the complaint. For example, “Deposits and withdrawals” or “Repaying your loan”
The consumer’s reported mailing state for the complaint
The date the CFPB received the complaint. For example, “05/25/2013”
This is how the company responded. For example, “Closed with explanation”
Identifies whether the consumer opted in to publish their complaint narrative. We do not publish the narrative unless the consumer consents and consumers can opt-out at any time.
The Consumer Complaint Database is a collection of {{ total_complaints|intcomma }} complaints, on a range of consumer financial products and services, sent to nearly 3,000 companies for response. We don’t verify all the facts alleged in these complaints, but we take steps to confirm a commercial relationship between the consumer and the company. See publication criteria
Since we started accepting complaints in July 2011, we’ve helped consumers connect with financial companies to understand issues with their mortgages, fix errors on their credit reports, stop unlawful calls from debt collectors, and get direct responses about problems with their credit cards, bank accounts, private student loans, and more. We analyze the data to identify trends and problems in the marketplace to help us do a better job supervising companies, enforcing federal consumer financial laws and writing rules and regulations. We publish reports on complaints and share information with state and federal agencies.
The database generally updates nightly, and contains certain information for each complaint, including the source of the complaint, the date of submission, and the company the complaint was sent to for response. The database also includes information about the actions taken by the company in response to the complaint, such as, whether the company’s response was timely, how the company responded, and whether the consumer disputed the company’s response. If the consumer opts to share it and after we take steps to remove personal information, we publish the consumer’s description of what happened. Companies also have the option to select a public response. Company level information should be considered in context of company size and/or market share. Complaints referred to other regulators, such as complaints about depository institutions with less than $10 billion in assets, are not published in the Consumer Complaint Database.
Our reports highlight some of what we’re seeing in the complaints we handle, but know there are more ways to use, analyze and build on the data. That’s why we make it possible for you to download the data, once we have taken steps to remove personal information.
Looking to export our data and have more control over it? Use our Open Data API.
For instructions and examples, refer to Socrata’s API documentation


What do the following passages say about the process of our transformation?
Romans 12:1-2
2 Corinthians 3:17-18
Peter’s journey is characterized by ups and downs along the way. Sometimes he shows his rocklike faith by walking on water to meet Jesus. Sometimes he sinks like a stone. But as we follow his life, we’ll find that he does change and grow and ultimately live into the name Jesus has given him.
Your journey likely has ups and downs as well. Sometimes you may look like a poster child for the changes faith can bring. Other times you may find yourself sinking back into your old habits. Up or down, know that God is with you, and that His love for you does not change with the whims of your behavior. He is writing a new story for your life, and that story has grace spelled out on every page.
Pray About It
Lord, help us to be as patient with ourselves as You are with us. As we walk this path with You, remind us that we are being transformed into Your likeness with ever-increasing glory. Show us the points of glory, the places where we have grown and changed, and help us long to be more like You every day. Amen.


rice-recipe
Slow-Cooker Red Beans and Rice
Few dishes embody the true tastes of the South more than red beans and rice, and this slow-cooker recipe helps you get their flavors on the table without spending all day in the kitchen. For this recipe we’ve used thinly sliced smoked turkey sausage, which works wonderfully in a slow cooker, as well as sweet onion, two types of bell pepper, and a hint of Creole seasoning. To give this quick-fix dinner a little extra spice, you can add hot sauce if you like. Top this Slow-Cooker Red Beans and Rice with finely chopped red onions, or finely chopped green onion. Both will add a little extra spice to this amazing dish
Ingredients
- 1 pound dried red kidney beans
- 1/2 pound andouille smoked chicken sausage, thinly sliced
- 3 celery ribs, chopped
- 1 green bell pepper, chopped
- 1 medium onion, chopped
- 3 garlic cloves, minced
- 1 tablespoon Creole seasoning
- 7 cups water
- 3 cups uncooked long-grain rice
- Garnish: sliced green onions
Directions
- Stir together first 8 ingredients in a 4-qt. slow cooker. Cover and cook on HIGH 7 hours or until beans are tender.
- Meanwhile, cook rice according to package directions. Serve with red bean mixture. Garnish, if desired.
- Note: We tested with Aidells Organic Fully Cooked Cajun Style Andouille Smoked Chicken Sausage.


View management.
More...
#include <View.hpp>
View management.
Definition at line 65 of file View.hpp.
◆ View()
| Rendering3D::View::View |
( |
size_t |
width, |
|
|
size_t |
height |
|
) |
| |
Creates an instance.
- Parameters
-
| width | The width of the view |
| height | The height of the view |
Definition at line 66 of file View.cpp.
◆ get_ambient_color()
Gets a copy of the ambient color.
- Returns
- The ambient color as copy
Definition at line 199 of file View.hpp.
◆ get_camera()
| Camera& Rendering3D::View::get_camera |
( |
| ) |
|
|
inline |
Gets a reference of the camera.
- Returns
- The reference of the camera
Definition at line 172 of file View.hpp.
◆ get_directional_lights()
| std::vector<std::shared_ptr<class DirectionalLight> >& Rendering3D::View::get_directional_lights |
( |
| ) |
|
|
inline |
Gets the directional light collection as reference.
- Returns
- The reference of the direction light collection
Definition at line 181 of file View.hpp.
◆ get_height()
| size_t Rendering3D::View::get_height |
( |
| ) |
|
|
inline |
Gets the height of the view as copy.
- Returns
- The copy of the height
Definition at line 154 of file View.hpp.
◆ get_point_lights()
| std::vector<std::shared_ptr<class PointLight> >& Rendering3D::View::get_point_lights |
( |
| ) |
|
|
inline |
Gets the point light collection as reference.
- Returns
- The reference of the point light collection
Definition at line 190 of file View.hpp.
◆ get_rasterizer()
Gets a reference of the rasterizer.
- Returns
- The reference of the rasterizer
Definition at line 163 of file View.hpp.
◆ get_width()
| size_t Rendering3D::View::get_width |
( |
| ) |
|
|
inline |
Gets the width of the view as copy.
- Returns
- The copy of the width
Definition at line 145 of file View.hpp.
◆ paint()
| void Rendering3D::View::paint |
( |
| ) |
|
Renders the view.
Definition at line 199 of file View.cpp.
◆ update()
| void Rendering3D::View::update |
( |
| ) |
|
Updates the view.
Definition at line 176 of file View.cpp.
The documentation for this class was generated from the following files:
- D:/Repositorios/3DRendering/Rendering/code/headers/View.hpp
- D:/Repositorios/3DRendering/Rendering/code/sources/View.cpp


Why do we use stochastic gradient descent algorithm:
-
Traditional Gradient Descent cons: (1). Time consuming to compute n gradients in one iteration. (2). Easy to trap in local optimum.
-
Stochastic Gradient Descent.
(1). Can avoid local optimum. (2). Able to solve scalable data.
Tricks in choice of learning rate and updating. a. Experiment with the learning rate $latex \gamma_0 &s=2$ using a small sample of the training set.
b. Step decay. $latex \gamma_{t+1} = \gamma_t - step &s=2$.
c. 1/t decay. $latex \gamma_t = \frac{\gamma_0}{1+\gamma_0 \lambda t}&s=2$
d. Exponential decay. $latex \gamma_t = \gamma_0 e^{-kt}&s=2$
e. Momentum. Description: When updating the parameter, use the direction of w(t-1) at the last iteration. Ads: (1) Smooth out the variations, when using one data to update is too sensitive sometimes. (2) Speed up when direction are the same. Usage: $latex \Delta w(t) = \gamma_t g(t) + \alpha \Delta w(t-1)&s=2$ alpha is usually 0.9
$latex w(t+1) = w(t) - \Delta w(t)&s=2$
f. Adaptive learning rate. AdaGrad. Description: It provides a specific learning rate for each parameter. Usage:
$latex \gamma_{i,t} =\frac{\gamma_0}{ \sqrt{\sum_{\hat{t} = 1}^t g_{\hat{t},i}^2}} &s=2$
d. RMSprop. Description: It keeps running average of its recent gradient magnitudes and divides the next gradient by this average, so that loosely gradient values are normalized. Usages: $latex MS(w,t) = 0.9 MS(w,t-1) + 0.1 g_t^2 &s=2$
$latex \Delta w(t) =\frac{ \gamma g_t }{MS(w,t)+u} &s=2$
$latex w(t+1) = w(t) - \Delta w(t) &s=2$
e. Combine RMSprop and momentum trick.
Reference:
-
Bottou, Léon. “Stochastic gradient descent tricks.” Neural Networks: Tricks of the Trade. Springer Berlin Heidelberg, 2012. 421-436.
-
http://www.willamette.edu/~gorr/classes/cs449/momrate.html
-
Toronto CSC321 Lecture notes. http://www.cs.toronto.edu/~tijmen/csc321/
-
Stanford CS231 Lecture notes. http://cs231n.stanford.edu/


The spirograph equation for three or more wheels can be generalized as follows:
$$z(t) = \sum_{k=1}^n a_k e^{i2\pi(n_kt+\theta_k)}$$
This program solves those equations for three wheels, assuming all of the $a$ coefficients are 1 and $\theta$ coefficients are 0. Find more details online at
http://linuxgazette.net/133/luana.html


I'm a fourth-year Electrical and Computer Engineering PhD student at The University of Texas at Austin, with my ambitious goal of building a general AI for human benefits. I am privileged to work with Prof.Peter Stone at the Learning Agent Research Group (LARG). Priviously I completed my undergraduate study at Shanghai Jiao Tong University with a major in Mechanical Engineering (Robotics). I broadened my practical AI skillset through an enriching internship under Xiaomeng Yang and Yuandong Tian at Meta FAIR Labs in Summer 2022. Besides research, I enjoy Tennis, Cello and Rap Music.
My current research interests include:
I coordinate Reinforcement Learning Reading Group (RLRG) at UT.
Academic Services: reviewer for NeurIPS, ICML, AAMAS, CVPR, RA-L
MACTA: A Multi-agent Reinforcement Learning Approach for Cache Timing Attacks and Detection
Jiaxun Cui, Xiaomeng yang*, Mulong Luo*, Geunbae Lee*, Peter Stone, Hsien-Hsin S Lee, Benjamin Lee, G Edward Suh, Wenjie Xiong*, Yuandong Tian*
International Conference on Learning Representations (ICLR), 2023
[paper] [code]
MACTA detectors can generalize to a heuristic attack not exposed in training with a 97.8% detection rate and reduce the attack bandwidth of adaptive attackers by 20% on average. In the meantime, MACTA attackers are qualitatively more effective than other attacks studied, and the average evasion rate of MACTA attackers against an unseen state-of-the-art detector can reach up to 99%.
Coopernaut: End-to-End Driving with Cooperative Perception for Networked Vehicles
Jiaxun Cui*, Hang Qiu*, Dian Chen, Peter Stone, Yuke Zhu
IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022
[paper] [project page] [code]
There are dangerous scenarios where single optical based sensor are occluded. We develop a series of benchmark scenarios in the CARLA simulator where cooperative perception can make big difference in the decisions made by the autonomous vehicles.
Meta-Learning for Multiround Chinese Standard Mahjong Game
Chinese Standard Mahjong Game is a 4-player zero-sum imperfect information game. While in the formal competitions of the mahjong game, a player will compete with the other opponents for a fixed number of rounds, and then the relative cumulative reward/points are compared. It is no longer a zero-sum game and the agents only care about a relative better performance than other players. This competition mechanism induces multi-round tactics. For example, an agent may play conservatively to secure its ranking or play riskly when it is left behind.
Scalable Multiagent Driving Policies For Reducing Traffic Congestion
Jiaxun Cui, William Macke, Harel Yedidsion, Aastha Goyal, Daniel Urielli, Peter Stone
Oral Presentation, International Conference on Autonomous Agents and Multiagent Systems (AAMAS), 2021
[paper]
[code]
In the mordern highway system, the issue of conjestions brings inefficiency in traffic throughput and also cause waste of energy consumption. In this project, we employed deep Reinforcement Learning method to alleviate stop-and-go waves arosed from merging. We explored two aspects of multi-agent learning: Centralized and Distributed. Evaluting only average speed and throughput efficiency could be toublesome because the two metrics may not be improved at the same time. Thus, we developed a new metric: time delay for a certain number of vehicles to enter and exit the networks.


---
layout: page
title: Start Here!
permalink: /starthere/
---
Who am I?
I'm Aditya Ramesh. Software Engineer (Member Technical) at D E Shaw & Co. I'm also a former Intern at D E Shaw, Cisco & Deloitte.
Welcome to my little corner of the internet. All content here represent only my opinions, and not that of any of my employers.
I spend a normal day usually indulging in some of these activities -
- Pencil sketching. (Say hi, @adityadraws)
- Taking a long walk while listening to a Spotify playlist or podcast.
- Writing a blog post.
- Competing in an algorithmic programming contest.
- Pulling an all-nighter at a hackathon.
- Studying for my academic examinations.
- Exploring open source projects.
- Building personal side projects
- Writing technical articles for Topcoder.
- Reading cool engineering blogs.
- Watching Netflix.
- Staring at walls while thinking over algorithmic puzzles.
What do I do?
I'm a member technical/software engineer at The D. E. Shaw Group.
The tl:dr; version of me is - I learn, build and write. Quite a bit.
For the full version, check out the about me section of my blog.
Why should you read my blog?
Blogarithms is an amalgamation of "Blog" and "Algorithms".
So the answer to this question depends a lot on what you're really looking for. My blog consists of my experiences. Mostly technical, some non-technical.
Articles of mine like "Cracking Dynamic Programming", or "The Two Pointer Algorithm" are great* if you're going to be interviewing with firms like Google, Microsoft, Amazon etc or just enjoy algorithms; while some other articles of mine like the one on imposter syndrome, or why fear may be stopping you from being awesome, might offer refreshing food for thought.
*I say "great" since many of my friends who read my technical articles have received full-time offers from these firms.
Aside from those, we have the articles of mine that cover some of my memorable experiences like building a product at Harvard University, or my article on almost ranking among the top 20 teams in Google Hash Code (India).
Where should you start reading from my blog?
Well, anywhere! Any article with a prerequisite will clearly state so, so fear not and pick whichever sounds fun. I'd suggest using the categories on the sidebar of the blog to find articles.
Want more of me?


Bs 2017 API
1 Introduction
Like previous years, all competing clients are expected to provide a web application that is available at a routeable URL.
Clients are expected to respond to HTTP requests and provide a route for POST /start and POST /move.
All clients are expected to respond within 200ms of the server's initial request. Failing to respond before the timemout may result in the server choosing a random move for you.
All responses are expected to have a 200 OK
status code.
2 Callbacks
2.1 POST /start
Called when a new game is started.
Game IDs are guaranteed to be unique1.
The purpose of this callback is for clients to report what their snake's name, colour, and other display properties should be for this game.
This callback should not be used to manage internal snake state it is not guaranteed that as you will be notified when the game ends, or when your snake dies.
All attributes the request are provided to maintain backwards compatibility with 2015 snake clients - it is strongly recommend that clients exclusively use the move callback for any and all game play logic.
| URL | /start |
| Method | POST |
| Headers | Content-Type: application-json |
2.1.1 Request attributes
| Attribute | Type |
|---|---|
| game_id | UUID |
| height | integer |
| width | integer |
2.1.2 Example Request
{ "width": 20, "height": 20, "game_id": "b1dadee8-a112-4e0e-afa2-2845cd1f21aa" } :ok
2.1.3 Response Attributes
| Attribute | Type | ||
|---|---|---|---|
| color | Color | Primary color for your snake and avatar | |
| name | string | Your snake's name. | |
| head_url | optional | url | An image to be displayed as your avatar. Name is for compatibility with previous years. Avatars are displayed in a square box. |
| taunt | optional | string | Message to display in the game client. |
| head_type | optional | HeadType | String matching one of the snake heads listed here. |
| tail_type | optional | TailType | String matching one of the snake tails listed here. |
| secondary_color | optional | Color | Accent color used by some snake heads. |
2.1.4 Example Response
- Code:
200 OK
- Content:
{ "color": "#FF0000", "secondary_color": "#00FF00", "head_url": "http://placecage.com/c/100/100", "name": "Cage Snake", "taunt": "OH GOD NOT THE BEES" "head_type": "pixel", "tail_type": "pixel" }
2.1.5 Sample call
my_snake_server_url="localhost:4000/test-snake" curl $my_snake_server_url/start \ -X POST \ -H "Content-Type: application/json" \ --data @- <<-REQUEST_BODY {"width":20,"height":20,"game_id":"example-game-id"} REQUEST_BODY
{"name":"test-snake","color":"#123123"}
2.2 POST /move
The game server will issue a request for this callback on each turn to request the client's move.
This callback should be used for all game logic.
| URL | /start |
| Method | POST |
| Headers | Content-Type: application-json |
2.2.1 Request Attributes
| Attribute | Type | |
|---|---|---|
| food | Array<Point> | Array of all food currently on the board |
| game_id | UUID | |
| height | integer | |
| snakes | Array<Snake> | Array of all living snakes in the game |
| dead_snake | Array<Snake> | Array of all dead snakes in the game |
| turn | integer | The current turn. |
| width | integer | |
| you | UUID | A reference to your snake's id, the snake object can be found in snakes . |
2.2.2 Example Request
{ "you": "2c4d4d70-8cca-48e0-ac9d-03ecafca0c98", "width": 2, "turn": 0, "snakes": [ { "taunt": "git gud", "name": "my-snake", "id": "2c4d4d70-8cca-48e0-ac9d-03ecafca0c98", "health_points": 93, "coords": [ [ 0, 0 ], [ 0, 0 ], [ 0, 0 ] ] }, { "taunt": "gotta go fast", "name": "other-snake", "id": "c35dcf26-7f48-492c-b7b5-94ae78fbc713", "health_points": 50, "coords": [ [ 1, 0 ], [ 1, 0 ], [ 1, 0 ] ] } ], "height": 2, "game_id": "a2facef2-b031-44ba-a36c-0859c389ef96", "food": [ [ 1, 1 ] ], "dead_snakes": [ { "taunt": "gotta go fast", "name": "other-snake", "id": "83fdf2b9-c8d0-44f4-acb2-0c506139079e", "health_points": 50, "coords": [ [ 5, 0 ], [ 5, 0 ], [ 5, 0 ] ] } ] } :ok
2.2.3 Response Attributes
| Attribute | Type | |
|---|---|---|
| move | "up" | "left" | "down" | "right" | |
| taunt | optional | string |
2.2.4 Example Response
- Code:
200 OK
- Content:
{ "move": "up", "taunt": "gotta go fast" }
2.2.5 Sample call
my_snake_server_url="localhost:4000/test-snake" curl $my_snake_server_url/move \ -X POST \ -H "Content-Type: application/json" \ --data @- <<-REQUEST_BODY {{"you": {"name": "my-snake", "coords": [[0, 0], [0, 0], [0, 0]]}, "turn": 0, "snakes": [{"name": "my-snake", "coords": [[0, 0], [0, 0], [0, 0]]}], "game_id": 0, "food": [[0, 1]]} REQUEST_BODY
{"move":"right"}
2.2.6 Notes
Requests timeout after 200ms, failing to respond will result in the server choosing a move for you.
2.3 Simple Example Snake
Below is a simple example snake. This is what the bare minimum implementation of a functional snake might look like.
This example is written in Ruby, but you are of course not limited in what technology you wish to use.
In the below example we create a basic Sinatra2 web application. The app severs the two post callbacks, and provides a response containing only the required attributes for both.
# ./Gemfile source "https://rubygems.org" gem "sinatra", require: "sinatra/base" gem "rack" # ./ruby_snake.rb require "json" class RubySnake < Sinatra::Base post "/start" do { name: "simple-ruby-example-snake", color: "#123456" }.to_json end post "/move" do { move: "up" }.to_json end end
This Snake only goes up, but it works!
3 Data Types
3.2 Snake
| Attributes | Type | |
|---|---|---|
| coords | Array<Point> | |
| health_points | 0..100 | |
| id | UUID | |
| name | string | |
| taunt | string |
{ "taunt": "git gud", "name": "my-snake", "id": "5b079dcd-0494-4afd-a08e-72c9a7c2d983", "health_points": 93, "coords": [ [0, 0], [0, 0], [0, 0] ] }
coords
is a complete list of a snakes head and body segments. The first
segment in coords
is a snakes head.
When a snake moves its' head segment will move in the direction specified, and all it's tail segments will advance to space ocupied by the previous segment
Eating food extends your snake's tail, and restores your health points.
For example:
// before eating food { "taunt": "git gud", "name": "my-snake", "id": "5b079dcd-0494-4afd-a08e-72c9a7c2d983", "health_points": 50, "coords": [ [2, 0], [1, 0], [0, 0] ] } // moves right, (1, 0), into a space that occupies food (3, 0) // the new state of the snake would be { "taunt": "git gud", "name": "my-snake", "id": "5b079dcd-0494-4afd-a08e-72c9a7c2d983", "health_points": 100, "coords": [ [3, 0], [2, 0], [1, 0], [1, 0] ] } // the tail has been extended by 1 and the health restored to 100
3.3 Color
color :: hexcode | hsl | named_color | rbg
"gold"
"#ffffff"
"rgb(255, 255, 255)"
"hsl(255, 100%, 100%)"
4 Game Rules
4.1 Objective
Bs is an adaptation of the classic video game "Snake", where the player maneuvers a snake around the play field to collect food pellets, which makes the snake grow longer. The main objective is to collect as much food as as possible, while avoiding hitting obstacles, such as walls and most importantly - your own snake.
In Bs, each round X number of snakes is pitted against each other, and the goal is to be the last snake left alive at the end of the round.
4.2 You lose if your snake…
- Runs into another snake's body.
- Runs into its own body.
- Runs into the walls of the play field.
- Collides head-to-head with a longer snake (both die if they are of the same size).
- Starves.
4.3 Starvation rules
- Your snake starts out with 100 life and counts down by 1 each turn.
- When your snake's life total reaches 0, it dies of starvation.
4.4 Avoiding starvation
- Food pellets spawn randomly around the play field.
- Each food pellet increases your snake's length by 1 and resets its life to 100.
4.5 Sportsmanship
- No DDoSing your opponents.
- No manual control of your snake.
5 General Advice
coming soon…
6 Deploying Your Snake
coming soon…


|
In a previous post, I
demonstrated how you can get a list of the Top 10 shell commands you
currently use, and how you can use this information to improve your workflow.
Since then I’ve received a number of suggestions and have also thought about
this command a good bit more, so I thought that I could offer a variation on
the implementation.
The previous version used awk but this one will instead use cut , as
follows:
history \|
cut -c8- \|
cut -d' ' -f1 \|
sort \|
uniq -c \|
sort -nr \|
head
I’ve formatted this solution to show only one command per line, just so that
it’s easy to read and follow my step-by-step description.
1. To start off, and without surprise, we issue the history command.
2. Next, we use cut to remove the first 8 characters only of the
output. My system is OS X, so just keep in mind that if you’re on another
system, the spacing of the output might possibly vary a little.
3. Again we use cut , but this time we accept the output of the
previous command by using the -d option, where we specify it to split on a
single space, but ask for only the first field of the result set to be returned
using the -f option.
4. Next up is really nothing special. We simply sort the output.
5. We then filter the sorted results using uniq , but we’ve made sure
to include the -c option to precede each output line with the count of the
number of times the line occurred in the input, followed by a single space.
Special thanks to @tdl for this tip in my previous
post on Coderwall.
6. To round out the most frequently used commands, we are sure to sort
the output numerically due to the command counts provided by uniq , and to
be sure to do so in reverse order since we’re interested in the most frequently
occurring commands first.
7. Lastly, we use head to show the Top 10 shell commands. Of
course, you could always vary this a bit if you’re interested in more than 10
by simply specifying -n count, where count should be replaced with the
number of results you desire.
The previous tip was so popular that I felt this merited some more thought. I
think it’s a great example not only of how to improve your workflow, but also
how shell commands can generally solve problems in variety of ways.
Enjoy, Chip
|


string mailparse_determine_best_xfer_encoding ( resource $fp )
Figures out the best way of encoding the content read from the given file pointer.
Returns one of the character encodings supported by the mbstring module.


uzbl(1) uzbl(1) NAME uzbl - A keyboard controlled browser based on Webkit SYNOPSIS uzbl [-u URI] [-v] [-n NAME] [-c CONFIG] DESCRIPTION Very minimal interface. No unnecessary interface elements. Controllable through a FIFO and with external scripts. What is not browsing, is not in uzbl. Things like url changing, load‐ ing/saving of bookmarks, saving history,.. are handled through external scripts that you write. OPTIONS -u, --uri=URI Uri to load (equivalent to 'set uri = URI') -v, --verbose Whether to print all messages or just errors. -n, --name=NAME Name of the current instance (defaults to Xorg window id) -c, --config=FILE Config file (this is pretty much equivalent to uzbl -c - < FILE ) --display=DISPLAY X display to use --help Help HOMEPAGE The uzbl homepage is http://www.uzbl.org. AUTHORS Dieter Plaetinck (Dieter@be) <email is dieter AT plaetinck.be>. See /usr/share/doc/uzbl/AUTHORS for all contributers. Wed May 27 2009 uzbl(1)


We exchange infrastructure!
- repurpose revolutionary markets
- matrix enterprise systems
- productize killer e-markets
- generate e-business niches
- embrace e-business experiences
- embrace granular markets
- maximize enterprise web-readiness
- productize rich ROI
- drive visionary solutions
- reintermediate distributed ROI


--- layout: post status: publish published: true title: Corey's 2009 MLB Final Standing Prediction author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 456 wordpress_url: http://ivyenvy.com/?p=456 date: '2009-04-03 07:40:15 +0000' date_gmt: '2009-04-03 13:40:15 +0000' categories: - General Baseball tags: - Ivy Envy MLB Final Standings Challenge - IEMLBFSC - '2009' comments: - id: 158 author: VetoPower author_email<EMAIL_ADDRESS>author_url: http://qconline.com/bloggers/vetopower date: '2009-04-03 10:01:07 +0000' date_gmt: '2009-04-03 16:01:07 +0000' content: "I'm not going to be the typical soothsaying Cubs fan anymore. Last season I picked the Cubs to go to the World Series and lose to the Tigers (oops on both accounts) and the year before that I picked them to get to get the NLCS.\r\n\r\nI refuse to pick them to win the World Series until they actually win one.\r\n\r\nAnd sweet Jesus, how bad is the AL West? Hey guys, that first number should be bigger than the second number in your standings. I know, I know ... but golf is different. Even so, no one should implode that badly on the back nine.\r\n\r\nNational League\r\n\r\nEast: 1, Mets; 2, Phillies; 3, Braves; 4, Marlins; 5, Nationals.\r\n\r\nCentral: 1, Cubs; 2, Cardinals; 3; Astros; 4, Brewers; 5, Pirates; 6, Reds.\r\n\r\nWest: 1, D-Backs; 2, Dodgers; 3, Giants; 4, Rockies; 5, Padres.\r\n\r\nAmerican League\r\n\r\nEast: 1, Red Sox; 2, Yankees; 3, Rays; 4, Blue Jays; 5, Orioles.\r\n\r\nCentral: 1, Twins; 2, White Sox; 3, Indians; 4, Tigers; 5, Royals.\r\n\r\nWest: 1, Angels; 2, My grandma; 3, My niece... ok... 2, Mariners; 3, A's; 4, Rangers.\r\n\r\nNLDS\r\nPhillies over the Cubs in 4.\r\nMets over the D-Backs in 4.\r\n\r\nALDS\r\nRed Sox over the the Twins in 3.\r\nAngels over the Yankees in 5.\r\n\r\nNLCS\r\nMets over the Phillies in 5.\r\n\r\nALCS\r\nAngels over the Red Sox in 7.\r\n\r\nNCIS\r\nGibbs over DiNozzo in 4.\r\n\r\nWorld Series\r\nMets over Angels in 6.\r\n\r\nBut what do I know? Maybe it'll be Rangers over the Nats." - id: 165 author: Kurt author_email<EMAIL_ADDRESS>author_url: http:// date: '2009-04-06 07:49:54 +0000' date_gmt: '2009-04-06 13:49:54 +0000' content: "NL \r\nCentral - 1. Cubs 2. Cards 3. Brewers 4. Astros 5. Reds 6. Pirates\r\nEast - 1. Mets 2. Phillies 3. Marlins 4. Braves 5. Nats\r\nWest - 1. Dodgers 2. D-backs 3. Rockies 4. Giants 5. Padres\r\nWildcard - It's a lock out of the East, Phillies\r\n\r\nAL\r\nCentral - 1. Indians 2. Twins 3. White Sox 4. Tigers 5. Royals\r\nEast - 1. Yankees 2. Red Sox 3. Rays 4. Blue Jays 5. Orioles\r\nWest - 1. Angels 2. Veto's grandma 3. A's 4. Mariners 5. Rangers\r\nWildcard - Also a lock out of the East, Red Sox\r\n\r\nI'm going to skip playoff predictions. I'm too superstitious not to pick the Cubs, but if I do I'm just a homer.\r\n\r\nOk. Maybe this is illegal, but for the sake of the contest I'm edited this to include my playoff picks. I realize I may have a slight advantage now that most of these teams have two games under their belt so if I must be disqualified I understand.\r\nNLDS\r\nCubs over Phillies\r\nDodgers over Mets\r\n\r\nNLCS\r\nCubs over Dodgers (Revenge)\r\n\r\nALDS\r\nIndians over Yanks (Girardi fired)\r\nAngels over Sawx\r\n\r\nALDS\r\nAngels over Indians\r\n\r\nWS\r\nCubs over Angels in 6" ---
National League
East: 1. New York 2. Philadelphia 3. Atlanta 4. Florida 5. Washington
Central: 1. Chicago 2. St. Louis 3. Milwaukee 4. Cincinnati 5. Houston 6. Pittsburgh
West: 1. Los Angeles 2. Arizona 3. San Francisco 4. Colorado 5. San Diego
American League
East: 1. New York 2. Boston 3. Tampa Bay 4. Toronto 5. Baltimore
Central: 1. Minnesota 2. Cleveland 3. Chicago 4. Kansas City 5. Detroit
West: 1. Los Angeles 2. Oakland 3. Texas 4. Seattle
NL Wildcard : Philadelphia
AL Wildcard: Boston
NLDS:
Chicago over New York
Los Angeles over Philadelphia
ALDS:
Los Angeles over Boston
New York over Minnesota
NLCS:
Chicago over Los Angeles
ALCS:
New York over Los Angeles
World Series:
New York over Chicago


Hi, I'm a self taught programmer currently
in process of learning basics of programming
to hopefully become a full-stack developer and start working in the field of computer science.
Portfolio
I only got started. This is the only thing I can show here! But more to come soon!


Joose - A postmodern class system for JavaScript
In browsers (see Manual.Installation):
<script type="text/javascript" src="/jsan/Task/Joose/Core.js"></script>
Then:
Class("Point", {
has: {
x: {is: "ro"},
y: {is: "rw"},
},
methods: {
clear: function () {
var x = this.getX()
this.setY(0)
}
}
})
Class("Point.ThreeD", {
isa: Point,
has: {
z: {}
},
after: {
clear: function () {
this.z = 0
}
}
})
var point = new Point.ThreeD({
x : 1,
y : 2,
z : 3
})
In NodeJS:
var Class = require('joose').Class
var Point = exports.Point = Class({
has: {
x: {is: "ro"},
y: {is: "rw"},
},
methods: {
clear: function () {
var x = this.getX()
this.setY(0)
}
}
})
exports.Point3D = Class({
isa: Point,
has: {
z: {}
},
after: {
clear: function () {
this.z = 0
}
}
})
Joose is a self-hosting meta object system for JavaScript with support for classes, inheritance, roles (aka traits), method modifiers and much more.
The main goal of Joose is to make JavaScript Object Oriented Programming easier, more consistent and less tedious. With Joose you can to think more about what you want to do and less about the mechanics of OOP.
The Joose framework has been successfully used in multiple production systems for twelve months now and has been proven to be very stable. Joose is being tested using an automated unit-test suite that is being run in all major browsers (Firefox, IE, Safari, Opera and Chrome) and on NodeJS server-side platform.
Joose core package is only 8kb (YUI+gz).
If you're new to Joose, the best place to start is the Joose.Manual docs, followed by the Joose.Cookbook. The intro will show you what Joose is, and how it makes JavaScript OO better.
The cookbook recipes on Joose basics will get you up to speed with many of Joose's features quickly. Once you have an idea of what Joose can do, you can use the API documentation to get more detail on features which interest you.
Joose makes every attempt to provide as much convenience as possible during class construction/definition, but still stay out of your way if you want it to. Here are a few items to note when building classes with Joose.
Joose provides a number of methods to all your classes, mostly through the inheritance from Joose.Meta.Object.
this.SUPER(arg1, arg2, ...)
Only valid in the scope of usual methods and OVERRIDE method modifiers. Calls a superclass's method with the arguments provided.
this.SUPERARG(Array arg)
Only valid in the scope of usual methods and OVERRIDE method modifiers. Calls a superclass's method with the "packed" arguments, provided as array. Usually used as: this.SUPERARG(arguments)
This method is just a shortcut for this.SUPER.apply(this, arguments)
this.BUILD([Object arg])
Default BUILD
method checks whether the 1st argument passed to it is an Object. If so, it passes it to initialize
method. This method also optionally detaches current instance.
See Joose.Manual.Traits for details.
this.initialize(Object properties)
Default initialize
method uses properties
to initialize the attributes of current instance.
this.toString()
Defalt string coercion is string "a ClassName", where ClassName is a name of instance's class.
Joose provides a number of properties to all instances of your classes.
this.constructor
A class with which this
instance was constructed.
this.meta
An instance of metaclass for this
instance's class.
Joose also provides a number of properties to classes.
class.meta
An instance of metaclass for this class. The same as this.meta
for instances of class
class.my
A static instance. See Joose.Manual.Static for more details.
class.superClass
A superclass (constructor function) of given class
Declaration helpers allows you to declare a class, role or module.
Class(String name, Object builders)
Declares a class, using provided builders. name
will be transformed into class's constructor. See the details here
Class(Object buildersObj)
Declares an anonymous class.
Role(String name, Object builders)
Role(Object buildersObj)
The same helpers for Roles. See Roles.
Module(String name, Object builders)
Module(String name, Function body)
The same helpers for Modules. See the details here
Joose also provides a number of small helpers functions, which you might found useful.
Joose.A.each(array, func, scope)
Calls a func
in the optional scope
for each element of array
as: func(element, index)
, where index
is the index of element in the array
. Returning a false
from func
stops the iteration.
If the iteration were stopped with returned false
value, this helper also return false
. Otherwise it returns undefined value.
Joose.A.map(array, func, scope)
Calls a func
in the optional scope
for each element of array
as: func(element, index)
, where index
is the index of element in the array
.
Returning values from all calls to func
are collected in the resulting array, which is returned.
Joose.A.exists(array, value)
Returns boolean value, indicating whether this value
is exists in the array
.
Joose.A.grep(array, func)
Calls the func
for each element of array
and returns an array, consisted from only those elements, for which it returns 'true' value
Joose.A.remove(array, removeEle)
Returns a "shallow copy" of array
, without the all the occurrences of removeEle
(if any). Comparison is performing with '===' operator. Do not modifies original array
.
Joose.S.saneSplit(str, delimeter)
Implements a perl-like 'split', which returns empty array for splitted empty string (not an array with an empty string). Behave as standard String.prototype.split
in other aspects.
Joose.S.uppercaseFirst(string)
Returns a copy of string
, with uppercased first letter.
Joose.O.each(object, func, scope)
Calls a func
in the optional scope
for all properties of the object
(including inherited via prototype chain).
func
is called as: func(value, name), where
valueis the value of the
nameproperty of
object. Returning a
falsefrom
funcstops the iteration.
If the iteration were stopped with returned
falsevalue, this helper also return
false`. Otherwise it returns undefined value.
Joose.O.eachOwn(object, func, scope)
Calls a func
in the optional scope
for only "own" properties of the object
. func
is called as: func(value, name), where
valueis the value of the
nameproperty of
object.
Returning a
falsefrom
funcstops the iteration. If the iteration were stopped with returned
falsevalue, this helper also return
false`. Otherwise it returns undefined value.
Joose.O.copy(source, target?)
Copies all the properties of source
object to the target
(which is created as empty object if not supplied). (including inherited via prototype chain). Returns target
.
Joose.O.copyOwn(source, target?)
Copies only the "own" properties of source
object to the target
(which is created as empty object if not supplied).. Returns target
.
Joose.O.getMutableCopy(object)
Returns a "mutable copy" of object
. "Mutable copy" is an empty object, which however inherit all the properties of original via prototype chain.
Joose.O.extend(target, source)
Copies all the properties of source
object to the target
(including inherited via prototype chain).
Joose.O.isEmpty(object)
Returns boolean value, indicating whether the object
have no own properties.
Joose.O.isInstance(obj)
Returns boolean value, indicating whether the passed obj
is an instance of some Joose class.
Joose.O.wantArray(obj)
Returns obj
itself if obj
is an array, or [ obj ]
otherwise.
To simplify declaration of attributes Joose provides a number of default attributes initializers (see Joose.Manual.Attributes for details)
Joose.I.Array
Returns empty Array when called
Joose.I.Object
Returns empty Object when called
Joose.I.Function
Returns empty Function when called (which in turn will return Joose.I.Function)
Joose.I.Now
Returns new instance of Date
(at the time of class instantiation)
You can provide some configuration options to Joose. To specify them before Joose has been loaded, create a global JOOSE_CFG
object. At the time of Joose loading, it will alias it as Joose.C
symbol.
Joose.C
is the place, where various extension will check for configuration options.
When you use Joose, you can specify which metaclass to use:
Class("Point", {
meta : NewMetaClass,
....
})
You can also specify traits which will be applied to your metaclass:
Class("Point", {
trait : TraitWithCustomBuilder,
coords : [ 1, 2, 3 ]
....
})
When you do this, your class's meta object will have the specified traits applied to it. See Joose.Manual.Roles and Joose.Manual.Traits for further details.
Generally if you're writing an extension for Joose itself you'll want to put your extension in the JooseX. namespace. This namespace is specifically for extensions that make Joose better or different in some fundamental way. It is traditionally not for a package that just happens to use Joose.
These extensions can be found in the npm registry. See Joose.Manual.JooseX for more details.
We offer a mailing list and an active IRC channel.
The mailing list is<EMAIL_ADDRESS>To subscribe, visit: http://groups.google.com/group/joose-js
You can also visit us at #joose on freenode. Questions at all levels (on Joose-related topics ;) are welcome.
Many thanks to the whole Moose community for being icebreaker in the meta world.
Special thanks to Dave Rolsky for the excellent Moose documentation written, on which this document is based.
http://joose.it - This is the official web home of Joose.
http://github.com/Joose/Joose - Our version control repository
http://www.iinteractive.com/moose - Home page of Moose - post-modern class system for perl
All complex software has bugs lurking in it, and this module is no exception.
Please report any bugs through the web interface at https://github.com/Joose/Joose/issues
We are very strict about what features we add to the Joose core, especially the user-visible features. Instead we have made sure that the underlying meta-system of Joose is as extensible as possible so that you can add your own features easily.
That said, occasionally there is a feature needed in the meta-system to support your planned extension, in which case you should
either email the mailing list<EMAIL_ADDRESS>or join us on IRC at
Malte Ubl
Jeremy Wall
Nickolay Platonov
Copyright (c) 2008-2011, Malte Ubl, Nickolay Platonov
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
Documentation is based on original Moose::Manual documentation, copyright 2006-2009 by Infinity Interactive, Inc.


Groceteria
Home
Fruits
Vegetables
Dairy
Bakery
Cart
User
share
favorite_border
Delicious Bananas
weight: 3lb
CAD$
2.99
BENEFITS
Apples are nutricious
Apples may be good for weight loss
Apples may be good for bone health
They're linked to a lowest risk of diabetes
ADD TO CART


Purging a URL will purge it from the cache. This input takes a filename and will purge or remove it from cache i.e it clears the cache /first.php will match any URL with /first.php.
/first.php


[Gecode] Model variable iterators
Christian Schulte
schulte at imit.kth.se
Thu Aug 11 15:44:41 CEST 2005
Ok, they are back.
Christian
--
Christian Schulte, http://www.imit.kth.se/~schulte/
-----Original Message-----
From: gecode-bounces at ps.uni-sb.de [mailto:gecode-bounces at ps.uni-sb.de] On
Behalf Of Guido Tack
Sent: Thursday, August 11, 2005 8:29 AM
To: gecode at ps.uni-sb.de
Subject: [Gecode] Model variable iterators
Hi!
I think we should revive the range iterators for model variables: if you
want
to implement an explorer (say in Alice or Java), you need to be able to
inspect the domains of variables in choice nodes.
Cheers,
Guido
--
Guido Tack
Programming Systems Lab, Saarland University, Saarbrücken
http://www.ps.uni-sb.de/~tack
_______________________________________________
Gecode mailing list
Gecode at ps.uni-sb.de http://www.ps.uni-sb.de/mailman/listinfo/gecode
More information about the gecode-users
mailing list


To implement an Iterative-FFT algorithm computes DFT. Look at figure 1.
Steps to implementthe Iterative-FFT algorithm:
In the above given vector, n=8. Values are : (0,2,3,-1,4,5,7,9)
(k) 10 (k) 2 (r 8 (k)) 2 (r 8 (k)) 10
0 0000 0000 0 = 0 * 24
2 0010 0100 4 = 1 * 22
3 0011 1100 12 = 3 * 22
-1 1001 1100 -4 = -1 * 22
4 0100 0010 2 = 2 * 20
5 0101 1010 10 = 5 * 21
7 0111 1110 14 = 7 * 21
9 1001 1001 9 = 9 * 20
Table 1 : Factorization of given vector (0,2,3,-1,4,5,7,9)
To implement an FFT algorithm with the bit-reversal permutation occurring ath the end takes 8 steps. Look at figure 1.
Algorithm to implementthe bit-reversal permutation occurring at the end:
Iterative-FFT(a)
1. Bit-Reverse -Copy(a, A)
2. n = a.length //n is a power of 2
3. for s= lg n to 1 //for bit-reversal permutation occurring at the end
4. m=2s
5. ωm = 2xi/m
6. for k= 0 to n-1 by m
7. ω = 1
8. for j=0 to m/2-1
9. t = ω A[k + j + m/2]
10. u = A[k + j]
11. A[k + j] = u + t
12. A[k + j + m/2] = u - t
13. ω = ω ωm
14. Return A
Call the function Bit-Reverse-Copy and its algorithm is given as :
1. Bit-Reverse -Copy(a, A)
2. n = a.length //n is a power of 2
3. for k = 0 to n-1
4. A[rev (k)] = ak
The twiddle factors computed by the ITERATIVE-FFT will depend on the innermost for loop.
The number of iterations of the for loop that is from k=0 to n-1 by m are n/m. For each m/2 iterations, that are computed by running the for loop from j=0 to m/2-1 the number of twiddle factors are: .
If the twiddle factors are computed before then there will be no requirement of any computation.
The number of twiddle factors that will show up are n/2 so those computed by us are m/2=
Butterfly Operations
A butterfly operation is used with the context of the fast Fourier transform which perform the computation by producing the larger DFT (that is the Discrete Fourier Transform) by the combination of the smaller DFTs. It is called so as its DFD (data flow diagram) has the shape of butterfly in the case of radix-2.
It is mostly used in the case of the algorithm called as Cooley–Tukey FFT algorithm, in this algorithm the DFD is breakdown recursively into the size into the r smaller transform of the size c and where r is the radix of the transform.
And in the next step the smaller DFDs are combined with the help of r butterflies which are of size r (which operations are performed c times) which are multiplied by the root of unity termed as twiddle factor.
The butterfly circuit of a fast Fourier-Transform comprises of various stages:
1. There is a memory stage where output of the butterfly-operation is received and the input is supplied.
2. There is a block for floating point computation which receives the input of the butterfly-operation from the stage operation and where the various operation sequences such as addition and multiplication are performed.
3. There is a forwarding circuit.
a. The multiplier output signal is received and the input signals adder is applied for at least one adder.
b. The multiplier output signal is received using at least one adder to the input port of the second adder.The recursive procedure of FFT, in the form of tree is shown below:
The leaf nodes given in the tree given above will specify inputs of FFT in parallel. The root node has all the inputs and they are divided in such a manner that consecutive inputs enter into left child and right child.
The representation of the FFT in parallel form is given below:
In the figure given above, the outputs of the adders at stage 1 become the inputs of the adders at stage 2. In FFT adders, all the outputs of adders at previous stage become inputs of current adder and twiddle factor is also there.
In order to identify a failed adder in the circuit which always produces a zero output, the circuit has been checked in order of decreasing stages. For two inputs x and y, with a twiddle factor of t, the outputs provided by an adder are and. As the changes made by twiddle factor is very low, outputs can be observed by removing twiddle factor.
For an input of 1, 1, 1, 1, 0, 0, 0 and 0, the outputs provided by adders at stage 1 are 1, 1, 1, 1, 1, 1, 1 and 1. At stage 2, the outputs become 1, 0, 1, 0, 1, 0, 1 and 0. So, at stage 1, every adder provides output of 1 from every wire and at stage 2 it provides output of 1 and 0. Here, corresponding outputs are considered which are 1, 0, 1, 0, 0, 0, 0and 0.
Consider the adders from top to bottom and then left to right as adder 1, adder 2, and adder 3 ……… adder 12. The fault adder found easily by looking at obtained outputs. For this, variation in inputs are made so that the output provided by any wire of the adder is 1, it s because the fault adder make output of 0 in both cases. A table that showing change in output and on the basis of them identification of fault adder is given below:
|
Change in output wires |
Fault adder |
|
y 0 and y1 |
Adder 1 |
|
y 2 and y3 |
Adder 2 |
|
y 4 and y5 |
Adder 3 |
|
y 6 and y7 |
Adder 4 |
|
y 0 and y2 |
Adder 5 |
|
y 1 and y3 |
Adder 6 |
|
y 4 and y6 |
Adder 7 |
|
y 5 and y7 |
Adder 8 |
|
y 0 and y4 |
Adder 9 |
|
y 1 and y5 |
Adder 10 |
|
y 2 and y6 |
Adder 11 |
|
y 3 and y7 |
Adder 12 |
The method that has been followed above is an efficient method because on the basis of the outputs the default adder can be detected. As the approach used here starts from the output, this makes the approach more efficient. It is because the user is always concerns with the output provided by the adder.


Everything Automation
Kubernetes
Container-Orchestration
- Automatically deploying and managing containers
- Ex: Docker Swarm,Kubernetes,MESOS
Architecture Overview
- Nodes: Machine on which Kubernetes is installed
- Also called minions
Kube-API Server
Basic-Commands
- minikube start: Start Minikube server
- kubectl run name --image=name: Run an image
- kubectl get pods: Information on pods running
- kubectl get podname: Information on specific pod
- kubectl describe podname: More info
- kubectl delete podname: Remove a pod
- kubectl edit pod: For editing yaml


DNA Host Configuration
*
DNA Host
*
User Name
*
Password
*
DNA Block Chain Configuration
*
BlockChain Host
*
Notification Configuration
*
Select Spark Space
*
{{x.roomName}}
Save Config
Reset


Find and replace (REST API)
Find and replace
Find and replace
Normalize
Normalize this column
Normalize
One-hot-encode this column
Change type of attribute
Text
Integer
Float
Date/Time
Remove outliers
X times standard deviation
Discretize
Number of bins
Boundaries between bins
Discretize by equi-width
Number of bins
Discretize by equi-frequency
Amount of bins
Fill empty fields
Mean
Median
Value
Fill empty fields
Extract from date/time
Year
Month
Week
Day
Weekday
Or round the date/time down
Month
Day
Hour
Minute
Menu
Home
Databases
Table
Contact
Settings
{% if logged %}
Log out
{% else %}
Log in
Register
{% endif %}
{% for name, values in frame.iteritems() %}
Fill empty fields
Find and replace (REST api)
Find and replace
Find and replace with regex
Change Type Attribute
One-Hot-encoding
Normalize
Discretize by equi-width
Discretize by equi-frequency
Discretize by range
Remove outliers
Edit date/time
{% endfor %}
{#
1,1,1,1,1,1,1,1,1,1
2,2,2,2,2,2,2
1,1,1,1,1,1,1
60,64,32,47,52,62,42,62
1,3,4,5,3,5,57
320,420,200,455,365,244,214,265
#}
{% for thead in cols %}
{{ thead }}
{% endfor %}
Delete
{% for idx, row in frame.iterrows() %}
{% for elem in row %}
{{ elem }}
{% endfor %}
{% endfor %}
{% for thead in cols %}
{{ thead }}
{% endfor %}
Delete


Example of simple file reader in Brython. Reads first selected file into browser. Could be used for some in-browser processing of the file.