Search Results

Search found 35561 results on 1423 pages for 'value'.

Page 73/1423 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Jlabel with alpha value

    - by jouzef19
    Hi: i have jLabel and i want to change its opacity (alpha value) each one second , i tried something like that but its not change each one second , jlable change its opacity with last alpha value . Color color = jLabel1.getBackground(); int alpha = 255; long initTime = System.currentTimeMillis(); while(true){ if(System.currentTimeMillis() - initTime >= 1000){ initTime = System.currentTimeMillis(); alpha -=1; Color color2 = new Color(color.getRed(),color.getGreen(),color.getBlue(),alpha); jLabel1.setBackground(color2); } if(alpha<=0) break; }

    Read the article

  • how subsonic SP should return a value

    - by android.sm
    Hi all, I'm very much new to SubSonic and need a little guidance. Here, I want to know how my SP should return a value. Currently, when I execute it I simply pass an Int and it returns me a string value. Here is code: SubSonic SP: public static StoredProcedure GetQuote(int? CategoryId) { StoredProcedure sp = new StoredProcedure("GetQuote", DataService.GetInstance("Quotes Provider"), "dbo"); sp.Command.AddParameter("@CategoryId", CategoryId, DbType.Int32, 0, 10); return sp; } My Code: public bool GetQuote(int category, out string quote) { bool val = false; quote = ""; try { StoredProcedure sp = SPs.GetQuote(category); if (sp != null) { sp.Execute(); val = true; } } catch (Exception err) { throw err; } return val; } Thanks all

    Read the article

  • Double value not correct on Device

    - by Clue
    int min = Int32.Parse(minutebox.Text); double kj = Convert.ToDouble(a.kj); double res = ((kj * op.koerpergewicht) * min); textbox.Text = res.ToString(); Shows me the correct number (with its punctuation - i. e. 2.33) on my English WP7-Emulator. However it doesn't work on my Device, which is set to German. The value is correct but the point, comma or whatever in that double value isn't shown correct. 43.22 on Emulator - 4322 on Device Why is that?

    Read the article

  • Identifying which value of a multi-row inserts fails foreign key constraint

    - by Jonathan
    I have a multi-row insert that looks something like: insert into table VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9); Assume the first attribute (1, 4, 7) is a foreign key to another table and assume that this referenced table does not have the value '4'. A MySQLExeption is thrown with error code 1452. EXCEPTION: Cannot add or update a child row: a foreign key constraint fails (dbName/tableName, CONSTRAINT id FOREIGN KEY (customer_id) REFERENCES referencedTable (customer_id)) Is there a way to identify which value caused the error? I would love to give my user an error message that said something like: Error: '4' does not exist in the referenced table. I am using the .NET mysql connector to execute the insert. Thanks- Jonathan

    Read the article

  • cc1plus: error: include: Value too large for defined data type when compiling with g++

    - by Android
    I am making a project that should compile on Windows and Linux. I have made the project in Visual Studio and then made a makefile for linux. I created all the files in Windows with VS. It compiles and runs perfectly in VS but when I run the makefile and it runs g++ I get $ g++ -c -I include -o obj/Linux_x86/Server.obj src/Server.cpp cc1plus: error: include: Value too large for defined data type cc1plus: error: src/Server.cpp: Value too large for defined data type The code is nothing more than a Hello World atm. I just wanted to make sure that everything was working before I started development. I have tried searching but to no avail. Any help would be appreciated.

    Read the article

  • Sum value of XML attributes using PowerShell 2.0

    - by Yooakim
    I have a directory with XML files. I quickly want to go through them and sum upp the value stored in one attribute. I have figured out how to fidn the nodes I am interested in. For example: (Select-Xml -Path .\*.xml -XPath "//*[@Attribue = 'valueImlookingfor']").Count This command gives me the count of elements in all of the XML files in the current directory which has the value "valueImlookingfor" in the "Attribue". I want to sum up all the values of the "Attribute", not count them. What would be the best way to do this in PowerShell? I am new to PowerShell so this may be trivial but un-known to me... All tips are much appreciated :-)

    Read the article

  • How to access a field's value via reflection (Scala 2.8)

    - by soc
    Consider the following code: class Foo(var name: String = "bar") Now i try to get the value and the correct type of it via reflection: val foo = new Foo val field = foo.getDeclaredField("name") field.setAccessible(true) //This is where it doesn't work val value = field.get(????) I tried things like field.get(foo), but that just returns an java.lang.Object but no String. Basically I need the correct type, because I want to invoke a method on it (e. g. toCharArray). What is the suggested way to do that?

    Read the article

  • MySQL - Sort on a calculated value based on two dates

    - by Petter Magnusson
    I have the following problem that needs to be solved in a MySQL query: Fields info - textfield date1 - a date field date2 - a date field offset1 - a text field with a number in the first two positions, example "10-High" offset2 - a text field with a number in the first two positions, example "10-High" I need to sort the records by the calculated "sortvalue" based on the current date (today): If today=date2 then sortvalue=offset1*10+offset2*5+1000 else sortvalue=offset1*10+offset2*5 I have quite good understanding of basic SQL with joins etc, but this I am not even sure if its possible...if it helps I could perhaps live with a single formula giving the same sort of effect as the IFs do....ie. before date1 = low value, after date2 = high value... Rgds PM

    Read the article

  • Cfengine Perform action based on variable value

    - by Daniel
    In cfengine, I have a variable that is set to the output of a command. Let say variable myoutput is set to "hi world". How can I execute a command based on the contents of myoutput. I would like to do something like this (sudo cfengine code): bundle agent test { vars: "myoutput" string => execresult("echo 'hi world';","noshell"); commands: myoutput=="hi world":: "/usr/bin/php myaction.php"; }

    Read the article

  • How to retrieve value from etc/sysconfig in Python

    - by stanleyxu2005
    Hi All, I have a config file FOO in /etc/sysconfig/. This Linux file is very similar to INI-File, but without a section declaration. In order to retrieve a value from this file, I used to write a shell script like: source /etc/sysconfig/FOO echo $MY_VALUE Now I want to do the same thing in python. I tried to use ConfigParser, but ConfigParser does not accept such an INI-File similar format, unless it has a section declaration. Is there any way to retrieve value from such a file?

    Read the article

  • Getting a value of td of a selected tr in jquery

    - by jaeyun
    Below is my table <table> <tr class=chargeTR> <td id=chargeTD> charge1 </td> </tr class=chargeTR> <td id=chargeTD> charge2 </td> </tr> <table> Below is my jquery call $(".chargeTR").each(function() { // this line works fine $.get("process.php", { value: $(this).find("#chargeTD").val(), // I must be doing something wrong here... }, function(theXML){ alert(theXML); }); }); I cannot get the value "charge1" and "charge2". Can somebody please correct me in this? Thank you,

    Read the article

  • Binding key/value pairs loaded from xml

    - by Hichem
    I want to load key/values configuration pairs stored in XML file. To bind a collection of data i know i need to use the ArrayList class, but the problem is that i want to be able to bind the loaded values using their corresponding keys and not by their indexes in the ArrayList object. For example i want to be able to do this : <mx:Text id="errorText" text="{Config.params['someKey']}" /> instead of : <mx:Text id="errorText" text="{Config.params[0]}" /> where Config.params is ArrayList (obviously i couldn't use ArrayList since it doesn't allow selecting a value by key) So the question is how to bind the key/value pairs loaded form XML. I don't want to go manually set variables, i want to bind them so when they are loaded the are set automatically. Did anyone had to do something like that ?

    Read the article

  • get value of dynamiclly created radiobuttonlist

    - by Mark
    Hi All, I'm trying to get the value of a dynamically created radiobuttonlist via javascript to call a pagemethod. This is how I'm creating the rbl: rbl.Attributes["onclick"] = "javascript:preview('" + rbl.ID + "','" + rbl.ClientID + "');"; And this is the javascript: function preview(controlid, clientid) { var radio = document.getElementsByName(clientid); var answer = "k"; for (var ii = 0; ii < radio.length; ii++) { if (radio[ii].checked) answer = radio[ii].value; } PageMethods.SaveAnswer(controlid, answer); } The problem however is that I want to get the groupname of the radiobuttionlist so I can use getElementsByName, but i have no luck so far. Kind regards, Mark

    Read the article

  • Silverlight: Use reflection to get the BindingExpression (and value) for controls having a ContentPr

    - by sfx
    Hello, I need to use reflection to get the binding value in a control that is a DataGridTemplateColumn (e.g HyperLinkButton). Does anyone know how I might do this? It seems simple enough to do this with a TextBlock because it has a “TextProperty” dependency property, but I can’t seem to get a binding expression from a control that does not have an immediate “TextProperty”. Here is the code I’m using to acquire the binding expression for a TextBlock: FrameworkElement fe = (FrameworkElement)dependencyObj; FieldInfo fi = fe.GetType().GetField("TextProperty"); BindingExpression bindingExpression = fe.GetBindingExpression((DependencyProperty)fi.GetValue(null)) However, the following code never works for a dependency object that is a HyperLinkButton: FieldInfo fi = fe.GetType().GetField("ContentProperty"); Does anyone know how I might be able to get the BindingExpression (and binding value) for the content of a HyperLinkButton? Cheers, sfx

    Read the article

  • HttpContext User value changing on its own?

    - by larryq
    Hi everyone, I'm working on an ASP.Net 2.0 application and am having a strange issue involving the HttpContext User. It appears to be changing on its own when I go to a particular page/directory. All of our pages inherit from a base page. In that base page's Page_Load() method we run an authorization check to see if the user can see the page they're going to. We retrieve the user to check against with this code: GenericPrincipal objPrincipal = (GenericPrincipal)Context.User; When I go to this unusual directory the User value isn't me, it's some other username I've never heard of. This username isn't authorized to see these pages, so authorization fails. This mysterious directory isn't a virtual web, just a regular directory in our website, however I've noticed it has its own Web.Config file. I'm guessing that's a cause of the trouble here. My question is, how can I investigate this further, in determining what's changing the User value when I go to this directory?

    Read the article

  • ToolStripComboBox + objects default string value

    - by Martin
    I am using a ToolStripComboBox to list some data. I am populating this combo with some custom objects: For Each obj As myObject In myObjectList myToolStripComboBox.Items.Add(obj) Next This works great except the text displayed in the combo is the name of the object class. I can understand why and realise that I need to do something to make the combo use a property from my class instead. The help files state: To add objects to the list at run time, assign an array of object references with the AddRange method. The list then displays the default string value for each object. You can add individual objects with the Add method. The bit in bold suggests I need to setup the default string value in my class. How would I go about doing this?

    Read the article

  • Configurable Values in Enum

    - by Omer Akhter
    I often use this design in my code to maintain configurable values. Consider this code: public enum Options { REGEX_STRING("Some Regex"), REGEX_PATTERN(Pattern.compile(REGEX_STRING.getString()), false), THREAD_COUNT(2), OPTIONS_PATH("options.config", false), DEBUG(true), ALWAYS_SAVE_OPTIONS(true), THREAD_WAIT_MILLIS(1000); Object value; boolean saveValue = true; private Options(Object value) { this.value = value; } private Options(Object value, boolean saveValue) { this.value = value; this.saveValue = saveValue; } public void setValue(Object value) { this.value = value; } public Object getValue() { return value; } public String getString() { return value.toString(); } public boolean getBoolean() { Boolean booleanValue = (value instanceof Boolean) ? (Boolean) value : null; if (value == null) { try { booleanValue = Boolean.valueOf(value.toString()); } catch (Throwable t) { } } // We want a NullPointerException here return booleanValue.booleanValue(); } public int getInteger() { Integer integerValue = (value instanceof Number) ? ((Number) value).intValue() : null; if (integerValue == null) { try { integerValue = Integer.valueOf(value.toString()); } catch (Throwable t) { } } return integerValue.intValue(); } public float getFloat() { Float floatValue = (value instanceof Number) ? ((Number) value).floatValue() : null; if (floatValue == null) { try { floatValue = Float.valueOf(value.toString()); } catch (Throwable t) { } } return floatValue.floatValue(); } public static void saveToFile(String path) throws IOException { FileWriter fw = new FileWriter(path); Properties properties = new Properties(); for (Options option : Options.values()) { if (option.saveValue) { properties.setProperty(option.name(), option.getString()); } } if (DEBUG.getBoolean()) { properties.list(System.out); } properties.store(fw, null); } public static void loadFromFile(String path) throws IOException { FileReader fr = new FileReader(path); Properties properties = new Properties(); properties.load(fr); if (DEBUG.getBoolean()) { properties.list(System.out); } Object value = null; for (Options option : Options.values()) { if (option.saveValue) { Class<?> clazz = option.value.getClass(); try { if (String.class.equals(clazz)) { value = properties.getProperty(option.name()); } else { value = clazz.getConstructor(String.class).newInstance(properties.getProperty(option.name())); } } catch (NoSuchMethodException ex) { Debug.log(ex); } catch (InstantiationException ex) { Debug.log(ex); } catch (IllegalAccessException ex) { Debug.log(ex); } catch (IllegalArgumentException ex) { Debug.log(ex); } catch (InvocationTargetException ex) { Debug.log(ex); } if (value != null) { option.setValue(value); } } } } } This way, I can save and retrieve values from files easily. The problem is that I don't want to repeat this code everywhere. Like as we know, enums can't be extended; so wherever I use this, I have to put all these methods there. I want only to declare the values and that if they should be persisted. No method definitions each time; any ideas?

    Read the article

  • rails check_box_tag value is NULL

    - by looloobs
    Hi I am not sure why I am having this problem, maybe I am using the check_box_tag incorrectly. I have a form that is used to send an email message. You are supposed to be able to choose one or more boxes that represent different groups of people. <%= check_box_tag (:bcc_email, value = @spouses) %> <%= f.label :bcc_email, "Company Spouses" %><br /> <%= check_box_tag (:bcc_email, value = @soldiers) %> <%= f.label :bcc_email, "Company Soldiers" %><br /> The values are an array of email addresses. Those work fine, I have had them functioning as drop down menus for sometime. When I look at the HTML page source the values are there, they are just not being passed along with the create method. Any ideas?

    Read the article

  • Compare 2 sets of data in Excel and returning a value when multiple columns match

    - by Susan C
    I have a data set for employees that contains name and 3 attributes (job function, job grade and location). I then have a data set for open positions that contains the requisition number and 3 attributes (job function, job grade and job location). For every employee, i would like the three attributes associated with them compared to the same three attributes of the open positions and have the cooresponding requisition numbers displayed for each employee where there is a match.

    Read the article

  • WPF, Setting property with single value on multiple subcontrols

    - by Andre van Heerwaarde
    I have a parent contentcontrol which displays data via a datatemplate. The datatemplate contains a stackpanel with several usercontols of the same type. I like to set the property only once on the parent control, it must set the value of the property on all the subcontrols. But if there is a way to do it on the stackpanel it's also OK. The template can be changed at runtime and the values need also to be propagated to the new template. My current solution is to implement the property on both parent and subcontrol and use code to propagate the value from the parent to all the subcontrols. My question is: is there a better or other ways of doing this?

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >