I have a gps time in the database,and when I do some query,I have to use the java.util.Date,however I found that I do not know how to change the gps time to java.util.Date.
Here is a example:
The readable time === The GPS time
2010-11-15 13:10:00 === 634254192000000000
2010-11-15 14:10:00 === 634254228000000000
The period of the two date is…
So if I have a recursive function with a global variable var_:
int var_;
void foo()
{
if(var_ == 3)
return;
else
var_++; foo();
}
and then I have a function that calls foo() so:
void bar()
{
foo();
return;
}
what is the best way to set var_ =0 everytime foo is called thats not from within itself. I know I could just do:
…
If you open this HTML in Firefox 3.6.3 (confirmed in some earlier versions too), and click the drawStuff() link repeatedly, it doesn't render the contents of the last div consistently. Looking more closely it seems like it's rendering select fields with height=0. Any idea why this would happen?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01…
The database is then transferring the data to a spinner which I want to leave position 0 blank so I can add a item to the spinner with no value making it look like a prompt. I have been going at it all day. FAil after Fail
MainActivity
public class MainActivity extends Activity {
Button AddBtn;
EditText et;
EditText cal;
Spinner spn;…
Hi, I like to add (+1) to a number. But problem is my number can sometimes have 0 preceding it. Like 01, 02, 03, 04. So I like result to be:
mockup01 + 1 = mockup02
mockup11 + 1 = mockup12
How can that be achieved? Example of how I would use it would be if I had filename named mockup_01.htm and change it to mockup_02.htm
Thanks!
I'm trying to add two values in velocity and it always returns 0. What am I doing wrong?
#set ($tmpPrice = $orderItem.ExtendedPrice + $discountAmount)
Both $orderItem.ExtendedPrice & $discountAmount are whole numbers with decimals, like this: 99.99
Hi2All..
I have some null struct, for example:
struct null_type
{
NullType& someNonVirtualMethod()
{
return *this;
}
};
And in some function i need to pass reference to this type.
Reason:
template <typename T1 = null_type, typename T2 = null_type, ... >
class LooksLikeATupleButItsNotATuple
{
public:
…
We have a VMWare ESXi 4.1 server hosting a number of Linux and Windows guests. Recently a new Linux guest was added to this server and seemed to be performing well. Tomcat and some other applications on this server were then installed which seem to have caused the server to run really slowly without any obvious resource issues.
Slow…
I have problem with starting PostgreSQL 8.4 on Ubuntu 9.10 Server after blackout. When I try to connect to the database it says:
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally before or while processing the request.
When I try to start it by using command
sudo -u postgres…
Recently I've started learning Unity3D. I'm working on a game as an exercise in which you control a space ship and have to dodge asteroids. If you feel like it's getting a bit too much you can hit the space bar, emitting a blast in all directions that repulses nearby asteroids. To create this blast I have the following code:
…
I have googled and found out Updates don't install because of "untrusted packages".
It didn't fixed the error. So, how do I fix my GUI update?
Updated
sudo apt-get update && sudo apt-get upgrade < working
The following packages will be upgraded:
ambiance-colors radiance-colors
2 upgraded, 0 newly…
I have been happily using JQuery for the last 2 years and have been quite sucessful creating some really cool functionality with it...so I am very comfortable with it. I also beleive the future of the web will continue on the current client-side path.
However...
The next challenge seems to be coming in the form…
I have win7 installed in my system and I decided to give Ubuntu a try. I formatted my drive as follow :
C:\ - For Win7 - 55G
D:\ - Data - 40G
E:\ - Unallocated space - 55G - This is where the installation of Ubuntu
I tried to install with this partition table (All set as logical)
/dev/sda6…
My scanner is detected but its not working Scanner BENQ 5000
lsusb
root@onezero:/home/one# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001:…
I have buyed domain from one company and hosting from another.
On hosting company website finded DNS addresses and applied them to domain hosting website(changed DNS) I done it yesterday, so today it should work, but: Unable to resolve the server's DNS address appears.
In direct admin control panel (DNS…
So I've been trying to get started with game development for Android using Unity3D. For my first project I've made a simple cube that you can spin using touch. For that I have the following code:
using UnityEngine;
using System.Collections;
public class TouchScript : MonoBehaviour {
float speed =…
What is the correct strategy to limit the scope of #define and avoid unwarrented token collisions.
In the following configuration:
Main.c
# include "Utility_1.h"
# include "Utility_2.h"
VOID Utility() // Was written without knowing of: Utility_1 & Utility_2
{
const UINT ZERO =…
On synaptic selected my old kernel to uninstall:
linux-generic
linux-headers-3.2.0-31-generic
linux-image-3.2.0-31-generic
linux-image-3.2.0-33-generic
linux-image-generic
But if i select to uninstall linux-headers-3.2.0-33-generic it select my display drivers and after that wanna install pae…
I’ve been looking at various asynchronous resource-loaders and I’m not sure which one to use yet. Where I work we have disparate group-efforts whose class-modules may use different versions of jQuery (etc). As such, nested dependencies may differ, as well. I have no control over this, so this…
I have just installed a new copy of Ubuntu 12.04 on my laptop . i have noticed that my system is running 4x to 5x faster than normal . i have just install Vmware Desktop & centos for testing something . i have noticed that i has installed in just like less than 1 minute !!
My system is…
I want nice operators for complex arithmetic to make my code more readable. Ocaml has a Complex module, so I just want to add operators that call those functions.
The most intuitive way for me is to make a new complex operator from all of the usual operators by appending '&' to the…
The app is basically ready, so I eagerly started to sort out creating the application entry in iTunes Connect. It's mostly intuitive actually, although I did have to create yet another icon for iTunes sized 512x512 pixels, damn lucky I did the original graphics as vector! It took me…
Hi gamedev, I'm developing a Tetris clone and working on the input at the moment.
When I was prototyping, movement was triggered by releasing a directional key. However, in most Tetris games I've played the movement is a bit more complex.
When a directional key is pressed, the…