Search Results

Search found 2107 results on 85 pages for 'matt walker'.

Page 14/85 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Php index page utitlizing an idea for a superswitch...

    - by Matt
    I dont know if this is a great idea...or a crap one. But I was thinking I may use one page to display all my pages using includes. Here is what my index.php would look like...on the functions include there is a function called "superSwitch" which will determine what requested page will be included....for instance if I do a get ?a=a it will goto the function superSwitch(a) superSwitch will take it and associate it with (login.php) then respond with such... here is the code for the index.php...please let me know if this makes sense and might work, or should I just stick to long blocks of code (which is why I am trying this because I hate long pages full of code...) of course as you can tell it is not actually including anything yet...the print is for debugging purposes. :) Thanks, Matt <?php //includes Functions include_once('inc/func.inc.php'); //set superget variable $superget = @$_GET['a']; //check if superget is set or null if (!$superget) { echo "Nothing Requested :)"; } else { //sanitizes the superget request $supergetr = supergetSanitize($superget) //uses the result "good" or "nogood" to determine what happens if ( $supergetr == "good" ) { //pulls superSwitch value of the request $ssresult = superSwitch($superget); print_r ($ssresult); } //if the sanitize is nogood else { //the superSwitch is instructed to respond with a 404 page $superget = "404" $ssresult = superSwitch($superget); print_r ($ssresult); } } ?>

    Read the article

  • Resolve php "deadlock"

    - by Matt
    Hey all, I'm currently running into a situation that I guess would be called deadlock. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php Dispatcher.php <? class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } ?> It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

  • 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

  • Resolve php endless recursion issue

    - by Matt
    Hey all, I'm currently running into an endless recursion situation. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. I'm looking for some kind of queue implementation that will make messages wait for each other.. One where the return values still get set. I'm looking to have as little boilerplate code in class A and class B as possible Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

  • Modularizing web applications

    - by Matt
    Hey all, I was wondering how big companies tend to modularize components on their page. Facebook is a good example: There's a team working on Search that has its own CSS, javascript, html, etc.. There's a team working on the news feed that has its own CSS, javascript, html, etc... ... And the list goes on They cannot all be aware of what everyone is naming their div tags and whatnot, so what's the controller(?) doing to hook all these components in on the final page?? Note: This doesn't just apply to facebook - any company that has separate teams working on separate components has some logic that helps them out. EDIT: Thanks all for the responses, unfortunately I still haven't really found what I'm looking for - when you check out the source code (granted its minified), the divs have UIDs, my guess is that there is a compilation process that runs through and makes each of the components unique, renaming divs and css rules.. any ideas? EDIT 2: Thanks all for contributing your thoughts - the bounty went to the highest upvoted answer. The question was designed to be vague- I think it led to a really interesting discussion. As I improve my build process, I will contribute my own thoughts and experiences. Thanks all! Matt Mueller

    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

  • Should a connect method return a value?

    - by Matt S
    I was looking at some code I've inherited and I couldn't decided if I like a bit of code. Basically, there is a method that looks like the following: bool Connect(connection parameters){...} It returns true if it connects successfully, false otherwise. I've written code like that in the past, but now, when I see this method I don't like it for a number of reasons. Its easy to write code that just ignores the returned value, or not realize it returns a value. There is no way to return an error message. Checking the return of the method doesn't really look nice: if (!Connect(...)){....} I could rewrite code to throw an exception when it doesn't successfully connect, but I don't consider that an exceptional situation. Instead I'm thinking of refactoring the code as follows: void Connect(Connection Parameters, out bool successful, out string errorMessage){...} I like that other developers have to provide the success and error strings so they know the method has error conditions and I can know return a message Anyone have any thoughts on the matter? Thanks -Matt

    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

  • 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

  • Getting all objects with a certain element inside a collection of strings with criteria API.

    - by Jens Jansson
    Hey. I'm trying to build a Hibernate Criteria query to find entities that have a specific element inside a collection. We can take as an example a Book -object that looks like this: public class Book { private Long id; private String title; private Set<String> authors = new HashSet<String>(); } The entity is mapped like this: <class name="Book" table="Book"> <id name="id" column="BOOK_ID"> <generator class="native"/> </id> <property name="title"/> <set name="authors" table="Book_Authors"> <key column="BOOK_ID"/> <element type="string" column="AUTHORS"/> </set> </class> Now I would like to find out which books are written by Matt. With pure SQL I can do a query like this: String author = "Matt"; String query = "SELECT * FROM Book " + "WHERE BOOK_ID IN " + "(SELECT BOOK_ID FROM Book_Authors " + "WHERE authors = :author )"; List<Book> result = session.createSQLQuery(query) .addEntity(Book.class) .setParameter("author", author) .list(); This works all good and well, and I get out all books that Matt has been a part of writing. The project I work in, however, uses the Criteria API instead of raw SQL, and I haven't found a way to express the same query in that form. I've taken a look on the Restrictions API and the closest I've found is Restions.in(propertyName, collection) but that works the other way around (one value in object, many values to match against). Any ideas?

    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

  • 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

  • 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

  • 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

  • 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

  • nUnit error when loading dll what to do ?

    - by Night Walker
    Hello all I am trying to run my first nunit example , but i am getting some error when i am loading the dll file with the tests by nunit . the example taken from here link text --------------------------- Assembly Not Loaded --------------------------- System.ApplicationException : Invalid cache path: C:\Documents and Settings\pauly\Local Settings\Temp;C:\Windows\Microsoft.NET\Framework\V2.0.50727\nunit20\ShadowCopyCache\4344_634116012858505240 ----> System.NotSupportedException : The given path's format is not supported. For further information, use the Exception Details menu item. --------------------------- OK --------------------------- Any idea what is wrong here ? Thanks .

    Read the article

  • resources at class library project

    - by Night Walker
    Hello I want to add some xml file as resource to my class library project . Any idea how to do so , and call it later? In windows application i would do it like ClassLibrary1.Properties.Resources.file.xml But here it didn't worked any idea how i do it here ?

    Read the article

  • Setting background text colour of radio button

    - by Night Walker
    Hello all I want to set up the Background color of the text in my radio button . I have tried Background="Chocolate" , but it sets the color of the circle dot there . Any idea how i do that ? This is my current code <RadioButton Content=" MSSQL" TextBlock.Foreground="Black" HorizontalAlignment="Left" Height="Auto" Padding="0" Margin="15,15,0,0" Name="radioButton_MSSQL" VerticalAlignment="Top" Width="66" GroupName="DataBases" BorderBrush="DarkOrchid" IsChecked="True" />

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >