SQL - Selecting multiple results using AVG

So I'm trying to select multiple results from my table. I have name's for users and a score for them. User's are split into groups. Fields necessary: groupnumber, score I'm attempting to find the total, average, minimum and maximum scores for each gr

Create a list of DbCursor in MongoDB and Java

I am trying to use a cursor to iterate over documents, i want to store them in a list,and later on return a list of type DBOject. Here is what I am trying: public List<DBObject> getResultsInDescendingOrderByDate(int limit) { List<DBObject> myL

Receive Ethernet packets on Linux with several Ethtypes in C

I want to receive ethernet packets from socket in Linux, but only those, which have one of two custom Ethtype values. As I know, if only 1 ethtype should be received, it's possible to specify this value while creating socket like this int socket = so

Resize animation to wikipedia

If you go to a Wikipedia page in Chrome and ctrl+scrollup or ctrl+scrolldown the resize is done in an animation. How is this achieved? (In FF only the Read View source View history links in the top right corner animate)If you examine the CSS with Chr

EmptyBorders on JPanel in BoxLayout.X_AXIS

I have a custom JPanel, which the paintComponent method is overridden to paint an image. I want to insert several of these custom panels vertically centered in a container. To do this I created a jpanel with BoxLayout.X_AXIS as layout manager. This w

Symfony UserBundle: Replace the field name in the database

In order to share the database with another, non-Symfony based application, I want to change some field names of the User table. The custom entity is defined like this: <?php namespace Bcg\UserBundle\Entity; use FOS\UserBundle\Entity\User as BaseUser

Concatenation in jQuery

var os = $.client.os; // mac var browser = $.client.browser; // firefox var browserversion = $.client.browserversion; // 3 $('#root').addClass( os + browser + browserversion ); .. results in <div id="root" class="macfirefox3">. H

CodeIgniter MVC: several models per controller?

I was pushed into an existing CodeIgniter project and am familiarizing myself with the proper conventions for their MVC approach. One thing I'm stuck on is relating models and controllers. The CI documentation gives almost no guidance on this and I'm

Automatic detection of NSEncoding

On my program I receive an NSData that has a string sometimes encoded in UTF8, other times in Latin1. Is there a way to automatically detect which encoding is being used? I tried writing it to a file so I could use stringWithContentsOfFile:usedEncodi

How to Change the Name and Address of a Tag Gag Tagger

Long story short I'm writing a script to migrate a very large project from (gasp) Microsoft SourceSafe to Git and I'm trying to retain the authors of the SourceSafe project's labels(which are essentially tags in Git). I know you can modify the author

Real-time data management

My program will be requesting realtime data from a website. This data can change at any time, so I need to request it repeatedly and frequently to monitor changes. The data is to be displayed on a windows form chart as a histogram along with some mov

Simplification of double einsum

I'm trying to use numpy.einsum to simplify a loop I have in my code. Currently, my code looks something like this: k = 100 m = 50 n = 10 A = np.arange(k*m*n).reshape(k, m, n) B = np.arange(m*m).reshape(m, m) T = np.zeros((n, n)) for ind in xrange(k):

Create a database for genealogical research

First, let me state that I am NOT a coder, and when it comes to databases, I'm basically an end-user. Ok, with that out of the way, here's my scenario: I have been researching old parish records in Trentino, Italy for the past 4 years. I've got close

Authentication in the Asmx service

I am using ASP.NET with an asmx service for data access towards my SQL database. The servie is called both Client and backend. The site is going to be used both our internal staff and for our customers. There is some methods in the asmx service that

jump from scanf between

In this program the second and forth scanf get skipping , don't know the reason . can some please tell the reason ? #include<stdio.h> main() { int age; char sex,status,city; printf("Enter the persons age \n"); scanf("\n%d",&a

Redirection in Ubuntu

Good evening. Set up Ubuntu 14.04,I started to use Terminal and encountered on a strange thing: I tried to find a file and hand the control to "more". find -name qwerty1 | more But something very strange goes on:given below both strings of code

Retrieving the DOS command output in C

Using system() or exec(), I can get any command to execute but they display the result into the Console. I want to execute the command and extract the output and process it, and then display it. How can I achieve this on Windows/DOS Platform?There's

PHP: 'MongoClient' class not found after installation (Linux)

I have mongo server install and the mondo php extension enable: Why am I still getting this error: Fatal error: Class 'MongoClient' not found in ... My code: // connect to mongodb $m = new MongoClient(); var_dump($m); How I install mongo server: `$ s

WPF Progressbar Will Not Align Properly

i have the following XAML code to display a set of controls in my window: <Grid Height="80"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Gr

Find a file with unknown extension

I got in my directory some images, with id in their names. I know the id's , but I don't know their formats, so I cant use a href to display them since I don't know the format. I need an idea or function for this so I can search: fe. href="img/avatar

Save the image as a block

I have used MySQL to save a image as a blob type. I 'm uploading files through PHP and when I get the image back I revive only a part of it. How can I improve the max size ? (my image file size is less than 300 KB) PHP uploader... if($_FILES!=null &&a

Delay in the evaluation of the knock-out connection

Knockout newbie here. I have a page to display the customer info. 1st div should be displayed when customer info is present. 2nd div should be displayed when no customers are displayed //1st Div <div id="custInfoList" data-role="content&

Android aapt doubles file errors when building with an ant

I am using ant to make a build system for our android project which has two build targets, Dev and Release. This involves replacing the default -package-resources target with my own one in my build.xml. It goes from this: <target name="-package-re