Search Results

Search found 1573 results on 63 pages for 'adam lane'.

Page 46/63 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • Using CreateSourceQuery in CTP4 Code First

    - by Adam Rackis
    I'm guessing this is impossible, but I'll throw it out there anyway. Is it possible to use CreateSourceQuery when programming with the EF4 CodeFirst API, in CTP4? I'd like to eagerly load properties attached to a collection of properties, like this: var sourceQuery = this.CurrentInvoice.PropertyInvoices.CreateSourceQuery(); sourceQuery.Include("Property").ToList(); But of course CreateSourceQuery is defined on EntityCollection<T>, whereas CodeFirst uses plain old ICollection (obviously). Is there some way to convert? I've gotten the below to work, but it's not quite what I'm looking for. Anyone know how to go from what's below to what's above (code below is from a class that inherits DbContext)? ObjectSet<Person> OSPeople = base.ObjectContext.CreateObjectSet<Person>(); OSPeople.Include(Pinner => Pinner.Books).ToList(); Thanks! EDIT: here's my version of the solution posted by zeeshanhirani - who's book by the way is amazing! dynamic result; if (invoice.PropertyInvoices is EntityCollection<PropertyInvoice>) result = (invoices.PropertyInvoices as EntityCollection<PropertyInvoice>).CreateSourceQuery().Yadda.Yadda.Yadda else //must be a unit test! result = invoices.PropertyInvoices; return result.ToList(); EDIT2: Ok, I just realized that you can't dispatch extension methods whilst using dynamic. So I guess we're not quite as dynamic as Ruby, but the example above is easily modifiable to comport with this restriction EDIT3: As mentioned in zeeshanhirani's blog post, this only works if (and only if) you have change-enabled proxies, which will get created if all of your properties are declared virtual. Here's another version of what the method might look like to use CreateSourceQuery with POCOs public class Person { public virtual int ID { get; set; } public virtual string FName { get; set; } public virtual string LName { get; set; } public virtual double Weight { get; set; } public virtual ICollection<Book> Books { get; set; } } public class Book { public virtual int ID { get; set; } public virtual string Title { get; set; } public virtual int Pages { get; set; } public virtual int OwnerID { get; set; } public virtual ICollection<Genre> Genres { get; set; } public virtual Person Owner { get; set; } } public class Genre { public virtual int ID { get; set; } public virtual string Name { get; set; } public virtual Genre ParentGenre { get; set; } public virtual ICollection<Book> Books { get; set; } } public class BookContext : DbContext { public void PrimeBooksCollectionToIncludeGenres(Person P) { if (P.Books is EntityCollection<Book>) (P.Books as EntityCollection<Book>).CreateSourceQuery().Include(b => b.Genres).ToList(); }

    Read the article

  • <a> with an inner <span> not triggering :active state in IE

    - by Adam Singer
    I want to style the :active state of a button that is represented by an . The tag has an inner (beacuse I want to add an icon to this button). I notice the :active state is triggered properly in everything but Internet Explorer. In IE, it appears that the area around the (the 's padding) triggers that :active state, but when clicking directly on the text within the , the :active state is not triggered. Is there a way to fix this without resorting to Javascript?

    Read the article

  • How do I secure password parameters in RESTful web service URIs?

    - by adam
    i'm a newbie to server-side programming, so please forgive me if this gets messy. i've been contracted to create a web service to allow authenticated users to access a database. users have to enter a login and password. been reading and reading about REST vs SOAP, and i thought i'd settled on a RESTful design when i came across this statement: "Data that needs to be secure should not be sent as parameters in URIs." this seems like a major demerit against a RESTful approach. i'm aware that with https the password would be encrypted to prevent man-in-the-middle interception, but that leaves the server logs and client history as possible exposure points. is there a RESTful solution out there for this problem, or do i need to go SOAPy? any advice appreciated.

    Read the article

  • Restoring a saved opengl ES buffer (i.e. writing it back to screen)

    - by Adam
    I'm writing an iPhone app where I need to save and load the screen contents. I was able to save the screen using glReadPixels(), but since there's no glDrawPixels() in openGL ES, I'm having a lot of trouble restoring that buffer to the screen. I gather that I need to save the screen as a texture: http://stackoverflow.com/questions/708760/what-is-the-equivalent-of-gldrawpixels-in-opengl-es-1-1 But I'm not sure how to implement this. Does anyone have or know of any code samples that do this? I'm an openGL noob, so any help would be greatly appreciated :)

    Read the article

  • C# - Ensuring an assembly is called via a specified assembly

    - by Adam Driscoll
    Is there any built in functionality to determine if an assembly is being called from a particular assembly? I have assembly A which references assembly B. Assembly A exposes PowerShell cmdlets and outputs types that are found within B. Certain methods and properties with in types of exposed by B are of interest to types in assembly A but not of interest to consumers of PowerShell or anyone attempting to load types in B directly and call methods within it. I have looked into InternalsVisibleToAttribute but it would require extensive rework because of the use of interfaces. I was devising a shared key system that would later be obfuscated but that seemed clunky. Is there any way to ensure B is called only by A?

    Read the article

  • Tab Content Does Not Refresh After First Click of Like Button

    - by Adam
    I've implemented a very simple "like guard" for a facebook tab, and am running into an issue with my test users. Multiple testers are reporting that when they open a tab and click the "like" button, they do not always get a page refresh (so the like guard does not disappear until they do a manual reload). This is using facebook's like button at the top of the page, not one I've coded up myself. As a sanity check, I enabled some simple logging on my server and have been able to recreate the issue - I hit "like" or "unlike" but there seems to be no request made to my index.php page, so definitely no refresh happening. I'm aware of this old bug https://developers.facebook.com/bugs/228778937218386 but this one seems different. For starters, after the first click of the "like" button, if I just continue clicking unlike/like/.... then the refresh happens automatically, as expected. What's especially weird is that if I reload the page after the first failed refresh, the refreshes start working again as expected, ie the first update to my like status triggers a page refresh. Some possibly (?) relevant info: My Tab is part of a test page, and is unpublished I am only using http hosting for the tab content, since my https isn't set up yet So far I've just tested with other admins - so maybe user role affects this? Curious to see if anyone has run into this issue before.

    Read the article

  • Guru of the Week 2 no match for the operator==

    - by Adam
    From Guru of the Week 2. We have the function: string FindAddr(const list<Employee> l, string name) { for( list<Employee>::const_iterator i = l.begin(); i != l.end(); i++) { if( *i == name ) // here will be compilation error { return (*i).addr; } } return ""; } I added dummy Employee class to that: class Employee { string n; public: string addr; Employee(string name) : n(name) {} Employee() {} string name() const { return n; } operator string() { return n; } }; And got compilation error: error: no match for ‘operator==’ in ‘i.std::_List_iterator<_Tp>::operator* [with _Tp = Employee]() == name’ It works only if add operator== to Employee. But, Herb Sutter wrote that: The Employee class isn't shown, but for this to work it must either have a conversion to string or a conversion ctor taking a string. But Employee has a conversion function and conversion constructor as well. GCC version 4.4.3. Compiled normally, g++ file.cpp without any flags. There should be implicit conversion and it should work, why it doesn't?

    Read the article

  • How do I avoid nesting forms when offering inline editing of lists with checkboxes for mass updates.

    - by adam
    A lot of sites offer the ability to edit lists of items inline as well as allowing multiple items to be selected via checkboxes and have an action performed all at once e.g. delete, mark as spam etc. But how do you implement this without violating html rules. I need one form for the checkboxes with individual submit_tags for the mass actions. But after a user clicks on an item in the list, another form via Ajax will be inserted within the checkbox form. How do I avoid doing this? I'm using rails and jQuery.

    Read the article

  • filter functions problem

    - by Adam
    I'm working on a search component for an app I'm working on and I needed to add some filters to it. I've found an example and got the first filter working fine. Now I'm trying to add a second filter I'm running into problems... In the example I found they use filterFunctions, but I only get an option for filterFunction, why is that? Here's the example code productsCollection.filterFunctions = [ filterByPrice, filterByType, filterByCondition, filterByVendor ] And this is what I'm trying acData.filterFunction = [filterByStatus, filterByDate] but with this code I get the following error message - 1067: Implicit coercion of a value of type Array to an unrelated type Function. Why am I getting this error and how would I go about add multiple filters to my Array Collection? Thanks!

    Read the article

  • How to get RSS feed item count?

    - by Adam Kane
    Hello, In C#, .NET 3.5, in a Windows Forms application... How does one get the integer count of the number of items that a given RSS url returns? Example: For my blog at: http://forgefx.blogspot.com/feeds/posts/default The expected result would be: postCount = 25 Thanks!

    Read the article

  • Rails - Why is my custom validation being triggered for only a build command.

    - by adam
    I have a sentence and correction model with a has_one and belongs_to relationship respectively. For some reason when I do def create @sentence = Sentence.find(params[:sentence_id]) @correction = @sentence.build_correction(params[:correction]) a custom validation I wrote for Correction is being called at the build_correction point. the validation is below class Correction < ActiveRecord::Base attr_accessible :text, :sentence_id, :user_id belongs_to :sentence belongs_to :user validate :correction_is_different_than_sentence def correction_is_different_than_sentence errors.add(:text, "can't be the same as the original sentence.") if (text == self.sentence.text) end the problem is for some reason on validation the correction object doesn't have the sentence id set (despite I used the build_correction method) and so it complains "you have nil object .... while executing nil.text" in the if clause in the validation above. So my question is why is the validation occuring for a build command, i thought it only triggers on a create or update. And why isnt the sentence_id getting set?

    Read the article

  • Opening all external links in Phongap's ChildBrowser using jQuery Mobile

    - by Adam
    I'm using jQuery Mobile & Phonegap, and have the following code to open all external links in a certain div with the ChildBrowser: $('.someDIV a').live('click', function() { var thisUrl = $(this).attr('href'); PhoneGap.exec("ChildBrowserCommand.showWebPage", thisUrl); return false; }); For some reason, while the page loads in the childbrowser, it also loads in the background, as if there's no "return false". I've found a workaround by giving the link's href attribute a value of "#", and using the title for the url like this: And updating the jQuery code accordingly, but this is a problem where my links are dynamically generated, and I can't have the url in the title attribute. Any ideas how to solve this?

    Read the article

  • Using javascript, show a certain amount of divs based on an answer

    - by Adam
    I'm building a form that first asks if you have 'foo'. If the answer is 'Yes', a div appears and asks 'How many foo do you have'? Based on the quantity answered, I'd like to show only that many divs. Thus if the user answers 1, only the first div will show. If they answer three, the first three will show. I have it set so that if the user answers no, the question of the amount remains hidden, but if they answer yes, they would be prompted for the quantity. This is what I've got so far... <script type="text/javascript"> $(document).ready(function(){ $(window).load(function() { $('#amt_of_foo,.foo_panels').hide(); }); $('#yes_foo').click(function() { $('#amt_of_foo').show(); }); $('#no_foo').click(function() { $('.foo_panels,#amt_of_foo').hide(); }); }); </script> </head> <body> <ul> <li> <div class="panel section_panel"> <h2>Questions About Your Foo</h2> <span>Do you have foo?:</span> <input type="radio" name="foo" id="no_foo" /> No <br /> <input type="radio" name="foo" id="yes_foo" /> Yes:</span></span> <span id="amt_of_foo"> <span>How many foo do you have?:</span> <span><input id="qty_of_foo" type="text" size="5" /> </span> </span> </div> </li> <!--answered yes to foo, and entered amount--> <div class="foo_panels"> <li> <li> <div class="panel foo_1"> <h1>First foo's information</h1> <span>Foo name:&nbsp;<input type="text" size="20" /></span> </div> </li> <li> <div class="panel foo_2"> <h1>Second foo's information</h1> <span>Foo name:&nbsp;<input type="text" size="20" /></span> </div> </li> <li> <div class="panel foo_3"> <h1>Third foo's information</h1> <span>Foo name:&nbsp;<input type="text" size="20" /></span> </div> </li> </div> <!--answered no to foo--> <li> <div class="panel"> <h1>Next Question, if no foo</h1> </div> </li> </ul> The ul is used for a jQuery 'slider' plugin. the 'panel' class is used for global css.

    Read the article

  • How could I use AJAX to create a Json data source .txt file?

    - by Adam
    I'm creating a form that collects standard information about customers. When the user hits save, I would like to create a .txt file that would be used to later retrieve all of the data collected from customers. I'm using DataTables which is a jQuery plugin to display the data. The .txt file would be formatted to be saved as such: { "aaData": [ ["client 1 name","address","city","state","zip"], ["client 2 name","address","city","state","zip"], ["client 3 name","address","city","state","zip"], ... ["client x name","address","city","state","zip"] ] } Where "aaData": is used by DataTables. This is going to part of an iPhone app, so the data source has to be very small and not reliant on a constant connection to a server, so, essentially, a client-side data source. The .txt file has to also be updated when edited and saved, and then replaced every time it is downloaded.

    Read the article

  • [PHP/MySQL] How to create text diff web app

    - by Adam Kiss
    Hello, idea I would like to create a little app for myself to store ideas (the thing is - I want it to do MY WAY) database I'm thinking going simple: id - unique id of revision in database text_id - identification number of text rev_id - number of revision flags - various purposes - expl. later title - self expl. desc - description text - self expl . flags - if I (i.e.) add flag rb;65, instead of storing whole text, I just said, that whenever I ask for latest revision, I go again in DB and check revision 65 Question: Is this setup the best? Is it better to store the diff, or whole text (i know, place is cheap...)? Does that revision flag make sense (wouldn't it be better to just copy text - more disk space, but less db and php processing. php I'm thinking, that I'll go with PEAR here. Although main point is to open-edit-save, possiblity to view revisions can't be that hard to program and can be life-saver in certain situations (good ideas got deleted, saving wrong version, etc...). However, I've never used PEAR in a long-time or full-project relationship, however, brief encounters in my previous experience left rather bad feeling - as I remember, it was too difficult to implement, slow and humongous to play with, so I don't know, if there's anything better. why? Although there are bazillions of various time/project/idea management tools, everything lacks something for me, whether it's sharing with users, syncing on more PCs, time-tracking, project management... And I believe, that this text diff webapp will be for internal use with various different tools later. So if you know any good and nice-UI-having project management app with support for text-heavy usage, just let me know, so I'll save my time for something better than redesigning the weel.

    Read the article

  • Is Cassandra database row size limited by available memory?

    - by Adam Hollidge
    I'm working with very long time series -- hundreds of millions of data points in one series -- and am considering Cassandra as a data store. In this question, one of the Cassandra committers (the über helpful jbellis) says that Cassandra rows can be very large, and that column slicing operations are faster than row slices, hence my question: Is the row size still limited by available memory?

    Read the article

  • How do I make this linkButton custom component work?

    - by Adam
    package { import mx.controls.LinkButton; import flash.text.TextLineMetrics; public class multiLineLinkButton extends LinkButton { override protected function createChildren():void { super.createChildren(); if (textField){ textField.wordWrap = true; textField.multiline = true; } } override public function measureText(s:String):TextLineMetrics { textField.text = s; var lineMetrics:TextLineMetrics = textField.getLineMetrics(0); lineMetrics.width = textField.textWidth; lineMetrics.height = textField.textHeight; return lineMetrics; } } my issue here is if you use this component you will see that the text is bunched up into a very small area. It does not fill the entire width of the linkButton. Anyone know why this is happening?

    Read the article

  • Mirroring a portion of the screen to an external display (in OSX)

    - by Adam
    I would like to write a program that can mirror a portion of the main display into a new window. Ideally this new window could then be displayed on an external monitor. I have seen this uiltity for a flightsim that does this on a pc (a multifunction display extractor). MFDex http://trac2.assembla.com/lightnings..._x86_Setup.msi I have looked at screen magnifiers or vnc clients for ideas but I think I need to write something from scratch. I have tried to do some reading on osx programing but where do I start in terms of gaining access to the display? I somehow need to extract the graphics from a particular program. Is it best to go near the final output stage (the individual pixels sent to the display) or somewhere nearer the window management stage. Any ideas or pointers would be much appreciated. I just need somewhere to start from. Regards,

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >