Hey,
I want to measure thread execution time in Java. Now I'm monitoring thread start and end times, but I think it's not so accurate because thread could be suspended during it execution.
What PHP code can I use to stop showing text at a certain time?
For example:
"Come to this event at 3PM on Monday!"
I don't want that to show after 3:01PM on the site.
I have a application that is developed using .Net Compact frame work 3.5, i need to synchronize the device date and time with the central server on every web service call.
Thanks.
I am getting the date from my mysql database and that date is correct but when I use the date() function the minute part is stuck a 6 minutes.
My mysql is returning 2010-06-15 09:59:18
Then in php I use this code:
date('M d,Y H:m A',strtotime($row[4]))
** $row[4] is from my while loop **
When I echo this out I get: Jun 15,2010 9:06 AM
I also have tried converting it to unix timestamp in my sql query, does the same thing.
I noticed that the hours work and the seconds work but the minutes are stuck at 6.
Does anyone have any ideas on what is going on?
Hello I have a problem with GregorianCalendar.
What is wrong in there?
How outcome is 2010/6/1 and not 2010/05/31?
package test;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class Main {
public static void main(String[] args) {
Calendar cal = new GregorianCalendar(2010, 5, 31);
System.out.println(cal.get(Calendar.YEAR) + "/" + cal.get(Calendar.MONTH) + "/" + cal.get(Calendar.DAY_OF_MONTH));
}
}
I'm trying to set up url routing on my server for the first time. I'm fairly sure that mod_rewrite is enabled. Are there any other configurations I need to change or things to set up? Should the routing.yml file just automatically get read?
Is there a way to kill a child thread after some specified time limit in Java?
Edit: Also this particular thread may be blocked in its worst case (Thread is used to wait for a file modification and blocks until this event occurs), so im not sure that interrupt() will be successful?
java.util.concurrent.ConcurrentLinkedQueue comes to mind, but is it really optimum for this two-thread scenario? I am looking for the minimum latency possible on both sides (producer and consumer). If the queue is empty you can immediately return null AND if the queue is full you can immediately discard the entry you are offering.
Does ConcurrentLinkedQueue use super fast and light locks (AtomicBoolean) ? Has anyone benchmarked ConcurrentLinkedQueue or knows about the ultimate fastest way of doing that?
Additional Details: I imagine the queue should be a fair one, meaning the consumer should not make the consumer wait any longer than it needs (by front-running it) and vice-versa.
hi,
i have a query regarding to insert data in multiple table..
i have a two tables. one is item table and second is field table.
i want to insert data in both table with one query at a time.
any idea about it.
Hi guys i have a table with shifts history along with emp ids
im using this code to retrieve a list of employees and their total shifts by specifying the range to count from:
SELECT ope_id, count(ope_id)
FROM operator_shift
WHERE ope_shift_date >=to_date( '01-MAR-10','dd-mon-yy') and ope_shift_date
<= to_date('31-MAR-10','dd-mon-yy')
GROUP BY OPE_ID
which gives
OPE_ID COUNT(OPE_ID)
1 14
2 7
3 6
4 6
5 2
6 5
7 2
8 1
9 2
10 4
10 rows selected.
NOW how do i choose the employee with the highest no of shifts under the specified range date, please this is really important
I'm using GlassFish v3. The following field is declared in a class:
@Resource
private javax.sql.DataSource _data_source;
The following is declare in web.xml:
<data-source
<namejava:app/env/data</name
<class-namecom.mysql.jdbc.Driver</class-name
<server-namelocalhost</server-name
<port-number3306</port-number
<usermyUser</user
<passwordmyPass</password
</data-source
At run-time _data_source is empty. What am I doing wrong?
Hi guys, i have the following code below:
const char* timeformat = "%Y-%m-%d %H:%M:%S";
const int timelength = 20;
char timecstring[timelength];
strftime(timecstring, timelength, timeformat, currentstruct);
cout << "timecstring is: " << timecstring << "\n";
currentstruct is a tm*. The cout is giving me the date in the correct format, but the year is not 2010, but 3910. I know there is something to do with the year cound starting at 1900, but im not sure how to get strftime to recognise this and not add 1900 to the value of 2010 that is there, can anyone help.
Regards
Paul
I'm using c#, and if I do
DateTime.ParseExact(“4/4/2010 4:20:00 PM”, “M'/'d'/'yyyy H':'mm':'ss' 'tt”, null)
The return value is always 4:20 AM -- what am I doing wrong with using tt?
Thanks!
Can someone explain this behaviour?
test.c:
#include <stdio.h>
int main(void)
{
printf("%d, %d\n", (int) (300.6000/0.05000), (int) (300.65000/0.05000));
printf("%f, %f\n", (300.6000/0.05000), (300.65000/0.05000));
return 0;
}
$ gcc test.c
$ ./a.out
6012, 6012
6012.000000, 6013.000000
I checked the assembly code and it puts both the arguments of the first printf as 6012, so it seems to be a compile time bug.
I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can anyone elaborate on this?
Thanks.
I have to support IE6 and I calculate rendering time by creating a timestamp in javascript at the beginning of the page and doing the difference when document.ready is fired in jQuery.
If I do 3 pages load, the rendering times in milliseconds can look like this :
page 1 : 735, 2672, 734
page 2 : 3063, 1516, 3375
page 3 : 8281, 2531, 3703
Why is that? How can I have more consistency?
How can I convert a COleDateTime::GetCurrentTime() to a unix time stamp or more specifically I want to convert the value so I can use it in PHP with the date() function?
I recently came across Pomodoro Technique as a way to increase productivity, get in the zone, and in general feel a sense of accomplishment at setting some short programming goals and achieving them.
So far I have enjoyed it and the sense of accomplishment I get after seeing a bunch of short goals add up at the end of the day to a lot of work done on a programming project.
I'm looking for other ideas similar or not to the pomodoro technique to add a little variety to achieving goals, personal productivity, get in the programming zone, etc.
Any ideas or techniques that are expressed formally such as in the pomodoro paper, that are not trite fluffy maxims?
Let's say we have an empty bathtub. We've lost the plug, so once water is added it will drain away at a constant rate of 2 liters pr. minute. We add water to the tub in increments. 60 liters at 10:51, 30 liters at 11:54 and 50 liters at 13:18.
So, the question is: How can I find out how much water is in the bathtub at any given time?
I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to resolve it? Rebooting normally takes a long time to take effect, and might just makes things worst
UPDATE: It is not about permissions - i can log in normally just fine. I suspect it might be because of memory issues