User Profile
Collapse
-
oops, I almost gave him an answer... How do I delete a post btw? -
Well, it does a little bit...
The thing is that I don't have a matching java type for the structure of the native variable. I don't know if GlobalRef can refer to something completely native without knowing about its structure. But here's a bright idea, I'll try holding that reference as void* and casting it in native calls...
Thanks Jos!Leave a comment:
-
JNI global reference in native code
Hello everyone, I have a question:
is there a way to make a global reference (pointer) in native code that'll survive between native method invocations?
something like this:
Code:... Some_struct *something=NULL; JNIEXPORT void JNICALL Java_SomeClass_initSomething(JNIEnv *env, jobject obj); JNIEXPORT jint JNICALL Java_SomeClass_useSomething(JNIEnv *env, jobject obj); ...
-
Ok, so just in case anybody comes across this looking for an answer, I did it, and this is how:
in win32 pom, i've added -LD to <compilerStartO ptions> and i gave up on IDEs, just did it from console...
Also I've added user32.lib & advapi32.lib to linkerStartOpti on (like in the tutorial)
There may have been more changes on my part, but I can't remember all now, and I think these were the key ones.
At first...Leave a comment:
-
Yeah, it does look like that, but it's a plugin and maven is pretty much just a bunch of plugins doing stuff.
The installation of the plugin is automated and instructed by POM, and i've literally copied the example from the repository and it breaks there.
I'am trying stuff, but it just wont click.
Thanks anyway!Leave a comment:
-
Maven native plugin and JNI
Hi everyone!
I'm in a bit of a problem here:
I have to make a maven project for native (jni & C) code.
I am using this plugin: http://mojo.codehaus.org/maven-nativ...gin/index.html
and trying to make this example build:
http://mojo.codehaus.org/maven-nativ...s/jni-dll.html
(the jni one in svn)
The profile is win32 and MSVC is the... -
For start, please wrap the code in your post in [ PHP ] [ /PHP ] tags,
i don't want to count the lines till line 58...Leave a comment:
-
You could fprintf() it somewhere instead of echoing...
@see: http://www.php.net/manual/en/function.fprint f.phpLeave a comment:
-
Good programming can't fix a bad design...
Here's a hint though:
you can add stuff to a php array like this:
[PHP]
$someArray=arra y();
for($i=0; $i<1210; $i++)
$someArray[]=array("item_". $i, "something" , $somethingelse) ;
//or like this:
$someArray["betaphetamyne_ price"]=1000;
$someArray[666]=$theBeast;
[/PHP]Leave a comment:
-
You can't.
You can only do the validation trough php again on the server side.
It's a bit of extra work but it's the only way to be sure.
JS validation is there only for user's comfort as he doesn't have to post back only to get validation error reports...Leave a comment:
-
I don't think no one will do the work for you...
You'll just gonna have to do it yourself and ask us questions when you get into problems.
Try googling it, you should get enough info to get you started.Leave a comment:
-
You might wanna try PHPLiveX library, but that wont free you from javascript, it's only a way to publish your php functions to javascript in a page and call them from there using XHR requests (ajax).Leave a comment:
-
do something like this:
[PHP]
//...
$bl=mysql_real_ escape_string($ _GET["bl"]); //bottom limit
$ul=mysql_real_ escape_string($ _GET["ul"]); //upper limit, that is how manu rows to select
$sql="SELECT login, gender, aboutme FROM users LIMIT $bl,$ul";
$_res=mysql_que ry($sql)
//the rest is the same like your code...
//...
mysql_free_resu lt($res);...Leave a comment:
-
-
Hm, this could be it:
[PHP]
if(!session_is_ registered('onl ine')){
@mysql_query("I NSERT INTO trv_online (session_id, activity, ip_address, refurl, user_agent)
VALUES
('".session_id( )."', now(), '{$_SERVER['REMOTE_ADDR']}', '{$_SERVER['HTTP_REFERER']}', '{$_SERVER['HTTP_USER_AGEN T']}')");
session_registe r('online');...Leave a comment:
-
"Two or more, use a FOR"
btw. if-else is not a loop, and there's no goto in java if you're counting on it.
What you basically need to do is make an array of your employees and iterate trough it doing the stuff you wanna do (print, recalculate etc.).
You may do it with a "while" as well as with a "for" or even "do...while ".
Ou and yeah, this is not a java ...Leave a comment:
-
Well, you may (quick)sort the list and use binary search...
If you really have no way of sorting the list, than you can optimize it a little by putting the search string at the end of the array (list) and do the linear search without checking the condition in for loop (as it will find at least one hit) and jump out when it finds a hit. That way you'll save little time for that condition check whether current i is less than list.length....Leave a comment:
-
IMHO using database is by far the easiest solution, after you cover some basics first.
Use this as reference http://www.php.net/manual/en/ref.mysql.php
Pay attention to functions:
mysql_connect() , mysql_select_db (), mysql_query() and mysql_close()
you'll be using them in that order...
And if you need an easy to install server to test those things you might wanna try this one: http://www.apachefr...Leave a comment:
-
does it register you as a member after a few clicks?
What I mean is, does it only break when you login or everytime it executes?Leave a comment:
-
You're welcome.
Tell me about it. Being a code monkey is one hell of a summer job....Leave a comment:
No activity results to display
Show More
Leave a comment: