Search Results

Search found 11277 results on 452 pages for 'jeff certain'.

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

  • Getting all objects with a certain element inside a collection of strings with criteria API.

    - by Jens Jansson
    Hey. I'm trying to build a Hibernate Criteria query to find entities that have a specific element inside a collection. We can take as an example a Book -object that looks like this: public class Book { private Long id; private String title; private Set<String> authors = new HashSet<String>(); } The entity is mapped like this: <class name="Book" table="Book"> <id name="id" column="BOOK_ID"> <generator class="native"/> </id> <property name="title"/> <set name="authors" table="Book_Authors"> <key column="BOOK_ID"/> <element type="string" column="AUTHORS"/> </set> </class> Now I would like to find out which books are written by Matt. With pure SQL I can do a query like this: String author = "Matt"; String query = "SELECT * FROM Book " + "WHERE BOOK_ID IN " + "(SELECT BOOK_ID FROM Book_Authors " + "WHERE authors = :author )"; List<Book> result = session.createSQLQuery(query) .addEntity(Book.class) .setParameter("author", author) .list(); This works all good and well, and I get out all books that Matt has been a part of writing. The project I work in, however, uses the Criteria API instead of raw SQL, and I haven't found a way to express the same query in that form. I've taken a look on the Restrictions API and the closest I've found is Restions.in(propertyName, collection) but that works the other way around (one value in object, many values to match against). Any ideas?

    Read the article

  • certain BitMapData types dont work in a beginBitmapFill() method.

    - by numerical25
    Say I loaded a bitMap into a bitmapData type called tileImage. tileImage = Bitmap(loader.content).bitmapData; say I decided to add that bitmap into a sprite like below this.graphics.beginBitmapFill(tileImage ); this.graphics.drawRect(0, 0,tWidth ,tHeight ); It would of course work. But say If I decided to add tileImage into a another bitMapData type like below var tImage:BitmapData = new BitmapData(30,30); tImage.copyPixels(tileImage,tRect,tPoint); and I then added tImage to my sprite this.graphics.beginBitmapFill(tImage); this.graphics.drawRect(0, 0,tWidth ,tHeight ); I then get the following error ArgumentError: Error #2015: Invalid BitmapData. tRect and tPoint are all predefined and set. tRect x and y are 0,0 and the width and height are 30x30. tPoint is 0,0 as well. Yes I understand that this is a very brief explanation but I wanted to elaborate that a bitMapdata type that has its data from the copypixel method does not work with beginBitmapFill. but a varible that gets its data straigt from the source, does. One works, and one doesnt, yet they are both the same data types. why is this ?

    Read the article

  • Can I use foreach to return only a certain type from a collection?

    - by RoboShop
    If I enter the code below, I get an error. Basically, the foreach will break when it comes across a Control that isn't a label. foreach (Label currControl in this.Controls()) { ... } I have to do something like this. foreach (Control currControl in this.Controls()) { if(typeof(Label).Equals(currControl.GetType())){ ... } } can anyone think of a better way of doing it without me needing to check the type? Can I somehow get foreach to skip the objects that aren't Labels?

    Read the article

  • How to assert certain method is called with Ruby minitest framework?

    - by steven.yang
    I want to test whether a function invokes other functions properly with minitest Ruby, but I cannot find a proper assert to test from the doc. The source code class SomeClass def invoke_function(name) name == "right" ? right () : wrong () end def right #... end def wrong #... end end The test code: describe SomeClass do it "should invoke right function" do # assert right() is called end it "should invoke other function" do # assert wrong() is called end end

    Read the article

  • How to prevent certain workflows from showing in SharePoint's Workflow.aspx page for a list.

    - by Burt
    I have a few workflows associated with a SharePoint list (e.g., Pages). Some are written as SharePoint WF workflows in Visual Studio, but some are no-code workflows created in SharePoint Designer. I programmatically start the WF workflows, but the no-code ones are started manually. When a user goes to "/_layouts/Workflow.aspx?ID=&List=&ShowStart=1" they will see all of the workflows. If I set ShowStart variable to 0 they will see none. If I don't allow the WF workflows to be started manually, then they don't seem to start programmatically correctly. Is there a way to allow the WF workflows to be started programmatically, but not manually? I also want the no-code workflows to be able to be started manually when ShowStart=1. Any ideas are welcome.

    Read the article

  • Find the shortest path in a graph which visits certain nodes.

    - by dmd
    I have a undirected graph with about 100 nodes and about 200 edges. One node is labelled 'start', one is 'end', and there's about a dozen labelled 'mustpass'. I need to find the shortest path through this graph that starts at 'start', ends at 'end', and passes through all of the 'mustpass' nodes (in any order). ( http://3e.org/local/maize-graph.png / http://3e.org/local/maize-graph.dot.txt is the graph in question - it represents a corn maze in Lancaster, PA)

    Read the article

  • Can I constrain a route parameter to a certain type in ASP.net MVC?

    - by Paul Suart
    I have the following route: routes.MapRoute( "Search", // Route name "Search/{affiliateId}", // URL with parameters new { controller = "Syndication", action = "Search" } // Parameter defaults ); Is there a way I can ensure "affiliateId" is a valid Guid? I'm using MVCContrib elsewhere in my site and I'm fairly it provides a way to implement this kind of constraint.... I just don't know what it is!

    Read the article

  • With Maven, how would I prevent Maven from filtering certain properties but allowing others?

    - by Benny
    The problem is that I'm trying to build a project that has in its resources a build.xml file. Basically, I package my project as a jar with Maven2, and then use ant installer to install my project. There is a property in the build.xml file that I need to filter called build.date, but there are other properties that I don't want to filter, like ${basedir}, because it's used by the ant installer but gets replaced by Maven's basedir variable. So, I need to somehow tell Maven to filter ${build.date}, but not ${basedir}. I tried creating a properties file as a filter with "basedir=${basedir}" as one of the properties, but I get the following error: Resolving expression: '${basedir}': Detected the following recursive expression cycle: [basedir] Any suggestions would be much appreciated. Thanks, B.J.

    Read the article

  • Why would certain browsers request all pages on my ASP.Net Web site twice?

    - by Deane
    Firefox is issuing duplicate requests to my ASP.Net web site. It will request a page, get the response, then immediately issue the same request again (well, almost the same -- see below). This happens on every page of this particular Web site (but not any others). IE does not do this, but Chrome also does this. I have confirmed that there is no Location header in the response, and no Javascript or meta tag in the page which would cause the page to be re-requested (if any of these were true, IE would be re-requesting pages as well). I have confirmed this behavior on multiple Firefox installs on multiple machines. Versions vary, but all are 3.x. The only difference between the two requests is the Accepts header. For the first request, it looks like this: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 For the second request, it looks like this: Accept: */* The Content-Type response header in all cases is: Content-Type: text/html; charset=utf-8 Something else odd -- even though Firefox requests the page twice, it uses the first response and discards the second. I put a counter on a page that increments with every request. I can watch the responses come back (via the Charles proxy). Firefox will get a "1" the first time, and a "2" the second time. Yet it will display the "1," for some reason. Chrome exhibits this exact same behavior. I suspect it's a protocol-level issue, given the difference in Accepts header, but I've never seen this before.

    Read the article

  • How to get joomla sections to display only on certain pages?

    - by thatryan
    I am brand new to joomla, and am trying to have a few sections, such as a feature slider, show up only on homepage, and some other stuff show only on internal pages. I thought I was on the right track with this code, but does not work correctly. What is the best way to do this? Thank you. <div id="wrapper"> <!--====================HOME PAGE ONLY========================--> <?php if(JRequest::getVar('view') == "frontpage" ) : ?> <div id="feature_slides" class="featuredbox-wrapper"><!--Featured Content Slider--> <jdoc:include type="modules" name="feature_slides" /> </div><!-- end #feature_slides --> <?php endif; ?> <!--====================END HOME PAGE ONLY========================--> <div id="main_content"> <!--====================INTERNAL PAGE ONLY========================--> <?php if(!JRequest::getVar('view') == "frontpage" ) : ?> <h2 class="page_name">I Am An Internal Page</h2> <h4 class="breadcrumbs">Breadcrumbs</h4> <?php endif; ?> <!--====================END INTERNAL PAGE ONLY========================--> <!--====================HOME PAGE ONLY========================--> <?php if(JRequest::getVar('view') == "frontpage" ) : ?> <div id="intro"> <jdoc:include type="modules" name="home_intro" /> </div><!-- end #intro --> <?php endif; ?> <!--====================END HOME PAGE ONLY========================--> <div id="main_area" class="clearfix"> <jdoc:include type="component" /> </div><!-- end #main_area --> <div id="certifications"> <jdoc:include type="modules" name="certifications" /> </div><!-- end #certifications --> </div><!-- end main_content --> <div id="right_sidebar"> <jdoc:include type="modules" name="right_sidebar" /> </div><!-- end #right_sidebar --> <div class="separator"></div><!-- end .separator --> </div><!-- end wrapper -->

    Read the article

  • Django many-to-many relationship to self with extra data, how do I select from a certain direction?

    - by Jake
    I have some hierarchical data where each Set can have many members and can belong to more than one Set(group) Here are the models: class Set(models.Model): ... groups = models.ManyToManyField('self', through='Membership', symmetrical=False) members = models.ManyToManyField('self', through='Membership', symmetrical=False) class Membership(models.Model): group = models.ForeignKey( Set, related_name='Members' ) member = models.ForeignKey( Set, related_name='Groups' ) order = models.IntegerField( default=-1 ) I want to know how to get all the members or all the groups for a Set instance. I think I can do it as follows, but it's not very logical, can anyone tell me what's going on and how I should be doing it? # This gives me a set of Sets # Which seems to be the groups this Set belongs to set_instance.set_set.all() # These give me a set of Memberships, not Sets set_instance.Members.all() set_instance.Groups.all() # These they both return a set of Sets # which seem to be the members of this one set_instance.members.all() set_instance.groups.all()

    Read the article

  • Select statement that combines similar rows with certain ids?

    - by vegatron
    hi I have a warehouse_products table which defines how many products in the warehouses so lets say I have 20 records/rows in the table, some rows may contain the same product id but in a different warehouse I need to create select statement that give every product one row, and in this row I must have the quantity in warehouse A and warehouse B .. so in the end I will get for example 10 rows that contain all the data

    Read the article

  • On a local network, are you able to password protect certain folders and how (in windows xp)?

    - by Derek
    I have a local network set up for my small office which consists of me, the manager, my wife, the secretary, and a few sales people/others. I would like to share passwords over the network and other such things privately to my wife, the secretary, but would not like the sales people and others to have access to it, yet I need the others to have access to other folders/documents that I'd like to share. How would I go about doing this if not by password? Thanks in advance

    Read the article

  • css: filters how to disable them for a certain class?

    - by jony
    On IE I'm having a bit of trouble with my CSS: body.transparent { background-color: transparent; color:#ffffff; text-shadow: 0 -1px #000, 1px 0 #000, 0 1px #000, -1px 0 #000; Filter:Glow(Color=#000000, Strength=1); } body.transparent a { text-shadow: none; filter: -;) } The glow filter needs to be excluded on body.transparent a, like the shadow is. But I just can't disable the filter for the the links. How do I do this??

    Read the article

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