MySQL account and group per day

I have the following structure ID DATE(DATETIME) TID 1 2012-04-01 23:23:23 8882 I'm trying to count the amount of rows and group them by each day of the month that matches TID = 8882 ThanksYou can group using the DAY function: SELECT DAY(Date), COUNT

Testing a Singleton

I've created a singleton which in the constructor goes like this: public static class MyCertificate { private readonly static X509Certificate2 _singletonInstance = new X509Certificate2(); static MyCertificate() { if(_singletonInstance == null) _singl

Why can not I focus a control I reveal with slideDown ()?

I want to reveal a div with an input inside when you click a button, and set its focus. If I use show(), it works, but if I use slideDown() the focus is lost after the animation completes. How can I prevent this from happening? Sample code: $("docume

Practical applications for AtomicInteger

I sort of understand that AtomicInteger and other Atomic variables allow concurrent accesses. In what cases is this class typically used though?There are two main uses of AtomicInteger: As an atomic counter (incrementAndGet(), etc) that can be used b

How to catch youtube URL and play in my application?

I've been searching fort this from last 2 days, but sorry to say i've not got any satisfied answers. My question is whenever a Youtube url is clicked in android device it should list my app as Complete action using I've tried a lot but not getting it

The Workbook_BeforePrint event does not work

I want to dynamically set some data to the header (and/or footer) of a sheet. From several forums I found numerous examples showing how to do that, and they all seem pretty easy to understand without any difficulty. So I applied what I read to a simp

Color image background with picture

I am wondering how I can set the backgroundColor of my UIView to the scroll View Textured background color. this is the way I plan on implementing it but im just not sure what the patternImage is called . jumpBarContainer.backgroundColor = [UIColor c

Can I use BufferedImage in Android?

I need to use Buffered Image into android.So I used java.awt.image.BufferedImage class jar.but it Showsjava.lang.noClassDefFoundError.anybody can i use BufferedImage into android?if yes,can tell what jar i should use?java.awt library is not supported

My simple sql update query does not work correctly :(

I've got a simple sql query that is trying to update a single row. The code came from some Linq-to-sql code (i used Profiler to grab it), but please don't worry about the source (L2S) ... that's irrelivant to the question. Now, when i try and do an u

Notepad ++ Regular expression adds the numbers

How do I sum or add a certain value to all those numbers? For example my goal is to increase all those numbers inside the "" with 100 but achieving that has been problematic. Basically just somehow sum the current number with +100. I have the fo

SQL order by time of day for 2 days

Title might be quite cryptic but here's my question. I have a table of events for a day (itinerary). Each entry (visit museum, for example) has slot_start and slot_end time columns. This is in 24hr format so 13:00:00 - 15:00:00 for example. I want to

Wordpress displaying the header and footer on all pages

Is there a way I can make the header and footer appear on all pages without placing get_header(); or get_footer(); in each of the separate page files? Is there something I can do in the loop or somewhere else that automatically does this?It works wit

JTable Image render takes too much load in Application

I am working on Java the Application of Swing and which i am getting Data and i am using swing Jtable Render for render Image in that but when data is more its hanging all time so what can i do to prevent that? example render that i am using. public

Fatal PHP error when installing Laravel 5 with Composer

I'm trying to run composer to install Laravel 5.0.14, and am also trying to test this code out in Jenkins using the Jenkins php-template. Whenever I run composer update, I get the following error: Error Output: PHP Fatal error: Call to undefined meth

Loss of color of the photo after the tattoo

Having a few teething problems watermarking a photo. It all works fine apart from the watermarked photo's colors become duller than they should be - very noticeable in-fact. I'm using imagecopyresized to do my watermarking, as this specifically allow

Add and find the average in a table

I"m trying to make a program that retrieves an endless amount of numbers that user inputs, and then it tells you how many numbers that you inputted, the sum of all the numbers, and then the average of the numbers. Here is the code I have so far. I do

problems with ArrayList in if-statement and for-loop

I have a question regarding the for-loop and ArrayList. I have a HashMap with String and Integers, where the String represents a class, and the Integer represents the grade. They I have a collection of students in an ArrayList. So what I am trying to

Need to delete the last column in each third line of a file

So far, I have the following code that allows me to loop through a file and identify the third line of every file. However, I want to delete the last column on every third line, but I'm having trouble coming up with the syntax: #!/bin/bash counter=1

Paragraphs in javascript

Do you know if there is an easy way of counting paragraphs in a textarea using nothing but javascript? Thanks,Try this one: document.getElementById('textarea_id').value.replace(/\n$/gm, '').split(/\n/).length; This will ignore empty strings (see @Sea

Django displays the value of the additional field in modelform

How do I set the value of a field (which is relevant to form, but not based directly on the same model) on a (model) form when it is displayed in the admin? Here is a simplified version of what I have (my actual app/model/etc is more complicated): A

Prolog takes the inverse of a predicate

I got a database that looks like hasChild(person1, person2). hasChild(person1, person3). hasChild(person4, person5). Which means that (for example) person1 has child named person2. I then create a predicate that identifies if the person is a parent p