Search Results

Search found 20088 results on 804 pages for 'endeca discovery pattern library'.

Page 11/804 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Strange pattern matching with functions instancing Show

    - by Sean D
    So I'm writing a program which returns a procedure for some given arithmetic problem, so I wanted to instance a couple of functions to Show so that I can print the same expression I evaluate when I test. The trouble is that the given code matches (-) to the first line when it should fall to the second. {-# OPTIONS_GHC -XFlexibleInstances #-} instance Show (t -> t-> t) where show (+) = "plus" show (-) = "minus" main = print [(+),(-)] returns [plus,plus] Am I just committing a motal sin printing functions in the first place or is there some way I can get it to match properly? edit:I realise I am getting the following warning: Warning: Pattern match(es) are overlapped In the definition of `show': show - = ... I still don't know why it overlaps, or how to stop it.

    Read the article

  • Entity framework using Data Repository pattern

    - by JamesStuddart
    Hi all, I have been implementing a new project which I have decided to use the repository pattern and Entity Framework. I have sucessfuly implemented basic CRUD methods and I have no moved onto my DeepLoads. From all the examples and documentation I can find to do this I need to call something like this: public Foo DeepLoadFoo() { return (from foobah in Context.Items.Include("bah").Include("foo").Include("foofoo") select foo).Single(); } This doesnt work for me, maybe I am trying to be too lazy but what I would like to achieve would be something along the lines of this: public Foo DeepLoadFoo(Foo entity, Type[] childTypes) { return (from foobah in Context.Items.Include(childTypes).Single(); } Is anything like this possible, or am I stuck with include.include.include.include? Thanks

    Read the article

  • Graphic editor opensource project example on c++ underlying composite pattern

    - by G-71
    Can you tell me when I can see a some opensource project (only project on C++ language), which is simple graphic editor, ?ontaining following primitive (for example): an ellipse, a rectangle, a line. And desirable, that to be able to group this primitive in one primitive (for example, Word Grouping - Group). Composite pattern use is desirable in this project. I want to see how to organize classes, but more serious for me is to see how organize grouping operation. I searched for it on codeproject.com codeproject.com, codeplex.com, but not found this. I have already some source http://pastebin.com/xe4JF5PW But in my opinion, this code is dirty and ugly. Therefore, I want to see some opensource project for example. Thanks!

    Read the article

  • Pattern Matching of Units of Measure in F#

    - by Oldrich Svec
    This function: let convert (v: float<_>) = match v with | :? float<m> -> v / 0.1<m> | :? float<m/s> -> v / 0.2<m/s> | _ -> failwith "unknown" produces an error The type 'float<'u>' does not have any proper subtypes and cannot be used as the source of a type test or runtime coercion. Is there any way how to pattern match units of measure?

    Read the article

  • Composite pattern in C++ problem

    - by annouk
    Hello! I have to work with an application in C++ similar to a phone book: the class Agenda with an STL list of Contacts.Regarding the contacts hierarchy,there is a base-class named Contact(an abstract one),and the derived classes Friend and Acquaintance(the types of contact). These classes have,for instance, a virtual method called getName,which returns the name of the contact. Now I must implement the Composite pattern by adding another type of contact,Company(being derived from Contact),which also contains a collection of Contacts(an STL list as well),that can be either of the "leaf" type(Friends or Acquaintances),or they can be Companies as well. Therefore,Company is the Compound type. The question is: how and where can I implement an STL find_if to search the contact with a given name(via getName function or suggest me smth else) both among the "leaf"-type Contact and inside the Company collection? In other words,how do I traverse the tree in order to find possible matches there too,using an uniform function definition? I hope I was pretty clear...

    Read the article

  • Exception handling pattern

    - by treefrog
    It is a common pattern I see where the error codes associated with an exception are stored as Static final ints. when the exception is created to be thrown, it is constructed with one of these codes along with an error message. This results in the method that is going to catch it having to look at the code and then decide on a course of action. The alternative seems to be- declare a class for EVERY exception error case Is there a middle ground ? what is the recommended method ?

    Read the article

  • Pattern matching against Scala Map type

    - by Tom Morris
    Imagine I have a Map[String, String] in Scala. I want to match against the full set of key–value pairings in the map. Something like this ought to be possible val record = Map("amenity" -> "restaurant", "cuisine" -> "chinese", "name" -> "Golden Palace") record match { case Map("amenity" -> "restaurant", "cuisine" -> "chinese") => "a Chinese restaurant" case Map("amenity" -> "restaurant", "cuisine" -> "italian") => "an Italian restaurant" case Map("amenity" -> "restaurant") => "some other restaurant" case _ => "something else entirely" } The compiler complains thulsy: error: value Map is not a case class constructor, nor does it have an unapply/unapplySeq method What currently is the best way to pattern match for key–value combinations in a Map?

    Read the article

  • Data Connection Library in SharePoint Server 2010

    - by Wayne
    What is a Data Connection Library in SharePoint Server 2010? A Data Connection Library in Microsoft SharePoint Server 2010 is a library that can contain two kinds of data connections: an Office Data Connection (ODC) file or a Universal Data Connection (UDC) file. Microsoft InfoPath 2010 uses data connections that comply with the Universal Data Connection (UDC) file schema and typically have either a *.udcx or *.xml file name extension. Data sources described by these data connections are stored on the server and can be used in standard form templates and browser-enabled form templates. How to create a SharePoint Server Data Connection Library? 1. Browse to a SharePoint Server 2010 site on which you have at least Design permissions. If you are on the root site, create a new site before you continue with the next step. 2. On the Site Actions menu, click More Options. 3. On the Create page, click Library under Filter By, and then click Data Connection Library. 4. On the right side of the Create page, type a name for the library, and then click the Create button. 5. Copy the URL of the new data connection library. How to create a new data connection file in InfoPath? 1. Open InfoPath Designer 2010, click Blank Form, and then click Design Form. 2. On the Data tab, click Data Connections, and then click Add. 3. In the Data Connection Wizard, click Create a new connection to, click Receive data, and then click Next. 4. Click the kind of data source that you are connecting to, such as Database, Web service, or SharePoint library or list, and then click Next. 5. Complete the remaining steps in the Data Connection Wizard to configure your data connection, and then click Finish to return to the Data Connections dialog box. 6. In the Data Connections dialog box, click Convert to Connection File. 7. In the Convert Data Connection dialog box, enter the URL of the data connection library that you previously copied (delete "Forms/AllItems.aspx" and anything following it from the URL), enter a name for the data connection file at the end of the URL, and then click OK. It will take a few moments to convert and save the data connection file to the library. 8. Confirm that the data connection was converted successfully by examining the Details section of the Data Connections dialog box while the name of the converted data connection is selected. 9. Browse to the SharePoint data connection library, click the drop-down next to the name of the data connection, click Approve/Reject, click Approved, and then click OK. Take advantage of SharePoint Data Connection Library and other useful features of SharePoint family of products that include, SharePoint Foundation 2010, MOSS 2007 and free SharePoint templates or web parts.

    Read the article

  • Java Matcher groups: Understanding The difference between "(?:X|Y)" and "(?:X)|(?:Y)"

    - by user358795
    Can anyone explain: Why the two patterns used below give different results? (answered below) Why the 2nd example gives a group count of 1 but says the start and end of group 1 is -1? public void testGroups() throws Exception { String TEST_STRING = "After Yes is group 1 End"; { Pattern p; Matcher m; String pattern="(?:Yes|No)(.*)End"; p=Pattern.compile(pattern); m=p.matcher(TEST_STRING); boolean f=m.find(); int count=m.groupCount(); int start=m.start(1); int end=m.end(1); System.out.println("Pattern=" + pattern + "\t Found=" + f + " Group count=" + count + " Start of group 1=" + start + " End of group 1=" + end ); } { Pattern p; Matcher m; String pattern="(?:Yes)|(?:No)(.*)End"; p=Pattern.compile(pattern); m=p.matcher(TEST_STRING); boolean f=m.find(); int count=m.groupCount(); int start=m.start(1); int end=m.end(1); System.out.println("Pattern=" + pattern + "\t Found=" + f + " Group count=" + count + " Start of group 1=" + start + " End of group 1=" + end ); } } Which gives the following output: Pattern=(?:Yes|No)(.*)End Found=true Group count=1 Start of group 1=9 End of group 1=21 Pattern=(?:Yes)|(?:No)(.*)End Found=true Group count=1 Start of group 1=-1 End of group 1=-1

    Read the article

  • Resource not found using library project in Android

    - by hgpc
    I'm converting an existing project into a library project. I configured the original project as a library project and added an application project which references the original project as a library. The library project has an activity (MainActivity) and its layout (main.xml). The application project declares this activity as the main activity in the manifest like this: <activity android:name="com.example.MainActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> When I run the application project I get the following error... android.content.res.Resources$NotFoundException: Resource ID #0x7f030002 ...on the following line of the onCreate method of the main activity: setContentView(R.layout.main); 0x7f030002 is the ID of R.layout.main in the library project. The application project has no main resource. If I run the original project I don't get this error. Both projects neither have compilation errors nor warnings and are built with Android 2.2 with min SDK version 3. What might be the problem?

    Read the article

  • Interface Builder can't see classes in a static library

    - by teabot
    I have refactored some UIView sub-classes into a static library. However, when using Interface Builder to create view components for a project that uses the static library I find that it is unaware of the library classes. What do I need to do to make the class interfaces visible to Interface Builder? Update: The correct answer refers to dragging the headers into the 'XIB browser'. The '.h' files can be dragged from a finder window to the window area identified in this image:

    Read the article

  • Face recognition Library

    - by Janusz
    I'm looking for a free face recognition library for a university project. I'm not looking for face detection. I'm looking for actual recognition. That means finding images that contain specified faces or libraries that calculate distances between specific faces. I'm using OpenCV for detecting the faces and a rough Eigenfaces Algorithm for the recognition now. But I thought there should be something out there with a better performance then a self written Eigenfaces Algorithm. I don't talk about speed as performance I'm looking for a library with better results as an simple Eigenfaces approach I took a look at faint but it seems the library is not very reusable for my own applications. I'm happy with a library in Python, Java, C++, C or something like that. The best thing would be if it can be run on a Windowsmachine

    Read the article

  • MVC pattern and (Game) State pattern

    - by topright
    Game States separate I/O processing, game logic and rendering into different classes: while (game_loop) { game->state->io_events(this); game->state->logic(this); game->state->rendering(); } You can easily change a game state in this approach. MVC separation works in more complex way: while (game_loop) { game->cotroller->io_events(this); game->model->logic(this); game->view->rendering(); } So changing Game States becomes error prone task (switch 3 classes, not 1). What are practical ways of combining these 2 concepts?

    Read the article

  • A C# app that references a C# dll which uses Enterprise Library is throwing an error

    - by Matt
    I have a C# app that references another C# dll which in turn uses Enterprise Library. Because my app has no config xml file for setting the Enterprise Library settings, it is throwing an error, specifically: "The configuration section for Logging cannot be found in the configuration source." "Microsoft.Practices.EnterpriseLibrary.Logging" I would rather not add an XML config file to my app to just turn off Enterprise Library. Is there a code way to do so in my the source for my app? EDIT: I'm on EL 4.1

    Read the article

  • Variant datatype library for C

    - by Joey Adams
    Is there a decent open-source C library for storing and manipulating dynamically-typed variables (a.k.a. variants)? I'm primarily interested in atomic values (int8, int16, int32, uint, strings, blobs, etc.), while JSON-style arrays and objects as well as custom objects would also be nice. A major case where such a library would be useful is in working with SQL databases. The most obvious feature of such a library would be a single type for all supported values, e.g.: struct Variant { enum Type type; union { int8_t int8_; int16_t int16_; // ... }; }; Other features might include converting Variant objects to/from C structures (using a binding table), converting values to/from strings, and integration with an existing database library such as SQLite. Note: I do not believe this is question is a duplicate of http://stackoverflow.com/questions/649649/any-library-for-generic-datatypes-in-c , which refers to "queues, trees, maps, lists". What I'm talking about focuses more on making working with SQL databases roughly as smooth as working with them in interpreted languages.

    Read the article

  • How to add dependencies to 3rd party library using nexus/maven

    - by ssaboum
    Hi everyone, i'm trying to use Nexus + m2eclipse/maven-3 professionnally, and i've got a huge 3rd party library that needs a lot of dependencies. Is there any ways to ease my pain by uploading to Nexus this third party library with all its dependencies linked, so that anyone who would need it would just have to add the maven-dependency-tag only for this huge library ? Do i need to create the pom myself ? thank you for your help.

    Read the article

  • Adding a JAR to an Eclipse Java library

    - by Paul Reiners
    How do you add a JAR file to an already existing Java library in Eclipse? Note that this is not a user library. That is, if you look at the Java Build Path for a Java project and click on the Libraries tab, you will see the list of libraries used by the project. If you expand a given library, you will see a list of JAR files included in that library. I want to add an additional JAR file to one of these libraries. I am using Version 3.4.0 of Eclipse.

    Read the article

  • graph library for scala

    - by Elazar Leibovich
    Is there a good library (or wrapper to Java library) for graphs, and/or graph algorithms in scala? This one seems to be quite dead. This is an example for the Dijkstra algorithm in scala, but I'm looking for a library a-la JGraphT.

    Read the article

  • Force import module from Python standard library instead of PYTHONPATH default

    - by jrdioko
    I have a custom module in one of the directories in my PYTHONPATH with the same name as one of the standard library modules, so that when I import module_name, that module gets loaded. If I want to use the original standard library module, is there any way to force Python to import from the standard library rather than from the PYTHONPATH directory, short of renaming the custom module and changing every reference to point to the new name?

    Read the article

  • Java graph library for comparing 2 graphs

    - by user311909
    Hello, Does anyone know a good java library for graph comparing by searching maximal common subgraph isomorphism to get information about their similarity? I do not want to compare graphs based on node labels. Or is there any other way how to topologicaly compare graphs with good java library? Now I am using library SimPack and it is usefull but I need something more. Any suggestions will be very helpful. Thanks in advance

    Read the article

  • Adding line with text between pattern and next occurence of the same pattern in bash

    - by kasper
    I am writing a bash script that modifies a file that looks like this: --- usr1 --- data data data data data data data data data data data data --- usr2 --- data data data data data data data data --- usr3 --- data data data data --- endline --- One question is: How to add next user line --- usrn --- after last user data lines? Second one is: How to delete specific user data lines (data lines and --- userx ---) i.e. I would like to delete usr2 with all his data set. It must work on bash 2.05 :) and I think it will use awk or sed, but I'm not sure.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >