$tree
Enjoy :)
Thursday, 2 September 2010
Create a jar file with .class file and properties files.
1. You need a menifest file:
App_Data_Export.mf
its content should look like this:
Manifest-Version: 1.0
Main-Class: App_Data_Export
Class-Path: . jars/commons-cli-1.0.jar jars/commons-lang-2.4.jar jars/commons-logging-1.1.1.jar jars/jdbcpersistence.jar jars/log4j-1.2.8.jar conf/test/.
all the paths are relative to the jar file being created and conf/test folder contains all the properties file.
2. Create a jar file.
$jar cmf App_Data_Export.mf App_Data_Export.jar App_Data_Export.class
3. To run the jar.
java -Xmx1024M -jar ${DATA_EXPORT_JAR} -config ${BASE_CONFIG_FILE} -filename ${DATA_FILE_PATH}/${DATA_FILE_NAME} -user cmms -password cmms | tee -a ${LOG_FILES}/${LOG_FILE_NAME}
where:
1. ${DATA_EXPORT_JAR} is the path of the JAR File we just created
2. -config and -filename are arguments to the main class.
3. tee -a ${LOG_FILES}/${LOG_FILE_NAME}, allows you to put the output to the output file and also see the output on the standard output.
Enjoy :).
App_Data_Export.mf
its content should look like this:
Manifest-Version: 1.0
Main-Class: App_Data_Export
Class-Path: . jars/commons-cli-1.0.jar jars/commons-lang-2.4.jar jars/commons-logging-1.1.1.jar jars/jdbcpersistence.jar jars/log4j-1.2.8.jar conf/test/.
all the paths are relative to the jar file being created and conf/test folder contains all the properties file.
2. Create a jar file.
$jar cmf App_Data_Export.mf App_Data_Export.jar App_Data_Export.class
3. To run the jar.
java -Xmx1024M -jar ${DATA_EXPORT_JAR} -config ${BASE_CONFIG_FILE} -filename ${DATA_FILE_PATH}/${DATA_FILE_NAME} -user cmms -password cmms | tee -a ${LOG_FILES}/${LOG_FILE_NAME}
where:
1. ${DATA_EXPORT_JAR} is the path of the JAR File we just created
2. -config and -filename are arguments to the main class.
3. tee -a ${LOG_FILES}/${LOG_FILE_NAME}, allows you to put the output to the output file and also see the output on the standard output.
Enjoy :).
Thursday, 22 October 2009
Saturday, 15 August 2009
Saturday, 8 August 2009
Improved Code : Second Life ... Attached Sensor Script... with HTTP Request to the Sensor...
string url = "http://apps.prendingerlab.net/virtual_social_network/virtual_mobile_social.php?";
string requestid = "";
string listAgents = "";
callWS(string source, string target)
{
// Call the server
requestid = llHTTPRequest(url + "enc_source_avatar=" + source + "&enc_target_avatar=" + target, [HTTP_METHOD,"GET"] , "");
//llSay(0,url + "enc_source_avatar=" + source + "&enc_target_avatar=" + target);
}
default
{
attach(key attached)
{
if (attached == NULL_KEY)
{
llSetTimerEvent(0);
llSetObjectName("SensorMSN");
llSay(0, llGetObjectName());
}
else
{
llSetTimerEvent(1);
llSetObjectName("Sensor on " + llKey2Name(llGetOwner()));
llSay(0, llGetObjectName());
}
}
timer()
{
llSensor("", NULL_KEY, AGENT, 10, PI);
}
sensor(integer total_number) // total_number is the number of avatars detected.
{
//llSay(0, "detected = " + (string)total_number);
integer i;
listAgents = "";
for (i = 0; i <>
{
if (llGetAgentInfo(llDetectedKey(i)) & AGENT_SCRIPTED)
{
//llSay(0, llKey2Name(llGetOwner()) + " is close to " + llDetectedName(i));
//callWS(llKey2Name(llGetOwner()), llDetectedName(i));
//enc_source_avatar=fawad&enc_target_avatar=fawad
listAgents = llDetectedName(i) + "," + listAgents;
}
}
callWS(llKey2Name(llGetOwner()), listAgents);
}
// if nobody is within 10 meters, say so.
no_sensor() {
//llSay(0, "Nobody is around.");
}
}
Thursday, 6 August 2009
Second Life ... Attached Sensor Script... with HTTP Request to the Sensor...
string url = "http://apps.prendingerlab.net/virtual_social_network/virtual_mobile_social.php?";
string requestid = "";
callWS(string source, string target)
{
// Call the server
requestid = llHTTPRequest(url + "enc_source_avatar=" + source + "&enc_target_avatar=" + target, [HTTP_METHOD,"GET"] , "");
}
default
{
attach(key attached)
{
if (attached == NULL_KEY)
{
llSetTimerEvent(0);
llSetObjectName("SensorMSN");
llSay(0, llGetObjectName());
}
else
{
llSetTimerEvent(1);
llSetObjectName("Sensor on " + llKey2Name(llGetOwner()));
llSay(0, llGetObjectName());
}
}
timer()
{
llSensor("", NULL_KEY, AGENT, 10, PI);
}
sensor(integer total_number) // total_number is the number of avatars detected.
{
llSay(0, "detected = " + (string)total_number);
integer i;
for (i = 0; i <>
{
if (llGetAgentInfo(llDetectedKey(i)) & AGENT_SCRIPTED)
{
//llSay(0, llKey2Name(llGetOwner()) + " is close to " + llDetectedName(i));
callWS(llKey2Name(llGetOwner()), llDetectedName(i));
//enc_source_avatar=fawad&enc_target_avatar=fawad
}
}
}
// if nobody is within 10 meters, say so.
no_sensor() {
llSay(0, "Nobody is around.");
}
}
Wednesday, 5 August 2009
Second Life ... Attached Sensor Script...
default
{
attach(key attached)
{
if (attached == NULL_KEY)
{
llSetTimerEvent(0);
llSetObjectName("SensorMSN");
llSay(0, llGetObjectName());
}
else
{
llSetTimerEvent(1);
llSetObjectName("Sensor on " + llKey2Name(llGetOwner()));
llSay(0, llGetObjectName());
}
}
timer()
{
llSensor("", NULL_KEY, AGENT, 10, PI);
}
sensor(integer total_number) // total_number is the number of avatars detected.
{
llSay(0, "detected = " + (string)total_number);
integer i;
for (i = 0; i <>
{
if (llGetAgentInfo(llDetectedKey(i)) & AGENT_SCRIPTED)
{
llSay(0, llKey2Name(llGetOwner()) + " is close to " + llDetectedName(i));
}
//llSay(0, llGetObjectName() + " is close to " + llDetectedName(i));
//if ( llGetSubString( llDetectedName(i), 0, 8) == "Sensor on")
//{
// llSay(0, llGetObjectName() + " is close to " + llDetectedName(i));
//}
}
}
// if nobody is within 10 meters, say so.
no_sensor() {
llSay(0, "Nobody is around.");
}
}
Subscribe to:
Posts (Atom)
Executive Summary: Anthropic's Claude Mythos Model
What Happened Anthropic announced Claude Mythos Preview , a new AI model it describes as its most capable ever — and so powerful in cyber...
-
Setting up a MPI cluster on Ubuntu involves the following steps: 1. Install OpenMPI on all machines. $sudo apt-get install libopenmpi-de...
-
> dotnet add package Microsoft.SemanticKernel.PromptTemplates.Handlebars --version 1.30.0 using Microsoft . SemanticKernel ; using Micr...
-
What Happened Anthropic announced Claude Mythos Preview , a new AI model it describes as its most capable ever — and so powerful in cyber...