Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 228/433 | < Previous Page | 224 225 226 227 228 229 230 231 232 233 234 235  | Next Page >

  • How to pickle and unpickle objects with self-references and from a class with slots?

    - by EOL
    Is it possible to pickle an object from a class with slots, when this object references itself through one of its attributes? Here is a simple example: import weakref import pickle class my_class(object): __slots__ = ('an_int', 'ref_to_self', '__weakref__') def __init__(self): self.an_int = 42 self.ref_to_self = weakref.WeakKeyDictionary({self: 1}) # __getstate__ and __setstate__ not defined: how should this be done? if __name__ == '__main__': obj = my_class() # How to make the following work? obj_pickled = pickle.dumps(obj) obj_unpickled = pickle.loads(obj_pickled) # Self-references should be kept: print "OK?", obj_unpickled == obj_unpickled.ref_to_self.keys()[0]

    Read the article

  • Align contents of a div in the center

    - by Jim
    I have a div with width:100%; since I want to fill out the parent container. I also want to have the contents of the div in its center. I can not find a horizontal-align:center attribute for the divs. How can I configure the div so that its contents are in the center? I.e if the div is this big: ------------------------------------------------------------------------------------------------------------ Enclosing tags here in the center ------------------------------------------------------------------------------------------------------------

    Read the article

  • call a python function in another class from a class?

    - by user3527697
    hi i'am begginer in pYthon and openerp , i want to call a function exists in another class for example: i have 2 class : class a: def notif_personne_event(self, cr, uid,ids,context=None): and import a class b: notifier(self, cr, uid,ids,context=None): self.notifiernotif_personne_event() but when i do this an error is displayed telling me that class b have not an attribute notifiernotif_personne_event() someone help me please

    Read the article

  • C struct memory layout?

    - by Eonil
    I have C# background. Very newbie to low level language like C. In C#, memory layout by compiler by default, and I have to specify some special attribute to override this behavior for exact layout. As I know, C does not re-align by default. But I heard there's a little re-aligning behavior which very hard to find. Can I know about C's memory layout behavior? (what should be re-aligned and not)

    Read the article

  • Django admin - remove field if editing an object

    - by John McCollum
    I have a model which is accessible through the Django admin area, something like the following: # model class Foo(models.Model): field_a = models.CharField(max_length=100) field_b = models.CharField(max_length=100) # admin.py class FooAdmin(admin.ModelAdmin): pass Let's say that I want to show field_a and field_b if the user is adding an object, but only field_a if the user is editing an object. Is there a simple way to do this, perhaps using the fields attribute? If if comes to it, I could hack a JavaScript solution, but it doesn't feel right to do that at all!

    Read the article

  • windows keydown listeners in C

    - by numerical25
    I am having a very hard time finding resources that talk about the windows message system. Mainly the keydown constant variables. I need to know what const varibles I need to listen for all keypress especially the arrow keys for C

    Read the article

  • Draw points in a view on iPhone screen?

    - by micropsari
    Hello, in my class I have an attribute IBOutlet UIImageView *imageView; And if I want to draw an image in this view I do : imageView.image = [UIImage imageNamed:@"foo.png"]; But how can I do to draw some points with coordinate x, y (in pixel) directly in the view ? Thanks !

    Read the article

  • How to enable a linkbutton server control using javascript?

    - by satyaj
    I have a linkbutton server control in my page whose Enabled attribute is initially set to "false". When a text box's text changes I would like to enable the linkbutton. I tried the following but it does not work. Could you let me know if i am missing something. function TextBox_TextChanged() { var control = $get("<%= linkButtonSave.ClientID%>"); if(control != null) control.enabled = true; } Thanks

    Read the article

  • How to Limit Text Characters in PHP?

    - by hateMe
    I was wondering how can I limit a users input like HTML maxlength attribute but with PHP, example would be nice? Is MySQL varchar(255) one way to limit a users character input? What are the cons of just counting on MySQL to do this?

    Read the article

  • Is there a pure HTML5 emacs mode?

    - by Marcelo Santos
    Question http://stackoverflow.com/questions/1082474/authoring-html5-in-emacs talks about nxml-mode but, from what I read, that can only be used for XHTML5, I want to use emacs with HTML5 (no XML syntax). Is there any mode with auto-indentation, tag/attribute completion, etc.?

    Read the article

  • ASP.NET - How to edit 'bit' data type?

    - by Peter
    I am coding in Visual Basic. I am using a checkbox control. Now depending on its checked property I need to set/unset a bit column in a SQL Server database. Here's the code: Try conSQL.Open() Dim cmd As New SqlCommand("update Student set send_mail = " + _ sendemailCheckBox.Checked.ToString + " where student_id = '" _ + sidnolabel.Text + "'", conSQL) cmd.ExecuteNonQuery() Finally conSQL.Close() End Try The send_mail attribute is of bit datatype. This code is not working. How do I go about it?

    Read the article

  • Reversed Sorted Dictionary?

    - by Mark
    I have a SortedDictionary as defined like this: SortedDictionary<TPriority, Queue<TValue>> dict; But I want to sort the keys in reverse order. I assume I need set the Comparer, but what comparer do I use for a generic TPriority? Note that TPriority implements IComparable.

    Read the article

  • What language is this?

    - by Blue
    got some keys with patterns like 4AC59BAA63A64327DCE12C0B2CD1A397 and B9E685495FECFC9854E7DBA508D91213 they have 32 chars and i would like not to decrypt then but to be able to make my own, its something like a hash of a file

    Read the article

  • Google App Engine: Update model definitons?

    - by Rosarch
    I recently updated one of my models by adding a db.ListProperty(): class DependencyArcTail(db.Model): courses = db.ListProperty(db.Key) ''' newly added ''' forwardLinks = db.ListProperty(db.Key) However, I can't seem to get this to be reflected in the SDK dashboard. I cleared the datastore and reloaded it. Then I ran the procedures that create the DependencyArcTail objects. However, forwardLinks still doesn't show up as an attribute in the SDK dashboard. What's happening?

    Read the article

  • replace commas with spaces from json array

    - by Alex
    I have a looping function creating: <li id="id1" name="Tag1,Tag2,Tag3"> <li id="id2" name="Tag1,Tag2,Tag3"> $.each(data.posts, function(i, post){ $('<li >', {id: this.id , name: post.tags}) }); How do I replace the commas between the tags with spaces. Also is there a way I can send the tags to a "class" attribute instead of "name". It seems to not work in Safari.

    Read the article

  • Python new-style classes and __subclasses__ function

    - by Fraser Graham
    Can somebody explain to me why this works (in Python 2.5) : class Foo(object): pass class Bar(Foo): pass print(Foo.__subclasses__()) but this doesn't : class Foo(): pass class Bar(Foo): pass print(Foo.__subclasses__()) The latter returns "AttributeError: class Foo has no attribute '__subclasses__'" but i'm not sure why. I know this is related to old-style vs. new-style classes but i'm not clear on why that would make this functionality unavailable.

    Read the article

  • red5: how can i extend ISharedObject ?

    - by ufk
    Hiya. Red5 uses ISharedObject interface to create shared objects and to operate them. because ISharedObject is an interface I'm having issues extending it. I would like to extend the getAttribute, setAttribute, get{Int/String/Map}Attribute so the values will be checked before entered or pulled out. how is it possible to do so ? thanks

    Read the article

  • export gridview data

    - by Eric
    What is the best way to export a gridview into an Excel spreadsheet? This seems easy except that my Gridview doesn't have an export attribute. What is the quickest way to do this?

    Read the article

< Previous Page | 224 225 226 227 228 229 230 231 232 233 234 235  | Next Page >