I came across this great infographic about the history of computer programming. It’s really interesting to see the big names that were involved at the inception, most of which are not around any more. But our good friends at IBM haven’t closed their doors yet!

# a strange trend: plastic surgery for couples

Have you heard of this before? Plastic surgery for couples!

Do you often find yourself staring at your reflection in the mirror and wished you could do something about your crooked nose?

Or wished that you were inherently born with bigger eyes so you wouldn’t have to go through the laborious process of putting on layers of eye makeup just to make your eyes pop? Or do you wish you had higher cheekbones like those of Scarlett Johansson’s?

If you answer yes then plastic surgery is what you need.

One would think that the female species are the only ones interested in physical enhancements with the notion that women compared to men are more concerned about how they look. You can just imagine our astonishment when the world of plastic surgery which supposedly caters to a pool of unsatisfied women has now lured men to take the plunge.

Quite surprisingly, today’s trend is scaling not in the number of tummy tucks, breast lifts and nose jobs but in the actually number of couples choosing to go under the knife together. We think they’ve taken their vows quite literally only that instead of growing old together they are now choosing to grow young together thanks to the genius that is plastic surgery. One particular patient who, together with his wife, went through a series of non-surgical procedures said that after getting their new look they feel more refreshed and more energized and they consider the experience as another part of their life together.

Contrary to what people think, couple surgery is far from being just a one-time thing as it is abruptly becoming a fast growing trend in the plastic surgery industry today. More and more surgeons who specialize in plastic surgery report that the number of couples who visit their clinics and book appointments is increasing by the day and all of them want to undergo procedures together with their partners. Some couples even have this bizarre idea of using plastic surgery as part of their anniversary celebration.

We delved into the possible reasons why men opt for plastic surgery and found out that they do it to stay competitive and viable. More and more men are flocking clinics to schedule for tummy tucks and liposuctions as their way of taking care of their mid-section. They also opt for chin implants to give them a more masculine look. These are just some of the many procedures marketable to modern-day men.

Surgeons have this theory that men want to keep up with their younger-looking wives that is why they are stepping up their game and diving into all sorts of plastic surgeries.

# makeup color matching in development

Statistically speaking, finding the right shade of makeup can be tough, no mater what your age. The data experts at Sephora, one of the world’s largest cosmetic companies, indicates that the average woman tries seven times before she finds the ideal foundation. (I wonder if we could create a computer algorithm to speed that up?) That can be an expensive proposition because of the price of quality makeup.

All hope is not lost, however, as Sephora is attempting to make the process easier by teaming up with Pantene, the company renowned as an authority on color and color systems, to help women, and maybe even some adventurous men, to find the correct shade of makeup on the first try.

The new foundation is called ColorIQ. The name is quite fitting, as the amount of research, development and data they had to process to develop this foundation is staggering. It features digital imaging technology that records 27 separate color-corrected images in under two seconds while using eight visible light and one ultraviolet light settings to recommend the ideal foundation color.

Sephora’s makeup experts indicate that skin tone is dictated by ethnicity, melanin levels, skin conditions, hemoglobin, sun exposure and freckles. Julie Bornstein, Sephora senior vice president, said that Sephora, which has spent decades working on the science behind color, has in conjunction with Pantone mapped 110 skin tone shades in the United States.

After Color IQ measures your signature skin tone, it takes the digital images of your face and breaks them into 100-pixel blocks. Sephora then creates a color composite along with a Pantone Skin Tone number for you.

Sephora has tested skin from women all over the world, producing 1,000 different skin combinations. That data will determine which foundation will work best for you, according to Bornstein. Once you get your Skin Tone number, a Sephora representative will enter it into the company’s iPad app for individualized suggestions.

Sephora’s New York and San Francisco stores will make this process available to women in those cities within the next few weeks. Roll-out of the skin scans to the company’s 300-plus stores in the United States will happen at a later date.

Bornstein noted that the concept of virtually trying on clothing and makeup is growing in both industries. What sets apart Sephora’s process is it has a certain purity that will make it effective.

Many will consider these customized fashion and makeup trends that help women find their best beauty solutions to be the next must-haves, but others will pass based on what may appear to be artificiality.

As Bornstein stated, however, this process give the industry the ability to truly recommend a product based on an individual’s skin.

# what are hash tables and how do they work?

As we saw with binary search, certain ageless data structures such as a binary search tree can help improve the efficiency of searches. From linear search to binary search, we improved our search efficiency from O(n) to O(logn) beautifully. We now present a new data structure, called a hash table, that will increase our efficiency to O(1), or constant time.

In computer science, a hash table, or a hash map, is a data structure that associates keys with values. The primary operation it supports efficiently is a lookup: given a key (e.g. a person’s name), find the corresponding value (e.g. that person’s telephone number). It works by transforming the key using a hash function into a hash, a number that is used to index into an array to locate the desired location (”bucket”) where the values should be.

Hash tables are often used to implement associative arrays, sets and caches. Like arrays, hash tables provide constant-time O(1) lookup on average, regardless of the number of items in the table. (O(1) means that it takes a constant amount of time independent of the number of items involved.) However, the rare worst-case lookup time can be as bad as O(n). Compared to other associative array data structures, hash tables are most useful when large numbers of records are to be stored, especially if the size of the data set can be predicted.

