Search Results

Search found 538 results on 22 pages for 'craig sanders'.

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

  • nHibernate Linq Projection

    - by Craig
    I am using the version 1.0 release of Linq for nHibernate. When I run the following linq statements I receive the error not a single-length projection: Surname I can find very few references to this on the web and looking into the source it says it should never occur! ClientID is a Int type and Surname is a string. When I comment out all the string fields in the projection and just leave ClientID it runs ok, but as soon as I add surname back it errors. var context = m_ClientRepository.Linq; var result = (from client in context from address in client.Addresses from contact in client.Contacts where client.Surname.StartsWith(surname) && client.GivenName.StartsWith(givenName) && contact.Value.StartsWith(phoneNumber) group client by new { client.ClientID, client.Surname, client.GivenName } into clientGroup select new ClientSearchDTO() { ClientID = clientGroup.Key.ClientID, Surname = clientGroup.Key.Surname, GivenName = clientGroup.Key.GivenName, Address = clientGroup.Max(x => x.Addresses.FirstOrDefault().Address), PhoneNumber = clientGroup.Max(x => x.Contacts.FirstOrDefault().Value) }) .Skip(Paging.FirstRecord(pageNumber)) .Take(5);

    Read the article

  • What is the preferred method of refreshing a combo box when the data changes?

    - by Craig Johnston
    What is the preferred method of refreshing a combo box when the data changes? If a form is open and the combo box data is already loaded, how do you refresh the contents of the combo box without the form having to be closed and reloaded? Do you have to do something on the Click event on the combo box? This would seem to be a potential slow down for the app if there is a hit to the database every time someone clicks on a combo box.

    Read the article

  • iPhone SDK Zoom like UITextField

    - by Craig
    I have noticed in a number of apps they let you see a zoomed in view of where you are dragging just like the way it is on a UITextField (screenshot attached) but it works over images etc.. Does anyone know if there is an easy way to achieve this? Since a number of apps use it I figured that there might be something built in or an easy way to do it. Any tips are appreciated.

    Read the article

  • VB.NET: Can the .EXE built by VS2005 be deployed as a standalone EXE?

    - by Craig Johnston
    VB.NET: Can the .EXE built by VS2005 be deployed as a standalone EXE? When I change the mode in VS2005 to "Release" and build the solution, the bin\Release directory then contains the solution .EXE file, but also a .pdb, vshost.exe and .xml file. What are these extra files and are they necessary? I copied the .exe file to another machine and it executed properly, but there was a significant delay when it first executed - thereafter it was like any other program. What is the reason for this, and can it be helped? Is it because the other 3 files in the Release folder are not there with it?

    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

  • What does Error 3112 indicate when compacting an MDB file?

    - by Craig Johnston
    What does Error 3112 indicate when compacting an MDB file? The Error description is "Records can't be read; no read permission on 'xyz123.mdb'" There is a known issue with the Compact function on some versions of Access MDBs. Is the solution in this case to run the Microsoft utility JETCOMP.EXE on this file? What are the other possible causes of this error?

    Read the article

  • Codeigniter: Retrieving data from multiple tables and displaying results

    - by Craig Ward
    Hi, I am developing my first big application using codeigniter and need a little help as I am fairly new to it all. I know how to get records out of the DB and display them, but I now have to get results from two tables and display them. I pass $data to the view, it works fine for $data['prop'] but I can't get the rest. $data['prop'] = $this->ManageProperty_model->get_property_details($p_id); $data['img'] = $this->ManageProperty_model->get_property_images($p_id); $this->load->model('ManageBranch_model'); $data['branch'] = $this->ManageBranch_model->get_branch_details($p_id); I usually echo out results like so: <?php foreach ($prop as $p) : ?> <?php echo $p->ID; ?> <?php endforeach; ?> Even if there is only 1 row being returned as I am not sure of another way.do I need a foreach for img and branch?

    Read the article

  • Detect certain characters in a text field

    - by Craig
    What is the easiest way to detect a character in a text field? I want to be able to detect a certain character and replace that character with another specific character. So If I write in a text field... "zyxw" I want it to be replaced with "abcd". I'm a newbie and don't really know where to start with this or how to go about it. If anyone has any methods of doing this, I would really appreciate it.

    Read the article

  • VB.NET: question about "using" block

    - by Craig Johnston
    Consider the code: On Error Goto ErrorHandler Using sr As StreamReader = New StreamReader(OpenFile) str = sr.ReadToEnd sr.Close() End Using Exit Sub ErrorHandler: If there is an error inside the Using block how do you clean up the sr object? The sr object is not in scope in ErrHandler so sr.Close() cannot be called. Does the Using block cleanup any resources automatically even if there is an error?

    Read the article

  • What platforms have something other than 8-bit char?

    - by Craig McQueen
    Every now and then, someone on SO points out that char (aka 'byte') isn't necessarily 8 bits. It seems that 8-bit char is almost universal. I would have thought that for mainstream platforms, it is necessary to have an 8-bit char to ensure its viability in the marketplace. Both now and historically, what platforms use a char that is not 8 bits, and why would they differ from the "normal" 8 bits? When writing code, and thinking about cross-platform support (e.g. for general-use libraries), what sort of consideration is it worth giving to platforms with non-8-bit char? In the past I've come across some Analog Devices DSPs for which char is 16 bits. DSPs are a bit of a niche architecture I suppose. (Then again, at the time hand-coded assembler easily beat what the available C compilers could do, so I didn't really get much experience with C on that platform.)

    Read the article

  • Can splitting .MDB files into segments help with stability?

    - by Craig Johnston
    Is this a realistic solution to the problems associated with larger .mdb files: split the large .mdb file into smaller .mdb files have one 'central' .mdb containing links to the tables in the smaller .mdb files How easy would it be to make this change to an .mdb backed VB application? Could the changes to the database be done so that there are no changes required to the front-end application?

    Read the article

  • mootools fx working except in ie9

    - by Craig
    This is my first attempt with Mootools, so I welcome a critique of the code. I have a dynamic list of images that expand on the 'click" event and contract on the 'mouseout' event. The code works fine in all browsers (FF, Safari, Chrome, even the smartphones) but not in IE9 (JS is enabled) Anyone with similar problem or solution? I plan to use a lightbox effect, downloading a larger & clearer image to the center of the page, instead of just resizing a small image. However, I am hesitant to attempt this, if there is problems with IE9. I have coded three image sizes with the upload commit, so the larger image is available for the lightbox, but, I don't see anything in mootools for a lightbox, or am I missing it? $i = 0; while($i < count($validate)) { <div class="validate"> <div class="validate_image_<?php echo $validate[$i]['validate_type']; ?>"> <div class="validate_image" id="validate_image_wrapper_<?php echo $i; ?>"> <?php if ($validate[$i]['validate_image_filename'] != '') { if (file_exists(UPLOAD_DIR . 'validate_image/' . str_replace('.', '_medium.', $validate[$i]['validate_image_filename']))) { echo '<img src="' . UPLOAD_URL . 'validate_image/' . str_replace('.', '_medium.', $validate[$i]['validate_image_filename']) . '" alt="Listing Image" />'; } else { echo '<img src="' . UPLOAD_URL . 'validate_image/' . str_replace('.', '_large.', $validate[$i]['validate_image_filename']) . '" alt="Listing image" />'; } } else { ?> <img src="/images/no_image_posted_validate.png" alt="no image posted" /> <?php } ?> </div> ... remainder of HTML display code function setupEnlargeImage() { window.myFx = new Fx({ duration: 200, transition: Fx.Transitions.Sine.easeOut }); $$('.validate_image').addEvent('click', function() { window.selectedImage = this.id; myFx.start(1,2.0); }); $$('.validate_image').addEvent('mouseout', function() { window.selectedImage = this.id; myFx.start(1.0,1); }); myFx.set = function(value) { var style = "scale(" + (value) + ")"; $(window.selectedImage).setStyles({ "-webkit-transform": style, "-moz-transform": style, "-o-transform": style, "-ms-transform": style, transform: style }); } }

    Read the article

  • Preventing ActiveRecord save() on an instance

    - by Craig Walker
    I have an ActiveRecord model object Foo; it represents a standard database row. I want to be able to display modified versions of instances of this object. I'd like to reuse the class itself, as it already has all the hooks & aspects I'll need. (For example: I already have a view that displays the appropriate attributes). Basically I want to clone the model instance, modify some of its properties, and feed it back to the caller (view, test, etc). I do not want these attribute modifications getting back into the database. However, I do want to include the id attribute in the cloned version, as it makes dealing with the route-helpers much easier. Thus, I plan on calling ActiveRecord::Base.clone(), manually setting the ID of the cloned instance, and then making the appropriate attribute changes to the new instance. This has me worried though; one save() on the modified instance and my original data will get clobbered. So, I'm looking to lock down the new instance so that it won't hurt anything else. I'm already planning on calling freeze() (on the understanding that this prevents further modification to the object, though the documentation isn't terribly clear). However, I don't see any obvious way to prevent a save(). What would be the best approach to achieving this?

    Read the article

  • Cocoa JSON - Check whether array or dictionary

    - by Craig
    Hi, I am using the Cocoa JSON framework ( http://code.google.com/p/json-framework/ ) to communicate with an API. The problem is that the API returns a dictionary if there is an error but returns an array of the results if it works. Is there a good way to detect if the JSONValue is an array or a dictionary? Thanks.

    Read the article

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