|
I have a sub routine where I pull in information from a database. I want to use variables from this sub routine in another sub routine. I tried making everything public but it doesn't want to be friendly and share.
Dim strEmail as String Public Sub readDB...
Started by Bruno43 on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
If you literally need a variable that is visible to different subs in the same class (code-behind page in ASP.Net), what you are looking for is probably... .
Passing them as arguments is great, if the sequence of calls to the subs in question makes that feasible .
|
|
The function header for pthread_create looks like this:
int pthread_create(pthread_t * thread, const pthread_attr_t * attr, void * (*start_routine)(void *), void *arg);
I understand it all except that the function pointer for start_routine is of the form...
Started by gmatt on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
From the documentation for pthread_create :
The thread is created....
From the spec :
If the start_routine returns, the effect is as if there was an implicit call to pthread_exit() using the return value of start_routine as the exit status.
|
|
I am looking for a Delphi 7 routine which connects to a time server to retrieve the correct time and date , and a routine to update the time and date of the pc.
The routine should of course take into account the time zone the pc is using.
If possible ...
Started by Edelcom on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Point it to your favourite time server and check....
Take a look at Indy's IdDayTime component.
Also, there must be tons of free components out there that you can use for free .
You might want to google for "Delphi 7 NTP" or "Delphi 7 Network Time Protocol" .
|
Ask your Facebook Friends
|
Win32 ReadFileEx is defined as:
BOOL WINAPI ReadFileEx( __in HANDLE hFile, __out_opt LPVOID lpBuffer, __in DWORD nNumberOfBytesToRead, __inout LPOVERLAPPED lpOverlapped, __in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine );
I am trying to figure...
Started by Gili on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
The lpOverlapped function passed into ReadFileEx is passed into the lpCompletionRoutine... .
Since lpCompletionRoutine runs on the calling thread, you should be fine .
Just create a slot and store a pointer to whatever data you want .
You could use Thread Local Storage ...
|
|
Do you have a simple debounce routine handy to deal with a single switch input?
This is a simple bare metal system without any OS.
I would like to avoid a looping construct with a specific count, as the processor speed might fluctuate.
Started by Benoit on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
Bool_t DebouncedKeyPress = false; // Service routine called every CHECK_MSEC.
The debounced state of the key.
|
|
My program has a daily routine, similar to an alarm clock event. Say, when it's 2pm(The time is the system time in my pc), do something for me.
What I want to do is to speed up the testing period(I don't really want to wait 4 days looking at the daily...
Started by Lily on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
In your case the alarm clock event) from the process (whatever it is your 'daily routine' is doing.
|
|
I am sure a general routine, or library must exists to do this, but I need to be able to show the user a "before" and "after" comparison of two versions of a string/text file.
For example the old visual source safe had a great tool where it show both ...
Started by E.J. Brennan on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
There was another discussion about it on another forum as well. .
I don't know of a VS plugin, but perhaps you're looking for something like Beyond Compare ?
I guess you are looking for a diff algorithm I would read diff and its algorithms .
|
|
How to optimize this line drawing routine ? Will memcpy work faster ?
void ScreenDriver::HorizontalLine(int wXStart, int wXEnd, int wYPos, COLORVAL Color, int wWidth) { int iLen = wXEnd - wXStart + 1; if (iLen <= 0) { return; } while(wWidth-- > ...
Started by tommyk on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Is), and/or
a special-purpose machine-language routine is generated on-the-fly (stored on the stack) because.
|
|
Hi,
I added some additional code to the Linux kernel (the scheduler) and now I would like to know what is the impact of this modification.
For user processes I always used:
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...);
Now I am wondering if there is a...
Started by Martin on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
There are good articles at lwn ( here , here , and here )
Measuring scheduler performance is notoriously hard, so good luck :)
unsigned long long native_sched_clock(void); from asm/timer.h for x86
unsigned... .
Latencytop is based on that.
Take a look at ftrace.
|
|
I need an efficient commify filter or routine for use with Template::Toolkit. It is to be used many times on the page. It should support decimals.
This one is found in The Perl Cookbook :
sub commify { my $text = reverse $_[0]; $text =~ s/(\d\d\d)(?=\...
Started by eugene y on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
This means that if you have on your page 10000 numbers... .
The commify function works on my desktop 130000 times per second on number like: "31243245356.4432" .
I think that if you are worried about speed of this - you are seriously misplacing your worries .
|