I used HTTP Chache Manager to Cache files which are being cached in browser. I am successful of doing it for some of the pages. Number of files being cached in Jmeter is equal to Number of files being cached by browser.
But in some cases :
I found number files being cached is lesser than the files being cached by browser.
Using Jmeter I found only 5 files are being cached but in real browser 12 files are getting cached.
Thanks in advance
Given a model structure like this:
class Book(models.Model):
user = models.ForeignKey(User)
class Readingdate(models.Model):
book = models.ForeignKey(Book)
date = models.DateField()
One book may have several readingdates.
How do I list books having at least one readingdate within a specific year?
I can do this:
from_date = datetime.date(2010,1,1)
to_date = datetime.date(2010,12,31)
book_ids = Readingdate.objects\
.filter(date__range=(from_date,to_date))\
.values_list('book_id', flat=True)
books_read_2010 = Book.objects.filter(id__in=book_ids)
Is it possible to do this with one queryset, or is this the best way?
I have a whole bunch of percentages stored as XX% (e.g. 12%, 50%, etc..) I need to remove the percentage sign and then multiply the percent against another variable thats just a number (e.g. 1000, 12000) and then output the result. Is there a simple way to strip the percentage sign and then calculate the output with PHP? Or should I consider some sort of JS solution?
I remember quickly adopting given .. when, say, //, and the smart matching operator when Perl 5.10 came around.
What do you consider the most useful fixes and features introduced with Perl 5.12.0?
I have the following models
user
has_many :leave_balances
leave_balance
belongs_to :user
belongs_to :leave_type
leave_type
has_many :leave_balances
I want to output a table format showing user names and their balance by leave type.
Not every user can have every balance i.e. outer joins required.
I'd like to see something like this:
Employee Annual Leave Sick Leave
Bob 10
Fred 9
Sara 12 15
I am unsure how to get this out as a single statement?
I am thinking something like User.joins(:leave_balances).joins(:leave_type)
Hi i got this text
2/92/20
3/32/32
4/62/6
5/22/28
6/60/61
7/33/32
8/34/31
9/31/19
10/19/19
11/34/39
12/32/32
14/19/25
15/45/37
16/32/32
17/84/36
18/72/33
and i need it to be like
// 2/92/20
chars[0][0]=2;
chars[0][1]=92;
chars[0][2]=20;
How should i make that
PS: the split must be in
$.ajax({
type: "POST",
url: "char_info2.php",
dataType: "html",
success: function(data)
{
//here
}
Is there any way I can find the rank of a set of values in Microsoft Reports?
For instance, in order to produce a table like the one below, what function/formula do I enter in the Rank column?
+------+-----+
|Value | Rank|
+------+-----+
| 12 | 3 |
| 30 | 5 |
| 5 | 1 |
| 10 | 2 |
| 24 | 4 |
+------+-----+
Update
Values in the value column are produced from calculations on the report-side so I cannot find the rank using a query.
Hi,
I need to figure out the value of data strings with jquery, for example like this:
{ label: "Beginner", data: 2},
{ label: "Advanced", data: 12},
{ label: "Expert", data: 22},
to add them up.
Something like:
var sum = data1+data2+data3;
alert(sum);
So the result for this example would be 36.
Appreciate your help!
Nicole
So I am using a scripting language with c++-like syntax, and I am trying to think of the best way to check if a date is within range. The problem I am running into is that if the current day is in a new month, the check is failing.
Here is what my code looks like:
if(iMonth >= iStartMonth && iMonth <= iEndMonth)
{
if(iDay >= iStartDay && iDay <= iEndDay)
{
if(iYear >= iStartYear && iYear <= iEndYear)
{
bEnabled = true;
return;
When I have something like this:
Start date: 3 27 2010
End Date: 4 15 2010
Current Date: 3 31 2010
The day check fails because if (iDay <= iEndDay) does not pass. The scripting language doesn't have a lot of time related functions, and I can't compare timestamps because I'm allowing users to put like "03:27:2010" and "04:15:2010" as start/end dates in a config file. I'm assuming I am just not thinking straight and missing an easy fix.
I run the following command to push the contents of my local database to Heroku:
heroku db:push --app my-app
and from my home computer it works flawlessly but from my work computer I get this error:
Taps Server Error: PGError: ERROR: time zone displacement out of range: "2011-11-15 12:00:00.000000+5894114400"
I'm not sure where that date is coming from, I can't find it in the data anywhere. Any ideas what's going on and/or how to fix it?
Thanks.
Here is the problem,
in Blend 3 i have 12 storyboards, i can manipulate them with using xaml, but when i try to manipulate them with c#, blend seems cannot see them. Where could be the problem?
The exact error is :
The name 'name of the stroyboard which exists' does not exists in the current context
I've tried this:
main = do
hSetBuffering stdin NoBuffering
c <- getChar
but it waits until the enter is pressed, which is not what I want. I want to read the character immediately after user presses it.
I am using ghc v6.12.1 on Windows 7.
I need plot a curve for my data , the source is like :
12, 14, 18, 30, ....
I was using Qt Qwt, and need port it to windows forms, are there controls? free of charge?
If you go to the "Variable Grid System" generator
and have:
column width = 20
number of columns = 12
and gutter width = 60
...the system provides a content width
of 900 and a full width of 960.
http://www.spry-soft.com/grids/
Now, this is all fine and dandy in Firefox, Chrome,
and even IE6, but when you load those settings in IE8,
you end up with the actual full width as 1000px,
not 960px.
Has this issue been encountered before?
I have an array of numbers:
@numbers = 1,2,3,6,8,9,11,12,13,14,15,20
and I want to print it this way:
1-3,6,8-9,11-15,20
Any thoughts? Of course I tried using the most common "looping", but still didn't get it.
I've got this openmp fortran program doing an embarrassingly parallel problem - do loop over 512^3 elements. See output below. Why would there be such strange behavior in the elapsed time as a function of threads? I thought it would peak at a sweet spot then slowly degrade. This clearly isn't happening. Perhaps I misunderstand something about openmp.
Threads, omp_get_wtime
1, 103.76298500015400
2, 65.346454000100493
4, 45.923643999965861
7, 38.074195000110194
8, 36.968765000114217
9, 39.45981499995105
10,40.753379000118002
12,39.577559999888763
14,37.909950000001118
Friday, March 12, 2010 1:18 pm. In windows -- and probably unix for that matter -- using the chdir() function in a (32-bit) program doesn't change the directory when the program exits. (It does in a 16-bit windows program.) Does anybody know how to do that in a windows 32-bit program?
I inherited a script running on Server 2003 that I need to port to Server 2008. The current script is:
strComputer = "servernamexyz"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
objOperatingSystem.Win32Shutdown(12)
Next
How do I convert this to run on Server 2008? Thanks!
I have a sql statement I am using a simple sort such as the following
Select numbers
From theTable
Order By numbers
What I get in return is the following
1
11
12
14
2
21
22
23
3
35
37
etc...
I want it to be ordered in normal order
1
2
3
4
5
6
etc...
hi
i have an string
List rows = new List();
now rows has an data like this
countryname~population
india~12,211
china~23,22,223
usa~45,454
japan~34,343,232
now i need to bind this data in gridview like countryname and population as header for gridview
countryname population
india 12,211
china 2322223
usa 45454
japan 34343232
any help would be
great thank you
We are using Crystal Report 12 in one of our projects. Currently I need to create report template which should show different icons based on the some field value.
That field contains a number, storing some kind of status and I have several icons corresponding some statuses.
At the moment I can't figure out how to implement such a thing in Crystal Reports designer.
Could someone please help me?
I'm trying to store a 12/24hr (ie; 00:00) clock time in a MySQL database. At the moment I am using the time datatype. This works ok but it insists on adding the seconds to the column. So you enter 09:20 and it is stored as 09:20:00. Is there any way I can limit it in MySQL to just 00:00?
I have:
class A {
public:
B toCPD() const;
And:
template<typename T>
class Ev {
public:
typedef result_of(T::toCPD()) D;
After instantiating Ev<A>, the compiler says:
meta.h:12: error: 'T::toCPD' is not a type
neither decltype nor typeof work either.