field

Why do we need static private array to initialize other non static private array fields?

If you take a look inside Stack<T> class from .NET 4.0, you will notice that there is an "emptyArray" private static field which is used inside constructors to initialize a real "array" private field. private T[] array; private static T[] emptyArray; private int size; private int version; static Stack() { Stack<T>.emptyArray = new ...

custom field template... file upload problem

Hi Gyus, I am facing problems with custom field template. it is not uploading the custom image file to the latest path, and tries to fetch from the path it stores in db. which is wp-content/uploads/2010/06/ but it doesnt upload the file here. any help, thanks in advanced. Regards, Farrukh ...

django not taking in consideration model fields declared in __init__

Hi, When using Model class like this: class MyModel(models.Model): def __init__(self, *args, **kwargs): self.myfield = models.Field() super(MyModel, self).__init__(*args, **kwargs) It doesn't take into consideration myfield(in the admin form, when saving the object... ) But if i declare like that: class MyModel(m...

How to query wordpress posts by custom field

I am attempting to have lots of posts in a specific category. The post will have a custom field that will be a date. I need the posts to be organized by the category, the custom field, and each page of posts should be separated by month of the custom field. So hard to explain... Page of posts for the current month. Links at the bottom f...

Bring field content from "parent" node to "child" node in Drupal

What I need to do is bring data from a field in a "parent" node to a "child" node. Something like the following: $myactive_trail = menu_get_active_trail(); $parent = $myactive_trail['2']['link_path']; print $parent->field_video['0']['filepath']; I know that there is not such thing as a parent not hence me trying to use menu_get_active...

[Fun riddle] Any clue on this error with generic relation using Django Orm?

This is a fun one :-) Working on an EAV, we inject a generic relationship handler at runtime in a model. model_cls is any class, and a EavValue class have a generic relation pointing to it. It works fine from EavValues to a model_cls, but on the other way we need to inject an accessor to ease things: generic_relation = generic.Generic...

How to loop on field names of a class

I have got a class which contains more then 150 fields. i need the name of fields (not value) in an array. because its very hard and not a good approach to write 150 fields name (which can be incremented or decremented in count according to requirement change) manually in code. i need help to get loop through names for field or get lis...

Conditional Random Fields -- How Do They Work?

I've read the papers linked to in this question. I half get it. Can someone help me figure out how to implement it? I assume that features are generated by some heuristic. Using a POS-tagger as an example; Maybe looking at training data shows that 'bird' is tagged with NOUN in all cases, so feature f1(z_(n-1),z_n,X,n) is generated as (...

Find all Lucene documents having a certain field

I want to find all documents in the index that have a certain field, regardless of the field's value. If at all possible using the query language, not the API. Is there a way? ...

Auto Generate Field Names from table PHP

Hi There! There is a problem of automatically retrieving field names from a MySQL table. If possible could the name be placed in this format along with the dynamically created text box? : The codes that I have created so far are located below: <?php include "db_connect.php"; $name = mysql_query("SELECT * from users"); $property = m...

SugarCRM 6 - Create an email address-like field to a module

I need to create an email-like field in SugarCRM i.e. one primary value and the ability to add more values dynamically. Anyone who has worked with SugarCRM will know what I'm talking about. Has anyone done anything similar to this? Any help would be appreciated. ...

Grant CCK Field edit rights to a user referenced from User Reference; Drupal

In Drupal I am trying to create a content node where the original author can upload an image and then 'challenge' another user to upload an image into that node as well. I can already grant the 2nd user access rights through CCK > User Reference > Node Access User Reference but I don't want that new user to be able to edit the whole node...

Where's the Encapsulation?

I'm a new programmer, so please forgive any dumbness of this question but can anyone please tell me how the folowing code is encapsulating private data- public class SomeClass { private int age; public int Age { get { return age; } set { age = value; } } public SomeClass(int age) { this....

How can I update a single field from an entity with Entity Framework?

I need to load an object from the database, modify some of its fields and relations, and then I want to store a new value for only one field, without modifying the rest. It would look something like this: var thing = db.Things.First(); thing.Field1 = "asdas"; thing.Field2 = 23; thing.OtherThings.Add(new OtherThing()); thing.FieldToUpd...

What are the common "backing field" naming schemes in .net?

When doing a backing field for a property what are the common naming schemes? Edit: make question specific to .net ...

how to arrange horizontal field manager at bottom of the screen? blackberry?

i want to put a menu at the bottom of the blackberry, menu items added to horizontal field manager... how to place the menu at the bottom of the screen... ...

Custom duration field on blackberry

Does anyone have a duration field they have created for Blackberry? The field needs to allow the user to select days, hours, minutes; needs to build in OS 4.5 and support touch interface manipulation (on the Storms). ...

How can I dynamically access a field of a field of a structure in MATLAB?

I'm interested in the general problem of accessing a field which may be buried an arbitrary number of levels deep in a containing structure. A concrete example using two levels is below. Say I have a structure toplevel, which I define from the MATLAB command line with the following: midlevel.bottomlevel = 'foo'; toplevel.midlevel = mi...

Drupal location CCK field does not save.

Hi! I have installed Location, GMAP, GMAP Location and Location CCK modules. I needed Location CCK because I could not force ordinary location to show in specific field group. It looks like it is attached statically to the main group (I have defined field groups as a tabs and do not want to show location information on the main tab). A...

blackberry layout change height of field

I have a custom field I have created that loads images from a url. What I would like to do is have the field take up no space and then when the image is loaded resize itself to the size of the image. I have almost everything done but I can't work out a way to get the layout to be re done after the image is loaded. It works if I specify t...