Search Results

Search found 16 results on 1 pages for 'thecoshman'.

Page 1/1 | 1 

  • Struggling to get set up with JOGL2.0

    - by thecoshman
    I guess that Game Dev' is a more sensible place for my problem then SO. I did have JOGL1.1 set up and working, but I soon discovered that it did not support the latest OpenGL, so I started work on upgrading to JOGL2.0 it's not gone too well. Firstly, is it worth me trying to get JOGL to work, or should I just move over to LWJGL? I am fairly comfortable with OpenGL (via C++) and from what I did get working with JOGL1.1, I seem to be OK adapting to it. Assuming that I stick with JOGL, am I foolish for trying to use JOGL2.0? From what I can gather, JOGL2.0 is still in beta, but I am willing to go with it as I want to make use of the latest OpenGL I can. I have been using the Eclipse IDE and have set up a user library for JOGL, here is a screen shot of the configuration and I have added this user library to my own Eclipse project. the system variable %JOGL_HOME% points to "C:\Users\edacosh\Downloads\JOGL2.0" so that should work fine. Now, the problem I actually having, when I try to run my code, on the line GLProfile glp = GLProfile.getDefault(); The code stops with the following message... Exception in thread "main" java.lang.NoClassDefFoundError: com/jogamp/common/jvm/JVMUtil at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:1145) at DiCE.DiCE.<init>(DiCE.java:33) at App.<init>(App.java:17) at App.main(App.java:12) Caused by: java.lang.ClassNotFoundException: com.jogamp.common.jvm.JVMUtil at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 4 more I have also set my project to ensure that it is using jre6 along with jdk6, as I was having some issues. I hope I have given you enough information to be able to help me. It probably doesn't help that I am rather new to Java, been developing in C++ for ages. Thanks

    Read the article

  • PHP ternary operator

    - by thecoshman
    ($DAO->get_num_rows() == 1) ? echo("is") : echo("are"); This dose not seem to be working for me,I get an error "Unexpected T_ECHO" I have tried it with out the brackets around the conditional. Am I just not able to use a ternary operator in this way? The $DAO-get_num_rows() returns an integer value. Thanks

    Read the article

  • 'echo' or drop out of 'programming' write HTML then start PHP code again

    - by thecoshman
    For the most part, when I want to display some HTML code to be actually rendered I would use a 'close PHP' tag, write the HTML, then open the PHP again. eg <?php // some php code ?> <p>HTML that I want displayed</p> <?php // more php code ?> But I have seen lots of people who would just use echo instead, so they would have done the above something like <?php // some php code echo("<p>HTML that I want displayed</p>"); // more php code ?> Is their any performance hit for dropping out and back in like that? I would assume not as the PHP engine would have to process the entire file either way. What about when you use the echo function in the way that dose not look like a function, eg echo "<p>HTML that I want displayed</p>" I would hope that this is purely a matter of taste, but I would like to know if I was missing out on something. I personally find the first way preferable (dropping out of PHP then back in) as it helps draw a clear distinction between PHP and HTML and also lets you make use of code highlighting and hinting for your HTML, which is always handy.

    Read the article

  • PHP reading 'get' veriable that may or may not have been set

    - by thecoshman
    Simply put, if you try to read the value of a get variable, what happens if said variable had not be put into the URL. Example: you request the page test.php, in that file it tries to read the value of $_GET['message']. What happens in this case? dose the value just get returned as ''? Dose this mean, that if I am always expecting a value to be entered, and am not willing to accept a value of '' that I can just do something like $foo = $_GET['bar']; if($foo == ''){ // Handle my 'error' } else { // $foo should now have a value that I can work with } Please bare in mind I know that I could use isset($_GET['bar']) But I don't just want to know if it is set, I don't care if it is or not, I just care if it has a value that is more then just an empty string.

    Read the article

  • PHP reading 'get' variable that may or may not have been set

    - by thecoshman
    Simply put, if you try to read the value of a get variable, what happens if said variable had not be put into the URL. Example: you request the page test.php, in that file it tries to read the value of $_GET['message']. What happens in this case? dose the value just get returned as ''? Dose this mean, that if I am always expecting a value to be entered, and am not willing to accept a value of '' that I can just do something like $foo = $_GET['bar']; if($foo == ''){ // Handle my 'error' } else { // $foo should now have a value that I can work with } Please bare in mind I know that I could use isset($_GET['bar']) But I don't just want to know if it is set, I don't care if it is or not, I just care if it has a value that is more then just an empty string.

    Read the article

  • JavaScript accessing form elements using document.forms[].elements[]

    - by thecoshman
    var loc_name = document.forms['create_<?php echo(htmlspecialchars($window_ID)); ?>'].elements['location_name']; alert(loc_name); This just gives me the message 'undefined' where as... var loc_name = document.forms['create_<?php echo(htmlspecialchars($window_ID)); ?>']; alert(loc_name); Gives me the object form business. Have I just got this all wrong? What is the 'proper' way to access this form element. The form element has the correct name and it has an id, the id is similar but not the same. ** HTML - as reuqested ** <form action="javascript:void(0)" name="create_<?php echo(htmlspecialchars($window_ID)); ?>" method="GET" onsubmit="return false"> <td> <input type="text" id="location_name_<?php echo($window_ID); ?>" name="location_name" value="Enter a name" onfocus="if(this.value == 'Enter a name'){this.value = ''}" onblur="if(this.value == ''){ this.value = 'Enter a name' }" /> </td> <td colspan="2"> <input type="button" name="create_location" value="Create" onclick="var pre_row_was = $('#pre_form_row_<?php echo($window_ID); ?>').innerHTML; $('#pre_form_row_<?php echo($window_ID); ?>').innerHTML = '<td colspan=\'3\'>Validating...</td>'; var loc_name = document.forms['create_<?php echo(htmlspecialchars($window_ID)); ?>'].elements['location_name']; alert(loc_name); if(loc_name.value == '') { alert('You can\'t leave the room name blank'); loc_name.focus(); loc_name.value = 'Enter a name'; $('#pre_form_row_<?php echo($window_ID); ?>').innerHTML = pre_row_was; return false; } if(loc_name.value == 'Enter a name') { alert('You must enter a room name first'); loc_name.focus(); $('#pre_form_row_<?php echo($window_ID); ?>').innerHTML = pre_row_was; return false; } $('#pre_form_row_<?php echo($window_ID); ?>').innerHTML = pre_row_was; Window_manager.new_window().load_xml('location/create.php?location_name=' + loc_name.value).display();" /> </td> </form> ugly as sin that is...

    Read the article

  • Complex jquery selction that also involves custom xml tags

    - by thecoshman
    I want to write a select something like... #window_4 > content > p:eq(0) I think I have this correct, but I have a few selectors that are all similar but I can't test them all at once. Am I right in saying this is selecting an element, who is the fist p tag child of a content tag that is a child of a tag with id 'window_4' If I have gotten this wrong, can you give me some pointers. Would love to be able to simplify this code, I have more code selecting the tag I am after then actually doing stuff with them.

    Read the article

  • How to not use JavaScript with in the elements events attributes but still load via AJAX

    - by thecoshman
    I am currently loading HTMl content via AJAX. I have code for things on different elements onclick attributes (and other event attributes). It does work, but I am starting to find that the code is getting rather large, and hard to read. I have also read that it is considered bad practice to have the event code 'inline' like this and that I should really do by element.onclick = foobar and have foobar defined somewhere else. I understand how with a static page it is fairly easy to do this, just have a script tag at the bottom of the page and once the page is loaded have it executed. This can then attach any and all events as you need them. But how can I get this sort of affect when loading content via AJAX. There is also the slight case that the content loaded can very depending on what is in the database, some times certain sections of HTML, such as tables of results, will not even be displayed there will be something else entirely. I can post some samples of code if any body needs them, but I have no idea what sort of things would help people with this one. I will point out, that I am using Jquery already so if it has some helpful little functions that would be rather sweet¬

    Read the article

  • Slight confusion of `this` in a JavaScript call back function

    - by thecoshman
    $.ajax({url: path_to_file, cache: false, success: function(html_result){ $("#window_" + this.id + "_cont_buffer").html(html_result);}) Now then. This function call is with in a function of a class. this.id is a property of said class. will this pass the function value of this.id into the string the anonymous function, or will it try to evaluate it when the function actually gets called, thus making no sense. If this is not going to work how I want it to, can you recommend how I achieve this.

    Read the article

  • Web development tool that can comprehend the concept of more than one language in a file at once

    - by thecoshman
    I currently use notepad++ on windows or gedit on ubuntu. Both of them work great with code highlighting and hinting etc. But both of them suffer from a huge flaw. I am yet to find a code editor that can handle this concept: <?php // ooh, look I am doing some php ?><a onclick="alert('hay, some javascript in here now!')"> This link is HTML?!</a> <?PHP echo("NOW we have some php as well!"); ?> At the moment, I just have to settle for the one language. I want something that can think of a that text as a default as HTML, but notice when sections are PHP. I want those sections of PHP to have there own code hinting and highlighting. Even more, lets say in an 'if else' I exit PHP, write some HTML then back into PHP, I want it to work out how the braces ( '{' and '}' ) should match up and let me know if I have missed one. I want the sections of in-line JavaScript to be picked up as such. I want all of these languages to get checked for syntax! Damn it, I want to tool that understands more than one language at once!

    Read the article

  • What would be a better way of doing the following

    - by thecoshman
    if(get_magic_quotes_gpc()) { $location_name = trim(mysql_real_escape_string(trim(stripslashes($_GET['location_name'])))); } else { $location_name = trim(mysql_real_escape_string(trim($_GET['location_name']))); } That's the code I have so far. seems to me this code is fundamentally ... OK. Do you think I can safely remove the inner trim(). Please try not a spam me with endless version of this, I want to try to learn how to do this better.

    Read the article

  • Purpose of singletons in programming

    - by thecoshman
    This is admittedly a rather loose question. My current understanding of singletons is that they are a class that you set up in such a way that only one instance is ever created. This sounds a lot like a static class to me. The main differnce being that with a static class you don't / can't instance it, you just use it such as Math.pi(). With a singletong class, you would still need to do something like singleton mySingleton = new singleton(); mysingleton.set_name("foo"); singleton otherSingleton = new singleton(); // correct me if i am wrong, but mysingleton == othersingleton right now, yes? // this the following should happen? otherSingleston.set_name("bar"); mysingleton.report_name(); // will output "bar" won't it? Please note, I am asking this language independently, more about the concept. So I am not so worried about actually how to coed such a class, but more why you would wan't to and what thing you would need to consider.

    Read the article

  • Help Fix a bug - Unexpected T_STRING

    - by thecoshman
    So I have just rebuilt my server, just on local network. Stick my site back on it, try to run the code, and I get a anice T_STRING error. This is all very strange, as I have not changed the code :S <?php $window_ID = -1; if(isset($_POST["window_ID"]) AND $_POST["window_ID"] != null){ $window_ID = trim($_POST["window_ID"]); } ?> This is the start of the file, apter this rather loverly snipit of PHP the rest is just XMl, yet on line 6 appertnlty there is an unexpected T_STRING, which is strange considering all that is on that line is the ?>, then the XML starts up... Any one got any ideas what has gone wrong here? Any chance it ould be magic quotes? I had turned it of before, but I want to now update my code to check for the magic quotes and avoid its stupid actions.

    Read the article

  • Type-casting. C and C++

    - by thecoshman
    I always though that float var_a = 9.99; int var_b = (int)var_a; was they way to typecast in c++... But here it said that its not the proper C++ way, its the old C way. So I ask, What is the proper C++ way, and more importantly, how do they differ? the C method should still work though shouldn't it.

    Read the article

  • What features can I use during log in/out

    - by thecoshman
    I know that this question is going to be painfully vague, but here it is any way. I have made an small console application designed to be run on Windows XP Pro computers. It will be run at log in and log out. The command to run this program will be set via GPO and will include command line operators to control what data the program sends. I have used a few built in C# classes to find out information about the computer, which is then sent of to a server as a web request. I need to know which of the following will have issues on a restricted user account on a domain. Enviroment ManagementObjectSearcher ManagmentObjectCollection System.Diagnostics.PerformanceCounter <-- side note, this class dosent seem to accept be saying using System.Diagnostics ComputerInfo WebRequest

    Read the article

1