I have some clean up code that I would like to execute at the end of execution even if my C# application crashes (delete temp files, etc). Is that possible to do in C#?
Thanks!
I have query like below
declare @str_CustomerID int
Insert into IMDECONP38.[Customer].dbo.CustomerMaster
( CustomerName , CustomerAddress , CustomerEmail , CustomerPhone )
values ( ‘werw12e’ , ‘jkj12kj’ , ‘3212423sdf’ , ‘1212121'
)
select @str_CustomerID= scope_identity()
after execution it returns null in my parameter
i want to get value of identity how can i do that
I am saving Images in NSCachesDirectory in a App. At the end of app execution i would like to clear all temporary cache. Is there a way to force clear all cache on application exit. I do realise the local folder keeps cache for 3 days..but my requirement is to force clear the Cache. Thx
My development PC has windows installed. And I've experienced weird php behaviour:
<?php
file_put_contents('c:/q', microtime(1) . "\r\n", FILE_APPEND);
sleep(10);
When I run this script in browser simultaneously in two different tabs I get such results
1294713622.125
1294713632.2188
which obviously is not what I expected, although in CLI everything is fine.
So the question: what can block execution? (session.auto_start is Off)
My understanding is that by default gprof takes into account CPU time. Is there a way to get it to profile based on wall-clock time?
My program does a lot of disk i/o, so the CPU time it uses only represents a fraction of the actual execution time. I need to know which portions of the disk i/o take up the most time.
Hey Guys,
I am wokring on a dialog, where in execution I want to round up all items that have a specific attribute and place an attribute value of their's into a comma delited list.
This is as far as I have gotten, which isnt far.
buttons: {
'Hook': function(){
$('.grid_pic:has(border=3)').(loop through id's, grab src, build variable with srcs comma delimeited)
}
Any ideas?
i have two shell scripts:
script1.sh
echo "date : DATE"
exit 0;
script2.sh
./scripts1.sh
if [ $? -eq 0 ]; then
reboot;
else
echo "Failed"
fi
What should be the result. Ideally it should have been "reboot" , however on some execution i got the "failed" message too. Can anyone explain why this happens?
I'd like to learn PHP specifically for dealing with security vulnerabilities/exploits.
Could someone recommend a book?
I don't know if I need to learn HTML/CSS/XML/XHTML etc, do I have to learn those too? I don't really plan on designing websites, could anyone help me with this? :P
(Context: running autohotkey scripts to try and automate some tests. The plan is to take screenshots and then compare them to 'standard' screenshots to detect if output has changed).
Is there a 'clever' way to check if two png images are different?
By clever I mean other than comparing them byte by byte? (after having compared their size, obviously)
Hello guys,
I have mod_cache used in conjunction with mod_cband.
But when we enable mod_cache mod_cband are overridden.
Any idea in order to define the order of execution (I suppose first mod_cache and after mod_cband)?
Thanks
I need to learn how to develop PHP extensions.
So, I assume I have to refresh my CPP skills (or is it C?).
What IDE should I use (auto-completion, object browsers etc). I plan to develop on Ubuntu 32.
Is there a good book or good website I can learn from?
I have two insert statements.Second one will be executed only after successful execution of First one.What I wd like to do is-
$sqlone="Insert into .....";
$sqltwo="Insert into.....";
If(mysql_query($sqlone))
{
If(mysql_query($sqltwo))
{
show message Data inserted in both tables.
}
}
If I install framework 4 will it replace framework 3.5? I still work on many applications using framework 3.5 which I do not plan to migrate in the near future however I'd like to use framework 4 for new projects.
I am writing a networking application using the java.nio api. My plan is to perform I/O on one thread, and handle events on another. To do this though, I need to synchronize reading/writing so that a race condition is never met.
Bearing in mind that I need to handle thousands of connections concurrently, is synchronization worth it, or should I use a single thread for I/O and event handling?
I am planning to develop an accelerometer based mouse on the android platform. the mobile device which i plan to use is htc nexus one. the cursor should move as the mobile is moved is space. will that be difficult compard to movement wrt gravity?
In an app I'm profiling, I found that in some scenarios this function is able to take over 10% of total execution time.
MSVC++ 2008 compiler is being used, for reference... I don't recall if modf maps to a single instruction or if there is likely any way to make it faster.
see also here for similar question on sqrt function
Hi everybody,
How could I make sure that the startProcess(); function is being called, but without halting the execution for myFunction(). I'll guess that there's a way to call a function and prevent it from returning it's value to thereby accomplishing this?
Pseudo-code:
function myFunction() {
startProcess();
return $something;
}
function startProcess() {
sleep(5);
// Do stuff that user doesn't should have to wait for.
}
Is it possible to know (serverside) the time it took for a file to upload? I have an image upload API and in my response I'd like to return the upload time (not including script execution time).
I am writing a program that stores data in a dictionary object, but this data needs to be saved at some point during the program execution and loaded back into the dictionary object when the program is run again.
How would I convert a dictionary object into a string that can be written to a file and loaded back into a dictionary object? This will hopefully support dictionaries containing dictionaries.
I plan on using solr on my VPS.
My server is Ubuntu.
Does anybody know if Jetty can run without problems on Ubuntu, just as in the example Solr distribution?
With Tomcat it is possible, but my Q is, is it possible with Jetty?
Thanks
If I create a scheduled task by calling ScheduledExecutorService.schedule(), it never quits after execution, is it a JDK bug, or I just miss something?
note: doSomething() is empty method below.
public static void doSomething() {
}
public static void main(String[] args) {
ScheduledFuture scheduleFuture =
Executors.newSingleThreadScheduledExecutor().schedule(new Callable() {
public Void call() {
try {
doSomething();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}, 1, TimeUnit.SECONDS);
}
I use Solr in my website, and now I am about to configure my VPS account.
I am at the stage where I need to install java in order to make Solr work.
Now, I only plan on running solr, and using it as it is (I have no java programming skills at all), so my Q is, do I need the entire JDK which includes JRE, or is JRE enough?
Thanks
BTW: My server OS is Linux (ubuntu 9.10).
Thanks
After testing on msvc8, I found:
Parse GetCommandLine() to argc and argv
Standard C Library initialization
C++ Constructor of global variables
These three things are called before entering main().
My questions are:
Will this execution order be different when I porting my program to different compiler (gcc or armcc), or different platform?
What stuff does Standard C Library initialization do? So far I know setlocale() is a must.
Is it safe to call standard C functions inside C++ constructor of global variables?
I was doing some work handling a lot of information and my partner told me that I was using too many matrices to manipulate the variables of the problem. The idea was to use one dimension arrays int a[] instead of the 2 dimensional arrays int b[][], to save memory and processing speed of the algorithm. How certain is that this change will accelerate the speed of execution or compilation of my code in c ++?