Search Results

Search found 1393 results on 56 pages for 'brian'.

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

  • Is PetraVM Jinx Beta 1 good?

    - by Brian T Hannan
    PetraVM recently came out with a Beta release of their Jinx product. Has anyone checked it out yet? Any feedback? By good, I mean: 1) easy to use 2) intuitive 3) useful 4) doesn't take a lot of code to integrate ... those kinds of things. Thanks guys!

    Read the article

  • iPhone dev - showing two locations on the map

    - by Brian
    Now I have the coordinate of two locations, let say locationA with latitude 40 and longitude -80, locationB with latitude 30 and longitude -70, I want to create a mapView that I can see both locations with appropriate viewing distance. I got the new coordinate by finding the midpoint (in this example, {35, -75}), but the question is, How can I get an appropriate viewing distance? In particular, how can I calculate CLLocationDistance (if I'm using MKCoordinateRegionMakeWithDistance) or MKCoordinateSpan (if I'm using MKCoordinateSpanMake). Thanks in advance.

    Read the article

  • Custom DataSource Extender

    - by Brian
    I dream of creating a control which works something like this: <asp:SqlDataSource id="dsFoo" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>" SelectCommandType="StoredProcedure" SelectCommand="cmd_foo"> </asp:SqlDataSource> <Custom:DataViewSource id="dvFoo" runat="server" rowfilter="colid &gt; 10" datasourceid="dsFoo"> </Custom:DataViewSource> I can accomplish the same thing in the code behind by executing cmd_foo, loading the results into a DataTable, then loading them into a DataView with a RowFilter. The goal would be to have multiple DataViews for one DataSource with whatever special filters I wish to apply to the select portion of the DataSource. I could imagine extending this to be more powerful. I tried peaking at this and this but am a bit confused on a few points. Currently, my main issue is being unsure where to grab the output data of the DataSource so I can stick it into a DataTable.

    Read the article

  • Setting left/top position not working in IE

    - by Brian
    Hello, In a custom ASP.NET AJAX control, i have this to do some repositioning. var dims = Sys.UI.DomElement.getBounds(control); this.get_element().style.position = "absolute"; //Sys.UI.DomElement.setLocation(this.get_element(), dims.x, (dims.y + dims.height)); this.get_element().style.left = dims.x; this.get_element().style.top = (dims.y + dims.height); getBounds simply returns the x/y and width/height. I use this to set the left/top, but in IE, it's doubling; say the coordinates are 500, 20; when it sets this on the element, its actually setting to 1000, 40. Any ideas why? In firefox, this works correctly. this.get_element() returns the correct element and all, but it's not setting correctly, even though event logging says it's the correct coordinates. When using setLocation too, it doesn't work in either... What else in my code may be affecting it? JQuery isn't an option here too. Thanks.

    Read the article

  • Searching for empty methods

    - by Brian McCord
    I am currently working on a security audit/code review of our system. This requires me to check all pages in the system and make sure that the code behind contains two methods that are used to check security. Sometimes the code in these methods get commented out to make testing easier. So, my question is does anyone know an easy way to search code, make sure the methods are present, and to determine which ones have no code or have all the code commented out. It would make my job much easier if I can get a list instead of having to look at every file... I'm sure I could write this myself, but I thought someone may know of something that already exists. Thanks!

    Read the article

  • golang dynamically parsing files

    - by Brian Voelker
    For parsing files i have setup a variable for template.ParseFiles and i currently have to manually set each file. Two things: How would i be able to walk through a main folder and a multitude of subfolders and automatically add them to ParseFiles so i dont have to manually add each file individually? How would i be able to call a file with the same name in a subfolder because currently I get an error at runtime if i add same name file in ParseFiles. var templates = template.Must(template.ParseFiles( "index.html", // main file "subfolder/index.html" // subfolder with same filename errors on runtime "includes/header.html", "includes/footer.html", )) func main() { // Walk and ParseFiles filepath.Walk("files", func(path string, info os.FileInfo, err error) { if !info.IsDir() { // Add path to ParseFiles } return }) http.HandleFunc("/", home) http.ListenAndServe(":8080", nil) } func home(w http.ResponseWriter, r *http.Request) { render(w, "index.html") } func render(w http.ResponseWriter, tmpl string) { err := templates.ExecuteTemplate(w, tmpl, nil) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } }

    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

  • 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

  • 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

  • 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

  • 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 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

  • 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

  • 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 Does Differential Execution Work?

    - by Brian
    I've seen a few mentions of this on SO, but staring at Wikipedia and at an MFC dynamic dialog demo did nothing to enlighten me. Can someone please explain this? Learning a fundamentally different concept sounds nice. Edit: I think I'm getting a better feel for it. I guess I just didn't look at the source code carefully enough the first time. I have mixed feelings about DE at this point. On the one hand, it can make certain tasks considerably easier. On the other hand, getting it up and running (i.e. setting it up in your language of choice) is not easy (I'm sure it would be if I understood it better)...though I guess the toolbox for it need only be made once, then expanded as necessary. I think in order to really understand it, I'll probably need to try implimenting it in another language.

    Read the article

  • Paperclip + ImageMagick on Windows 7: Image display fails when I add styles to attached_file in mode

    - by Brian Roisentul
    I'm working with Ruby on rails 2.3.8, NetBeans IDE. I've installed paperclip and I could show/save images successfully. Now, I've installed ImageMagick-6.6.2-4-Q16(for windows 7, 64bits). Until that moment, my model looked like this(and worked fine): has_attached_file :photo Now, after installing ImageMagick, when I add the :style line it fails: has_attached_file :photo, :styles => {:thumb => "100x100#", :small => "150x150>", :large => "400x400>" } and it throws the following error message when I try to upload an image: TypeError in ProfilesController#update backtrace must be Array of String The only thing I'm doing in the update action of that controller is the following: @profile.update_attributes(params[:profile]) @profile.update_attribute(:photo, params[:profile][:photo]) I've also installed miniMagick gem(because I read somewhere I had to do it). What am I missing?

    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

  • 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

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