SQL Query with SUM with Group By

The GROUP BY clause forms rows for each unique combinaton of the columns you nominate in that clause. If you want to show a sum for each month, then only include s.month in the group by clause: e.g If you include reseller details in the select clause also include them in the group by clause … Read more

Python group by

Do it in 2 steps. First, create a dictionary. Then, convert that dictionary into the expected format. It is also possible with itertools.groupby but it requires the input to be sorted first. Note both of these do not respect the original order of the keys. You need an OrderedDict if you need to keep the … Read more

Rename Pandas DataFrame Index

The rename method takes a dictionary for the index which applies to index values.You want to rename to index level’s name: A good way to think about this is that columns and index are the same type of object (Index or MultiIndex), and you can interchange the two via transpose. This is a little bit confusing since the index names … Read more

Remove list from list in Python

Possible Duplicate:Get difference from two lists in Python What is a simplified way of doing this? I have been trying on my own, and I can’t figure it out. list a and list b, the new list should have items that are only in list a. So: I tried writing code, but every time it … Read more

Difference between ‘strcpy’ and ‘strcpy_s’?

strcpy is a unsafe function. When you try to copy a string using strcpy() to a buffer which is not large enough to contain it, it will cause a buffer overflow. strcpy_s() is a security enhanced version of strcpy(). With strcpy_s you can specify the size of the destination buffer to avoid buffer overflows during copies.

What is the difference between Amazon SNS and Amazon SQS?

SNS is a distributed publish-subscribe system. Messages are pushed to subscribers as and when they are sent by publishers to SNS. SQS is distributed queuing system. Messages are not pushed to receivers. Receivers have to poll or pull messages from SQS. Messages can’t be received by multiple receivers at the same time. Any one receiver can receive a message, process and delete it. Other receivers do not receive … Read more