Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 117/255 | < Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >

  • Matrix "Zigzag" Reordering

    - by fbrereto
    I have an NxM matrix in Matlab that I would like to reorder in similar fashion to the way JPEG reorders its subblock pixels: (referenced from here) I would like the algorithm to be generic such that I can pass in a 2D matrix with any dimensions. I am a C++ programmer by trade and am very tempted to write an old school loop to accomplish this, but I suspect there is a better way to do it in Matlab.

    Read the article

  • Why does sorted list have to have a key value pair?

    - by clawson
    If I just want a sorted list of just dates, integers, or doubles is it really necessary to have to define a SortedList(of Integer, Integer)? Seems intriguing to me, but may just be trival. I'd prefer just to use a SortedList(of Integer). (This question is in relation to the .Net generic collections)

    Read the article

  • How to generate irregular ball shapes?

    - by tomato
    What kind of algorithms would generate random "goo balls" like those in World of Goo. (btw, if you haven't played it yet, highly recommended). I'm using Proccesing, but any generic algorithm would do. I guess it boils down to how to "randomly" make balls that are kind of round, but not perfectly round, and still looking realistic. Thanks in advance!

    Read the article

  • Combine hash values in C#

    - by Chris
    I'm creating a generic object collection class and need to implement a Hash function. I can obviously (and easily!) get the hash values for each object but was looking for the 'correct' way to combine them to avoid any issues. Does just adding, xoring or any basic operation harm the quality of the hash or am I going to have to do something like getting the objects as bytes, combining them and then hashing that? Cheers in advance

    Read the article

  • use viewengine only within certain area

    - by Daniel Powell
    Is it possible to use a custom view engine for a specific area only? I have tried public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Forms_default", "Forms/{client}/{controller}/{action}/{id}", new { client="Generic",action = "Index", id = UrlParameter.Optional } ); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new ClientSpecificViewEngine()); } Within my area but this seems to be a site wide affect as I'm getting errors specific to the custom view engine when visiting pages outside the area.

    Read the article

  • Generating custom-form documents from base-form plus XML?

    - by KlaymenDK
    Hi all, this is my first stack overflow, and it's a complex one. Sorry. My task is to generate custom documents from a basic template plus some XML without having a custom form design element for each case. Here's the whole picture: We are building a Lotus Notes (client, not web) application for world-wide application access control; the scope is something like 400.000 users being able to request access to any of 1000+ applications. Each application needs its own request form -- different number of approvers, various info required, that sort of thing. We simply can't have a thousand forms in a database (one per application), and anyway their maintenance really needs to be pushed from the developers to the application owners. So instead of custom forms, we'd like to create a generic "template" form that stores a block of basic fields, but then allows application owners to define another block of fields dynamically -- "I want a mandatory plain-text field named 'Name' here, and then a date field named 'Due' here that must be later than today's date, and then ...". I hope this makes sense (if not, think of it as a generic questionnaire application). I pretty much have the structure in place for designing the dynamic fields (form builder GUI - XML-encoded data - pre-rendered DXL for injecting into a form), including mark-up for field types, value options, and rudimentary field validation instructions. My problem is generating a document with this dynamic content injected at the proper location (without needing a custom form design element for each case). Doing the dynamic content via HTML is out. The Notes client web rendering is simply way too poor, and it would be quite a challenge to implement things like field validation instructions, date selectors, and name look-ups. DXL, on the other hand, would allow us to use native Notes fields and code. As a tech demo, I've managed to implement a custom form generator that injects the pre-rendered DXL for the dynamic content into a base form; but as I said, we don't want a ton of custom form design elements. I've tried to implement a way to create a document with the "store form in document" flag set, but once I've created the document from the base form, I can't get DXL access to the stored form design, and so I can't inject my dynamic content. I know this is not something Notes was ever intended to do. Has anyone ever tried something like it (and gotten away with it)? Thanks for reading this far. With a boatload of thanks in advance, Jan Gundtofte-Bruun

    Read the article

  • .htaccess rewrite not working

    - by snumb130
    I need help with a rewrite in .htaccess. I am trying to do the following: When a user types http://www.example.com/csc/alabama/ I need to pull info from http://www.example.com/csc/index.php?state=alabama I thought it should be this Options +FollowSymLinks RewriteEngine On RewriteRule ^csc/([^/]*)$ /csc/index.php?state=$1 [L] I keep getting a 404 error. On a side note, I would like to be able to do this with a generic sub-directory, so that csc could be abc or anything else but this is not the priority.

    Read the article

  • Class template specializations with shared functionality

    - by Thomas
    I'm writing a simple maths library with a template vector type: template<typename T, size_t N> class Vector { public: Vector<T, N> &operator+=(Vector<T, N> const &other); // ... more operators, functions ... }; Now I want some additional functionality specifically for some of these. Let's say I want functions x() and y() on Vector<T, 2> to access particular coordinates. I could create a partial specialization for this: template<typename T> class Vector<T, 3> { public: Vector<T, 3> &operator+=(Vector<T, 3> const &other); // ... and again all the operators and functions ... T x() const; T y() const; }; But now I'm repeating everything that already existed in the generic template. I could also use inheritance. Renaming the generic template to VectorBase, I could do this: template<typename T, size_t N> class Vector : public VectorBase<T, N> { }; template<typename T> class Vector<T, 3> : public VectorBase<T, 3> { public: T x() const; T y() const; }; However, now the problem is that all operators are defined on VectorBase, so they return VectorBase instances. These cannot be assigned to Vector variables: Vector<float, 3> v; Vector<float, 3> w; w = 5 * v; // error: no conversion from VectorBase<float, 3> to Vector<float, 3> I could give Vector an implicit conversion constructor to make this possible: template<typename T, size_t N> class Vector : public VectorBase<T, N> { public: Vector(VectorBase<T, N> const &other); }; However, now I'm converting from Vector to VectorBase and back again. Even though the types are the same in memory, and the compiler might optimize all this away, it feels clunky and I don't really like to have potential run-time overhead for what is essentially a compile-time problem. Is there any other way to solve this?

    Read the article

  • The best way to use dictionary items as we use the advantages of List

    - by blgnklc
    I want to get use of dictionary items like I do in List generic class, e.g; foreach(item in ItemList) { item.BlaBla; } but in dictionary there s no chance, like e method above... Dictionary<string, HtmlInputImage> smartPenImageDictionary; I mean I got to know the key item for the dictionary item.. but what I want, I want to travel from beginning of the list till the end..

    Read the article

  • Slow form submission.

    - by Tony
    When I submit a form, I can see my browser's progress bar slowly increased, it takes 4-6s to submit a form. It was a generic form like : <form id="someid" name="someName" action="someAction.do"> ... </form> I test it in IE8 and Firefox 3,both are very slow. My network condition is fine, my server works great. What could be the problem?

    Read the article

  • Android: how to detect a private number programmatically

    - by Bao Le
    I use BroadcastReceiver to intercept incoming call on Android phone as below tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); Bundle bundle = intent.getExtras(); String number = bundle.getString(TelephonyManager.EXTRA_INCOMING_NUMBER); In the "private number" case, I tested on two devices, it shows the number as -1 on HTC Wildfire and -2 on Galaxy S. I checked the android.telephony.PhoneNumberUtils but it could't help me. Is there a function or a generic way to detect a private number on Android phone? Thanks

    Read the article

  • Blocking problem Deserializing XML to object problem

    - by fernando
    I have a blocking problem I have XML file under some url http://myserver/mywebApp/myXML.xml In the below code which I run in Console Application, bookcollection has null Books field :( <books> <book id="5352"> <date>1986-05-05</date> <title> Alice in chains </title> </book> <book id="4334"> <date>1986-05-05</date> <title> 1000 ways to heaven </title> </book> <book id="1111"> <date>1986-05-05</date> <title> Kitchen and me </title> </book> </books> XmlDocument doc = new XmlDocument(); doc.Load("http://myserver/mywebapp/myXML.xml"); BookCollection books = new BookCollection(); XmlNodeReader reader2 = new XmlNodeReader(doc.DocumentElement); XmlSerializer ser2 = new XmlSerializer(books.GetType()); object obj = ser2.Deserialize(reader2); BookCollection books2= (BookCollection)obj; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { [Serializable()] public class Book { [System.Xml.Serialization.XmlAttribute("id")] public string id { get; set; } [System.Xml.Serialization.XmlElement("date")] public string date { get; set; } [System.Xml.Serialization.XmlElement("title")] public string title { get; set; } } } using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization; namespace ConsoleApplication1 { [Serializable()] [System.Xml.Serialization.XmlRootAttribute("books", Namespace = "", IsNullable = false)] public class BookCollection { [XmlArray("books")] [XmlArrayItem("book", typeof(Book))] public Book[] Books { get; set; } } }

    Read the article

  • Public SQL database for educational purposes

    - by Grzegorz Oledzki
    I am looking for a publicly available SQL database with free access, where one can run some SELECT queries for free on some meaningful data (not item1, item2, item3). Have you seen any? Even better if it came together with some tutorial. Vendor is not that relevant, as long as one can connect using a generic JDBC client.

    Read the article

  • Java: Finding objects in collections.

    - by Jake
    This problem occurs over and over. I have some complicated object, such as a Cat, which has many properties, such as age, favorite cat food, and so forth. A bunch of Cats are stored in a Java Collection, and I need to find all the Cats that are aged 3, or those whose favorite cat food is Whiskas. Surely, I can write a custom method that finds those Cats with a specific property, but this gets cumbersome with many properties; is there some generic way of doing this?

    Read the article

  • User control javascript

    - by Prashant
    Hi, I have a generic user control which will be used twice in a page. There is a javascript asscoiated with it which also needs to be added. How can I add this to a page since the javascript will be added multiple times.

    Read the article

  • Is there an existing template for a new C++ Open Source project

    - by esavard
    I want to start a new C++ (Qt) Open Source project and I'm wondering if there is an existing template somewhere for files usually found in an Open Source project but that are not purely source code (README, LICENSE, CHANGELOG, etc.) I could probably find a popular Open Source project for inspiration but if there is some existing generic templates, I will use that instead. Thanks.

    Read the article

< Previous Page | 113 114 115 116 117 118 119 120 121 122 123 124  | Next Page >