Search Results

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

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

  • Filter list as a parameter in a compiled query

    - by JK
    I have the following compiled query that I want to return a list of "groups" that don't have a "GroupID" that's contained in a filtered list: CompiledQuery.Compile(ConfigEntities contexty, List list) = from c in context.Groups where (!csList.Contains(c.GroupID)) select c).ToList() However I'm getting the following run-time error: The specified parameter 'categories' of type 'System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c261364e126]]' is not valid. Only scalar parameters (such as Int32, Decimal, and Guid) are supported. Any ideas?

    Read the article

  • Trouble using South with Django and Heroku

    - by Dan
    I had an existing Django project that I've just added South to. I ran syncdb locally. I ran manage.py schemamigration app_name locally I ran manage.py migrate app_name --fake locally I commit and pushed to heroku master I ran syncdb on heroku I ran manage.py schemamigration app_name on heroku I ran manage.py migrate app_name on heroku I then receive this: $ heroku run python notecard/manage.py migrate notecards Running python notecard/manage.py migrate notecards attached to terminal... up, run.1 Running migrations for notecards: - Migrating forwards to 0005_initial. > notecards:0003_initial Traceback (most recent call last): File "notecard/manage.py", line 14, in <module> execute_manager(settings) File "/app/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager utility.execute() File "/app/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv self.execute(*args, **options.__dict__) File "/app/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute output = self.handle(*args, **options) File "/app/lib/python2.7/site-packages/south/management/commands/migrate.py", line 105, in handle ignore_ghosts = ignore_ghosts, File "/app/lib/python2.7/site-packages/south/migration/__init__.py", line 191, in migrate_app success = migrator.migrate_many(target, workplan, database) File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 221, in migrate_many result = migrator.__class__.migrate_many(migrator, target, migrations, database) File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 292, in migrate_many result = self.migrate(migration, database) File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 125, in migrate result = self.run(migration) File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 99, in run return self.run_migration(migration) File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 81, in run_migration migration_function() File "/app/lib/python2.7/site-packages/south/migration/migrators.py", line 57, in <lambda> return (lambda: direction(orm)) File "/app/notecard/notecards/migrations/0003_initial.py", line 15, in forwards ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])), File "/app/lib/python2.7/site-packages/south/db/generic.py", line 226, in create_table ', '.join([col for col in columns if col]), File "/app/lib/python2.7/site-packages/south/db/generic.py", line 150, in execute cursor.execute(sql, params) File "/app/lib/python2.7/site-packages/django/db/backends/util.py", line 34, in execute return self.cursor.execute(sql, params) File "/app/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute return self.cursor.execute(query, args) django.db.utils.DatabaseError: relation "notecards_semester" already exists I have 3 models. Section, Semester, and Notecards. I've added one field to the Notecards model and I cannot get it added on Heroku. Thank you.

    Read the article

  • Summary of changes for each API level?

    - by MisterSquonk
    As the title says, are there any sources (web pages etc) of summarised changes at each API level? I have an app which I've put out to a small group of beta testers and I already fell foul of Environment.getExternalFilesDir(), which I hadn't noticed was introduced in API Level 8, when a couple of the guys tried it on Android v2.1 devices. The majority of my code should be pretty generic but it would be useful if I could find a condensed/summarised list/table or similar that I can quickly glance over.

    Read the article

  • Any way to allow classes implementing IEntity and downcast to have operator == comparisons?

    - by George Mauer
    Basically here's the issue. All entities in my system are identified by their type and their id. new Customer() { Id = 1} == new Customer() {Id = 1}; new Customer() { Id = 1} != new Customer() {Id = 2}; new Customer() { Id = 1} != new Product() {Id = 1}; Pretty standard scenario. Since all Entities have an Id I define an interface for all entities. public interface IEntity { int Id { get; set;} } And to simplify creation of entities I make public abstract class BaseEntity<T> : where T : IEntity { int Id { get; set;} public static bool operator ==(BaseEntity<T> e1, BaseEntity<T> e2) { if (object.ReferenceEquals(null, e1)) return false; return e1.Equals(e2); } public static bool operator !=(BaseEntity<T> e1, BaseEntity<T> e2) { return !(e1 == e2); } } where Customer and Product are something like public class Customer : BaseEntity<Customer>, IEntity {} public class Product : BaseEntity<Product>, IEntity {} I think this is hunky dory. I think all I have to do is override Equals in each entity (if I'm super clever, I can even override it only once in the BaseEntity) and everything with work. So now I'm expanding my test coverage and find that its not quite so simple! First of all , when downcasting to IEntity and using == the BaseEntity< override is not used. So what's the solution? Is there something else I can do? If not, this is seriously annoying. Upadate It would seem that there is something wrong with my tests - or rather with comparing on generics. Check this out [Test] public void when_created_manually_non_generic() { // PASSES! var e1 = new Terminal() {Id = 1}; var e2 = new Terminal() {Id = 1}; Assert.IsTrue(e1 == e2); } [Test] public void when_created_manually_generic() { // FAILS! GenericCompare(new Terminal() { Id = 1 }, new Terminal() { Id = 1 }); } private void GenericCompare<T>(T e1, T e2) where T : class, IEntity { Assert.IsTrue(e1 == e2); } Whats going on here? This is not as big a problem as I was afraid, but is still quite annoying and a completely unintuitive way for the language to behave. Update Update Ah I get it, the generic implicitly downcasts to IEntity for some reason. I stand by this being unintuitive and potentially problematic for my Domain's consumers as they need to remember that anything happening within a generic method or class needs to be compared with Equals()

    Read the article

  • Wait for all WPF animations to stop

    - by Ray
    Given a WPF window, which may or may not have animations, I'd like to wait until they are all done before continuing processing. Is there a generic way to do this. Currently I can do something like this: void WaitForAnimation(Storyboard storyboard) { WaitUntil(() => storyboard.GetCurrentState() == ClockState.Stopped); } But this assumes I know the storyboards or have some way of finding them. Is there a way of doing that?

    Read the article

  • Adding controls dynamically not XHTML formatted

    - by LiverpoolsNumber9
    Hi - I'm adding generic html controls to repeater items at "onitemdatabound". It works absolutely fine but just wondering (or hoping) if there's any way of getting those controls to render on the page in XHTML format? It's just an annoyance really - my markup is beautifully clean and correctly indented until the repeater! Using .net 3.5, and C#. Thanks in advance, Rob

    Read the article

  • Capture form fields and repopulate the form with them

    - by Joel Cunningham
    I am currently testing a large web form and would like to be able to easily populate the form with several different lots of test data without having to type them each time. Is there a generic way to capture form inputs on a web page and have them repopulated on a different page load? I thought a tool like greasemonkey might be able to do something like this.

    Read the article

  • C# code analysis - VS 2005

    - by anon
    I have a C# user control project which causes intermittent .NET run time error, a generic error, and wondering if there is any code analysis tool that I can point at my .sln file which would tell me what may be causing my error

    Read the article

  • C# Generics - Strange Interview Question

    - by udana
    An interviewer argued me "Genrics are not completely Genrics", He provided the example (Parameters int k,int d are not generic) public static void PrintThis<T>(T a, T b, T c, int k,int d) { } He asked me if i prove still it is generics , i will be allowed to take up the next round. I did not know what he is expecting from me,and what he really means by showing such example. Guide me how to smartly face such a strange interview ?. Thanks in advance.

    Read the article

  • Effective Data Validation

    - by John Conde
    What's an effective way to handle data validation, say, from a form submission? Originally I had a bunch of if statements that checked each value and collected invalid values in an array for later retrieval (and listing). // Store errors here $errors = array(); // Hypothetical check if a string is alphanumeric if (!preg_match('/^[a-z\d]+$/i', $fieldvalue)) { $errors[$fieldname] = 'Please only use letters and numbers for your street address'; } // etc... What I did next was create a class that handles various data validation scenarios and store the results in an internal array. After data validation was complete I would check to see if any errors occurred and handle accordingly: class Validation { private $errorList = array(); public function isAlphaNumeric($string, $field, $msg = '') { if (!preg_match('/^[a-z\d]+$/i', $string)) { $this->errorList[$field] = $msg; } } // more methods here public function creditCard($cardNumber, $field, $msg = '') { // Validate credit card number } // more methods here public function hasErrors() { return count($this->errorList); } } /* Client code */ $validate = new Validation(); $validate->isAlphaNumeric($fieldvalue1, $fieldname1, 'Please only use letters and numbers for your street address'); $validate->creditCard($fieldvalue2, $fieldname2, 'Please enter a valid credit card number'); if ($validate->hasErrors()) { // Handle as appropriate } Naturally it didn't take long before this class became bloated with the virtually unlimited types of data to be validated. What I'm doing now is using decorators to separate the different types of data into their own classes and call them only when needed leaving generic validations (i.e. isAlphaNumeric()) in the base class: class Validation { private $errorList = array(); public function isAlphaNumeric($string, $field, $msg = '') { if (!preg_match('/^[a-z\d]+$/i', $string)) { $this->errorList[$field] = $msg; } } // more generic methods here public function setError($field, $msg = '') { $this->errorList[$field] = $msg; } public function hasErrors() { return count($this->errorList); } } class ValidationCreditCard { protected $validate; public function __construct(Validation $validate) { $this->validate = $validate; } public function creditCard($cardNumber, $field, $msg = '') { // Do validation // ... // if there is an error $this->validate->setError($field, $msg); } // more methods here } /* Client code */ $validate = new Validation(); $validate->isAlphaNumeric($fieldvalue, $fieldname, 'Please only use letters and numbers for your street address'); $validateCC = new ValidationCreditCard($validate); $validateCC->creditCard($fieldvalue2, $fieldname2, 'Please enter a valid credit card number'); if ($validate->hasErrors()) { // Handle as appropriate } Am I on the right track? Or did I just complicate data validation more then I needed to?

    Read the article

  • Best way to store configuration settings outside of web.config

    - by Wil
    I'm starting to consider creating a class library that I want to make generic so others can use it. While planning it out, I came to thinking about the various configuration settings that I would need. Since the idea is to make it open/shared, I wanted to make things as easy on the end user as possible. What's the best way to setup configuration settings without making use of web.config/app.config?

    Read the article

  • Dynamically Rendering in a Scrollable Area

    - by James
    What is the generic algorithm or process that is commonly used to dynamically render portions of a scrolling area? For example, in Google Maps, when the user scrolls past the bounds of the currently rendered area, a grey checkerboard pattern is displayed within the not-yet-rendered portions while the application loads and renders those areas. I'm looking specifically for the approach, or the mathematics, related to filling a graphics area in chunks based on what has just come into view. If possible, I'm looking for anything relevant to the GDI+ process of doing so.

    Read the article

  • Data structures libaray in C

    - by Vineel Kumar Reddy
    Hi all I am very much used to .NET and java collection libraries and searching for a similar library in C. I am in need of following A list data structure for storing generic objects. and also a Dictionary data structure for key value pairs. Please let me know if any library exists. Thanks.

    Read the article

  • Why is my List.Sort method in C# reversing the order of my list?

    - by Fiona Holder
    I have a list of items in a generic list: A1 (sort index 1) A2 (sort index 2) B1 (sort index 3) B2 (sort index 3) B3 (sort index 3) The comparator on them takes the form: this.sortIndex.CompareTo(other.sortIndex) When I do a List.Sort() on the list of items, I get the following order out: A1 A2 B3 B2 B1 It has obviously worked in the sense that the sort indexes are in the right order, but I really don't want it to be re-ordering the 'B' items. Is there any tweak I can make to my comparator to fix this?

    Read the article

  • How do I read an attribute on a class at runtime?

    - by Zaff
    I am trying to create a generic method that will read an attribute on a class and return that value at runtime. How do would I do this? Note: DomainName attribute is of class DomainNameAttribute. [DomainName(“MyTable”)] Public class MyClass : DomianBase {} What I am trying to generate: //This should return “MyTable” String DomainNameValue = GetDomainName<MyClass>();

    Read the article

  • glibc regexp performance

    - by Jack
    Anyone has experience measuring glibc regexp functions? Are there any generic tests I need to run to make such a measurements (in addition to testing the exact patterns I intend to search)? Thanks.

    Read the article

  • How to get the form active control?

    - by PabloG
    Is there a way to get the form active control? I was checking in the help for the "Support.GetActiveControl" method but it isn't supported :) for the Compact Framework. I suppose that I can track the focus by adding a custom GotFocus event handler to all the form controls, but I'm looking for a more generic way that can be implemented for any form.

    Read the article

  • Agile Web Development

    - by sidcom
    Hi all Im looking for some resources and information around agile web development. I have done a search and found a wiki page and lots of other sites around the subject. Most of these sites are orientated around Ruby on Rails. Does anyone know of any sites or resources that cover other platforms and languages like asp.net and php or are even generic. Thanks

    Read the article

  • What's the Microsoft Ajax equivalent to jquery.ajaxSetup() or .ajaxError()?

    - by Seth Petry-Johnson
    I have an ASP.NET MVC site that uses both Microsoft Ajax [Ajax.BeginForm()] and jQuery to make asynchronous requests. I want to configure both frameworks such that a generic error handler is automatically attached if the developer does not explicitly specify a failure callback. In jQuery I can accomplish this with either .ajaxSetup() or .ajaxError(). What is the equivalent in the Microsoft Ajax client library? I'm fairly sure it's something in the Sys object but I can't find it...

    Read the article

  • Converting PDF to PCL5 on Windows?

    - by Hein du Plessis
    In my application, I need to convert PDF docs to PCL5 generic files to send to FTP PCL capable printers. Printing to file would be a last resort, I would prefer a small-footprint command line tool or API that will do the job. I've seen some mention of doing this on Linux using Ghostscript, but I've got no idea how to replicate this on windows. Many thanks

    Read the article

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