When get a .sql file, how do you execute it? Double click to open it and press F5? Is there any other way to execute it and also able to see the execution result. Thanks.
Hi all,
I'm using rmagick to manipulate image files. I use the ImageList.new on each file to get started. When I apply this method to an invalid image file I get the below error which interrupts the execution of the script:
RMagick.rb:1635:in `read': Improper image header (Magick::ImageMagickError)
Therefore I would like to be able to check whether a file is a valid image file before using this method.
Any ideas?
Thanks.
Object doesn't support this property or method
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotSupportedException: Object doesn't support this property or method
Is it considered crazy to store common SQL queries for my web app in a database for use in execution? Or is that common practice? Or is it impossible?
My thinking is, this way, I avoid hard-coding SQL into my application files, and add another level of abstraction.
Is this crazy? Is this what a stored procedure is? Or is that something else?
Let's say I want to make a little wrapper along the lines of:
def wrapper(f: (Any) => Any): Any = {
println("Executing now")
val res = f
println("Execution finished")
res
}
wrapper {
println("2")
}
Does this make sense? My wrapper method is obviously wrong, but I think the spirit of what I want to do is possible. Am I right in thinking so? If so, what's the solution? Thanks!
Our pom.xml currently contains both the build settings, as well as execution of selenium using selenium-maven-plugin.
I would like to split it in to two pom files, one for the build and unit tests and the second one for executing selenium tests. (This way I could first build the project in Hudson, and after successful build execute Selenium tests using another project).
Is it possible to configure maven to only execute the selenium-maven-plugin?
Hi all,
I need to compile C++ code in windows application and append the results (Output or execution errors) on rich text box. I use CodeDomProvider Class but I unable to compile the code using C++ language. Please Help.......... Need Proper answer in easy way....
Based upon SO answer "my ($export = $doc) =~ s{.odt}{.pdf};" why does this Perl script produce a compile error?
$ cat so.pl
#!/usr/bin/perl
my $doc ="x.odt";
my ($export = $doc) =~ s{\.odt}{.pdf};
$ ./so.pl
Can't declare scalar assignment in "my" at ./so.pl line 3, near ") =~"
Execution of ./so.pl aborted due to compilation errors.
Actually that's it. What does this error mean? I've googled on it, but found nothing.
This error appears in firebug console after the page is loaded, or when i click on tabs. It does not prevent the execution of another JavaScript code, but the nature of it is mysterious for me.
I have Console Application written in C# that is scheduled to run every 15 min. or so using the Built in Windows Task Scheduler.
Every time it runs the black console box pops up for the duration of it's execution and then closes.
I am not writing anything to the console. Is there a way to make this run in the background?
I am new to maven and hit a problem that looks easy in the first place but I already kept me busy for a whole day about and no way to get it working.
First as part of running eclipse:eclipse plugin I create a linked folder like below:
<linkedResources>
<linkedResource>
<name>properties</name>
<type>2</type>
<location>${PARENT-2-PROJECT_LOC}/some_other_project/properties</location>
</linkedResource>
<linkedResource>
<name>properties/messages.properties</name>
<type>1</type>
<location>${PARENT-2-PROJECT_LOC}/some_other_project/properties/messages.properties</location>
</linkedResource>
And then I am adding that folder as a source folder like below:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>properties</source>
<source>some_real_folder</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
However when I am looking at the generated .classpath in eclipse the “some_real_folder” is there but the “properties” is not. It looks like by default the build-helper-maven-plugin will check if the folder is there and if it is not it won’t add it.
I am using maven 3.0.4 outside eclipse to run the build and I can see in the maven logs something like this:
[INFO] Source directory: <some path>\properties added.
This is my project structure:
project1
\-- properties (this is the real folder)
project2
\-- some_real_folder
\-- properties (this is the link resource pointing to the project1/properties folder)
All I need is to have both "some_real_folder" and the linked resource "properties" added to the .classpath of the project2
Hi, I'm using this XML classes for the first time and can't find this piece of info.
I'm doing:
xmlDoc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));
xmlDoc.Add(new XElement("Images"));
xmlDoc .Save("C:\\Backup\\images.xml");
But doesn't work. It only works if I use just the filename, like "images.xml", but of course, the file gets saved on the execution path.
hi,
when i run my application i got this error like...
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.
can you help me..
In win32 programming in C:
Whats the best way to execute a win32 console program within another win32 program, and have the program that started the execution capture the output? At the moment I made the program redirect output to a file, but I am sure I must be able to open some sort of pipe?
Hello!
I`m trying to write simple batch file generator in python. Batch file consist of about 30-50 lines of text and is passed to other applications. During the execution of script there a lot of calls to external applications. I want to create file in memory (like named pipes in win32). Is there any platform independ way?
p.s. sorry for possible mistakes in text, I'm still learning English
I have a long task in Javascript that should be performed before the web page content is displayed. During the execution of this task I would like to show an image whose opacity will grow up to 100% (when the task is done).
How this can be achieved ?
I want to calculate time elapsed during a function call in C, to the precision of 1 nanosecond.
Is there a timer function available in C to do it?
If yes please provide a sample code-snippet.
Pseudo code
Timer.Start()
foo();
Timer.Stop()
Display time elapsed in execution of foo()
Environment details: - using gcc 3.4 compiler on a RHEL machine
Is it possible to use HTML form to start an executable in the server, and allow user to input further information into the same executable?
from a web form, input executable name with one parameter missing.
the executable starts, and post question for the missing parameter.
user enter the value for the missing parameter, the information get passed to the executable.
the executable continue its execution.
Thank you,
Pan
It should be a tool to enable versioning of a database schema and efficiently updating databases with older versions of the schema:
robustness, does it handle all edge cases
support for data migration
command line execution
flexibility, can some data be compared as well
In the answers a breakdown on support for these points (and anything I may have missed) would be appreciated.
how can i control two processes to run alternately in separate terminal windows.
for example i run the code for each on separate terminal windows at 11:59 and both of them wait for the time to be 12:00. at this moment process one starts execution and process two waits for say 10 seconds. then they switch, process two executes and process one waits.
in this way they take turns until the process is complete.
This is a real shot in the dark, however maybe someone had a similar issue. Some console apps are being invoked by either SQL Server 2008, or Autosys (job schedule) under Windows Server 2008; output results of execution are being saved into .txt files. Every so often, with no definite pattern as far as I can tell saved output is displayed as a series of what I presume are Chinese characters. Have anyone encountered phenomenon above?
Hi,
I have a PHP script that runs database queries. Now, if a query fails, should I trigger an error or throw an exception? I noticed that if I do the latter, the script execution will stop after facing the exception.
My code is as follows:
if (!$this->connection[0]->query($this->query))
throw new Exception($this->connection[0]->error);
What are the pros and cons of using exceptions for this kind of cases (failed queries)?
I want to make Waf generate a beep when it finishes the execution of any command that took more than 10 seconds.
I don't know how do add this and assure that the code executes when Waf exits.
This should run for any Waf command not only build.
I checked the Waf book but I wasn't able to find any indication about how should I do this.
Hello,
At times the get_file_contents takes too long and that hangs the entire script. Is there any way of setting a time out limit on get_file_contents, without modifying the maximum execution time of the script?
Edit:
Its taking long because the file does not exist. I am getting "failed to open stream: HTTP request failed!" error. But it takes forever.