Search Results

Search found 494 results on 20 pages for 'craig shearer'.

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

  • Can I copy/clone a function in JavaScript?

    - by Craig Stuntz
    I'm using jQuery with the validators plugin. I would like to replace the "required" validator with one of my own. This is easy: jQuery.validator.addMethod("required", function(value, element, param) { return myRequired(value, element, param); }, jQuery.validator.messages.required); So far, so good. This works just fine. But what I really want to do is call my function in some cases, and the default validator for the rest. Unfortunately, this turns out to be recursive: jQuery.validator.addMethod("required", function(value, element, param) { // handle comboboxes with empty guids if (someTest(element)) { return myRequired(value, element, param); } return jQuery.validator.methods.required(value, element, param); }, jQuery.validator.messages.required); I looked at the source code for the validators, and the default implementation of "required" is defined as an anonymous method at jQuery.validator.messages.required. So there is no other (non-anonymous) reference to the function that I can use. Storing a reference to the function externally before calling addMethod and calling the default validator via that reference makes no difference. What I really need to do is to be able to copy the default required validator function by value instead of by reference. But after quite a bit of searching, I can't figure out how to do that. Is it possible? If it's impossible, then I can copy the source for the original function. But that creates a maintenance problem, and I would rather not do that unless there is no "better way."

    Read the article

  • Eclipse Search Only Specific Folders

    - by Craig
    Hello, I already saw the answers for a question almost identical to this: http://stackoverflow.com/questions/443169/eclipse-exclude-folders-from-search. However I am looking for a resolution that would allow me to say look at 10 of my 200 folders and those 10 change all the time. Is there a way I can search through just 1 folder and avoid any other folders that are not inside it? I don't want to create a different project as I am using SVN and I have had cases with mxml files and other files that adding a file that we moved from one project to another caused problems for other developers.

    Read the article

  • How can I loop through posts as well as child pages to display them all by date in Wordpress 2.9

    - by Craig Dennis
    Some background info -- In wordpress I have my portfolio as a parent page with each item of work a child page. I also have a blog. I want to display the most recent 6 items on the homepage whether they are from my portfolio or my blog. I have a loop that displays the posts and on another page I have a loop that displays the child pages of a specific parent page. I only need to display the_title and the_post_thumbnail. Is it possible to loop through both the posts and the child pages and display them in order of date (recent first). So the final display would be a mixture of posts and child pages. Could it be done by having a separate loop for pages and one for posts, then somehow adding the results to an array and then pull them out in date order (recent first). Any help would be greatful. Thanks

    Read the article

  • RESTfully Nesting Resource Routes with Single Identifiers

    - by Craig Walker
    In my Rails app I have a fairly standard has_many relationship between two entities. A Foo has zero or more Bars; a Bar belongs to exactly one Foo. Both Foo and Bar are identified by a single integer ID value. These values are unique across all of their respective instances. Bar is existence dependent on Foo: it makes no sense to have a Bar without a Foo. There's two ways to RESTfully references instances of these classes. Given a Foo.id of "100" and a Bar.id of "200": Reference each Foo and Bar through their own "top-level" URL routes, like so: /foo/100 /bar/200 Reference Bar as a nested resource through its instance of Foo: /foo/100 /foo/100/bar/200 I like the nested routes in #2 as it more closely represents the actual dependency relationship between the entities. However, it does seem to involve a lot of extra work for very little gain. Assuming that I know about a particular Bar, I don't need to be told about a particular Foo; I can derive that from the Bar itself. In fact, I probably should be validating the routed Foo everywhere I go (so that you couldn't do /foo/150/bar/200, assuming Bar 200 is not assigned to Foo 150). Ultimately, I don't see what this brings me. So, are there any other arguments for or against these two routing schemes?

    Read the article

  • Why use "DLLSelfRegister" in VB deployment package?

    - by Craig Johnston
    Why would you use DLLSelfRegister in a VB deployment package? I am trying to sort out possible conflict problems with a calendar control: msacal70.ocx. Apparently there is a conflict with newer Office calendar controls. I noticed the setup.lst for the VB deployment package uses DLLSelfRegister for this control. What are the effects of allowing a DLL to self-register and would removing DLLSelfRegister cause the ocx to register during installation of the package?

    Read the article

  • nHibernate Criteria API Projections

    - by Craig
    I have an entity that is like this public class Customer { public Customer() { Addresses = new List<Address>(); } public int CustomerId { get; set; } public string Name { get; set; } public IList<Address> Addresses { get; set; } } And I am trying to query it using the Criteria API like this. ICriteria query = m_CustomerRepository.Query() .CreateAlias("Address", "a", NHibernate.SqlCommand.JoinType.LeftOuterJoin); var result = query .SetProjection(Projections.Distinct( Projections.ProjectionList() .Add(Projections.Alias(Projections.Property("CustomerId"), "CustomerId")) .Add(Projections.Alias(Projections.Property("Name"), "Name")) .Add(Projections.Alias(Projections.Property("Addresses"), "Addresses")) )) .SetResultTransformer(new AliasToBeanResultTransformer(typeof(Customer))) .List<Customer>() as List<Customer>; When I run this query the Addresses property of the Customer object is null. Is there anyway to add a projection for this List property?

    Read the article

  • .NET: will Random.Random operate differently inside a static method

    - by Craig Johnston
    I am having difficulty with the following code which is inside a static method of a non-static class. int iRand; int rand; rand = new Random((int)DateTime.Now.Ticks); iRand = rand.Next(50000); The iRand number, along with some other values, are being inserted into a new row of an Access MDB table via OLEDB. The iRand number is being inserted into a field that is part of the primary key, and the insert attempt is throwing the following exception even though the iRand number is supposed to be random: System.Data.OleDb.OleDbException: The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. Could the fact the method is static be making the iRand number stay the same, for some reason?

    Read the article

  • How can you determine when the user scrolls to the bottom of a DataGridView?

    - by Craig
    I am writing a C# Windows Forms Application in Visual Studio 2008. I have a DataGridView with a lot of data in it. I would like to initially only populate 10,000 rows and add more only when the user scrolls to the bottom. I am handling the DataGridView's Scroll event, but it never seems to raise with the ScrollEventArgs.Type property set to Last, which is the condition I think I need to catch to add more rows. I have read about people having bad experiences with the DataGridView.Scroll event (e.g. http://stackoverflow.com/questions/785200/datagridview-scroll-event-and-scrolleventtype-endscroll), but the solution provided (http://stackoverflow.com/questions/472389/how-can-i-receive-the-scroll-box-type-scroll-events-from-a-datagridview/767603#767603) only adds the ScrollEventArgs.Type property to come back as EndScroll, not Last like I need. Does anybody know how to get the event to raise properly, or another way to accomplish this task?

    Read the article

  • Is there a way to undo Mocha stubbing of any_instance in Test::Unit

    - by Craig Walker
    Much like this question, I too am using Ryan Bates's nifty_scaffold. It has the desirable aspect of using Mocha's any_instance method to force an "invalid" state in model objects buried behind the controller. Unlike the question I linked to, I'm not using RSpec, but Test::Unit. That means that the two RSpec-centric solutions there won't work for me. Is there a general (ie: works with Test::Unit) way to remove the any_instance stubbing? I believe that it's causing a bug in my tests, and I'd like to verify that.

    Read the article

  • Redirect url to # (anchor)

    - by Craig Fowler
    I have a site that I just converted to use anchor navigation.. hwww.site.com/shows is now www.site.com/#shows It loads the info from the /shows directory to a div and adds the hash tag to tell you where you are. The problem is, if you go to www.site.com/shows, the content is still there, but unstyled. How can I get it to redirect without going into an infinite loop of redirects? I'm sure I explained that terribly, hopefully you guys get it.

    Read the article

  • Error importing SSIS package with Konesans File system Watcher task into SQL Server 2008

    - by Craig HB
    I am importing SSIS packages to SQL Server 2008 that were originally built for SQL Server 2005. I upgraded them in VS2008 and them imported them. They all import and work except for the one with the Konesans File system Watcher task. I installed in the setup exe for Konesans File system Watcher SQL Server 2008 on my dev pc and the production server, but still get this error: Exception from HRESULT: 0xC0010026 (Microsoft.SqlServer.DTSRuntimeWrap) Any advice?

    Read the article

  • Deploy application to iPhone Simulator

    - by Craig Warren
    Hi, I am looking for a way to deploy my application to another users simulator. To be blunt the person needs to show the application on the simulator and is not capable of compiling the source code and I don't have the time to produce the instructions. What I want to do is provide them with the .app (or another) file and have them install it in the simulator just like they can do with any real iPhone Device. Does anyone know how I can do this?

    Read the article

  • ASP.NET UserControl Inheritence

    - by Craig
    I have a UserControl that is working fine. It is declared like this. public partial class DynamicList : System.Web.UI.UserControl { protected static BaseListController m_GenericListController = null; public DynamicList() { m_GenericListController = new GenericListController(this); } } Now I want to override this control so I can change some of the properties. I have created a class like this. public partial class JobRunningList : DynamicList { public JobRunningList() { m_GenericListController = new JobListController(this); (m_GenericListController as GenericListController).ModuleId = 14; } } It appears that the controls in the DynamicList are not getting created though when I use the JobRunningList control now causing predictably bad results. The DynamicList UserControl has a ListView on it and a few other controls. It appears these are not created when using the JobRunningList. Is there any secret to this?

    Read the article

  • Codeigniter: Retrieving a variable from Model to use in a Controller

    - by Craig Ward
    Hi, I bet this is easy but been trying for a while and can't seem to get it to work. Basically I am setting up pagination and in the model below I want to pass $total_rows to my controller so I can add it to the config like so '$config['total_rows'] = $total_rows;'. function get_timeline_filter($per_page, $offset, $source) { $this->db->where('source', $source); $this->db->order_by("date", "desc"); $q = $this->db->get('timeline', $per_page, $offset); $total_rows = $this->db->count_all_results(); if($q->num_rows() >0) { foreach ($q->result() as $row) { $data[] = $row; } return $data; } } I understand how to pass things form the Controller to the model using $this->example_model->example($something); but not sure how to get a variable from the model?

    Read the article

  • Table and Column names causing problems

    - by craig
    I have an issue when the T4 linq templates generate the classes for my MySql db using subsonic 3. It looks like one of our table names "operator" is causing problems in the Context.cs generated class. In the following line of code in Context.cs Visual Studio sees <operator> as a c# operator and generates a compilation error of "Type expected" public Query<operator> operators { get; set; } Is there anyway I can work around this without having to rename my database table and column names? For example hard coding something in Settings.ttinclude to use or map different names to specific db tables and columns?

    Read the article

  • Hardest javascript debugging problem ever

    - by Craig
    We have an ASP.NET application and when running on client site they often get null reference Javascript errors. As with all these errors the information IE6 displays is less than helpful. But the problem is as soon as I install IE script debugger and try and debug a bit more the error becomes non-reproducible.When script debugger is not installed then the error occurs again. Are there any other tools that could be helpful for javascript debugging on client site. The error is also not produced with IE7 or Firefox.

    Read the article

  • What C++ pitfalls should I avoid ?

    - by Craig H
    I remember first learning about vectors in the STL and after some time, I wanted to use a vector of bools for one of my projects. After seeing some strange behavior and doing some research, I learned that a vector of bools is not really a vector of bools. Anyone out there have any other common pitfalls to avoid in C++?

    Read the article

  • Why would you need to run regasm and caspol on a .net component more than once?

    - by Craig Johnston
    Why would you need to run regasm and caspol on a .NET component more than once? I have a COM client that uses a .NET component residing on another machine. Consequently I need to run regasm and caspol on this .NET component. What could cause there to be the need to do this again on the same machine to the same component? Is the effect of regasm and caspol only temporary? Or can I assume that someone has reset or cleared something on a machine if I am having to do this again?

    Read the article

  • Populating an association with children in factory_girl

    - by Craig Walker
    I have a model Foo that has_many 'Bar'. I have a factory_girl factory for each of these objects. The factory for Bar has an association to Foo; it will instantiate a Foo when it creates the Bar. I'd like a Factory that creates a Foo that contains a Bar. Ideally this Bar would be created through the :bar factory, and respect the build strategy (create/build) used to create the Foo. I know I could just call the :bar factory and then grab the Foo reference from the new Bar. I'd like to avoid this; in my test case, the important object is Foo; calling the Bar factory seems a bit circuitous. Also, I can see the need for a Foo with multiple Bars. Is this possible in factory_girl? How do you define this relationship in the parent?

    Read the article

  • Cocoa: Hide one application

    - by Craig
    Is it possible to hide one specific application using cocoa? I know you can hide all other applications using the following code [[NSWorkspace sharedWorkspace] performSelectorOnMainThread:@selector(hideOtherApplications) withObject:NULL waitUntilDone:NO]; But is it possible to hide just one specific application say Safari for example?

    Read the article

  • Nested Object Forms not working as expected

    - by Craig Walker
    I'm trying to get a nested model forms view working. As far as I can tell I'm doing everything right, but it still does not work. I'm on Rails 3 beta 3. My models are as expected: class Recipe < ActiveRecord::Base has_many :ingredients, :dependent => :destroy accepts_nested_attributes_for :ingredients attr_accessible :name end class Ingredient < ActiveRecord::Base attr_accessible :name, :sort_order, :amount belongs_to :recipe end I can use Recipe.ingredients_attributes= as expected: recipe = Recipe.new recipe.ingredients_attributes = [ {:name=>"flour", :amount=>"1 cup"}, {:name=>"sugar", :amount=>"2 cups"}] recipe.ingredients.size # -> 2; ingredients contains expected instances However, I cannot create new object graphs using a hash of parameters as shown in the documentation: params = { :name => "test", :ingredients_attributes => [ {:name=>"flour", :amount=>"1 cup"}, {:name=>"sugar", :amount=>"2 cups"}] } recipe = Recipe.new(params) recipe.name # -> "test" recipe.ingredients # -> []; no ingredient instances in the collection Is there something I'm doing wrong here? Or is there a problem in the Rails 3 beta?

    Read the article

  • Bundle a Python app as a single file to support add-ons or extensions?

    - by Brandon Craig Rhodes
    There are several utilities — all with different procedures, limitations, and target operating systems — for getting a Python package and all of its dependencies and turning them into a single binary program that is easy to ship to customers: http://wiki.python.org/moin/Freeze http://www.pyinstaller.org/ http://www.py2exe.org/ http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html My situation goes one step further: third-party developers will be wanting to write plug-ins, extensions, or add-ons for my application. It is, of course, a daunting question how users on platforms like Windows would most easily install plugins or addons in such a way that my app can easily discover that they have been installed. But beyond that basic question is another: how can a third-party developer bundle their extension with whatever libraries the extension itself needs (which might be binary modules, like lxml) in such a way that the plugin's dependencies become available for import at the same time that the plugin becomes available. How can this be approached? Will my application need its own plug-in area on disk and its own plug-in registry to make this tractable? Or are there general mechanisms, that I could avoid writing myself, that would allow an app that is distributed as a single executable to look around and find plugins that are also installed as single files?

    Read the article

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