Search Results

Search found 1166 results on 47 pages for 'nick hodges'.

Page 30/47 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Recursive Binary Search Tree Insert

    - by Nick Sinklier
    So this is my first java program, but I've done c++ for a few years. I wrote what I think should work, but in fact it does not. So I had a stipulation of having to write a method for this call: tree.insertNode(value); where value is an int. I wanted to write it recursively, for obvious reasons, so I had to do a work around: public void insertNode(int key) { Node temp = new Node(key); if(root == null) root = temp; else insertNode(temp); } public void insertNode(Node temp) { if(root == null) root = temp; else if(temp.getKey() <= root.getKey()) insertNode(root.getLeft()); else insertNode(root.getRight()); } Thanks for any advice.

    Read the article

  • Python module seeing a full list as empty in another module

    - by Nick
    I'm working on a pygame project and have the main engine layed out. The problem is I hit a bug that I just can not seem to figure out. What happens is one module can't read a variable from another module. It's not that the variable can't be read, it just sees an empty list instead of what it really is. Instead of posting the entire source code I reproduced the bug in two small snippets that hopefully a skillful python-ist can interpret in his\her head. Code: main.py (This is the file that gets run) import screen screens = [] #A stack for all the game screens def current_screen(): #return a reference to the current screen return screens[-1] def play(): print'play called' current_screen().update() if __name__=='__main__': screens.append(screen.Screen()) play() screen.py import main class Screen: def __init__(self): print'screen made' def update(self): print main.screens #Should have a reference to itself in there Thanks!

    Read the article

  • Divs, flash and doctype :(

    - by nick
    I have a web-site, that uses colorbox, it also has flash header. Everything works fine in both ff and ie. Before ive started to use colorbox, i had little div that covered small part of flash header for menu purposes. Now, since im using colorbox, i had to declare doctype, and set wmode on flash to 'opaque', in order everything to work right way.But now i cant get that little div, to appear on top of my flash header. If anyone can help me with this, please do so.... or atleast tell me what should i read : ( im will be very gratefull for any solution. current html document structure: ... all the js and css files ... heres that div's style from corresponding css file: .cell_r0_c0{position: absolute;left: 61%;width:260;height:69; background-color: #000000; vertical-align: bottom;} I think i've allready tried all the combinations of position attribute, also tried diff z-index values, and i can't get it work the way i want. Maybe ive missed something idk. Please help me :(

    Read the article

  • Which Maven Glassfish plugin to use?

    - by Nick Klauer
    I've been trying to integrate deploying java .war's in Glassfish V3 through Maven. While I have found a few plugins, none of them look to be very active: Maven Glassfish Plugin Eskato's Wordpress Blog on Maven And I got the most information out of Eskato's Blog, it was written March 2008, so I don't know what the state of Glassfish Maven integration is, nor can I find a suitable plugin to work with. With the Maven Glassfish Plugin I have had some success, but it still doesn't work entirely well for all goals it says it supports, which makes some of the commands ineffective. Has anyone else been able to integrate Glassfish V3 and Maven successfully? If so, what resources did you use to get it done?

    Read the article

  • 'Step Into' is suddenly not working in Visual Studio

    - by Nick LaMarca
    All of a sudden, I have run into an issue where I cannot step into any code through debugging in Visual Studio. The step over works fine, but it refuses to step into (F11) any of my code. This was working before, now all of a sudden it does not. I've tried some things below, but I still had no success: Delete all bin files in every project in my solution, clean solution, re-build solution. Build projects in solution indivdualy Restart machine It an ASP.NET C# application consuming a WCF sevice locally. It is in debug mode. I have a breakpoint set on the page consuming the service. The breakpoint hits, but it will not step into the service code. The ASP.NET site and the service code is all in the same solution. This all of a sudden does not work, it did work before. How can I fix this problem? Adding a breakpoint to the service project I get a warning: Breakpoint will not currently be hit. No symbols have been loaded for this document. I deleted all the bin folders for all the projects and re-built them one by one. They all succeeded, but still I am getting the symbols won't load on any breakpoint I put into any project in the solution other than the ASP.NET project where the breakpoint works. I was able to debug step into all the projects before, this is an all of a sudden thing. Information from the output window.. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\SMDiagnostics\v4.0_4.0.0.0__b77a5c561934e089\SMDiagnostics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.DurableInstancing\v4.0_4.0.0.0__31bf3856ad364e35\System.Runtime.DurableInstancing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Xaml.Hosting\v4.0_4.0.0.0__31bf3856ad364e35\System.Xaml.Hosting.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\2d49cf50\14eee2cf\App_Web_jmow15fw.dll', Symbols loaded. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Discovery\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Discovery.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Routing\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Routing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Channels\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Channels.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

    Read the article

  • AddAllAttributes method spring mvc

    - by Nick Robertson
    I have two lists List<User> list_of_users=new ArrayList<User>(); List<String> list_of_attributes=new ArrayList<String>(); When i try to use the following lines of code: model.addAttribute("takeattributes",list_of_users); model.addAttribute("takeattributes",list_of_attributes); I realise that it keeps only the second list (list_of_attributes) and the first deleted. I was wondering how to keep both of these two lists in the model.Is this possible to be happened?Is the AddAllAttributes method what i need?If yes can anyone explain me how the AddAllAttributes method is working.I look at the spring mvc documentation but i didn't really understand.

    Read the article

  • WPF - How do I style a row based on a binding property value?

    - by Nick
    Hey! So I am trying to bind a collection of objects (IList<) to a WPF datagrid. I would like to make the row background a different color if the 'artist' property is null or empty. I am checking the value stored at the property on the LoadingRow datagrid event. Currently my implementation seems to style all of the rows with an empty or null 'artist' property correctly. The problem is that is also styles the rows where the property is not null or empty in some cases. So some rows are given the red background even though the rows 'artist' property is not null. Can anyone tell me why this could be?? Here is the LoadingRow event: private void trackGrid_LoadingRow(object sender, DataGridRowEventArgs e) { Track t = e.Row.DataContext as Track; if (String.IsNullOrEmpty(t.Artist)) { e.Row.Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 125, 125)); } }

    Read the article

  • How to use dirent.h correctly.

    - by Nick
    Hello, I am new to C++ and I am experimenting with the dirent.h header to manipulate directory entries. The following little app compiles but pukes after you supple a directory name. Can someone give me a hint? The int quit is there to provide a while loop. I removed the loop in an attempt to isolate my problem. thanks! #include <iostream> #include <dirent.h> using namespace std; int main() { char *dirname = 0; DIR *pd = 0; struct dirent *pdirent = 0; int quit = 1; cout<< "Enter a directory path to open (leave blank to quit):\n"; cin >> dirname; if(dirname == NULL) { quit = 0; } pd = opendir(dirname); if(pd == NULL) { cout << "ERROR: Please provide a valid directory path.\n"; } return 0; }

    Read the article

  • Publishing web service on IIS 7 gives 500.19 - Internal Server Error

    - by Nick
    Hello. I have created a folder and published my webservice to this folder. I then created an application (in IIS 7) and pointed it at this folder location. When I try and hit the ASMX file from a browser on the local machine I get the following error: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Can someone tell me why?

    Read the article

  • Is there a way to keep a selenium session persistent accross multiple tests?

    - by Nick
    I am testing a django application's frontend with selenium and that's first time I use it. I have multiple tests that test things after user logged in. I want them to be separate tests, but I want to have only log in once, is that possible? (As oppose to what I do right now: I log in first, then execute my testing actions of test1, then log in again and execute my testing actions for test2, etc.)

    Read the article

  • Control the size of points in an R scatterplot?

    - by Nick
    In R, the plot() function takes a pch argument that controls the appearance of the points in the plot. I'm making scatterplots with tens of thousands of points and prefer a small, but not too small dot. Basically, I find pch='.' to be too small, but pch=19 to be too fat. Is there something in the middle or some way to scale the dots down somehow?

    Read the article

  • GWT 2.0 and Dynamic (or lack thereof) Grids

    - by nick
    Still new to GWT and was attempting to create a dynamic grid using the UiBinder. However I got a strange (and horribly misleading) error about the tag for grid not being properly closed. After a bit of research I found out Grid isn't currently supported for UiBinding. For those of you in the 2.0 world how have you been handling tabular layout?

    Read the article

  • Javascript Prototyping Question

    - by Nick Lowman
    I'm just reading about Prototypes in JavaScript and Douglas Crockford offers and excellent way to select a new objects prototype but can anyone explain (below) why obj01's type equals 'object' when I pass it in function as it's prototype? if (typeof Object.beget !== 'function') { Object.beget = function (o) { console.log(typeof o);//function var F = function () {}; F.prototype = o; console.log(typeof F);//function return new F(); }; } var func01 = function(){}; var obj01 = Object.beget(func01); console.log(typeof obj01);//object console.log(typeof obj01.prototype);//object I thought it would be console.log(typeof obj01);//function console.log(typeof obj01.prototype);//function

    Read the article

  • How to handle all exceptions in a web java project

    - by Nick Donovan
    I am doing an web java project about an hotel reservation. I am using, sql, hibernate, java server pages. I want to know how can I redirect an incoming exception to an error.jsp file . There are a lot of java code , and a lot of jsp file. So I want to rederict every exception that I haven't handle to an error page, is there any way to do it ? An exception can come from everywhere and I can't know and handle them all ( for example an user can write to much data in an textfield, and it will generate me an sql exception for data to long) Thank you, sorry for my english.

    Read the article

  • How to get SimpleRpcClient.Call() to be a blocking call to achieve synchronous communication with RabbitMQ?

    - by Nick Josevski
    In the .NET version (2.4.1) of RabbitMQ the RabbitMQ.Client.MessagePatterns.SimpleRpcClient has a Call() method with these signatures: public virtual object[] Call(params object[] args); public virtual byte[] Call(byte[] body); public virtual byte[] Call(IBasicProperties requestProperties, byte[] body, out IBasicProperties replyProperties); The problem: With various attempts, the method still continues to not block where I expect it to, so it's unable ever handle the response. The Question: Am I missing something obvious in the setup of the SimpleRpcClient, or earlier with the IModel, IConnection, or even PublicationAddress? More Info: I've also tried various paramater configurations of the QueueDeclare() method too with no luck. string QueueDeclare(string queue, bool durable, bool exclusive, bool autoDelete, IDictionary arguments); Some more reference code of my setup of these: IConnection conn = new ConnectionFactory{Address = "127.0.0.1"}.CreateConnection()); using (IModel ch = conn.CreateModel()) { var client = new SimpleRpcClient(ch, queueName); var queueName = ch.QueueDeclare("t.qid", true, true, true, null); ch.QueueBind(queueName, "exch", "", null); //HERE: does not block? var replyMessageBytes = client.Call(prop, msgToSend, out replyProp); } Looking elsewhere: Or is it likely there's an issue in my "server side" code? With and without the use of BasicAck() it appears the client has already continued execution.

    Read the article

  • Closing inputstreams

    - by Nick
    I have the below code to read from a URL object: URL url= new URL("http://datasource.com"); BufferedReader reader = new BufferedReader( new InputStreamReader(url.openStream())); After I am done getting the data, is this sufficient to close and release all the resrouces: reader.close(); I did not see a method for URL to close it, like URL.close()...but wondering if I shouldn't do something more like this: InputStreamReader inputStreamReader = new InputStreamReader(url.openStream()); BufferedReader reader = new BufferedReader(inputStreamReader); // Do Stuff inputStreamReader.close(); reader.close();

    Read the article

  • Guide need to build a JSP based webapplication

    - by Nick
    I want do a web-application that consists of the following pages: Main, Inventory, Shopping, Login, and Report. All will be JSPs and all will be called using the MVC pattern where one of two servlets uses the RequestDispatcher to call the appropriate JSP. This uses server-side forwarding and not redirection. I have ER diagram: http://tinypic.com/r/155oxlt/5 if u can guide I can do it successfully.

    Read the article

  • Rails ActiveRecord- has_many through and belongs_to a related model

    - by Nick
    I have 3 models sites, user_favorites and users. Relevant relationships: class Site < ActiveRecord::Base has_many :users, :through => :user_favorites class UserFavorite < ActiveRecord::Base belongs_to :user, :counter_cache => true belongs_to :site end class User < ActiveRecord:Base has_many :user_favorites has_many :sites, :through => :user_favorites All of that works just fine. I'd like to add a new attribute to the Site model to indicate which user created it. I don't believe this constitutes a has_and_belongs_to_many scenario. A site has many users through user_favorites but I want it to belong to a single user reflecting the owner/creator. I'm wondering what the ORM best practice is for this. SQL wise I'd just use different joins depending on what I was trying to query with a created_by FK in Site. Sorry if I'm missing something basic here. Thanks

    Read the article

  • How to Communicate between minifb and a GAE-Hosted Silverlight Client

    - by Nick Gotch
    I have a minifb app (technically gminifb) running on Google App Engine with a bunch of handlers for processing all kinds of requests from a Silverlight client. What's the recommended approach for adding the FB GET variables, such as fb_sig, to the HTTP requests? I believe I can technically pass the session key and uid directly and get things to work but it seems there's probably a much better way to do this. I was reading about FBJS AJAX and I'm trying to figure out how I can use it to proxy the HTTP requests from the Silverlight client through it. Is this a good way to do it? And if so, how would I go about doing so? Any other recommendations would be appreciated too. Thanks,

    Read the article

  • How to resize an openGL window created with wglCreateContext?

    - by Nick
    Is it possible to resize an openGL window (or device context) created with wglCreateContext without disabling it? If so how? Right now I have a function which resizes the DC but the only way I could get it to work was to call DisableOpenGL and then re-enable. This causes any textures and other state changes to be lost. I would like to do this without the disable so that I do not have to go through the tedious task of recreating the openGL DC state. HWND hWnd; HDC hDC; void View_setSizeWin32(int width, int height) { // resize the window LPRECT rec = malloc(sizeof(RECT)); GetWindowRect(hWnd, rec); SetWindowPos( hWnd, HWND_TOP, rec->left, rec->top, rec->left+width, rec->left+height, SWP_NOMOVE ); free(rec); // sad panda DisableOpenGL( hWnd, hDC, hRC ); EnableOpenGL( hWnd, &hDC, &hRC ); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-(width/2), width/2, -(height/2), height/2, -1.0, 1.0); // have fun recreating the openGL state.... } void EnableOpenGL(HWND hWnd, HDC * hDC, HGLRC * hRC) { PIXELFORMATDESCRIPTOR pfd; int format; // get the device context (DC) *hDC = GetDC( hWnd ); // set the pixel format for the DC ZeroMemory( &pfd, sizeof( pfd ) ); pfd.nSize = sizeof( pfd ); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; pfd.iPixelType = PFD_TYPE_RGBA; pfd.cColorBits = 24; pfd.cDepthBits = 16; pfd.iLayerType = PFD_MAIN_PLANE; format = ChoosePixelFormat( *hDC, &pfd ); SetPixelFormat( *hDC, format, &pfd ); // create and enable the render context (RC) *hRC = wglCreateContext( *hDC ); wglMakeCurrent( *hDC, *hRC ); } void DisableOpenGL(HWND hWnd, HDC hDC, HGLRC hRC) { wglMakeCurrent( NULL, NULL ); wglDeleteContext( hRC ); ReleaseDC( hWnd, hDC ); }

    Read the article

  • Verifying serialisation streams when used for messaging

    - by Nick
    I want to add distributed messaging to some applications. One target would be embedded and the other applications would be running on Windows. I'm thinking of having a connection manager, to which all of the applications would connect and communicate. I only need some simple kind of RPC mechanism. I've looked at Google Protocol Buffers, but I don't really like the idea of code generation. I'd rather use serialisation and somehow verify the format of the serialised stream. I.e. Perhaps send metadata about what the stream would contain so that each endpoint can verify it is reading the correct version. Does anyone know of any examples of this? Perhaps the message format could be read from a file which all the applications read to verify the stream format?

    Read the article

  • How do you return a pointer to a base class with a virtual function?

    - by Nick Sweet
    I have a base class called Element, a derived class called Vector, and I'm trying to redefine two virtual functions from Element in Vector. //element.h template <class T> class Element { public: Element(); virtual Element& plus(const Element&); virtual Element& minus(const Element&); }; and in another file //Vector.h #include "Element.h" template <class T> class Vector: public Element<T> { T x, y, z; public: //constructors Vector(); Vector(const T& x, const T& y = 0, const T& z =0); Vector(const Vector& u); ... //operations Element<T>& plus(const Element<T>& v) const; Element<T>& minus(const Element<T>& v) const; ... }; //sum template <class T> Element<T>& Vector<T>::plus(const Element<T>& v) const { Element<T>* ret = new Vector((x + v.x), (y + v.y), (z + v.z)); return *ret; } //difference template <class T> Element<T>& Vector<T>::minus(const Element<T>& v) const { Vector<T>* ret = new Vector((x - v.x), (y - v.y), (z - v.z)); return *ret; } but I always get error: 'const class Element' has no member named 'getx' So, can I define my virtual functions to take Vector& as an argument instead, or is there a way for me to access the data members of Vector through a pointer to Element? I'm still fairly new to inheritance polymorphism, fyi.

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >