Search Results

Search found 1416 results on 57 pages for 'brian bishop'.

Page 42/57 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Browser compatibility jQuery UI dialog

    - by Brian
    I have a jQuery Dialog box on one of my pages. One of the buttons in the dialog boxes triggers a JavaScript prompt OnClick. Everything seems OK with the lastest versions of Internet Explorer, Chrome, and Mozilla Firefox, but some users are reporting weird behavior. Are there any known browser compatibility errors with jQuery UI dialog boxes?

    Read the article

  • rails xml to active record object

    - by Brian D.
    I've been googling for a while to try and convert and incoming XML request into an active record object. I've tried using the ActiveRecordObject.new.from_xml method but it doesn't seem to handle relationships. For example, say I have the following xml: <blog> <title></title> <blog-pages> <blog-page> <page-number></page-number> <content></content> </blog-page> </blog-pages> </blog> And I have the following model objects: class Blog < ActiveRecord::Base has_many :blog_pages end class BlogPage < ActiveRecord::Base belongs_to :blog end Is there a way to convert the xml into a blog object WITH relationships? Or do I need to manually parse the XML? Thanks in advance.

    Read the article

  • What does MySqlDataAdapter.Fill return when the results are empty?

    - by Brian
    I have a 'worker' function that will be processing any and all sql queries in my program. I will need to execute queries that return result sets and ones that just execute stored procedures without any results. Is this possible with MySqlDataAdapter.Fill or do I need to use the MySqlCommand.ExecuteNonQuery() method? Here is my 'worker' function for reference: private DataSet RunQuery(string SQL) { MySqlConnection connection; MySqlCommand command; MySqlDataAdapter adapter; DataSet dataset = new DataSet(); lock(locker) { connection = new MySqlConnection(MyConString); command = new MySqlCommand(); command = connection.CreateCommand(); command.CommandText = SQL; adapter = new MySqlDataAdapter(); adapter.Fill(dataset); } return dataset; }

    Read the article

  • Is There A Central Repository of Javascript Information?

    - by Brian
    For example, if you want information of PHP functions, you can go to http://www.php.net/ . If you want information of Perl functions you can to to http://www.cpan.org/ and/or use perldoc. If you want information on Java you can go to http://java.sun.com and/or use javadoc. However, if you want information on Javascript methods/functions and their attributes, return values, etc. where do you go? The reason I ask is I was playing with the "focus()" method and wondering if it could be passed any values or if it returned anything when called. I have done a cursory Google search but haven't found much. Does such a beast exist or am I out of luck? Thanks for reading, and have a good day.

    Read the article

  • What are the most important things to know about Ruby?

    - by Brian T Hannan
    I am new to the language and I need to know what are the top things that are absolutely necessary to know in order to make a fully functional website or web app using the Ruby programming language? Mainly Ruby on Rails with Rake and other tools that mainly use Rake. Update: I know many other languages like C++, Java, PHP, Perl, etc, etc .... Update 2: This is great ... keep 'em coming!

    Read the article

  • Why does this asp.net mvc unit test fail?

    - by Brian McCord
    I have this unit test: [TestMethod] public void Delete_Post_Passes_With_State_4() { //Arrange ViewResult result = stateController.Delete( 4 ) as ViewResult; var model = (State)result.ViewData.Model; //Act RedirectToRouteResult redirectResult = stateController.Delete( model ) as RedirectToRouteResult; var newresult = stateController.Delete( 4 ) as ViewResult; var newmodel = (State)newresult.ViewData.Model; //Assert Assert.AreEqual( redirectResult.RouteValues["action"], "Index" ); Assert.IsNull( newmodel ); } Here are the two controller actions that handle deleting: // // GET: /State/Delete/5 public ActionResult Delete(int id) { var x = _stateService.GetById( id ); return View(x); } // // POST: /State/Delete/5 [HttpPost] public ActionResult Delete(State model) { try { if( model == null ) { return View( model ); } _stateService.Delete( model ); return RedirectToAction("Index"); } catch { return View( model ); } } What I can't figure out is why this test fails. I have verified that the record actually gets deleted from the list. If I set a break point in the Delete method on the line: var x = _stateService.GetById( id ); The GetById does indeed return a null just as it should, but when it gets back to the newresult variable in the test, the ViewData.Model is the deleted model. What am I doing wrong?

    Read the article

  • iphone dev - how to catch exception 'NSRangeException'

    - by Brian
    In my app I try to scroll a UITableView to the top once after I updated the content of the table. However, under some circumstance, my table is EMPTY. So I got the following exception: Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]: row (0) beyond bounds (0) for section (0).' how can I catch this exception? I tried NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0]; if (indexPath != nil) { [EventTable scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES]; } but it doesn't catch the exception because indexPath is not nil.

    Read the article

  • Using ActiveRecord::Base.transaction in a rake task?

    - by Brian Jordan
    I am writing a rake task which, at one point, uses a custom YAML file import method to seed the database. At one point in the import code, I have: ActiveRecord::Base.transaction do Trying to run the rake task throws: You have a nil object when you didn't expect it! You might have expected an instance of ActiveRecord::Base. The error occurred while evaluating nil.[] The stack trace points to the aforementioned line in the code. Is there a way to instantiate ActiveRecord::Base during a rake task? Thanks!

    Read the article

  • How can I deploy a Perl/Python/Ruby script without installing an interpreter?

    - by Brian G
    I want to write a piece of software which is essentially a regex data scrubber. I am going to take a contact list in CSV and remove all non-word characters and such from the person's name. This project has Perl written all over it but my client base is largely non-technical and installing Perl on Windows would not be worth it for them. Any ideas on how I can use a Perl/Python/Ruby type language without all the headaches of getting the interpreter on their computer? Thought about web for a second but it would not work for business reasons.

    Read the article

  • starting rails in test environment

    - by Brian D.
    I'm trying to load up rails in the test environment using a ruby script. I've tried googling a bit and found this recommendation: require "../../config/environment" ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'test' This seems to load up my environment alright, but my development database is still being used. Am I doing something wrong? Here is my database.yml file... however I don't think it is the issue development: adapter: mysql encoding: utf8 reconnect: false database: BrianSite_development pool: 5 username: root password: dev host: localhost # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql encoding: utf8 reconnect: false database: BrianSite_test pool: 5 username: root password: dev host: localhost production: adapter: mysql encoding: utf8 reconnect: false database: BrianSite_production pool: 5 username: root password: dev host: localhost I can't use ruby script/server -e test because I'm trying to run ruby code after I load rails. More specifically what I'm trying to do is: run a .sql database script, load up rails and then run automated tests. Everything seems to be working fine, but for whatever reason rails seems to be loading in the development environment instead of the test environment. Here is a shortened version of the code I am trying to run: system "execute mysql script here" require "../../config/environment" ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'test' describe Blog do it "should be initialized successfully" do blog = Blog.new end end I don't need to start a server, I just need to load my rails code base (models, controllers, etc..) so I can run tests against my code. Thanks for any help.

    Read the article

  • How can I check for GPS support in-App to add a feature for those with Location services enabled?

    - by Brian Lacy
    How can I check for GPS support in-App to add a feature for those with Location services enabled? My concern is, I know I'd have to specify the tag in the manifest to declare that the app uses location services, but I still want the app to function for those without. I just want to check and, if the service is available, use it; otherwise just ignore that one feature. Thanks.

    Read the article

  • Google App Engine getting verbose_name of a property from an instance

    - by Brian M. Hunt
    Given a model likeso: from google.appengine.ext import db class X(db.Model): p = db.StringProperty(verbose_name="Like p, but more modern.") How does one access verbose_name from x=X() (an instance of X)? One might expect that x.p.verbose_name would work, or alternatively x.properties()['p'].verbose_name, but neither seems to work. Thanks! EDIT: x.name.verbose_name = x.p.verbose_name

    Read the article

  • KDevelop has no build menu.

    - by Brian Hooper
    I have just installed KDevelop on my Ubuntu machine (KDevelop 3.9.95 on Ubuntu 9.10) with sudo apt-get install kdevelop I created a new project with the "Hello World" program in it, but there doesn't appear to be any way to compile anything. The manuals refer to the build menu but there isn't one, all all compile options on the other menus are greyed out. Does anyone know what I have done wrong?

    Read the article

  • How to force inclusion of an object file in a static library when linking into executable?

    - by Brian Bassett
    I have a C++ project that due to its directory structure is set up as a static library A, which is linked into shared library B, which is linked into executable C. (This is a cross-platform project using CMake, so on Windows we get A.lib, B.dll, and C.exe, and on Linux we get libA.a, libB.so, and C.) Library A has an init function (A_init, defined in A/initA.cpp), that is called from library B's init function (B_init, defined in B/initB.cpp), which is called from C's main. Thus, when linking B, A_init (and all symbols defined in initA.cpp) is linked into B (which is our desired behavior). The problem comes in that the A library also defines a function (Af, defined in A/Afort.f) that is intended to by dynamically loaded (i.e. LoadLibrary/GetProcAddress on Windows and dlopen/dlsym on Linux). Since there are no references to Af from library B, symbols from A/Afort.o are not included into B. On Windows, we can artifically create a reference by using the pragma: #pragma comment (linker, "/export:_Af") Since this is a pragma, it only works on Windows (using Visual Studio 2008). To get it working on Linux, we've tried adding the following to A/initA.cpp: extern void Af(void); static void (*Af_fp)(void) = &Af; This does not cause the symbol Af to be included in the final link of B. How can we force the symbol Af to be linked into B?

    Read the article

  • What is Dublin and how does it relate to WCF

    - by brian
    Going through some WCF hosting questions on StackOverflow, I've seen Dublin mentioned a few times as a technology from Microsoft that is forthcoming. It's only alluded to and not actually defined though. Can someone give me a good explanation of what Dublin is? Also, what is its release status and is it going by a different name now? (Here's an example: it's mentioned in the comments to this answer)

    Read the article

  • ASP.NET MVC Unit Testing Controllers - Repositories

    - by Brian McCord
    This is more of an opinion seeking question, so there may not be a "right" answer, but I would welcome arguments as to why your answer is the "right" one. Given an MVC application that is using Entity Framework for the persistence engine, a repository layer, a service layer that basically defers to the repository, and a delete method on a controller that looks like this: public ActionResult Delete(State model) { try { if( model == null ) { return View( model ); } _stateService.Delete( model ); return RedirectToAction("Index"); } catch { return View( model ); } } I am looking for the proper way to Unit Test this. Currently, I have a fake repository that gets used in the service, and my unit test looks like this: [TestMethod] public void Delete_Post_Passes_With_State_4() { //Arrange var stateService = GetService(); var stateController = new StateController( stateService ); ViewResult result = stateController.Delete( 4 ) as ViewResult; var model = (State)result.ViewData.Model; //Act RedirectToRouteResult redirectResult = stateController.Delete( model ) as RedirectToRouteResult; stateController = new StateController( stateService ); var newresult = stateController.Delete( 4 ) as ViewResult; var newmodel = (State)newresult.ViewData.Model; //Assert Assert.AreEqual( redirectResult.RouteValues["action"], "Index" ); Assert.IsNull( newmodel ); } Is this overkill? Do I need to check to see if the record actually got deleted (as I already have Service and Repository tests that verify this)? Should I even use a fake repository here or would it make more sense just to mock the whole thing? The examples I'm looking at used this model of doing things, and I just copied it, but I'm really open to doing things in a "best practices" way. Thanks.

    Read the article

  • JQuery Delegate and using traveral options in function

    - by Brian
    I am having trouble figuring out how to use the JQuery delegate function to do what I require. Basically, I need to allow users to add Panels (i.e. divs) to a form dynamically by selecting a button. Then when a user clicks a button within a given Panel, I want to be able to to something to that Panel (like change the color in this example). Unfortunately, it seems that references to the JQuery traversing functions don't work in this instance. Can anybody explain how to achieve this effect? Is there anyway to bind a different delegate to the each panel as its added. $('.addPanels').delegate('*', 'click', function() { $(this).parent.css('background-color', 'black'); $('.placeholder').append('Add item'); }); <div class="addPanels"> <div class="panel"> <a href="#" class="addLink">Add item</a> text</div> <div class="placeholder"/> </div> </div>

    Read the article

  • How do I query through a many-to-many relationship using NHibernate Criteria and Lambda Extensions?

    - by Brian Kendig
    In my database I have a Person table and an Event table (parties, meetings, &c.). This many-to-many relationship is represented through an Invitation table. Each Person can have many Invitations. Each Event can also have many Invitations. If I want a list of Events to which a Person is invited, I can use this HQL query: IQuery query = Session.CreateQuery("SELECT i.Event from Invitation i where i.Person = :p"); query.SetParameter("p", person); return query.List<Person>(); How would I write this query with NHibernate criteria and Lambda Extensions?

    Read the article

  • Setting Nullable Integer to String Containing Nothing yields 0

    - by Brian MacKay
    I've been pulling my hair out over some unexpected behavior from nullable integers. If I set an Integer to Nothing, it becomes Nothing as expected. If I set an Integer? to a String that is Nothing, it becomes 0! Of course I get this whether I explicitly cast the String to Integer? or not. I realize I could work around this pretty easily but I want to know what I'm missing. Dim NullString As String = Nothing Dim NullableInt As Integer? = CType(NullString, Integer?) 'Expected NullableInt to be Nothing, but it's 0! NullableInt = Nothing 'This works -- NullableInt now contains Nothing. How is this EDIT: Previously I had my code up here so without the explicit conversion to 'Integer?' and everyone seemed to be fixated on that. I want to be clear that this is not an issue that would have been caught by Option Strict On -- check out the accepted answer. This is a quirk of the string-to-integer conversion rules which predate nullable types, but still impact them.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >