Search Results

Search found 366 results on 15 pages for 'cory walker'.

Page 10/15 | < Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • datetime command line argument in python 2.4

    - by Ike Walker
    I want to pass a datetime value into my python script on the command line. My first idea was to use optparse and pass the value in as a string, then use datetime.strptime to convert it to a datetime. This works fine on my machine (python 2.6), but I also need to run this script on machines that are running python 2.4, which doesn't have datetime.strptime. How can I pass the datetime value to the script in python 2.4? Here's the code I'm using in 2.6: parser = optparse.OptionParser() parser.add_option("-m", "--max_timestamp", dest="max_timestamp", help="only aggregate items older than MAX_TIMESTAMP", metavar="MAX_TIMESTAMP(YYYY-MM-DD HH24:MM)") options,args = parser.parse_args() if options.max_timestamp: # Try parsing the date argument try: max_timestamp = datetime.datetime.strptime(options.max_timestamp, "%Y-%m-%d %H:%M") except: print "Error parsing date input:",sys.exc_info() sys.exit(1)

    Read the article

  • AI navigation around a 2d map - Avoiding obstacles.

    - by Curt Walker
    Hey there, I know my question seems pretty vague but I can't think of a better way to put it so I'll start off by explaining what I'm trying to do. I'm currently working on a project whereby I've been given a map and I'm coding a 'Critter' that should be able to navigate it's way around the map, the critter has various other functions but are not relevant to the current question. The whole program and solution is being written in C#. I can control the speed of the critter, and retrieve it's current location on the map by returning it's current X and Y position, I can also set it's direction when it collides with the terrain that blocks it. The only problem I have is that I can't think of a way to intelligently navigate my way around the map, so far I've been basing it around what direction the critter is facing when it collides with the terrain, and this is in no way a good way of moving around the map! I'm not a games programmer, and this is for a software assignment, so I have no clue on AI techniques. All I am after is a push in the right direction on how I could go about getting this critter to find it's way around any map given to me. Here's an image of the map and critters to give you an idea of what i'm talking about. Here's a link to an image of what the maps and critters look like. Map and Critter image I'm in no way looking for anyone to give me a full solution, just a push in the general direction on map navigation. Thanks in advance!

    Read the article

  • Compile a shared library statically

    - by Simon Walker
    I've got a shared library with some homemade functions, which I compile into my other programs, but I have to link the end program with all the libraries I have used to compile the static library. Here is an example: I have function foo in the library which requires a function from another library libbar.so. In my main program to use function foo I have to compile it with the -lbar flag. Is there a way I can compile my library statically so it includes all the required code from the other libraries, and I can compile my end program without needing the -lbar flag? Cheers

    Read the article

  • how i can check if this header exists ?

    - by Night Walker
    I am trying to check in my xml file if HeaderReportUnit exists, how i can check if this Header exists ? I am using 2.0 assembly , really thanks for help <?xml version="1.0" encoding="UTF-8" ?> - <HeadReportUnit> - <Title> <ModuleNum>ModuleNum</ModuleNum> <hdstSetPos>hdstSetPos</hdstSetPos> <hdstNzlName>hdstNzlName</hdstNzlName> <nzavSpecName>nzavSpecName</nzavSpecName> <nzavNzlDiameter>nzavNzlDiameter</nzavNzlDiameter> <nzavNzlSizeX>nzavNzlSizeX</nzavNzlSizeX> <nzavNzlSizeY>nzavNzlSizeY</nzavNzlSizeY> <nzavNzlType2>nzavNzlType2</nzavNzlType2> </Title> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 1</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 2</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 3</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 4</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 5</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 6</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 7</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 8</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 9</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</nzavNzlSizeX> <nzavNzlSizeY>0.6</nzavNzlSizeY> <nzavNzlType2>Standard</nzavNzlType2> </Unit> - <Unit> <ModuleNum>1</ModuleNum> <hdstSetPos>1- 10</hdstSetPos> <hdstNzlName>R07-007-070</hdstNzlName> <nzavSpecName>AA05700</nzavSpecName> <nzavNzlDiameter>0.0</nzavNzlDiameter> <nzavNzlSizeX>0.7</ nzavNzlSizeX

    Read the article

  • Modifying association arrays on cloned ActiveRecord objects

    - by Craig Walker
    I have an ActiveRecord model class Foo that has_many Bar. I want to clone a Foo (to get duplicates of most of its attributes) and then modify its Bar instances. This is a problem because cloned ActiveRecord instances share the same associated array; changes to one affect the other. f1 = Foo.new b = Bar.new f1.bars << b f2 = f1.clone f2.bars.includes? b # true f1.bars.clear f2.bars.includes? b # now false The real problem is that I can't detach the bars arrays from either Foo: f1.bars << b f2.bars.includes? b # true f2.bars = [] f2.bars.includes? b # now false f1.bars.includes? b # now also false If I could do that, then I could replace the Bars as I wanted to. However, any change to one Foo seems to affect the other.

    Read the article

  • Assemble an image browser side with JavaScript or Flash?

    - by Kris Walker
    Would it be possible to assemble an image on the browser by 'concatenating' other downloaded images together? The use case is this. The page will display 36 different tiles (small images). The user should be able to arrange those tiles into a 6 x 6 grid and save the resulting grid to disk as an image. The best solution would be to do it all in the browser without Flash. The next best solution would be to allow the user to create the grid in the browser with simple JavaScript drag and drop functionality and then send the coordinates to the server for image processing. The last solution would be to do it all in the browser with Flash. Is it even possible for Flash to create an image and then allow the user to save it from the browser? I am familiar with the Pixastic JavaScript library ( http://www.pixastic.com/ ), but it relies on getting image data to and from a canvas element which is not very well supported. What if I send the tile images to the browser as base64 encoded strings? Could I use JavaScript to create the 6 x 6 grid image? And if so, is there some way of allowing the user to get it onto disk without relying on the canvas element?

    Read the article

  • Panel widget overlapping other contents in android

    - by walker
    I'm trying to utilize the Panel widget introduced in android-misc-widgets. It's been good so far. Now the problem is the sliding panel overlaps my top menu bar. For clarification look at the following screenshots. This is when I open panel using drag gesture (no problem here): This is when I open the panel with a single tap (look at the icons overlapping the top menu): There is one other problem, If there is any content inside the activity, opening the panel pushes that content out of the screen!

    Read the article

  • Migrate style from TabItem to TabHeader

    - by OffApps Cory
    Good day! I have a TabControl with TabItems that have been customized via a control template. This control template specifies a trigger whereby on mouseover, the content of tab header grows slightly. <ControlTemplate> <Storyboard x:Key="TabHeaderGrow"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="TabName" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1.1"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="TabName" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1.1"/> </DoubleAnimationUsingKeyFrames> </Storyboard> <ControlTemplate.Triggers> <EventTrigger RoutedEvent="Mouse.MouseEnter"> <BeginStoryboard Storyboard="{StaticResource TabHeaderGrow}"/> </EventTrigger> When I mouseover any of the tabs they work as expected, however the trigger also fires when I mouseover any of the elements in the tab body. I know that I need to migrate the control styling to a tabHeader controlTemplate, but I am unsure how to do that. I can't seem to do template binding for the content of the tabheader. Any help would be appreciated.

    Read the article

  • Sphinx autodoc is not automatic enough

    - by Cory Walker
    I'm trying to use Sphinx to document a 5,000+ line project in Python. It has about 7 base modules. As far as I know, In order to use autodoc I need to write code like this for each file in my project: .. automodule:: mods.set.tests :members: :show-inheritance: This is way too tedious because I have many files. It would be much easier if I could just specify that I wanted the 'mods' module to be documented. Sphinx could then recursively go through the module and make a page for each submodule. Is there A feature like this? If not I could write a script to make all the .rst files, but that would take up a lot of time.

    Read the article

  • SSIS - 'Execute SQL' Task and Record Sets

    - by Mick Walker
    Hi, How can I access a 'RecordSet' within a 'Execute SQL' task when using SSIS? I have looked at the parameter mapping options within the Execute SQL Task Editor and cannot find a type of object to allow me to pass the variable holding my record set to the task.

    Read the article

  • 2 Questions about nUnit.

    - by Night Walker
    Hi all I have 2 questions about functionality of nunit. What is the difference between [TestFixtureSetUp] and [SetUp] attributes ? I am writing a some class with tests and I see that half of my test functions need one setup, And an another half needs another set up. How can I have in one class two little different SetUp functions that are called with different functions Thanks.

    Read the article

  • MySQL triggers cannot update rows in same table the trigger is assigned to. Suggested workaround?

    - by Cory House
    MySQL doesn't currently support updating rows in the same table the trigger is assigned to since the call could become recursive. Does anyone have suggestions on a good workaround/alternative? Right now my plan is to call a stored procedure that performs the logic I really wanted in a trigger, but I'd love to hear how others have gotten around this limitation. Edit: A little more background as requested. I have a table that stores product attribute assignments. When a new parent product record is inserted, I'd like the trigger to perform a corresponding insert in the same table for each child record. This denormalization is necessary for performance. MySQL doesn't support this and throws: Can't update table 'mytable' in stored function/trigger because it is already used by statement which invoked this stored function/trigger. A long discussion on the issue on the MySQL forums basically lead to: Use a stored proc, which is what I went with for now. Thanks in advance!

    Read the article

  • Configuring PHP in IIS with Tomcat

    - by Silent Walker
    I have my Java site running under IIS 7. I need to install wordpress blog in it. I've installed and configured PHP in IIS. I have tested the PHP handler by creating a separate site, everything works fine, phpinfo() gives the desired output. However, I'm having problem running the PHP files inside my Java web application. I've put my test PHP file inside a folder called blog. When I access this folder in the browser as /mysite/blog I get a 404 page from my Java application. When I try to invoke the php page directly, http://mysite/blog/index.php, I get an unprocessed php page. I'm using isapi_handler for the reidrects. How do I tell my isapi_handler to ignore /blog folder? In my IIS handler mapping, *.php is mapped with Fast CGI. I'm not sure how to approach this problem and any help on this would be much appreciated. Thanks in advance.

    Read the article

  • CouchDB Versioning / Auditing

    - by Cory
    I'm attempting to use CouchDB for a system that requires full auditing of all data operations. Because of its built in revision-tracking, couch seemed like an ideal choice. But then I read in the O'Reilly textbook that "CouchDB does not guarantee that older versions are kept around." I can't seem to find much more documentation on this point, or how couch deals with its revision-tracking internally. Is there any way to configure couch either on a per-database, or per-document level to keep all versions around forever? If so, how?

    Read the article

  • Validations for a has_many/belongs_to relationship

    - by Craig Walker
    I have a Recipe model which has_many Ingredients (which in turn belongs_to Recipe). I want Ingredient to be existent dependent on Recipe; an Ingredient should never exist without a Recipe. I'm trying to enforce the presence of a valid Recipe ID in the Ingredient. I've been doing this with a validates :recipe, :presence => true (Rails 3) statement in Ingredient. This works fine if I save the Recipe before adding an Ingredient to it's ingredients collection. However, if I don't have explicit control over the saving (such as when I'm creating a Recipe and its Ingredients from a nested form) then I get an error: Ingredients recipe can't be blank I can get around this simply by dropping the presence validation on Ingredient.recipe. However, I don't particularly like this, as it means I'm working without a safety net. What is the best way to enforce existence-dependence in Rails? Things I'm considering (please comment on the wisdom of each): Adding a not-null constraint on the ingredients.recipe_id database column, and letting the database do the checking for me. A custom validation that somehow checks whether the Ingredient is in an unsaved recipe's ingredient collection (and thus can't have a recipe_id but is still considered valid).

    Read the article

  • How do I make the "back button" work with jQuery hide/show functions?

    - by Walker
    I'm looking for a way to append text to the url with jQuery so that the back button is not broken when a user loads new content with jQuery. For example, I have a three step form - the first step is (www.xyz.com/form-1). When the user clicks next step, jQuery slides in the next page. I would like that page to be (www.xyz.com/form-2). I know websites like hypem.com do this, I'm just looking for an elegant way to handle it.

    Read the article

  • Switching from one connectionstring to another when moving from development to cloud

    - by Nancy Walker
    Hello, I am working on a cloud application. When I test out the application on my computer I want to have my connection string set as follows in ServiceConfiguration.cscfg: <Setting name="DataConnectionString" value="UseDevelopmentStorage=true" /> When I publish to the cloud I need to have it set as follows: <Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=yyy" /> I keep going from one environment to the other and keep having to change the DataConnectionString. Is there a way that I can automate this? I looked around and can't see any examples but I'm sure some others have the same problem as me. Thanks, Nancy

    Read the article

  • Troubleshooting MSSQL Connection from PHP

    - by Cory Dee
    I'm trying to connect to an external Sql Server through PHP 5.2. Using this line: $con = mssql_connect('123.123.123.123','Username','Password') or die('Could not connect to the server!'); I'm receiving this error: Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: 123.123.123.123 in /home/file/public_html/structure/index.php on line 4 Could not connect to the server! My hosting provider assures me that ports are open for my server to connect to the DB. Looking at my php info, MSSQL Support is enabled, using FreeTDS. Any ideas why this would be failing, or how I can begin trouble shooting the problem?

    Read the article

  • How to properly use Object Contexts in Entity Framework using BackgroundWorker

    - by OffApps Cory
    Good day, I am developing using Entity Framework and WPF, and I am encountering some errors and I don't know why. When saving a record (using a BackgroundWorker), I set the entities change tracker to nothing (null), attach the record to a new disposable context, save it, detach, and dispose of the context. Saving a record fires and event in the MainViewModel of the program that the other ViewModels (including the one that is saving) need to refresh their entities to reflect changes. Private Sub _saveRecordWorker_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles _saveRecordWorker.DoWork Using MyContext As New RVShippingEntities Dim MyShipment = CType(ShipmentRecord, IEntityWithChangeTracker) MyShipment.SetChangeTracker(Nothing) MyContext.Attach(MyShipment) MyContext.Detach(ShipmentRecord) End Using End Sub The Refresh background worker is similar, but it has a Do While block to keep it from interfering with the save worker (which doesn't appear to be working; hence the post). When I save (and it subsequently refreshes) I get the following error: The calling thread cannot access this object because a different thread owns it. I thought that with the DoWhile block, it would wait (and when i step through it does) until the save thread finished, and all would be good. But it would seem that something (either the main thread or the save thread) is still doing something that is interfering. Is there a better way of doing this? Am I doing it is a goofy kludgey fashion? Any help would be appreciated. (Apparently Firefox recognized kludgey as a word. Interesting)

    Read the article

  • Setting up httpd.conf / mod_rewrite to redirect to codeigniter?

    - by Walker
    I'm sorry to ask this here, as I'm sure the solution is fairly easy but for the life of my I can't setup httpd.conf on my apache server to automatically load the code_igniter files. Instead I'm having to go into the folder itself localhost/trunk/etc/etc until I get index.php - which messes with some of the relative paths (our backend coder is gone for the week so I can't ask him, but he has already setup the rewrite rules on our development server).

    Read the article

  • I'm looking for a reliable way to verify T-SQL stored procedures. Anybody got one?

    - by Cory Larson
    Hi all-- We're upgrading from SQL Server 2005 to 2008. Almost every database in the 2005 instance is set to 2000 compatibility mode, but we're jumping to 2008. Our testing is complete, but what we've learned is that we need to get faster at it. I've discovered some stored procedures that either SELECT data from missing tables or try to ORDER BY columns that don't exist. Wrapping the SQL to create the procedures in SET PARSEONLY ON and trapping errors in a try/catch only catches the invalid columns in the ORDER BYs. It does not find the error with the procedure selecting data from the missing table. SSMS 2008's intellisense, however, DOES find the issue, but I can still go ahead and successfully run the ALTER script for the procedure without it complaining. So, why can I even get away with creating a procedure that fails when it runs? Are there any tools out there that can do better than what I've tried? The first tool I found wasn't very useful: DbValidator from CodeProject, but it finds fewer problems than this script I found on SqlServerCentral, which found the invalid column references. ------------------------------------------------------------------------- -- Check Syntax of Database Objects -- Copyrighted work. Free to use as a tool to check your own code or in -- any software not sold. All other uses require written permission. ------------------------------------------------------------------------- -- Turn on ParseOnly so that we don't actually execute anything. SET PARSEONLY ON GO -- Create a table to iterate through declare @ObjectList table (ID_NUM int NOT NULL IDENTITY (1, 1), OBJ_NAME varchar(255), OBJ_TYPE char(2)) -- Get a list of most of the scriptable objects in the DB. insert into @ObjectList (OBJ_NAME, OBJ_TYPE) SELECT name, type FROM sysobjects WHERE type in ('P', 'FN', 'IF', 'TF', 'TR', 'V') order by type, name -- Var to hold the SQL that we will be syntax checking declare @SQLToCheckSyntaxFor varchar(max) -- Var to hold the name of the object we are currently checking declare @ObjectName varchar(255) -- Var to hold the type of the object we are currently checking declare @ObjectType char(2) -- Var to indicate our current location in iterating through the list of objects declare @IDNum int -- Var to indicate the max number of objects we need to iterate through declare @MaxIDNum int -- Set the inital value and max value select @IDNum = Min(ID_NUM), @MaxIDNum = Max(ID_NUM) from @ObjectList -- Begin iteration while @IDNum <= @MaxIDNum begin -- Load per iteration values here select @ObjectName = OBJ_NAME, @ObjectType = OBJ_TYPE from @ObjectList where ID_NUM = @IDNum -- Get the text of the db Object (ie create script for the sproc) SELECT @SQLToCheckSyntaxFor = OBJECT_DEFINITION(OBJECT_ID(@ObjectName, @ObjectType)) begin try -- Run the create script (remember that PARSEONLY has been turned on) EXECUTE(@SQLToCheckSyntaxFor) end try begin catch -- See if the object name is the same in the script and the catalog (kind of a special error) if (ERROR_PROCEDURE() <> @ObjectName) begin print 'Error in ' + @ObjectName print ' The Name in the script is ' + ERROR_PROCEDURE()+ '. (They don''t match)' end -- If the error is just that this already exists then we don't want to report that. else if (ERROR_MESSAGE() <> 'There is already an object named ''' + ERROR_PROCEDURE() + ''' in the database.') begin -- Report the error that we got. print 'Error in ' + ERROR_PROCEDURE() print ' ERROR TEXT: ' + ERROR_MESSAGE() end end catch -- Setup to iterate to the next item in the table select @IDNum = case when Min(ID_NUM) is NULL then @IDNum + 1 else Min(ID_NUM) end from @ObjectList where ID_NUM > @IDNum end -- Turn the ParseOnly back off. SET PARSEONLY OFF GO Any suggestions?

    Read the article

  • File comparison utility

    - by Night Walker
    Hello all I am looking for compare utility similar for "win merge" or "beyond compare" . That in addition for gui comparison will have api that i will be able to run on my files via my code and see if the files are the same or not and also use it in gui mode to show graphically the differences . Any recommendations ? thanks

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15  | Next Page >