Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 163/332 | < Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >

  • Django save, column specified twice

    - by realshadow
    Hey, I would like to save a modified model, but I get Programming error - that a field is specified twice. class ProductInfo(models.Model): product_info_id = models.AutoField(primary_key=True) language_id = models.IntegerField() product_id = models.IntegerField() description = models.TextField(blank=True) status = models.IntegerField() model = models.CharField(max_length=255, blank=True) label = models.ForeignKey(Category_info, verbose_name = 'Category_info', db_column = 'language_id', to_field = 'node_id', null = True) I get this error because the foreign key uses as db_column language_id. If I will delete it, my object will be saved properly. I dont quite understand whats going on and since I have defined almost all of my models this way, I fear its totally wrong or maybe I just missunderstood it... Any ideas? Regards

    Read the article

  • Create a Font using strings pulled from a string table.

    - by Matthew Smith
    I am writing a tool to create an otf or ttc with only characters defined in our localized string table, so we can cut down memory usage. I already have the information for the Japanese characters we are using but I am unable to find an example of creating a new font based around these characters. Does anyone know of a good example or even the interface I can access to do this? I am working in C# with .NET 3.5. I am looking into Volt and TTOasm from Microsoft, but I am not sure if they will do exactly what I need. Any information is appreciated. Thanks, Matt Smith

    Read the article

  • Set binding for DataTemplate components in code

    - by Chouppy
    Hi; sorry if I'm not clear, it's not really clear in my head too (especially after trying to find my way in other posts :p) What I'm willing to do is creating DataGrids in code, with zero to numerous columns containing a button, which will call one same function but with a "parameter" (different for each column). Here is what I got so far : DataGrid created in code DataTemplate defined in the xaml resources (with a button) DataGridTemplateColumn which uses the above DataTemplate Is it possible to bind the button's properties (in the DataTemplate), to the DataGridTemplateColumn properties (in my case, the column header would be ok), and how? Is there a way to get an access to the DataTemplate components (the button for example) in code, and modify their properties? Is it possible (and not hazardous) to create a DataTemplate in code? I declared mine in xaml because I found a post advising to do so instead of code. Thanks for your help.

    Read the article

  • Sort by an object's type

    - by Richard Levasseur
    Hi all, I have code that statically registers (type, handler_function) pairs at module load time, resulting in a dict like this: HANDLERS = { str: HandleStr, int: HandleInt, ParentClass: HandleCustomParent, ChildClass: HandleCustomChild } def HandleObject(obj): for data_type in sorted(HANDLERS.keys(), ???): if isinstance(obj, data_type): HANDLERS[data_type](obj) Where ChildClass inherits from ParentClass. The problem is that, since its a dict, the order isn't defined - but how do I introspect type objects to figure out a sort key? The resulting order should be child classes follow by super classes (most specific types first). E.g. str comes before basestring, and ChildClass comes before ParentClass. If types are unrelated, it doesn't matter where they go relative to each other.

    Read the article

  • Scala type system : basic type mismatch

    - by SiM
    I have a basic type system type mismatch problem: I have a class with a method def Create(nodeItem : NodeItem) = {p_nodeStart.addEndNode(nodeItem)} where p_nodeStart is NodeCache class NodeCache[END_T<:BaseNode] private(node: Node) extends BaseNode { def addEndNode(endNode : END_T) = {this.CACHE_HAS_ENDNODES.Create(endNode)} and the error its giving me is: error: type mismatch; found : nodes.NodeItem required: Nothing def Create(nodeItem : NodeItem) = {p_nodeStart.addEndNode(nodeItem)} while the NodeCache is defined as object NodeTrigger { def Create() { val nodeTimeCache = NodeCache.Create[NodeItem](node) and in object NodeCache object NodeCache { def Create[END_T<:BaseNode]() { val nodeCache = new NodeCache[END_T](node); Any ideas, how to fix the error?

    Read the article

  • Inheritance Problem in Perl OOP

    - by Sam
    Hello, I have a sub class that calls a method from a super class. and the method in the super class use a method that is defined in the super class as asbstract(not really abstract) but implemented in the sub class. for example: package BaseClass; sub new { } sub method1 { return someAbstractMethod(); } sub someAbtsractMethod { die "oops, this is an abstract method that should be implemented in a subclass" ; } 1; package SubClass; sub new { } sub someAbtsractMethod { print "now we implement the asbtract method"; } 1; now when I do: $sub = new SubClass(); $sub-method1(); It calls the abstract message and i get the specified error message. if I took off the abstractmethod from the super class and just leave the implementation in the subclass, It does not recognize the method and I get subroutine abstractmethod not found error.

    Read the article

  • How to add items rows to a listview WPF and VB.net

    - by leviatan1001
    Im getting crazy with it. It is so easy in windows form, but in wpf it seems to be different. Every example i find is in C# and i cant addapt it. Well, this is the code i have. Atm, i have just defined the columns: 'diseño de las columnas Dim item As ListViewItem = New ListViewItem Dim Mi_Lista As GridView = New GridView Mi_Lista.AllowsColumnReorder = True Dim cine As New GridViewColumn() Dim Si3d As New GridViewColumn cine.Header = "Cine" cine.DisplayMemberBinding = New Binding("Cine") Si3d.DisplayMemberBinding = New Binding("si3D") cine.Width = 140 Si3d.Header = "3D" Si3d.Width = 50 Mi_Lista.Columns.Add(cine) Mi_Lista.Columns.Add(Si3d) Thanks in advance.

    Read the article

  • Can someone explain me implicit conversions in Scala?

    - by Oscar Reyes
    And more specifically how does the BigInt works for convert int to BigInt? In the source code it reads: ... implicit def int2bigInt(i: Int): BigInt = apply(i) ... How is this code invoked? I can understand how this other sample: "Date literals" works. In. val christmas = 24 Dec 2010 Defined by: implicit def dateLiterals(date: Int) = new { import java.util.Date def Dec(year: Int) = new Date(year, 11, date) } When int get's passed the message Dec with an int as parameter, the system looks for another method that can handle the request, in this case Dec(year:Int) Q1. Am I right in my understanding of Date literals? Q2. How does it apply to BigInt? Thanks

    Read the article

  • Problem with HSQLDB & SequenceGenerator

    - by Srirangan
    Hi, I have an entity which has an ID field: @Id @Column(name = "`U##ID_VOIE`") @GeneratedValue(generator = "VOIE_SEQ") private String id; The class has the sequence generator defined as well: @SequenceGenerator(name = "VOIE_SEQ", sequenceName = "VOIE_SEQ") and the Oracle schema has the requisite sequence present. Everything works okay. We also have tests, which uses an in-memory HSQLDB. Before running the tests, all the tables are created based on the Hibernate entity classes. However the table for this particular class is not being created. And error pops up, because ID is a String and the SequenceGenerator in HSQLDB returns an INT / LONG / Numeric value. The application is using a legacy Oracle database and ID_VOIE column must remain a String / Varchar. Any solutions?

    Read the article

  • GDB skips over my code!

    - by sheepsimulator
    So, I've defined a class like DataLoggingSystemStateReceiver { DataLoggingSystemStateReceiver() { // stuff } // ... other functions here }; In main, I instantiate DataLoggingSystemStateReceiver like so: int main() { // ... run stuff Sensor sensor(port, timer); DataLoggingSystemStateReceiver dlss(); Log::notice("started"); return 0; } However, when I step through this code in gdb, it runs: Sensor sensor(port, timer); skips DataLoggingSystemStateReceiver dlss(); and continues with Log::notice("started"); What gives? EDIT: By changing DataLoggingSystemStateReceiver dlss(); to DataLoggingSystemStateReceiver dlss; in main(), the line executes. Can someone explain why?

    Read the article

  • Create user variable in Intellij File Template

    - by Matt Broekhuis
    I am trying to use Intellij's file templates (not live templates) to help mitigate how much boilerplate code I use when making Services, daos, and their interfaces. I am able to use all the system defined variables just fine, such as ${PACKAGE_NAME} What I want though, is to be able to use my own variable names, like ${MY_USER_INPUT} however, when i do this like above, I get an error The documentation says : It is also possible to specify arbitrary number of custom variables in format ${<VARIABLE_NAME>}. and then Intellij is supposed to prompt the user for the value. However, this just plain doesn't work for me. What am I missing?

    Read the article

  • Problem creating PostGIS template database

    - by omat
    I am trying to build a template geographic database for PostGIS (1.5) on Mac OS X Snow Leopard (10.6) for my GeoDjango application. I am following: http://docs.djangoproject.com/en/dev/ref/contrib/gis/install/#creating-a-spatial-database-template-for-postgis I've managed to come up to the point where the provided postgis.sql should be run (i.e. psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql) At that point I am getting an error at the first SQL statement that is tried to be run. When I try that on the psql prompt the result is as follows: template_postgis=# CREATE OR REPLACE FUNCTION st_spheroid_in(cstring) RETURNS spheroid AS '/usr/local/pgsql/lib/postgis-1.5','ellipsoid_in' LANGUAGE 'C' IMMUTABLE STRICT; NOTICE: type "spheroid" is not yet defined DETAIL: Creating a shell type definition. ERROR: could not load library "/usr/local/pgsql/lib/postgis-1.5.so": dlopen(/usr/local/pgsql/lib/postgis-1.5.so, 10): Symbol not found: _DatumGetFloat4 Referenced from: /usr/local/pgsql/lib/postgis-1.5.so Expected in: /opt/local/lib/postgresql83/bin/postgres in /usr/local/pgsql/lib/postgis1.5.so Any ideas what might have been messed up?

    Read the article

  • can't jQuery 3d party dialog to do what i want :)

    - by ropstah
    i'm using NyroModal, a 3rd party jQuery based dialog script. According to these settings, I should be able to do this: $.nyroModalManual({ type : 'ajax', url : '/url', 'ajax' : { url : '/url', data : 'somedata=1' } }); However I receive an error "$.ajax() is not defined". How could this be? p.s. If I run console.debug($.ajax()) right before the nyroModalManual part, it shows the XMLHTTPObject nicely, so I'm probably doing something wrong in the settings... I just need to be able to pass data.

    Read the article

  • Are there any tools to help the user to design a State Machine to be consumed by my application?

    - by kolrie
    When reading this question I remembered there was something I have been researching for a while now and I though Stackoverflow could be of help. I have created a framework that handles applications as state machines. Currently all the state business logic and transactions are handled via Java code. I was looking for some UI implementation that would allow the user to draw the state machines and transactions and generate a file that can later on be consumed by my framework to "run" the workflow according to one or more defined state machines. Ideally I would like to use an open standard like SCXML. The goal as the UI would be to have something like this plugin IBM have for Rational Software Architect: Do you know any editor, plugin or library that would have something similar or at least serve as a good starting point?

    Read the article

  • how to specify set of files to be copied in lib while creating war

    - by Jigar Shah
    This is my build target <target name="build-war" depends="build-java"> <war destfile="${dist.dir}/${std.war.file}" webxml="${resources.dir}/WEB-INF/web.xml"> <fileset dir="${jsp.dir}" /> <lib dir="${lib.dir}"/> <classes dir="${build.classes.dir}" /> </war> </target> Here for <lib> can i specify some how a fileset / pattern set ? Basically i want to copy different jar from different places. (Not in one directlry) And That fileset or patternset i want to be defined in another build file which actually imports this build file. <lib refid="${patternset.id}"/>

    Read the article

  • Prototypes Object.extend with multiple objects that contain there own functions.

    - by erickreutz
    How would I achieve something along the lines of this.. var Persistence = new Lawnchair('name'); Object.extend(Lawnchair.prototype, { UserDefaults: { setup: function(callback) { // "save" is a native Lawnchair function that doesnt //work because // "this" does not reference "Lawnchair" // but if I am one level up it does. Say if I defined // a function called UserDefaults_setup() it would work // but UserDefaults.setup does not work. this.save({key: 'key', value: 'value'}); // What is this functions scope? // How do I access Lawnchairs "this" } }, Schedule: { refresh: function(callback) { } } }); //this get called but doesnt work. Persistence.UserDefaults.setup();

    Read the article

  • Ambiguous Generic restriction T:class vs T:struct

    - by Maslow
    This code generates a compiler error that the member is already defined with the same parameter types. private T GetProperty<T>(Func<Settings, T> GetFunc) where T:class { try { return GetFunc(Properties.Settings.Default); } catch (Exception exception) { SettingReadException(this,exception); return null; } } private TNullable? GetProperty<TNullable>(Func<Settings, TNullable> GetFunc) where TNullable : struct { try { return GetFunc(Properties.Settings.Default); } catch (Exception ex) { SettingReadException(this, ex); return new Nullable<TNullable>(); } } Is there a clean work around?

    Read the article

  • xcode syntax color coding explained?

    - by Max Fraser
    Can anyone give me a quick rundown of the color syntax meanings in xcode? I am running into some problems and understanding the color coding I am sure will help me out. Currently I have some variables that are light blue and I think they need to be black but I am not sure of the difference? masterViewController=[[UINavigationController alloc] initWithDestination: destination]; I believe my masterViewController here should be colored black and not the light blue it is currently colored - I am assuming I defined or initialized something wrong somewhere. First day in xCode so I am pretty damn confused!

    Read the article

  • Does C99 guarantee that arrays are contiguous ?

    - by kriss
    Following an hot comment thread in another question, I came to debate of what is and what is not defined in C99 standard about C arrays. Basically when I define a 2D array like int a[5][5], does the standard C99 garantee or not that it will be a contiguous block of ints, can I cast it to (int *)a and be sure I will have a valid 1D array of 25 ints. As I understand the standard the above property is implicit in the sizeof definition and in pointer arithmetic, but others seems to disagree and says casting to (int*) the above structure give an undefined behavior (even if they agree that all existing implementations actually allocate contiguous values). More specifically, if we think an implementation that would instrument arrays to check array boundaries for all dimensions and return some kind of error when accessing 1D array, or does not give correct access to elements above 1st row. Could such implementation be standard compilant ? And in this case what parts of the C99 standard are relevant.

    Read the article

  • Why doesn't javascript function aliasing work?

    - by codeninja
    I have some Firebug console function calls that I wanted to disable when Firebug wasn't enabled, e.g. console isn't defined. This works fine in IE6 and FF3, but not in Chrome: var log; if(console){ log = console.log; }else{ log = function(){ return; } } I get an "Uncaught TypeError: Illegal Invocation" in Chrome =/ I read about the issue here, where you have to apply a context, which is kind of new to me... and I can't seem to figure how to accomplish the above in all browsers...

    Read the article

  • How to enable Automatic Sorting of IEnumerable Data in GridView?

    - by ace
    How can I enable automatic sorting of my BLL which returns a List CustomerList:List in a GridView? Customer is my own strongly typed class and CustomerList is a List of customers. I know one approach is to set the AllowSorting property to true in the GridView and handle the OnSorting event and call a sorting method defined in my CustomerList class. However I would like a solution which is automatic in the sense that I do not have to handle the OnSorting Event, it should be like how GridView handles automatic sorting for DataView, DataTable, and DataSet. Is there an Interface I need to implement on my CustomerList or Customer class that will enable that functionality?

    Read the article

  • Calculating co-ordinate of a point on a path given a distance

    - by Alex
    I'm working on a project that surveys the condition of a road or highway using a calibrated trip computer connected to a rugged-PC. An operator keys in defect codes as they travel along a pre-defined route. I need to show an indicator on the map screen that shows the vehicles current position, taking into account the distance data from the trip computer. I know the exact lat lon co-ordinates at the starting point of each section of road, and the road is made up of a series of points. The question is: how can I calculate the lat lon co-ordinates of the vehicle assuming that it has continued on the route and traveled a certain distance (e.g. 1.4km). The co-ordinates would be 'locked onto' the road line, as shown in blue on the diagram below. Thanks, Alex

    Read the article

  • How can I get mounted name and (Drive letter too) on Windows using python

    - by aberry
    I am using Daemon tool to mount an ISO image on Windows XP machine.I do mount using Daemon command (daemon.exe -mount 0,). Above command will mount ISO image to device number. In my case I have 4 partition (C,D,E,F) and G for DVD/CD-RW. Now what happen, ISO gets mounted to drive letter 'H:' with name (as defined while creating ISO) say 'testmount' My queries:- 1) How can I get mount name of mounted ISO image (i.e. 'testmount'). Just another case; if there are already some mount points existing on machine and I created a new one using Daemon tool. Then If I can get latest one using script that will be great. 2) How to get drive letter where it did get mounted. If anyone know python script or command (or even Win command ) to get these info. do let me know. Thanks...

    Read the article

  • Do I always have to supply Tkx's -command argument with an anonymous subroutine?

    - by Zaid
    I find it a bit weird that I have to wrap defined subroutines anonymously when specifying the -command argument for Tkx widgets. The example from TkDocs demonstrates this: my $cb = $frm->new_ttk__button ( -text => "Calculate", -command => sub {calculate();} ); sub calculate { $meters = int(0.3048*$feet*10000.0+.5)/10000.0 || ''; } Why doesn't it work when I write -command => &calculate() or -command => \&calculate()?

    Read the article

  • Unexpected generics behaviour

    - by pronicles
    I found strange generics behaviour. In two words - thing I realy want is to use ComplexObject1 in most general way, and the thing I realy missed is why defined generic type(... extends BuisnessObject) is lost. The discuss thread is also awailable in my blog http://pronicles.blogspot.com/2010/03/unexpected-generics-behaviour.html. public class Test { public interface EntityObject {} public interface SomeInterface {} public class BasicEntity implements EntityObject {} public interface BuisnessObject<E extends EntityObject> { E getEntity(); } public interface ComplexObject1<V extends SomeInterface> extends BusinessObject<BasicEntity> {} public interface ComplexObject2 extends BuisnessObject<BasicEntity> {} public void test(){ ComplexObject1 complexObject1 = null; ComplexObject2 complexObject2 = null; EntityObject entityObject1 = complexObject1.getEntity(); //BasicEntity entityObject1 = complexObject1.getEntity(); wtf incompatible types!!!! BasicEntity basicEntity = complexObject2.getEntity(); } }

    Read the article

< Previous Page | 159 160 161 162 163 164 165 166 167 168 169 170  | Next Page >