values

Increment and insert Integer values on Android SQLite Database

Hello, Im trying to insert values on Android SQLite Database. The question is, Iḿ trying to insert a word, the table has 3 columns, ID, WORD, COUNT. When I insert a word in the database, some method will verify if this word exists on the database. If yes, it will increment the value of COUNT for this word. Example. I have a word "Quest...

iPhone: Accessing data from table cell

I'm creating a form and was wondering if anyone knows how to retrieve a UITextField value from a table cell. - (IBAction)saveForm:(id)sender { NSLog(@"TextField Value => %@", titleField.text); } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { ... switch(indexPath.section) ...

How to determine the amount of entries an array has?

I'm trying to loop through an array backwards, so I figured I could try $Array = Array("One", "Two", "Three", "Four", "Five"); For ($Entry = Amount_of_values($Array); $Entry = 0; $Entry = $Entry-1){ Echo $Array[$Entry] . " "; //Should be Five Four Three Two One } but I have no idea how to retrieve the amount of values in an array ...

Get a subset of random values from an array php

Hi, Starting with an array with 10K values. I want to randomly get 1000 values from it and put them into another array. Right now, I am using a for loop to get the values, but I want to pick 1000 values and not have to loop 1000 times. The array_slice function works, but it doesn't give random values. What is the correct (most effi...

Overriding default value in derived class (c#)

If i have an accessor and default property in a base class as follows: class base{ protected int _foo = 5; public int foo {get{return _foo;}set{_foo = value;}} } Then I derive this class, is it possible to override the default value of _foo? class derived:base{ // foo still returns 5? protected new int _foo = 10; } ...

Android - Main.xml doesn't recognize my color values... ?

In the values/colors.xml, I put: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"&gt; <color name="blank">#f0f0f0</color> </resources> In the layout/main.xml, I put: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/androi...

jQuery ui slider wrong values?

Example code: http://jsbin.com/eqile3/ This is a slider with 2 handles, 1 for min and 1 for max and on the slide event these values are put in the input fields. Notice that when sliding the min-handle up and down, the min value is 11 (eventhough I set it to 10), but when sliding up from the min-position it goes from 11 to 10 and then 1...

jQuery Passing Variables to MySQL from PHP

The below code works as far as I can tell except for the var tid and var open section. They are being submitted from an image href: $("#chngeHref").click(function() { var tid = $('tid').attr('value'); // VARIABLES DONT WORK var open = $('open').attr('value'); // VARIABLES DONT WORK $.ajax({ type: "POST", ...

How to get values of Dropdownlist MVC 2 for insert in DB

Hi everyone, I am beginning in this issue MVC 2 I hope you can help me. I created a basic model public class RegisterModel { public string Name { get; set; } public int idCountry { get; set; } public string Country { get; set; } } And I have in the controller the following public ActionResult Register() ViewData["c...

jquery gettings variables from img src rather than window.location.href

I found this snippet of code, which works a treat: $.urlParam = function(name){ var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); if (!results) { return 0; } return results[1] || 0;} } So if the url/query string was xyz.com/index.html?lang=de just call var langval = $.urlParam('lang'); an...

Finding The Max of sum of elements in matrix in distinct rows and columns

Hi, I have a nxm matrix and I need to find the maximum of sum of its values in distinct rows and columns. For example considering the following Matrix: m1 m2 m3 n1 1 2 3 n2 4 5 6 n3 7 8 9 n4 10 11 12 The max will be 12+8+4 = 24 Note that finding the max and eliminating all values belonging to that column or ...

decimal values in a gridview

How to display a decimal value in the gridview. Say if user enters a value 0.5, it got inserted into DB as 0.5, but while diplaying it back on the the front end , it is displayed as 0.50. How to avoid this scenario. And also the user should be able to enter 5 places after the decimal point. Like 0.12345 is acceptable and 0.123456 is no...

Delphi DBGrid Format Display Values

Hi I need to format values in a DBGrid to display in a certain format ex '#,##0.00'. Any idea how to do that? Regards, Pieter ...

Plot stacked chart with javascript with negatives values.

I need to plot this with javascript (excel chart): http://pontt.com/plotexcel.jpg (bar below the x-axis and bar above the x-axis). Anyone know of a javascript library (except google charts) that supports stacked bar charts with negative values and the plot just as excel? I tried several libraries, but I had no success in trying to plot...

Checkbox - pass values

Hi, I have a page with a checkbox that is populated from a sql. The table on the sql is setup as follows. sopid, Type, DisplayOrder, Deleted. 1 test1 1 False 2 test2 2 False What i want to do is if check test1 and test2 for example it outputs the sopID to a textbox in the following manor - 1,2 etc......

jQuery getting value of array by index

Hello, using jQuery, I'm trying to get values of fileTypes by using an index. I'm not sure how to do go about doing this but so far I've tried settings.fileTypes[0] which does not work. Any help is appreciated, thanks! var defaults = { fileTypes : { windows: 'Setup_File.exe', mac: 'Setup_File.dmg', ...

problem selecting jqGrid cell on rowSelect and sending them to server

When I am using rowSelect and sending the values of column 1 and 2 its not sending the value selected for second rowSelect ...instead only sending all the value of column 1 but not column 2 . ... my approach: jQuery("#viewt").click( function(){ var grid = jQuery("#inventoryInq"); var ids =grid.jqGrid('getGridParam','selarrrow...

Groovy keyset and values

Is there a way to grab the key of one map and replace the value of the other with its value? def wild = [animal1:"pet3", animal2:"dog", animal3:"pig"] def pet = [pet1:"hamster", pet2:"fish", pet3:"cat"] if(pet.containsKey(wild.animal1)) { //replace wild.animal1 with the value contained in pet3 for example //so wild.animal1 wou...

JavaScript object with internally referenced properties

I'm trying to create a global object with a series of 'slave' properties that are derived from the value of one 'master' property in the same object - something like: var x = 5; var myObj = { master : 17, slave1 : this.master + x, slave2 : (this.master / 2.2) + 1, slave3 : Math.floor(this.slave2) //etc. }; I realiz...

How to send textbox value to a CGI script

I have a textbox with id kTb. When I click the button after entering some value in the textbox, the below changeV(str) is called inside a javascript ('onClick="changeV(kTb.value)"'). The 'alert(str)' gives me the value I entered in the textbox but when I pass it 'urll = "uSetENV.cgi?kullaTest=str"', I am NOT getting the entered value, it...