Hash tables may be used as in-memory data structures. Hash tables may also be adopted for use with persistent data structures; database indexes sometimes use disk-based data structures based on hash tables, although balanced trees are more popular.

//this program creates a hash table as a set of linked lists // here 10 pointers are used to address 10 linked lists which form a hash tablw #include#include int main() { int i,k,num; struct node { int n; struct node* next; }; struct node *temp,*p1,*AOP[10]; for(i=0;i<10;i++) AOP[i]= NULL; for( i=0;i<20;i++) { scanf(“%d”, &num); k=num%10; p1=( struct node*) malloc ( sizeof(struct node)); p1->n=num; p1->next=NULL; if(AOP[k]==NULL) AOP[k]=p1; else { p1->next=AOP[k]; AOP[k]=p1; } } for(i=0;i<10;i++) { temp=AOP[i]; printf(“List number %d :”, i); while(temp!=NULL) { printf(“%5d”,temp->n); temp=temp->next; } printf(“\n“); } }

# huffman encoding algorithm

Data transmission and storage cost money. The more information being dealt with, the more it costs. In spite of this, most digital data are not stored in the most compact form. Rather, they are stored in whatever way makes them easiest to use, such as: ASCII text from word processors, binary code that can be executed on a computer, individual samples from a data acquisition system, etc.

Data compression is the general term for the various algorithms and programs developed to address this problem. A compression program is used to convert data from an easy-to-use format to one optimized for compactness. Likewise, an uncompression program returns the information to its original form.

There are many different reasons for and ways of encoding data, and one of these ways is Huffman coding. This is used as a compression method in digital imaging and video as well as in other areas. The idea behind Huffman coding is simply to use shorter bit patterns for more common characters, and longer bit patterns for less common characters.

Huffman coding is based on the frequency of occurance of a data item (pixel in images). The principle is to use a lower number of bits to encode the data that occurs more frequently.

## The first version of Huffman encoding

#include#include

## The second version of Huffman encoding by Una Benlic

#include#include #include #include

# what is quicksort and how does it work? video of cards sorted by quick sort

Pick an element from the array (the pivot), partition the remaining elements into those greater than and less than this pivot, and recursively sort the partitions. There are many variants of the basic scheme above: to select the pivot, to partition the array, to stop the recursion on small partitions, etc.

Quick-sort is a randomized sorting algorithm based on the divide-and-conquer method.

The worst-case efficiency of the quick sort, O(n2), occurs when the list is sorted and the left-most element is chosen. Randomly choosing a pivot point rather than using the left-most element is recommended if the data to be sorted isn’t random. As long as the pivot point is chosen randomly, the quick sort has an algorithmic complexity of O(nlogn).

Video of how quick sort works with cards:

The quick sort is by far the fastest of the common sorting algorithms. It’s possible to write a special-purpose sorting algorithm that can beat the quick sort for some data sets, but for general-case sorting there isn’t anything faster. Quick sort is not stable. The worst-case space-complexity is O(N), but it can be limited to O(log(N)) if the code is modified.

#include using namespace std; int a[10]; int partition(int left, int right); void swap(int i, int j); void sort(int i, int j); int main() { int i,j=0,k=9; for(i=0;i<10;i++) cin >> a[i]; sort(j,k); for(i=0;i<10;i++) cout << a[i] << endl; } void sort(int left, int right) { int p; if(left>=right) return; p = partition(left, right); sort(left,p-1); sort(p+1,right); } int partition(int left, int right) { int first=left, pivot=right–; while(left<=right) { while(a[left]<a[pivot]) left++; while((right>=first)&&(a[right]>=a[pivot])) right–; if(left<right) { swap(left,right); left++; } } if(left!=pivot) swap(left,pivot); return left; } void swap(int i, int j) { int temp=a[i]; a[i]=a[j]; a[j]=temp; }

# the monte carlo algorithm/method

The Monte Carlo method is a way of solving problems using statistical methods; stochastic technique (which means using random numbers) and probability.

Given some probability, P, that an event will occur in certain conditions, a computer can be used to generate those conditions repeatedly. The number of times the event occurs divided by the number of times the conditions are generated should be approximately equal to P.

*Scope:* The Monte Carlo methods are applied in various fields of mathematics, physics, economics and etc. Monte Carlo simulation methods are especially useful in studying systems with a large number of coupled degrees of freedom, such as liquids, disordered materials, strongly coupled solids, and cellular structures. The Monte Carlo method is often useful for solving problems in physics and mathematics which cannot be solved by analytical means. They are useful for modeling phenomena with significant uncertainty in inputs, such as the calculation of risk in business.

*Calculation of Pi:* Let’s make a circle inside a square and let’s take a quadrant out of it.

If we take a dice and throw it randomly inside the square, the probability that the dice will end up in the circle area is circle_area/square_area. Now if we replace it with formulas, just for one quadrant, we get:

*Pi=4*dice_hitting_circle_area/dice_hitting_square_area.* So by Pythagoras theorem we just have to take random values for x and y coordinates, square them, sum them up, take the square root out of the sum and if the result is less or equal to 1 then the dice is inside the circle. By repeating this few times we can get the approximation of the number Pi.

#include#include #include using namespace std; int main() { double x, y; //define x and y coordiantes int count_inside = 0, till=1000; //how many tries you want srand(time(NULL)); //define random values for(int i=0; i