Search Results

Search found 17734 results on 710 pages for 'values'.

Page 10/710 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Unable to read values from object returned from ActiveRecord.find

    - by Venki
    I make the following call to the DB. @patientRegistration = PatientRegistration.find(:all, :conditions=["name = '#{patientName}'"]) Search for patient registration based on a given name. I get a valid @patientRegistration object.When I invoke @patientRegistration.inspect it prints correctly all the values for the object in the DB. But when I try to read a particular attribute (Say id or name) by doing the following: @patientRegistration.id or @patientRegistration.name. I get invalid values. Either its blank or some junk values. I dont understand how inspect is able to retrieve all the values correctly but reading individual attributes gives invalid values. Thanks

    Read the article

  • Android Show Map location when Longitude/ Latitude values are in DMS Format

    - by JibW
    In my Android application I need to load Google map and show the location according to the Latitude and the Longitude values provided. I referred the following tutorial and its completely ok. Work fine. Link to the tutorial I followed Problem is Latitude and Longitude values are stored in SQLite database in the DMS Fromat. If those values were in the Decimal Degrees format then No problem, as I can do the way it was in that tutorial. I need to Show the exact place by adding Overlay Item(I have given the Longitude and Latitude values by DMS Format). [Example values: 36°7'59''N, 5°25'59''W] Thanks...

    Read the article

  • Getting ListView values into a string array?

    - by Andrew
    I have a ListView control set up in details mode, and on a button press I would like to retrieve all column values from that row in the ListView. This is my code so far: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim items As ListView.SelectedListViewItemCollection = _ Me.ManageList.SelectedItems Dim item As ListViewItem Dim values(0 To 4) As String Dim i As Integer = 0 For Each item In items values(i) = item.SubItems(1).Text i = i + 1 Next End Sub But values just comes out as an empty array. Any ideas? I just want the values array to be filled with the data of that ListView row. Cheers.

    Read the article

  • Can't fill a column of NULLs with actual values by making an association to the proper values in the

    - by UkraineTrain
    I have a table with separate columns for months, days and a varchar column for 6 hour increments for each day ('12AM', '6AM', '12PM', '6PM'). There's also a column that's supposed to have calculated numeric values for each of those 6 hour increments. These calculated values come from some reference table. This reference table contains values for each day for several months broken down by hour where each hour has its own column. So, basically, I have to add the values for each 6 hour increment. I have no idea how to associate the correct values in the reference table to those 6 hour increments. I will really appreciate any help on this.

    Read the article

  • MySQL update query, how to skip empty values?

    - by Pawel
    I've got such query: $sql = "UPDATE test_accs SET acc_owner = '$owner_id', acc_policy_version = '$version', acc_policy_last_update = '$approved', acc_policy_next_update = '$renewed' WHERE acc_id = '1'"; Now, all of these values on the web folmular are optional, one can set one of these values, two, or so. Now, after I submit the form, it goes in the query like that: UPDATE test_accs SET acc_owner = '2', acc_policy_version = '1.2', acc_policy_last_update = '2012-12-19', acc_policy_next_update = '2012-12-18' WHERE acc_id = '1' It works only when I submit all values from the form. Can you please show me how could it work even if not all the values has been sent, just for example one of them? When I set one value (f.ex. policy version), it looks like that: UPDATE test_accs SET acc_owner = '', acc_policy_version = '1.2', acc_policy_last_update = '', acc_policy_next_update = '' WHERE acc_id = '1' and it isn't working. It might be possible cause of the acc_owner table values? #1366 - Incorrect integer value: '' for column 'acc_owner' at row 1 Thanks in advice.

    Read the article

  • Javascript: Taking the highest 2 numerical values out of a series of 4 possible values.

    - by Bodhi
    What I'm trying to do is to take the highest two values out of 4 possible variables and add them together, while ignoring the lesser two values. My values will be anywhere between 1 and 5. So, for example, if I have Trait1, Trait2, Trait3 and Trait4 with the following assigned values: 3, 3, 2, 1, the script will pick up the 3 and the 3, but not the 2 and the 1. If I change the values around so that I have 4, 3, 1, 5, the script will pick up the 4 and the 5, but not the 3 and the 1. How would I go about doing this? Thank you in advance.

    Read the article

  • allow only distinct values in ComboBox

    - by Ravinder Gangadher
    In my project, I am trying to populate ComboBox from DataSet. I succeeded in populating but the values inside the ComboBox are not distinct (Because it just showing the values present in DataSet). I cant bind the ComboBox to DataSet because I am adding "Select" text at first of populating the values. Here is my code. ComboBox --> cmb DataSet --> ds DataSet Column Name --> value(string) cmb.Items.Clear(); cmb.Items.Add("Select"); for (int intCount = 0; intCount < ds.Tables[0].Rows.Count; intCount++) { cmb.Items.Add(ds.Tables[0].Rows[intCount][value].ToString()); } cmb.SelectedIndex = 0; My question is how to allow distinct values (or restrict duplicate values) inside the ComboBox.

    Read the article

  • jre1.6.0_27 HashMap values() sourcecode

    - by Liu guanghua
    Today, I opened jre1.6.0_27 HashMap values() method sourcecode 389 public Set<K> keySet() 390 { 391 Set localSet = this.keySet; 392 return (this.keySet = new KeySet(null)); 393 } 394 395 public Collection<V> values() 396 { 397 Collection localCollection = this.values; 398 return (this.values = new Values(null)); 399 } I think these sourcecode are error, but I don't know why they look like this. Who can tell me why?

    Read the article

  • Is it possible to use the values method for a HashMap if the values are ArrayLists?

    - by Denman
    I'm stuck trying to get something to work in an assignment. I have a HashMap<Integer, ArrayList<Object>> called sharedLocks and I want to check whether a certain value can be found in any ArrayList in the HashMap. The following code obviously wouldn't work because Object[] can't be cast to ArrayList[], but it is a demonstration of the general functionality that I want. ArrayList[] values = (ArrayList[]) sharedLocks.values().toArray(); boolean valueExists = false; for (int i = 0; i < values.length; i++) { if (values[i].contains(accessedObject)) { valueExists = true; } } Is there a way for me to check every ArrayList in the HashMap for a certain value? I'm not sure how to use the values method for HashMaps in this case. Any help would be much appreciated.

    Read the article

  • Splitting values into groups evenly

    - by Paul Knopf
    Let me try to explain the situation the best I can. Lets say I have 3 values 1, 2, 3 I tell an algorithm to split this values into x columns. Lets say x = 2 for clarification. The algorithm determines that the group of values is best put into two columns the following way. 1st column 2nd column --------------------------- 1 3 2 Each column has an even number (totals, not literals) value. Now lets say I have the following values 7, 8, 3, 1, 4 I tell the algorithm that I want the values split into 3 columns. The algorithm now tells me that the following is the best fit. 1st column 2nd column 3rd column 8 7 3 1 4 Notice how the columns arent quiet even, but it is as close as it can get. A little over and a little under is considered ok, as long as the list is AS CLOSE TO EVEN AS IT CAN BE. Anybody got any suggestions? Know any good methods of doing this?

    Read the article

  • Spreadsheet formula: lowest 100 values in a range

    - by Justin Lawrence
    Is there any way I could sum up the lowest 100 values within a range? I know that min() would give you the lowest value but i need something to return the 100 lowest values. I just used 100 hypothetically to make it easier to understand what I'm trying to achieve. I can use any of the following spreadsheet apps: Openoffice.org, Excel or Google Spreadsheets -- whichever works. Thanks a lot!!!

    Read the article

  • Using Paste Special - Values with the HYPERLINK function in Excel

    - by Pete
    I have a long list of data in Excel. Using the Hyperlink function =HYPERLINK(C2,A2) i've added individual links to them all. Now i want to get rid of the function and just leave the data with the link. So i do Paste Special -- Values Which does the job but then the link is removed. How can i paste the values and keep the hyperlink?

    Read the article

  • printf + print param and values

    - by yael
    I need to print the following values with printf as the follwoing around like this: printf "[date +%d"/"%b"/"%G"-"%T] [WARN] $PARAM1 $PARAM2 $PARAM3 The required output: [02/Jun/2010-11:08:42] [WARN] val1....val2...val3 the gap between val1 to val2 and from val2 to val3 must be const gap not depend the length of the values

    Read the article

  • Excel formula to compare single value in one cell with multiple values in other cell

    - by Raw
    I have a value in Column A, which I want to compare with multiple values of corresponding cell in column B, and depending on that value, put the answer in column C. For example, using the table below, it searching in column B for values which are less than or equal to 12 and put the answer in same order in column C. Column A Column B Column C 12 0,12,13,14 Yes, Yes, No, No 101 101,102,103,104 Yes, No, No, No How can I do this in Excel?

    Read the article

  • remove specific values from multi value dictionary

    - by Anthony
    I've seen posts here on how to make a dictionary that has multiple values per key, like one of the solutions presented in this link: Multi Value Dictionary it seems that I have to use a List< as the value for the keys, so that a key can store multiple values. the solution in the link is fine if you want to add values. But my problem now is how to remove specific values from a single key. I have this code for adding values to a dictionary: private Dictionary<TKey, List<TValue>> mEventDict; // this is for initializing the dictionary public void Subscribe(eVtEvtId inEvent, VtEvtDelegate inCallbackMethod) { if (mEventDict.ContainsKey(inEvent)) { mEventDict[inEvent].Add(inCallbackMethod); } else { mEventDict.Add(inEvent, new List<TValue>() { v }); } } // this is for adding values to the dictionary. // if the "key" (inEvent) is not yet present in the dictionary, // the key will be added first before the value my problem now is removing a specific value from a key. I have this code: public void Unsubscribe(eVtEvtId inEvent, VtEvtDelegate inCallbackMethod) { try { mEventDict[inEvent].Remove(inCallbackMethod); } catch (ArgumentNullException) { MessageBox.Show("The event is not yet present in the dictionary"); } } basically, what I did is just replace the Add() with Remove() . Will this work? Also, if you have any problems or questions with the code (initialization, etc.), feel free to ask. Thanks for the advice.

    Read the article

  • Passing list of values to django view via jQuery ajax call

    - by finspin
    I'm trying to pass a list of numeric values (ids) from one web page to another with jQuery ajax call. I can't figure out how to pass and read all the values in the list. I can successfully post and read 1 value but not multiple values. Here is what I have so far: jQuery: var postUrl = "http://localhost:8000/ingredients/"; $('li').click(function(){ values = [1, 2]; $.ajax({ url: postUrl, type: 'POST', data: {'terid': values}, traditional: true, dataType: 'html', success: function(result){ $('#ingredients').append(result); } }); }); /ingredients/ view: def ingredients(request): if request.is_ajax(): ourid = request.POST.get('terid', False) ingredients = Ingredience.objects.filter(food__id__in=ourid) t = get_template('ingredients.html') html = t.render(Context({'ingredients': ingredients,})) return HttpResponse(html) else: html = '<p>This is not ajax</p>' return HttpResponse(html) With Firebug I can see that POST contains both ids but probably in the wrong format (terid=1&terid=2). So my ingredients view picks up only terid=2. What am I doing wrong? EDIT: To clarify, I need the ourid variable pass values [1, 2] to the filter in the ingredients view.

    Read the article

  • Saving form values to database after a user logs in

    - by redfalcon
    Hi. We have a form with ratings to submit for a certain restaurant. After the user has entered some values and wants to submit them, we check whether the user is logged in or not. If not, we display a login form and let the user put in his account data and redirect him to the restaurant he wanted to submit a rating for. The problem is, that after he successfully logged in himself, the submitted values are not saved to the database (which works fine if the user is already logged in). So I wondered if it is possible, to somehow save the data although the user is not logged in. I thought of maybe saving the filled values in a variable and have then automatically re-entered after we redirected the user. But I guess this wont work because we use before_filter :login_required, :only => [ :create ] So we couldnt even access the filled in values, since we display the login-form before the method has processed the values in the form, right? Any idea how we can make rails to save the values or at least have them automatically re-entered to the form? Thanks!

    Read the article

  • one key multiple values from different sources c#

    - by user2964034
    I am trying to make a c# program that will compare two files for me, and tell me the differences of specific parts. I have been able to get the parts I need into variables while looping through, but I now want to add these to a key with 3 values per file, so a key with 6 values overall which I will then compare to eachother later on. But I can only add 3 values at a time using the loop I have, so I need to be able to add the last 3 values to the key without overwriting the first 3. example of data from file: [\Advanced\Rules\Correlation Rules\Suspect_portscan\]; CheckDescription =S Detect Port scans; Enabled =B 0; Priority =L 3; I have managed to get what I need into variables so I have: string SigName would be "Suspect_portscan" Int Enabled, Priority, Blocking as 0 3 and null respectivly. I then want to make a dictionary type thing, with a key which would be the SigName and the first 3 values as enabled, priority, blocking. Then when looping through the second file, I want to add the 2nd files settings for the enabled, priority, blocking for the same SigName (so to the key) in the last 3 value slots. I will then compare this against itself, like 'if signame(0) != signame(3)' so if file 1 enabled is not the same as file two enabled make a note and tell me. But the problem I have is not being able to get the data into a dictionary or lookup, I'm completely stumped. It seems like I should use a dictionary with a list for the values but I cant get it working on the second loop through. Thanks.

    Read the article

  • Generate unique ID from multiple values with fault tolerance

    - by ojreadmore
    Given some values, I'd like to make a (pretty darn) unique result. $unique1 = generate(array('ab034', '981kja7261', '381jkfa0', 'vzcvqdx2993883i3ifja8', '0plnmjfys')); //now $unique1 == "sqef3452y"; I also need something that's pretty close to return the same result. In this case, 20% of the values is missing. $unique2 = generate(array('ab034', '981kja7261', '381jkfa0', 'vzcvqdx2993883i3ifja8')); //also $unique2 == "sqef3452y"; I'm not sure where to begin with such an algorithm but I have some assumptions. I assume that the more values given, the more accurate the resulting ID – in other words, using 20 values is better than 5. I also assume that a confidence factor can be calculated and adjusted. What would be nice to have is a weight factor where one can say 'value 1 is more important than value 3'. This would require a multidimensional array for input instead of one dimension. I just mashed on the keyboard for these values, but in practice they may be short or long alpha numeric values.

    Read the article

  • How can I remove rows with unique values? As in only keeping rows with duplicate values?

    - by user1456405
    Here's the conundrum, I'm a complete and utter noob when it comes to programming. I understand the basics, but am still learning javascript. I have a spreadsheet of surveys, in which I need to see how particular users have varied over time. As such, I need to disregard all rows with unique values in a particular column. The data looks like this: Response Date Response_ID Account_ID Q.1 10/20/2011 12:03:43 PM 23655956 1168161 8 10/20/2011 03:52:57 PM 23660161 1168152 0 10/21/2011 10:55:54 AM 23672903 1166121 7 10/23/2011 04:28:16 PM 23694471 1144756 9 10/25/2011 06:30:52 AM 23732674 1167449 7 10/25/2011 07:52:28 AM 23734597 1087618 5 I've found a way to do so in VBA, which sucks as I have to use excel, per below: Sub Del_Unique() Application.ScreenUpdating = False Columns("B:B").Insert Shift:=xlToRight Columns("A:A").Copy Destination:=Columns("B:B") i = Application.CountIf(Range("A:A"), "<>") + 50 If i > 65536 Then i = 65536 Do If Application.CountIf(Range("B:B"), Range("A" & i)) = 1 Then Rows(i).Delete End If i = i - 1 Loop Until i = 0 Columns("B:B").Delete Application.ScreenUpdating = True End Sub But that requires mucking about. I'd really like to do it in Google Spreadsheets with a script that won't have to be changed. Closest I can get is retrieving all duplicate user ids from the range, but can't associate that with the row. That code follows: function findDuplicatesInSelection() { var activeRange = SpreadsheetApp.getActiveRange(); var values = activeRange.getValues(); // values that appear at least once var once = {}; // values that appear at least twice var twice = {}; // values that appear at least twice, stored in a pretty fashion! var final = []; for (var i = 0; i < values.length; i++) { var inner = values[i]; for (var j = 0; j < inner.length; j++) { var cell = inner[j]; if (cell == "") continue; if (once.hasOwnProperty(cell)) { if (!twice.hasOwnProperty(cell)) { final.push(cell); } twice[cell] = 1; } else { once[cell] = 1; } } } if (final.length == 0) { Browser.msgBox("No duplicates found"); } else { Browser.msgBox("Duplicates are: " + final); } } Anyhow, sorry if this is the wrong place or format, but half of what I've found so far has been from stack, I thought it was a good place to start. Thanks!

    Read the article

  • MYSQL - Multiple set values in one update statement [migrated]

    - by Maurzank
    MYSQL - MULTIPLE SET VALUES IN ONE UPDATE STATEMENT USING 2 TABLES AS REFERENCE AND STORING VALUES IN ONE OF THOSE TABLES WITH A SPECIFIC LOGIC. Hello people, A problem came up by making an UPDATE. The example issue is as follows: CURRENUSRTABLE +------------+-------+ | ID | STATE | +------------+-------+ | 123 | 3 | | 456 | 3 | | 789 | 3 | +------------+-------+ HISTORYTABLE +------------+------------+-----+ | ID | TRDATE | ACT | +------------+------------+-----+ | 123 | 2013-11-01 | 5 | | 456 | 2013-11-01 | 5 | | 789 | 2013-11-01 | 5 | | 123 | 2013-11-02 | 4 | | 456 | 2013-11-02 | 4 | | 789 | 2013-11-02 | 4 | | 123 | 2013-11-03 | 3 | | 456 | 2013-11-03 | 3 | | 789 | 2013-11-03 | 3 | +------------+------------+-----+ I'm using these variables: @BA=3, @DE=5, @BL=4, What I'm trying to do is an update on CURRENUSRTABLE.STATE using HISTORYTABLE.ACT with the following logic: STATE value will be updated as ACT value, except when STATE value is 4 and ACT is 3, then STATE will be 5 I made this statement: UPDATE CURRENUSRTABLE RIGHT OUTER JOIN HISTORYTABLE ON HISTORYTABLE.ID=CURRENUSRTABLE.ID SET CURRENUSRTABLE.STATE= ( SELECT CASE HISTORYTABLE.ACT WHEN @DE THEN @DE WHEN @BL THEN @BL WHEN @BA THEN CASE CURRENUSRTABLE.STATE WHEN @BL THEN @DE ELSE @BA END END ORDER BY HISTORYTABLE.TRDATE,FIELD(HISTORYTABLE.ACT,@DE,@BL,@BA) ) WHERE HISTORYTABLE.TRDATE BETWEEN '2013-11-01' AND '2013-11-01' I'm intentionally using "RIGHT OUTER JOIN" and "HISTORYTABLE.TRDATE BETWEEN" because I'd like to change the values in CURRENUSRTABLE using a timeframe of more than one day. If I execute this statement many times using only one day (i.e. "BETWEEN '2013-11-01' AND '2013-11-01'" and then "BETWEEN '2013-11-02' AND '2013-11-02'"... etc ) it works perfectly, but if it is executed using the dates "BETWEEN '2013-11-01' AND '2013-11-03'" the results on CURRENUSRTABLE.STATE are 3, which is wrong, it should be 5. I think the problem relies on "CASE CURRENUSRTABLE.STATE" when uses "HISTORYTABLE.TRDATE BETWEEN '2013-11-01' AND '2013-11-03'", because it reads the STATE 9 times which has not been commited yet until the statement ends. Query OK, 9 rows affected (0.00 sec) Rows matched: 9 Changed: 9 Warnings: 0 Maybe the solution is very simple, but unfortunately I've not much practice on MySQL since I've worked with it less than 2 months :) Is there any suggestions to solve this issue? PD: MySQL version is 4.1.22, I know is very old an EOL, unfortunately I have to make these statements on this version. Thanks!

    Read the article

  • Can't display RSSI values in Wireshark

    - by Giovanni Soldi
    I am trying to analyze the up-link Wireless traffic generated by my Sony Ericsson phone and captured by my D-Link router, on which I installed the DD-WRT firmware. To do this, first I log in the router and enable the prism0 interface by typing the command: wl -i eth1 monitor 1 and then I start to capture the packets by typing: tcpdump -i prism0 ether src xx:xx:xx:xx:xx:xx -s0 -w /tmp/smbshare/sony_ericsson_test.pcap where xx:xx:xx:xx:xx:xx is the MAC address of my Sony Ericsson phone. After a while I transfer the sony_ericsson_test.pcap file to my computer and open it with Wireshark program. In order to display the RSSI values I follow this procedure: Edit - Preferences... - Columns - Press "Add" button - As "Field type" I choose "IEEE 802.11 RSSI" and finally I choose name "Power" and click on "Apply" button. The problem is that the column "Power" is empty with no RSSI values. Does Anyone has a clue on why are RSSI values not displayed? Maybe I am missing a passage. Looking forward to hearing from anyone of you! Thanks in advance for your help!

    Read the article

  • Linux arp cache timeout values

    - by Jak
    I'm trying to configure sane values for the Linux kernel arp cache timeout, but I can't find a detailed explanation as to how they work anywhere. Even the kernel.org documentation doesn't give a good explanation, I can only find recommended values to alleviate overflow. Here is an example of the values I have: net.ipv4.neigh.default.gc_thresh1 = 128 net.ipv4.neigh.default.gc_thresh2 = 512 net.ipv4.neigh.default.gc_thresh3 = 1024 Now, from what I've gathered so far: gc_thresh1 is the number of arp entries allowed before the garbage collector starts removing any entries at all. gc_thresh2 is the soft-limit, which is the number of entries allowed before the garbage collector actively removes arp entries. gc_thresh3 is the hard limit, where entries above this number are aggressively removed. Now, if I understand correctly, if the number of arp entries goes beyond gc_thresh1 but remains below gc_thresh2, the excess will be removed periodically with an interval set by gc_interval. My question is, if the number of entries goes beyond gc_thresh2 but below gc_thresh3, or if the number goes beyond gc_thresh3, how are the entries removed? In other words, what does "actively" and "aggressively" removed mean exactly? I assume it means they are removed more frequently than what is defined in gc_interval, but I can't find by how much.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >