Hi All,
I am using a timer with interval 50 miliseconds.
But in the timer's tick event when I print the time it's always 62 or 65 ms.
I don't understand why it's taking 10 ms more.
Please can some one have look into this.
Here is the code I am using.
static int _counter;
System.Timers.Timer _timer = new System.Timers.Timer(1000);
public Form1()
{
InitializeComponent();
_timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed);
_timer.Start();
}
void _timer_Elapsed(object sender, ElapsedEventArgs e)
{
Console.WriteLine(DateTime.Now.ToString("{hh:mm:ss.fff}"));
_counter++;
if (_counter == 20)
_timer.Stop();
}
And this the output:
{01:59:08.381}
{01:59:09.393}
{01:59:10.407}
{01:59:11.421}
{01:59:12.435}
{01:59:13.449}
{01:59:14.463}
{01:59:15.477}
{01:59:16.491}
{01:59:17.505}
{01:59:18.519}
{01:59:19.533}
{01:59:20.547}
{01:59:21.561}
{01:59:22.575}
{01:59:23.589}
{01:59:24.603}
{01:59:25.615}
{01:59:26.629}
{01:59:27.643}
hi all,
i have an address for a location. when i click some button in my app. it should redirect to default google map in android and drop the pin to that particular location. how to do that? Any Idea?
I have an application and from this application I have to start another process by shutting down the current application and after the completion of the process again start the application. The flow is as follows, suppose I have an application app.exe, and another application another.exe, so i have to do following:
1) Start app.exe
2) Stop/shutdown app.exe and start another.exe from app.exe
3) When another.exe completes, stop/shutdown another.exe and start app.exe from another.exe
Anyone please provide me some clue of how to do it ?
i want to send input data in one application to the other application using "intent" or can we store user input from one application that can be used by other application.
Hi, I am loading data from one sample.xml file using http service. the xml file will generated by jsp and it is saving in one proper location like(d:/programfiles/some.xml).now when I first time login to application i need to check whether that xml file is present or not. How can I check?
Please help me in this it will very help full for me.
i created a non static inner class like this
class sample{
public void sam(){
System.out.println("hi");
}
}
called it in main class like this:
sample obj=new sample();
obj.sam();
it throws an exception: non-staic class context like that? when i put the both object and class as static. it works.why?
(function () {
function User() {
//some properties
}
//private fn 1
User.prototype._aPrivateFn = function () {
//private function defined just like a public function,
//for convetion underscore character is added
}
//private function type 2
//a closure
function _anotherPrivateFunction() {
// do something
}
//public function
User.prototype.APublicFunction = function () {
//call private fn1
this._aPrivateFn();
//call private fn2
_anotherPrivateFunction();
}
window.UserX = User;
})();
//which of the two ways of defining private methods of a javascript object is better way, specially in sense of memory management and performance.
iam having an array of items like
[item1,itmem2,item3];
i have to insert these items at a particular userId:
final results look like this
UserId ItemId
2 || item1
2 || item2
2 || item3
currently iam looping through the array in php code and inserting each item one by one eg
foreach($items as $item)
{
insert into items (UserId,ItemId) value (2,$item);
}
is it possible i can insert all entries in single query.
i saw that in asp.net .asmx file, we create webservices
[webmethod]
//method defination here
now for soap webservice
[webmethod]
[SoapHeader(some parameters here)]
//method defination here
my question is what's the difference b/w both webservcies type and how to choose which service type to choose
Does the the Flash/flex development die because of the HTML5? flash is the main need to play the multimedia activities on the browser. HTML5 includes this video playing option just with the tag. Everybody knows flash content takes time to load initially.So what about the Future of Flash and Flex development people?
//I am cloning a dom element and inserting it in dom element multiple times
<div class='toBeCloned'>some text</div>
<div id='target'></div>
var _clone=$('.toBeCloned').clone(true);//create clone
var _target=$('#target'); //this is target
_target.append(_clone); //append target
_target.append(_clone); //append target
_target.append(_clone); //append target
//this should add 3 elements but it's adding only one
As I was a Windows programmer it was so easy to show a message box on a form.
But on an ASP.NET page I don't know how can I show it?
Actually I have some condition and based on that I want to show a message box to the user to get his/her response and based on that response I want to continue.
For example I want to ask the user "Do you want to continue?" with two buttons "Yes" & "No".
hi
i am using cakephp for my project but whille creating acl using command promt.
when i run the following command cake schema run create DbAcl it genrate three tables in database. but after puting the following code in users_controller.php. and this command. cake acl view aro
it dont create aros.
function index()
{
$aro =& $this->Acl->Aro;
//pr($aro); exit;
//Here's all of our group info in an array we can iterate through
$groups = array(
0 => array(
'alias' => 'admins'
),
1 => array(
'alias' => 'guests'
),
2 => array(
'alias' => 'mangers'
)
);
//Iterate and create ARO groups
foreach($groups as $data)
{
//Remember to call create() when saving in loops...
$aro->create();
//Save data
$aro->save($data);
}
}
Can we develop the apps using java for Iphone and ipad. i was experienced in java. Nothing about objective-c. is that possible? Else tell me how to study the objective c with java comparatively?
Hi All,
Could I get ideas on retrieving the dataset using lookup method. Basically, my scenario as I have source data needs to lookup for other source table and on matching column from source I need to get all the records from other source data.
its a one to many relations. I tried Lookup but gives only one record on matching condition, OLE DB command don't retrieve any data as it will do only Insert/Update operations.
Thanks
prav
Hi All,
I want to know why we can't have "char" as underlying enum type.
As we have byte,sbyte,int,uint,long,ulong,short,ushort as underlying
enum type.
Second what is the default underlying type of an enum?
Hi All, my login form in flex when I login I have created a cookie in jsp like this name setValueCookie.jsp
<%@ page language="java" import="java.util.* , javax.net.*" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
String username = request.getParameter("value");
System.out.println("Email got in cookieSet = " + username);
if(username==null) username="";
Date now = new Date();
String timestamp = now.toString();
Cookie cookie = new Cookie("username",username);
cookie.setMaxAge(365 * 24 * 60 * 60);
response.addCookie(cookie);
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>DashBoard-Cookie</title>
</head>
<body>
</body>
</html>
now using Http service request parameter i am passing username 'Value' to this jsp. and i am reading cookie value from getValueCookie.jsp like this
<%
String cookieName = "username";
Cookie cookies [] = request.getCookies ();
Cookie myCookie = null;
String result;
if (cookies != null)
{
for (int i = 0; i < cookies.length; i++)
{
if (cookies [i].getName().equals (cookieName))
{
myCookie = cookies[i];
break;
}
}
}
%>
<data>
<status><%=myCookie.getValue().toString()%></status>
</data>
through the httpservice value i am getting but if i open a new window or any new tab cookie value is not getting how can i solve this? Thanks in advance.
how to differentiate the 480X800 and 480X854 screens. we have an option to put the one image at the hdpi folder.in my case 480X800 image is does not support for the 480X854 image. it shows a blank space at the bottom.Any Idea?
Hi All,
I have a string say string s ="C:\\Data" , I have an array which contains some strings containg "C:\Data" in the beginning i.e. string[] arr = new {"C:\\Data\abc.xml","C:\\Data\Test\hello.cs"};.
I have to remove the string "C:\Data" from each entry and have to combine it with another string say string fixed = "D:\\Data".
What is the best way to do it, please help as I am a new programmer in C#.