Search Results

Search found 1872 results on 75 pages for 'tom genoni'.

Page 57/75 | < Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >

  • Euler rotation of direction vector

    - by Tom Savage
    I have defined an object in 3D space with position, rotation and scale values (all defined as 3D vectors). It also has upwards and forwards direction vectors. When I rotate the object, I need these direction vectors to rotate with it. Assuming my up vector is (0, 1, 0) and my forwards vector is (0, 0, 1) at zero rotation, how might I achieve this?

    Read the article

  • hunting maven dependencies

    - by Tom
    I want to start using maven in code I distribute but I can't find an efficient way to work with dependencies. Every new dependency takes me far too long to add. As a simple example, I need to add Tomcat for compilation. Do I really have to manually trawl the repo in my browser to find the group-id, artifact-id and version number? In every case it seems easier to find the non-maven downloads. I hope I've missed something obvious.

    Read the article

  • C# Why does this code not show a GUI properly?

    - by Tom
    class Program { static String ChannelName = null; static Form1 f; static void Main() { f = new Form1(); f.Show(); try { MY CODE WHICH CALLS INTO ANOTHER CLASS BUT CANNOT PASS THE GUI INSTANCE AS IT USES REMOTING } } } I know this isnt the best/normal way to do it, but i need to write data to the GUI from a class which has bo instance of the GUI so i was going to call Program.method() and use a function to write to the GUI in program. However when i run the above my GUI displays but with the windows hourglass? Could someone show me a quick fix so that i can still crudely show the GUI, let the application code run and then later write to the GUI?

    Read the article

  • Converting different registry value types to string?

    - by Tom
    Hi, im traversing through the registry, taking the values of the keys and storing them as strings. I have discovered there are many different types. Some of these types are causing my filestream writer to fail. Is it possible to convert all of the below into a string form. The actual data value is not important, just the ability to differentiate between different values. DWORD ExpandString Binary (is this just the same as byte[] ?) MultiString

    Read the article

  • Java: how to avoid circual references when dumping object information with reflection?

    - by Tom
    I've modified an object dumping method to avoid circual references causing a StackOverflow error. This is what I ended up with: //returns all fields of the given object in a string public static String dumpFields(Object o, int callCount, ArrayList excludeList) { //add this object to the exclude list to avoid circual references in the future if (excludeList == null) excludeList = new ArrayList(); excludeList.add(o); callCount++; StringBuffer tabs = new StringBuffer(); for (int k = 0; k < callCount; k++) { tabs.append("\t"); } StringBuffer buffer = new StringBuffer(); Class oClass = o.getClass(); if (oClass.isArray()) { buffer.append("\n"); buffer.append(tabs.toString()); buffer.append("["); for (int i = 0; i < Array.getLength(o); i++) { if (i < 0) buffer.append(","); Object value = Array.get(o, i); if (value != null) { if (excludeList.contains(value)) { buffer.append("circular reference"); } else if (value.getClass().isPrimitive() || value.getClass() == java.lang.Long.class || value.getClass() == java.lang.String.class || value.getClass() == java.lang.Integer.class || value.getClass() == java.lang.Boolean.class) { buffer.append(value); } else { buffer.append(dumpFields(value, callCount, excludeList)); } } } buffer.append(tabs.toString()); buffer.append("]\n"); } else { buffer.append("\n"); buffer.append(tabs.toString()); buffer.append("{\n"); while (oClass != null) { Field[] fields = oClass.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { if (fields[i] == null) continue; buffer.append(tabs.toString()); fields[i].setAccessible(true); buffer.append(fields[i].getName()); buffer.append("="); try { Object value = fields[i].get(o); if (value != null) { if (excludeList.contains(value)) { buffer.append("circular reference"); } else if ((value.getClass().isPrimitive()) || (value.getClass() == java.lang.Long.class) || (value.getClass() == java.lang.String.class) || (value.getClass() == java.lang.Integer.class) || (value.getClass() == java.lang.Boolean.class)) { buffer.append(value); } else { buffer.append(dumpFields(value, callCount, excludeList)); } } } catch (IllegalAccessException e) { System.out.println("IllegalAccessException: " + e.getMessage()); } buffer.append("\n"); } oClass = oClass.getSuperclass(); } buffer.append(tabs.toString()); buffer.append("}\n"); } return buffer.toString(); } The method is initially called like this: System.out.println(dumpFields(obj, 0, null); So, basically I added an excludeList which contains all the previousely checked objects. Now, if an object contains another object and that object links back to the original object, it should not follow that object further down the chain. However, my logic seems to have a flaw as I still get stuck in an infinite loop. Does anyone know why this is happening?

    Read the article

  • Saving and restoring OpenGL model-view

    - by Tom
    I am a new-comer to OpenGL, and much of it remains mysterious to my feeble brain. I have been studying the NeHe demos as well as the Red Book. I am writing an Android application that displays the Earth in the center of the screen. The user can rotate the Earth about any axis (much like a very simple "Google Earth"). This code is working (I based it on the NeHe examples). Now I want to add a feature; the user should be able to save the current model orientation, then later return to that same orientation. For example, the user may save the Earth orientation such that the viewer is looking down at her hometown, and north-east is "up". How do I do this with OpenGL-ES? To capture and save the current orientation, my code could get the current model-view transformation matrix - I think I understand how to do that. But later on how do I apply that saved matrix to restore the view?

    Read the article

  • Program always returns binary '>>' : no operator found which takes a left-hand operand of type error

    - by Tom Ward
    So I've been set a task to create a temperature converter in C++ using this equation: Celsius = (5/9)*(Fahrenheit – 32) and so far I've come up with this (I've cut out the 10 lines worth of comments from the start so the code posted begins on line 11, if that makes any sense) #include <iostream> #include <string> #include <iomanip> #include <cmath> using namespace std; int main () { float celsius; float farenheit; std::cout << "**************************" << endl; std::cout << "*4001COMP-Lab5-Question 1*" << endl; std::cout << "**************************" << endl << endl; std::cout << "Please enter a temperature in farenheit: "; std::cin >> farenheit >> endl; std::cout << "Temperature (farenheit): " << endl; std::cout << "Temperature (celsius): " << celsius << endl; std::cin.get(); return 0; } Everytime I try to run this program I get a heap of errors with this one appearing every time: 1m:\visual studio 2010\projects\week 5\week 5\main.cpp(26): error C2678: binary '' : no operator found which takes a left-hand operand of type 'std::basic_istream<_Elem,_Traits' (or there is no acceptable conversion) I've tried everything I can think of to get rid of this error but it reappears every time, any idea on how to fix this?

    Read the article

  • Search tool that uses a grammar rather than regular expression?

    - by Tom Hubbard
    Are there any search tools that allow you to set up a simple token/grammar parsing system that work similar to regular expressions? What we want to do is search our ColdFusion code for queries that do not have cfqueryparams in them. A regular expression gets a bit tough in this situation because I can't keep track of the start tags while looking for something else before getting an end tag. It seems like a parsing system would work more accurately.

    Read the article

  • eclipse + maven + tomcat debugging

    - by Tom
    I'm developping a web application in Eclipse and I'm using maven, spring and tomcat. Now the problem I have is that debug as = debug on server doesn't work. I just get exceptions. (and yes I've created the server) If I use the mvn command to compile it, put the war in my tomcat webapps dir and start my tomcat the application works fine. But for the functionallity I'm now working on debugging would be usefull.

    Read the article

  • Why does SendMailMAPI rename file attachments to shorter ones?

    - by Tom
    I use the following emailing function with Eudora. For some reason the attachment file name is renamed to be something else. How can I make sure the attachment file name remains intact? function SendMailMAPI(const Subject, Body, FileName, SenderName, SenderEMail, RecepientName, RecepientEMail: String) : Integer; var message: TMapiMessage; lpSender, lpRecepient: TMapiRecipDesc; FileAttach: TMapiFileDesc; SM: TFNMapiSendMail; MAPIModule: HModule; begin FillChar(message, SizeOf(message), 0); with message do begin if (Subject<>'') then begin lpszSubject := PChar(Subject) end; if (Body<>'') then begin lpszNoteText := PChar(Body) end; if (SenderEMail<>'') then begin lpSender.ulRecipClass := MAPI_ORIG; if (SenderName='') then begin lpSender.lpszName := PChar(SenderEMail) end else begin lpSender.lpszName := PChar(SenderName) end; lpSender.lpszAddress := PChar('SMTP:'+SenderEMail); lpSender.ulReserved := 0; lpSender.ulEIDSize := 0; lpSender.lpEntryID := nil; lpOriginator := @lpSender; end; if (RecepientEMail<>'') then begin lpRecepient.ulRecipClass := MAPI_TO; if (RecepientName='') then begin lpRecepient.lpszName := PChar(RecepientEMail) end else begin lpRecepient.lpszName := PChar(RecepientName) end; lpRecepient.lpszAddress := PChar('SMTP:'+RecepientEMail); lpRecepient.ulReserved := 0; lpRecepient.ulEIDSize := 0; lpRecepient.lpEntryID := nil; nRecipCount := 1; lpRecips := @lpRecepient; end else begin lpRecips := nil end; if (FileName='') then begin nFileCount := 0; lpFiles := nil; end else begin FillChar(FileAttach, SizeOf(FileAttach), 0); FileAttach.nPosition := Cardinal($FFFFFFFF); FileAttach.lpszPathName := PChar(FileName); nFileCount := 1; lpFiles := @FileAttach; end; end; MAPIModule := LoadLibrary(PChar(MAPIDLL)); if MAPIModule=0 then begin Result := -1 end else begin try @SM := GetProcAddress(MAPIModule, 'MAPISendMail'); if @SM<>nil then begin Result := SM(0, Application.Handle, message, MAPI_DIALOG or MAPI_LOGON_UI, 0); end else begin Result := 1 end; finally FreeLibrary(MAPIModule); end; end; if Result<>0 then begin MessageDlg('Error sending mail ('+IntToStr(Result)+').', mtError, [mbOk], 0) end;

    Read the article

  • Getting HTMLUnknownElement with jQuery.find() and an XML Document

    - by Tom
    I'm attempting to load up an XML document (specifically an RSS feed) via an Ajax request, parse it, and insert some information based on said feed into my page. The code works fine in Firefox, Opera, Chrome, and Safari, but not IE7. Go figure. After doing some initial debugging, I've found that the XML string is being retrieved via the request, and the specific node type I'm getting when trying to parse nodes out of the document is HTMLUnknownElement. Here's the relevant code: $.get('feed.php', function(oXmlDoc) { var titles = $(oXmlDoc).find('title'); var dates = $(oXmlDoc).find('pubDate'); for(var i = 0; i < 5; i++) { parseNodes(titles[i].firstChild.nodeValue, dates[i].firstChild.nodeValue)); } }); The parseNodes function is never actually being hit because IE cannot access firstChild and, consequently, nodeValue. Thanks in advance for any ideas and/or suggestions on how to address this.

    Read the article

  • how to get option title="sample" using jquery

    - by tom
    Hi, I'm trying to update a hidden field based on the a title attribute on a select option, I've tried the code bellow and can't seem to get it to work. Thanks for any help! <form> <select id="selectbox"> <option name="test" value="one" title="title" selected="selected">one</option> <option name="test2" value="two" title="title2">two</option> </select> </form> <input id="update" type="hidden" value="defaultold" /> <script> $('#update').val('default'); $('#selectbox').change(function() { $('#update').val($(this).attr("title")); }); </script>

    Read the article

  • Stackoverflow interesting tags

    - by Tom
    So, that's how works Interesting Tags: I add into them my interested tags like php, mysql, jquery and so on. Then, if any of questions has the same tags as mine it makes background orange. I understand how to use jquery to do that (there were related questions to that), but without mysql it can't be done. Now, here is a question. How is it done? I imagine like that: There is a row in mysql for every member, let's call it "interested_tags". After I write and submit my tag through input, it is being written in a row "interested_tags". Then, the main page has a query which shows all answers and it always checks answer's with mine tags with strpos like this if(strpos($question_tags, $my_tags) === true) {        //and here will be made background orange } Am I thinking right or is there any way to do it?

    Read the article

  • Load two instances of the same DLL in Delphi

    - by Tom
    Here's my problem: I would like to create two separate instances of the same DLL. The following doesn't work because Handle1 and Handle2 will get the same address Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll.dll'); The following works, but I have to make a copy of the DLL and rename it to something else (which seems a bit silly) Handle1 := LoadLibrary('mydll.dll'); Handle2 := LoadLibrary('mydll2.dll'); Is there a way to have only one DLL file, but load several instances of it?

    Read the article

  • SFINAE and detecting if a C++ function object returns void.

    - by Tom Swirly
    I've read the various authorities on this, include Dewhurst and yet haven't managed to get anywhere with this seemingly simple question. What I want to do is to call a C++ function object, (basically, anything you can call, a pure function or a class with ()), and return its value, if that is not void, or "true" otherwise. #include <stdio.h> struct Foo { void operator()() {} }; struct Bar { bool operator()() { return false; } }; Foo foo; Bar bar; bool baz() { return false; } void bang() {} const char* print(bool b) { printf(b ? "true, " : "false, "); } template <typename Functor> bool magicCallFunction(Functor f) { return true; // lots of template magic occurs here... } int main(int argc, char** argv) { print(magicCallFunction(foo)); print(magicCallFunction(bar)); print(magicCallFunction(baz)); print(magicCallFunction(bang)); printf("\n"); }

    Read the article

  • Using arrays in Jquery

    - by Tom
    Here is a code: <input type="button" id="array[1]" value="Value1" /> <input type="button" id="array[2]" value="Value2" /> <input type="button" id="array[3]" value="Value3" /> And I want to do something like that: $('#array').click(function() { id = this.id; $.ajax({ here goes type, url, data and else }); }) I want to id add array's number. For example, if I click button where id is array[3] so id gets value of 3 in Jquery's function. Hope you got what I mean.

    Read the article

  • Why does my perl script return a zero return code when I explicitly call exit with a non-zero parame

    - by Tom Duckering
    I have a perl script which calls another script. The perl script should be propagating the script's return code but seems to be returning zero to its caller (a Java application) desipte the explicit call to exit $scriptReturnCode. It's probably something dumb since I'm by no means a perl expert. Code and output as follows (I realise that <=> could/should be != but that's what I have): print "INFO: Calling ${scriptDirectory}/${script} ${args}" $scriptReturnCode = system("${scriptDirectory}/${script} ${args}"); if ( $scriptReturnCode <=> 0 ) { print "ERROR: The script returned $scriptReturnCode\n"; exit $scriptReturnCode; } else { print "INFO: The script returned $scriptReturnCode.\n"; exit 0; } The output I have from my Java is: 20/04/2010 14:40:01 - INFO: Calling /path/to/script/script.ksh arg1 arg2 20/04/2010 14:40:01 - Could not find installer files <= this is from the script.ksh 20/04/2010 14:40:01 - ERROR: The script returned 256 20/04/2010 14:40:01 - Command Finished. Exit Code: 0 <= this is the Java app.

    Read the article

  • Switching 2003 SRV to 2008 caused Asp.net application not to Import Dll

    - by Tom
    Switching aged 2003 SRV to 2008 caused my Asp.net 2 application fail: The application is no more loading the required library DLL from /bin/ folder anymore. What should I change in my code or web.config to make this webapp load OK also in new 2008 server? Now I receive this error when I access the application: This type is in IMPORTS ( Dll ). Compiler Error Message: BC30002: Type 'Facebook.Entity.User' is not defined.

    Read the article

  • javascript: How to assign a function to an element.

    - by Tom
    Hi, Here's what I want: I have an element in my html code, and I want to assign a function to the onClick event, depending on some conditions to be known down the road. For example <a href="" id = "element"><img .....> //other code </a> Then I want to do something like this <logic:equals some_condition> <script> var e = document.getObjectById("element"); e.onClick = my_function(); </script> </logic> But I cant get it working. Is there any special syntax? I've tried with e.onClick = my_function; e.onClick = function(){my_function();} Sadly i'm in IE 6. Thanks in advance.

    Read the article

  • JQuery: Create n selects after choosing it in the select box

    - by Tom
    I have this select: <select name="main"> <option value="2">2s</option> <option value="3">3s</option> <option value="5">5s</option> </select> How do I make, that after choosing 2s, 2 selects would be created: <select name="select1"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> </select> <select name="select2"> <option value="0">0</option> <option value="1">1</option> <option value="2">2</option> </select> After choosing 3s, it would create 3 selects and so on. Thanks Would appreciate jsfiddle example

    Read the article

< Previous Page | 53 54 55 56 57 58 59 60 61 62 63 64  | Next Page >