Search Results

Search found 166 results on 7 pages for 'dominic barnes'.

Page 4/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • Python doesn't work properly when I execute a script after using Right Click >> Command Prompt Here

    - by Dominic Bou-Samra
    This is a weird bug. I know it's something funky going on with my PATH variable, but no idea how to fix it. If I have a script C:\Test\test.py and I execute it from within IDLE, it works fine. If I open up Command Prompt using Runcmd.exe and navigate manually it works fine. But if I use Windows 7's convenient Right Click on folder Command Prompt Here then type test.py it fails with import errors. I also cannot just type "python" to reach a python shell session if I use the latter method above. Any ideas?

    Read the article

  • crazy asp.net error

    - by dominic
    Hi I am having a problem debugging an issue on a website. Everything works locally, the local and server databases are the same The strange thing about the error is that it points to my local dev machine in the error stack. Is that crazy or what, The files are published and being hosted on a server machine and the error is pointing to a line of code on my local dev box. I feel like I am losing the plot. Can someone pls help be clear the air here because this is very weird Error in '/' Application. Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index] System.Collections.ArrayList.get_Item(Int32 index) +10066148 System.Collections.Specialized.NameObjectCollectionBase.BaseGet(Int32 index) +17 System.Web.HttpFileCollection.get_Item(Int32 index) +9 System.Web.HttpFileCollectionWrapper.get_Item(Int32 index) +18 PitchPortal.Web.Binders.DocumentModelBinder.ValidateAndAssignPostedFile(ControllerContext controllerContext, ModelBindingContext bindingContext, Document doc) in C:\Users\Bich Vu\Documents\Visual Studio 2008\Projects\PitchPortal\PitchPortal.Web\Binders\DocumentModelBinder.cs:73 PitchPortal.Web.Binders.DocumentModelBinder.BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) in C:\Users\Bich Vu\Documents\Visual Studio 2008\Projects\PitchPortal\PitchPortal.Web\Binders\DocumentModelBinder.cs:45 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +404 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +140 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +658084 System.Web.Mvc.Controller.ExecuteCore() +125 System.Web.Mvc.<c_DisplayClass8.b_4() +48 System.Web.Mvc.Async.<c_DisplayClass1.b_0() +21 System.Web.Mvc.Async.<c__DisplayClass81.<BeginSynchronous>b__7(IAsyncResult _) +15 System.Web.Mvc.Async.WrappedAsyncResult1.End() +85 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +454 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +263

    Read the article

  • Explaining abstraction to a non-programmer.

    - by Dominic Bou-Samra
    Abstraction is a concept that seems difficult to explain, without reverting to using programming terminology. I've thought about it a lot, and I can't come up with a satisfactory answer. Does anyone have any very general, yet very pertinent explanations? Metaphors, similes etc are all welcome.

    Read the article

  • How do I draw the desktop on Mac OS X?

    - by Dominic Cooney
    I want to draw the desktop on Mac OS X (Snow Leopard). Specifically, I want to achieve the same effect as running: /System/Library/Frameworks/ScreenSaver.framework/Resources/ ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background (If you’re not near your computer, this displays the screensaver where you would normally see your desktop background.) I know how to make a window without a border (by subclassing NSWindow and overriding initWithContentRect:styleMask:backing:defer: to set the window style to NSBorderlessWindowMask) and without a shadow (setHasShadow:NO.) I know that I can call setLevel:kCGDesktopWindowLevel or kCGDesktopIconWindowLevel to put my window below other windows (see question 418791.) However this isn’t exactly what I want, because a window at this level is still on top of the desktop icons. I want to be on top of the desktop background, but below the icons. My view is opaque. If there is a technique that clobbers the desktop background, that is OK.

    Read the article

  • Manipulating binary data in Python

    - by Dominic Bou-Samra
    I am opening up a binary file like so: file = open("test/test.x", 'rb') and reading in lines to a list. Each line looks a little like: '\xbe\x00\xc8d\xf8d\x08\xe4.\x07~\x03\x9e\x07\xbe\x03\xde\x07\xfe\n' I am having a hard time manipulating this data. If I try and print each line, python freezes, and emits beeping noises (I think there's a binary beep code in there somewhere). How do I go about using this data safely? How can I convert each hex number to decimal?

    Read the article

  • Sticky Footers that move down when dynamic content gets loaded

    - by Dominic Rodger
    I've been using this snippet of jQuery to get a sticky footer: if($(document.body).height() < $(window).height()){ $("#footer").css({position: "absolute",top:($(window).scrollTop()+$(window).height()-$("#footer").height())+"px", width: "100%"}); } $(window).scroll(positionFooter).resize(positionFooter); However, that breaks when I've got expandable/collapsible divs lying around where the original content was less high than the window, since it is then stuck to the bottom of the window, rather than the bottom of the document. Is there a way of fixing this, or a better way of doing it? Please bear in mind that I don't have much control over the HTML, since I need to do this in Django's admin interface, which doesn't allow much injection of HTML in the places you might want to to accomplish this sort of thing (i.e. this answer and this answer don't work for me).

    Read the article

  • Pros and Cons of Different macro function / inline methods in C

    - by Robert S. Barnes
    According to the C FAQ, there are basically 3 practical methods for "inlining" code in C: #define MACRO(arg1, arg2) do { \ /* declarations */ \ stmt1; \ stmt2; \ /* ... */ \ } while(0) /* (no trailing ; ) */ or #define FUNC(arg1, arg2) (expr1, expr2, expr3) To clarify this one, the arguments are used in the expressions, and the comma operator returns the value of the last expression. or using the inline declaration which is supported as an extension to gcc and in the c99 standard. The do { ... } while (0) method is widely used in the Linux kernel, but I haven't encountered the other two methods very often if at all. I'm referring specifically to multi-statement "functions", not single statement ones like MAX or MIN. What are the pros and cons of each method, and why would you choose one over the other in various situations?

    Read the article

  • The new operator in C# isn't overriding base class member

    - by Dominic Zukiewicz
    I am confused as to why the new operator isn't working as I expected it to. Note: All classes below are defined in the same namespace, and in the same file. This class allows you to prefix any content written to the console with some provided text. public class ConsoleWriter { private string prefix; public ConsoleWriter(string prefix) { this.prefix = prefix; } public void Write(string text) { Console.WriteLine(String.Concat(prefix,text)); } } Here is a base class: public class BaseClass { protected static ConsoleWriter consoleWriter = new ConsoleWriter(""); public static void Write(string text) { consoleWriter.Write(text); } } Here is an implemented class: public class NewClass : BaseClass { protected new static ConsoleWriter consoleWriter = new ConsoleWriter("> "); } Now here's the code to execute this: class Program { static void Main(string[] args) { BaseClass.Write("Hello World!"); NewClass.Write("Hello World!"); Console.Read(); } } So I would expect the output to be Hello World! > Hello World! But the output is Hello World Hello World I do not understand why this is happening. Here is my thought process as to what is happening: The CLR calls the BaseClass.Write() method The CLR initialises the BaseClass.consoleWriter member. The method is called and executed with the BaseClass.consoleWriter variable Then The CLR calls the NewClass.Write() The CLR initialises the NewClass.consoleWriter object. The CLR sees that the implementation lies in BaseClass, but the method is inherited through The CLR executes the method locally (in NewClass) using the NewClass.consoleWriter variable I thought this is how the inheritance structure works? Please can someone help me understand why this is not working?

    Read the article

  • Image inside a button not positioned correctly in Firefox

    - by Dominic Rodger
    I have the following markup: <p class="managebox"> <button value="Add page"> <img src="page_add.png" alt="Add more content" /> Add Page </button> </p> And the following CSS: p.managebox { position: relative; } p.managebox button { display: block; padding: 5px 7px 4px 30px; position: relative; } p.managebox button img { position: absolute; left: 7px; } In IE 8 I get this: In Chrome 4.0 I get this: In Firefox 3.6 I get this: Does anyone know what I'm doing wrong? One thing I've just realised that may be relevant - if I use an a instead of button, it works fine.

    Read the article

  • Recreating "presentModalViewController"?

    - by Benjohn Barnes
    I'm using a UIImagePickerController set up as a camera with an overlay view. I want to present a modal view controller on top on this. When I do so, though, the camera view "closes". This would be okay, but when I dismissModalViewControllerAnimated, I see the closed camera, and there is a long and annoying delay before it reopens. I would like to avoid this. Unless someone has a better approach, I am planning to simply perform the transition that presentModalViewController would perform myself. However, if I take my modal view from it's controller and add it as a sub view of the camera overlay view, like this: [[_imagePickerController cameraOverlayView] addSubview: [viewController view]]; then the modal view doesn't show up at all, and the application crashes with an EXC_BAD_ACCESS in my "modal" view's layoutSubViews. Where as, if I present it with presentModalViewController, everything works fine. Clearly, presentModalViewController is also doing some other stuff. Does anyone know what this is so that I can recreate it?

    Read the article

  • OmniCppComplete: Completing on Class Members which are STL containers

    - by Robert S. Barnes
    Completion on class members which are STL containers is failing. Completion on local objects which are STL containers works fine. For example, given the following files: // foo.h #include <string> class foo { public: void set_str(const std::string &); std::string get_str_reverse( void ); private: std::string str; }; // foo.cpp #include "foo.h" using std::string; string foo::get_str_reverse ( void ) { string temp; temp.assign(str); reverse(temp.begin(), temp.end()); return temp; } /* ----- end of method foo::get_str ----- */ void foo::set_str ( const string &s ) { str.assign(s); } /* ----- end of method foo::set_str ----- */ I've generated the tags for these two files using: ctags -R --c++-kinds=+pl --fields=+iaS --extra=+q . When I type temp. in the cpp I get a list of string member functions as expected. But if I type str. omnicppcomplete spits out "Pattern Not Found". I've noticed that the temp. completion only works if I have the using std::string; declaration. How do I get completion to work on my class members which are STL containers?

    Read the article

  • SOAP security in Salesforce

    - by Dean Barnes
    I am trying to change the wsdl2apex code for a web service call header that currently looks like this: <env:Header> <Security xmlns="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"> <UsernameToken Id="UsernameToken-4"> <Username>test</Username> <Password>test</Password> </UsernameToken> </Security> </env:Header> to look like this: <soapenv:Header> <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-4" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>Test</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Test</wsse:Password> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> One problem is that I can't work out how to change the namespaces for elements (or even if it matters what name they have). A secondary problem is putting the Type attribute onto the Password element. Can any provide any information that might help? Thanks

    Read the article

  • Synchronizing in SQL Replication works when manually syncing, but not automatically

    - by Dominic Zukiewicz
    I'm using SQL Server 2005 to create a replication copy of the main databases, so that the reports can point to the replication copy instead of locking out our main databases. I have set up the 3 databases as publications and then 3 subscribers moving the transactions over to the subscribers, instantaneously I hope! What seems to be happening is that when using the "Insert Tracer" function, replication take publisher to distributor < 2 seconds, but to replicate to the subscribers can take over 7 minutes (and these are local databases on a SAN). This could be for 2 reasons: The SQL statements used to query the database are obtaining locks which are stopping the transactions updating the subscribers. The subscribers are just too busy for the replication to apply the changes. What seems to trouble me more, is that although the Replication Monitor / Insert Tracer are showing these statistics, if you use the "View Subscription Details" and then click Start, it will sync within seconds. My goal would be to have the data syncing (ideally) continuously, or every minute, perhaps I should reduce the batch size of the transactions? What am I doing wrong? [Note that the -Continuous flag is set!]

    Read the article

  • Rewriting a simple Pygame 2D drawing function in C++

    - by Dominic Bou-Samra
    I have a 2D list of vectors (say 20x20 / 400 points) and I am drawing these points on a screen like so: for row in grid: for point in row: pygame.draw.circle(window, white, (particle.x, particle.y), 2, 0) pygame.display.flip() #redraw the screen This works perfectly, however it's much slower then I expected. I want to rewrite this in C++ and hopefully learn some stuff (I am doing a unit on C++ atm, so it'll help) on the way. What's the easiest way to approach this? I have looked at Direct X, and have so far followed a bunch of tutorials and have drawn some rudimentary triangles. However I can't find a simple (draw point).

    Read the article

  • Android date/time displaying 0 instead of 12

    - by bEtTy Barnes
    I wonder what's wrong with my code below: // Assign hour set in the picker c.set( Calendar.HOUR, selectedHour ); c.set( Calendar.MINUTE, selectedMinute ); // For alternative times c.add( Calendar.HOUR, SUB_SIX_HOUR ); c.add( Calendar.MINUTE, SUB_FLAT_MINUTE ); hour = c.get( Calendar.HOUR ); minute = c.get( Calendar.MINUTE ); hour = c.get( Calendar.HOUR_OF_DAY ); StringBuilder sb4 = new StringBuilder(); if(hour>=12){ sb4.append(hour-12).append( ":" ).append(minute).append(" PM"); }else if(hour == 0){ sb4.append( "12" ).append( ":" ).append(minute).append( "AM" ); }else{ sb4.append(hour).append( ":" ).append(minute).append(" AM"); } alternative.setText( "Alternative times: " + sb3 + " (9 hours)" + sb4 + " (6 hours)" ); Please help me figure out how to display 12 instead of 0 when the calculated time is 12:00 midnight. Thanks!

    Read the article

  • Advice on Mocking System Calls

    - by Robert S. Barnes
    I have a class which calls getaddrinfo for DNS look ups. During testing I want to simulate various error conditions involving this system call. What's the recommended method for mocking system calls like this? I'm using Boost.Test for my unit testing.

    Read the article

  • How to handle building and parsing HTTP URL's / URI's / paths in Perl

    - by Robert S. Barnes
    I have a wget like script which downloads a page and then retrieves all the files linked in img tags on that page. Given the URL of the original page and the the link extracted from the img tag in that page I need to build the URL for the image file I want to retrieve. Currently I use a function I wrote: sub build_url { my ( $base, $path ) = @_; # if the path is absolute just prepend the domain to it if ($path =~ /^\//) { ($base) = $base =~ /^(?:http:\/\/)?(\w+(?:\.\w+)+)/; return "$base$path"; } my @base = split '/', $base; my @path = split '/', $path; # remove a trailing filename pop @base if $base =~ /[[:alnum:]]+\/[\w\d]+\.[\w]+$/; # check for relative paths my $relcount = $path =~ /(\.\.\/)/g; while ( $relcount-- ) { pop @base; shift @path; } return join '/', @base, @path; } The thing is, I'm surely not the first person solving this problem, and in fact it's such a general problem that I assume there must be some better, more standard way of dealing with it, using either a core module or something from CPAN - although via a core module is preferable. I was thinking about File::Spec but wasn't sure if it has all the functionality I would need.

    Read the article

  • Boost.Test: Looking for a working non-Trivial Test Suite Example / Tutorial

    - by Robert S. Barnes
    The Boost.Test documentation and examples don't really seem to contain any non-trivial examples and so far the two tutorials I've found here and here while helpful are both fairly basic. I would like to have a master test suite for the entire project, while maintaining per module suites of unit tests and fixtures that can be run independently. I'll also be using a mock server to test various networking edge cases. I'm on Ubuntu 8.04, but I'll take any example Linux or Windows since I'm writing my own makefiles anyways.

    Read the article

  • ZF2 - How to use the Hydrator/exchangeArray() to populate a nested object

    - by Dominic Watson
    I've got an object with values that are stored in my database. My object also contains another object which is stored in the database using just the ID of it (foreign key). http://framework.zend.com/manual/2.0/en/modules/zend.stdlib.hydrator.html Before the Hydrator/exchangeArray functionality in ZF2 you would use a Mapper to grab everything you need to create the object. Now I'm trying to eliminate this extra layer by just using Hydration/exchangeArray to populate my objects but am a bit stuck on creating the nested object. Should my entity have the Inner object's table injected into it so I can create it if the ID of it is passed to my 'exchangeArray' ? Here are example entities as an example. // Village id, name, position, square_id // Map Square id, name, type Upon sending square_id to my Village's exchangeArray() function. It would get the mapTable and use hydrator to pull in the square using the ID I have. It doesn't seem right to be to have mapper instances inside my entity as I thought they should be disconnected from anything but it's own entity specific parameters and functionality?

    Read the article

  • PHP combobox can't save the selected value on Edit Page

    - by bEtTy Barnes
    hello I've got problem with my combobox. It's not saving the selected value in Edit page. Here what I'm working with: private function inputCAR(){ $html = ""; $selectedId = $this->CAR; //$html .= '<option value="Roadmap Accelerator - Core">Roadmap Accelerator - Core</option>'; //$html .= '<option value="Roadmap Accelerator - Optional Core">Roadmap Accelerator - Optional Core</option>'; //$html .= '<option value="Regulatory">Regulatory</option>'; //$html .= '<option value="Mission Critical">Mission Critical</option>'; //$html .= '<option value="Various CARs/Types">Various CARs/types</option>'; $selection = array( "Roadmap Accelerator - Core", "Roadmap Accelerator - Optional Core", "Regulatory", "Mission Critical", "Various CARs/types" ); $html .= '<label for="car">CAR Type</label>'; $html .= HTML::selectStart("car"); foreach($selection as $value){ $text = $value; $html .= HTML::option($value, $text, $selectedId == $value ? true : false); } $html .= HTML::selectEnd(); return $html; } My option function: public static function option($value, $text, $isSelected=false) { $html = '<option value="' . $value . '"'; if($isSelected) { $html .= ' selected="selected"'; } $html .= '>'; $html .= $text; $html .= '</option>'; return $html; } When I first created a record. The selected value from my combobox got saved into the DB then the page refreshed to display. When I went to edit page, to select another value, and clicked save button. On the display page, it's not saving. For example. on Create page I selected Regulatory. then I changed my mind and changed it to Mission Critical on Edit page. On display page it is not changed. I don't know what's wrong or what I'm missing here. Any help is welcome and truly appreciated. Thanks.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >