How to run a .JAR file with Delphi [closed] - delphi

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Me and a friend have being trying to do this for a while and regardless of how hard we searched and tried; we just couldn't do it.
But what we are trying to do is Run/Execute a .jar file from delphi ( from like a click of a button )
I did try using ShellExecute (from the ShellAPI) but I didn't how to pass the parameters correctly;
The end purpose we want it to execute his minecraft server (bukkit) with delphi; (These are the usual parameters that are passed "java -Xmx1024M -Xms1024M -jar minecraft_server.jar") It may seem pointless, but we thought it would be a good challenge and I'm not one for giving up! So I was wondering is it possible with out using outside libraries and could you help me? I'm not asking for a source I'm asking for assistance and a starting point. Thanks in advance

Like this:
ShellExecute(
0,
nil,
'java.exe',
'-Xmx1024M -Xms1024M -jar minecraft_server.jar',
nil,
SW_SHOW
);
In order for this to work, the file minecraft_server.jar must be located in the working directory when you call ShellExecute. If you cannot ensure that then pass the full path to the .jar file.

Related

How do include a .c file to my ios app? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have file.c file that I want to add to my ios app. I renamed it to file.m, rename the main() to main2() and included it in my project in xCode. It compiles fine but how do I run main2()?
Could someone please explain this in detail? Thanks.
More likely than not, the main of the original C program is going to try and set up a processing loop or otherwise wait for some kind of input and then try to process it.
You aren't going to be able to simply embed one entire program in another and expect it to work unmodified. You'll need to understand how the second program works and then integrate that functionality into the first. Without seeing the implementation of your second main, it is impossible to say more.
You have to call main2() somewhere in your main source file. main() is the entry point for C programs, so if you rename main() to something else, you will have to call it manually.

How to create an CSV file for OpenCV [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I was reading on Facial Recogntion on OpenCV and it required me to use an CSV file for my project. I am using Ubuntu 12.04 and I think it is telling me to use Python to write the code. I have no idea of the code and what I want is to get my own image into the CSV file and let it work. How do I do that? I only have a C++ background and I don't know what to do. Can someone please teach me how to make one of those files? I have googled for a long time but no results.
http://docs.opencv.org/trunk/modules/contrib/doc/facerec/tutorial/facerec_video_recognition.html
The CSV file here is used to define the learning database for FaceRecognition, it's just a list of image files and a corresponding subject id :
/path/to/subject1image1.jpg;0
/path/to/subject1image2.jpg;0
/path/to/subject1image3.jpg;0
...
/path/to/subject2image1.jpg;1
/path/to/subject2image2.jpg;1
...
/path/to/subject3image1.jpg;2
...
You could do this by hand if you have the time or you could use their python script.
To use the script you just have to respect the file hierarchy /basepath/<subject>/<image.ext> then simply run the script with python and it will generates the corresponding CSV file.

starter ruby - my first ruby site [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am looking to make my first ruby - based website.
I am assuming looking at tutorials that print "hello" should work, but it does not.
Any pointers? I am assuming this is a silly noob question.
my file is located on mysite.com/test.rb
thanks!
(this is more of a dummy starter question than coding, so it is here rather than stack).
Have a look at Sinatra. You can get a hello world site up in 5 lines of code, and then start checking out tutorials from there.
Check out Ruby on Rails resource http://ruby.railstutorial.org/ruby-on-rails-tutorial-book. It is very easy to start learning.
If your file only contains the following
print "hello"
then it most certainly wont just work by browsing to site.com/foo.rb
You need things setup like a webserver to handle the request and route it to a ruby interpreter, etc...

File management iOS [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am creating a static library for iOS which reads data from files which have to be present in the system (I am not downloading them when the application runs) and do some calculations and return the results.
I will need to ship the files along the application. So my questions are below
How to include input files in the project so that they get copied along with the application.
How to read from the files when the application is running.
Thanks
How to include input files in the project so that they get copied along with the application.
Copy them into the app's bundle directory.
How to read from the files when the application is running.
Now that's broad enough a question. Maybe you're looking for the NSFileManager, NSFileHandle and NSData classes.

What code would let me find the compiled executable's directory? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
...Even when a user opens an application by double-clicking an associated file in a directory that's different from the executable. I've always used ExtractFilePath(Application.EXEName), but this function doesn't work as hoped in this circumstance.
ExeName returns ParamStr(0) which in turn returns the string produced by GetModuleFileName with hModule set to 0. I cannot see any reason why this wouldn't work in a normal application.
Also try ParamStr(0). Maybe that works when application.exename doesn't?
ExePath := ExtractFilePath(paramstr(0));
I do it all the time, and it always works, whatever OS it is running on.

Resources