Search Results

Search found 13249 results on 530 pages for 'field guy'.

Page 3/530 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Variable for the field name of mysql row result

    - by ana
    I'm retrieving a row with php from mysql and it has fields like: name_en, name_es, name_de... I want to retrieve the right field base on my $lang variable (en, es, de...). If the $lang variable is 'es', I'd need to get $row['name_es']. I've tried this (based on this thread), but it's not working: $name = $row->{'name_'.$lang}; Any idea how can I use a variable as the name of the field of a row? Thanks in advance for your help!

    Read the article

  • How to access a field's value in an object using reflection

    - by kentcdodds
    My Question: How to overcome an IllegalAccessException to access the value of a an object's field using reflection. Expansion: I'm trying to learn about reflection to make some of my projects more generic. I'm running into an IllegalAccessException when trying to call field.getValue(object) to get the value of that field in that object. I can get the name and type just fine. If I change the declaration from private to public then this works fine. But in an effort to follow the "rules" of encapsulation I don't want to do this. Any help would be greatly appreciated! Thanks! My Code: package main; import java.lang.reflect.Field; public class Tester { public static void main(String args[]) throws Exception { new Tester().reflectionTest(); } public void reflectionTest() throws Exception { Person person = new Person("John Doe", "555-123-4567", "Rover"); Field[] fields = person.getClass().getDeclaredFields(); for (Field field : fields) { System.out.println("Field Name: " + field.getName()); System.out.println("Field Type: " + field.getType()); System.out.println("Field Value: " + field.get(person)); //The line above throws: Exception in thread "main" java.lang.IllegalAccessException: Class main.Tester can not access a member of class main.Tester$Person with modifiers "private final" } } public class Person { private final String name; private final String phoneNumber; private final String dogsName; public Person(String name, String phoneNumber, String dogsName) { this.name = name; this.phoneNumber = phoneNumber; this.dogsName = dogsName; } } } The Output: run: Field Name: name Field Type: class java.lang.String Exception in thread "main" java.lang.IllegalAccessException: Class main.Tester can not access a member of class main.Tester$Person with modifiers "private final" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:95) at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:261) at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:253) at java.lang.reflect.Field.doSecurityCheck(Field.java:983) at java.lang.reflect.Field.getFieldAccessor(Field.java:927) at java.lang.reflect.Field.get(Field.java:372) at main.Tester.reflectionTest(Tester.java:17) at main.Tester.main(Tester.java:8) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)

    Read the article

  • What is @namespace field in C# class?

    - by MainMa
    Hi, I'm browsing the source code of StyleCop, and I found a curious thing: /// <summary> /// The namespace that the rule is contained within. /// </summary> private string @namespace; // [...] internal Rule(string name, string @namespace, string checkId, string context, bool warning) : this(name, @namespace, checkId, context, warning, string.Empty, null, true, false) { Param.Ignore(name, @namespace, checkId, context, warning); } What is this thing? Is it just a simple field where at-sign is used to indicate that it is a field, and not a namespace keyword? If so, may at-sign be used for any reserved word (for example @dynamic, @using, etc.)?

    Read the article

  • Can't search in a certain field using solR

    - by intrance
    Hi, I'm setting up an environment using Nutch 1.0 + solR 1.4. In Nutch I configured the subcollection plugin which seems to work nicely. If I search as normal adding fl=* I can see the subcollection field is filled as intented. (something like <str name="subcollection">mysite.com</str>). My problem is, I would like to be able to search only in one or more given subcollections, but whenever my searchquery is something like q=subcollection:mysite.com it won't work. I've also tried to add a fl=* or searched in mysite* instead but I never get any results. Obviously solR "knows" the subcollection field, as it doesn't result with an error but simply whith an empty result. I'd be glad for any help

    Read the article

  • JPA generic field

    - by m.ugues
    Hallo all Is it possible to persist a generic field? I have this property on an Entity class ... private T payload; ... T extends EventMessagePayload and public interface StringPayload extends EventMessagePayload{ String getPayload(); } In my application i persist the field only when is of String type and during the save operation all works great. When I read the object instead JPA try to create a String object but instead is a StringPaylod. Is there a way to intercept the creation and handle the object marshalling? Kind regards Massimo

    Read the article

  • How to detect hidden field tampering?

    - by Myron
    On a form of my web app, I've got a hidden field that I need to protect from tampering for security reasons. I'm trying to come up with a solution whereby I can detect if the value of the hidden field has been changed, and react appropriately (i.e. with a generic "Something went wrong, please try again" error message). The solution should be secure enough that brute force attacks are infeasible. I've got a basic solution that I think will work, but I'm not security expert and I may be totally missing something here. My idea is to render two hidden inputs: one named "important_value", containing the value I need to protect, and one named "important_value_hash" containing the SHA hash of the important value concatenated with a constant long random string (i.e. the same string will be used every time). When the form is submitted, the server will re-compute the SHA hash, and compare against the submitted value of important_value_hash. If they are not the same, the important_value has been tampered with. I could also concatenate additional values with the SHA's input string (maybe the user's IP address?), but I don't know if that really gains me anything. Will this be secure? Anyone have any insight into how it might be broken, and what could/should be done to improve it? Thanks!

    Read the article

  • django hidden field error

    - by dana
    hi, there, i'm building a message system for a virtual community, but i can't take the userprofile id i have in views.py def save_message(request): if request.method == 'POST': form = MessageForm(request.POST) if form.is_valid(): new_obj = form.save(commit=False) new_obj.sender = request.user u = UserProfile.objects.get(request.POST['userprofile_id']) new_obj.owner = u new_obj.save() return HttpResponseRedirect('.') else: form = MessageForm() return render_to_response('messages/messages.html', { 'form': form, }, context_instance=RequestContext(request)) and the template: {% block primary %} <form action="." method="post"> {{ form.as_p }} <p><input type="hidden" value="{{ userprofile.id }}" name = "owner" /></p> <p><input type="submit" value="Send Message!" /></p> </form> {% endblock %} forms.py: class MessageForm(ModelForm): class Meta: model = Messages fields = ['message'] models.py: class Messages(models.Model): message = models.CharField(max_length = 300) read = models.BooleanField(default=False) owner = models.ForeignKey(UserProfile) sender = models.ForeignKey(User) I don't figure out why i get this error,since i'm just trying to get the profileId of a user, using a hiddeen field. the error is: Key 'UserProfile_id' not found in <QueryDict: {u'owner': [u''], u'message': [u'fdghjkl']}> and i'm getting it after i fill out the message text field. Thanks!

    Read the article

  • Delete field using curl in couchdb

    - by 2x2p1p
    Hi guys. I searched and didn't found, can I delete a field of a couchdb's document using curl ? The most I can do is delete a document :( curl -X DELETE http://localhost:5984/users/jack?rev=1-cee2abbbe4afefa9b3b5db10260c0c94 Thanks.

    Read the article

  • same table, 1 field to 2 field query

    - by edib
    I have 2 tables: 1st holds employees (of ones in any position) and the 2nd holds manager employee relations with id numbers. I want to write a query like 1st field: name(employee), 2nd field: name(manager) How can I do that?

    Read the article

  • make field a dropdown in access 2007

    - by Crash893
    I'm creating a HR database in access 2007 I have a main table of employee info and several tables that relate to that table ( education for example) that list the acceptable elements that can populate that cell in that row When i create a form it was created as just a plain text field which is constrained but I wanted to create a dropdown that had just the data that they are allowed to enter to avoid confusion.

    Read the article

  • MySQL : Selecting alternative field if given field is empty

    - by Kyobul
    Hi, I wonder if is it possible to run mysql command which can select an alternative field if the first given field is empty, on the same table. Example : I have table called "posts" which have "intro" and "content". In the same statement I would like to select as a result "content" if "intro" is empty, but not having both in the result array. Thanks in advance

    Read the article

  • Identify Field Control properties Dynamically

    - by Pravin Kumar
    I have an app in which the user's actions such as "minimizing a window","closing a window","clicking a button" ... has to be captured. And those Field Controls ( like buttons, close icon , minimise icon ... ) can be in any application and have to be dynamically identified Is there a way to do this in C# ??? Any useful pointers are much appreciated. Thanks,

    Read the article

  • drupal how to show custom profile field

    - by Arun
    i added a profile field to registration form. how to show in edit registration (account) form . i wrote a module for edit account in that $form [function editregistration_form_user_profile_form_alter(&$form, &$form_state) ] doesn't contain the values of custom profile fields.

    Read the article

  • remove specific field after clicking back in browser or using history.go(-1)

    - by Y.G.J
    i have a form with a capacha, if the capacha was entered wrong, after submit the page is doing a "history.go(-1)" and all fields include the capacha input are back on the screen right now i have a js that clear that - but now that i need it in several places, i want to know if it possible to clear a form field after back with something related to the html form or what ever thanks

    Read the article

  • Creating tooltips for each field in Sharepoint form.

    - by ephieste
    I want to create tool tips for each part in a form which employees have to fill in a share point web page. When users move the mouse cursor on each field (Title, description, department etc.) the related tip will be automatically became visible as a simple pop-up (tool tip) and summarize what they should write there. and when the mouse cursor is not on one of these fields there is no tool tip. How can I design such a system via share point designer? I am not able use any add ons. I can't upload any additional things to the server. I have to make page based design. I would be glad if you kindly help me.

    Read the article

  • MS Word Macro - Numeric field insertion with automatic calculation at end of page

    - by Will
    Hi, I am trying to duplicate a feature that exists in Multimate (Ashton Tate) word processor. Yes, the one that hasnt been supported for 20 years! If I can duplicate this one feature I can get all the users off MM and onto Word. The documents they create are billing documents. they consist of a descriptive paragraph of any length on the left side of the page, and a billing amount at the end of the paragraph over on the right hand side, like this (excuse the imperfect formatting).... +-----------------whole page--------------------+ |                                                                    | |    pppp-para 1-pppppppppp                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    pppppppppppppppppppp      $$$$$  | |                                                                    |  |                                                                    |  |    pppp-para 2-pppppppppp                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    p                                         p                   | |    pppppppppppppppppppp      $$$$$  | |                                                                    |  |                                                                    |  |                             etc                                  | +-----------------------------------------------------+ some of these bills can be a few hundred pages and have a dozen or so paragraphs on each page, which is why none of the users will leave MM until this efficient little feature can be duplicated. The thing that MM does really easily is that there is a function key that they can press at any time that will - - jump the cursor from the paragraph they are writing over to the right hand side - create a numeric field - allow them to enter a number into the numeric field - return them to the left hand side to start a new paragraph What MM also does is automatically total the numeric fields on each page and create a subtotal in the page footer. it also creates a total for the entire document and puts this in the footer of the last page. I would like to duplicate this feature in word with a macro, but have no idea where to start. Any suggestions or code would be great, thanks, will.

    Read the article

  • Jquery Hidden Field in Table

    - by zSysop
    Hi all, I was wondering if anyone knew of a way to access a hidden field (by client id) within a table row using jquery. $("#tblOne").find("tr").click(function() { var worker = $(this).find(":input").val(); }); I find that the above works for a row that has only one input, but i need some help figuring out a way to get the value by the inputs name. Here's the example of a table row. How would i access the two fields by their id's? <table id="tblOne"> <tr> <td> <asp:HiddenField id="hdnfld_Id" Text='<% Eval("ID") %>'></asp:HiddenField> </td> <td> <asp:HiddenField id="hdnfld_Id2" Text='<% Eval("ID2") %>'></asp:HiddenField> </td> </tr> </table>

    Read the article

  • Django automatically compress Model Field on save() and decompress when field is accessed

    - by Brian M. Hunt
    Given a Django model likeso: from django.db import models class MyModel(models.Model): textfield = models.TextField() How can one automatically compress textfield (e.g. with zlib) on save() and decompress it when the property textfield is accessed (i.e. not on load), with a workflow like this: m = MyModel() textfield = "Hello, world, how are you?" m.save() # compress textfield on save m.textfield # no decompression id = m.id() m = MyModel.get(pk=id) # textfield still compressed m.textfield # textfield decompressed I'd be inclined to think that you would overload MyModel.save, but I don't know the pattern for in-place modification of the element when saving. I also don't know the best way in Django to decompress when the field when it's accessed (overload __getattr__?). Or would a better way to do this be to have a custom field type? I'm certain I've seen an example of almost exactly this, but alas I've not been able to find it recently. Thank you for reading – and for any input you may be able to provide.

    Read the article

  • How to get common field in ten tables with different field name

    - by Fero
    Hi all, I am having a common field in ten tables with different field name. example: table1: t1_id     t1_location 1         india 2         china 3         america table2: t2_id     t2_location 4         london 5         australia 6         america Now my o/p should be: location india china america london australia How should i get that using mysql query. thanks in advance

    Read the article

  • How can i bind a Database field value to a hidden field inside a gridview

    - by Dorababu
    I use the following to bind a field from the table to a hidden field inside a gridview but i am getting the error as System.Data.DataRowView' does not contain a property with the name 'AccountType'. This is how i assigned <asp:TemplateField> <ItemTemplate> <asp:HiddenField ID="hdnAccntType" runat="Server" Value='<%#Eval("AccountType") %>' /> </ItemTemplate> </asp:TemplateField> Is it correct or i have to make any corrections

    Read the article

  • Idiomatic Scala way to deal with base vs derived class field names?

    - by Gregor Scheidt
    Consider the following base and derived classes in Scala: abstract class Base( val x : String ) final class Derived( x : String ) extends Base( "Base's " + x ) { override def toString = x } Here, the identifier 'x' of the Derived class parameter overrides the field of the Base class, so invoking toString like this: println( new Derived( "string" ).toString ) returns the Derived value and gives the result "string". So a reference to the 'x' parameter prompts the compiler to automatically generate a field on Derived, which is served up in the call to toString. This is very convenient usually, but leads to a replication of the field (I'm now storing the field on both Base and Derived), which may be undesirable. To avoid this replication, I can rename the Derived class parameter from 'x' to something else, like '_x': abstract class Base( val x : String ) final class Derived( _x : String ) extends Base( "Base's " + _x ) { override def toString = x } Now a call to toString returns "Base's string", which is what I want. Unfortunately, the code now looks somewhat ugly, and using named parameters to initialize the class also becomes less elegant: new Derived( _x = "string" ) There is also a risk of forgetting to give the derived classes' initialization parameters different names and inadvertently referring to the wrong field (undesirable since the Base class might actually hold a different value). Is there a better way? Edit: To clarify, I really only want the Base values; the Derived ones just seem necessary for initializing the Base ones. The example only references them to illustrate the ensuing issues. It might be nice to have a way to suppress automatic field generation if the derived class would otherwise end up hiding a base class field.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >