Hello, I am trying to compare a double to be within various ranges, but the comparison is not working correctly. Rounding precision is not a concern, because if the value will match the boundaries so rarely, and it is rounding up to the higher range is acceptable. Below is the code at issue: if (kq == 2) if (fundt[kq-1][ky-1][2-1] < 450,000,000.00) ktti[ky-1][0] = 1; else if ((fundt[kq-1][ky-1][2-1] >= 450,000,000.00) && (fundt[kq-1][ky-1][2-1] < 525,000,000.00)) ktti[ky-1][0] = 2; else if ((fundt[kq-1][ky-1][2-1] >= 525,000,000.00) && (fundt[kq-1][ky-1][2-1] < 650,000,000.00)) ktti[ky-1][0] = 3; else if ((fundt[kq-1][ky-1][2-1] >= 650,000,000.00) && (fundt[kq-1][ky-1][2-1] < 750,000,000.00)) ktti[ky-1][0] = 4; …

Member Avatar
Member Avatar
+0 forum 3

I have two items which can be selected from two seperate comboboxes. I need to populate a 3rd combobox with range calculated from selection of first two. Default for this 3rd box must be 0 with plus and minus range. A little help would be much appreciated.

Member Avatar
Member Avatar
+0 forum 4

SO im working on a python code that reads a csv file with 1600 entries roughly and i am splitting them up on the collum value of pc numbers. I keep getting a error that states " Traceback (most recent call last): File "C:\Users\HatterX\Desktop\test\test25", line 50, in <module> data.sort(key=lambda x: x[2]) File "C:\Users\HatterX\Desktop\test\test25", line 50, in <lambda> data.sort(key=lambda x: x[2]) IndexError: list index out of range ". Could someone tell me what im doing wrong please this has me very conffused and frustrated. import csv, datetime, os, shutil, glob newrow={'PC Number': '', 'INSTALL NEW LUXURY SIGN - YES/NO': '', 'Status': …

Member Avatar
Member Avatar
+0 forum 2

I would like to do something like this: comboBox6.Items.AddRange(new IEnumerable<int> { Enumerable.Range(1,8).ToArray() } ); (add numbers 1 to 8 to ComboBox Items using an IEnumerable object), but i can't figure out how. Thanks.

Member Avatar
Member Avatar
+0 forum 2

hi.. i am creating as program that needs to generate a batch. for example i added job that has a batch range of 001-100, it is a must that all of the number greater and less than one hundred are included. and i don't know how. Please help. need it badly

Member Avatar
Member Avatar
+0 forum 2

I need jquery code for DOB range validation(age should be at least 15) using the .validate() jquery function. I am not able to create the function in the rule, help anyone ?

Member Avatar
Member Avatar
+0 forum 1

This example calculates timed x, y points of a projectile motion that can be used for plotting or other calculations.

Member Avatar
Member Avatar
+3 forum 3

Hi All, I have a question. Is adding/filling range numbers to an ArrayList possible in java?? Like this: {<12345, 13455>, <12745, 13755>, <2345, 2755>, <5345, 9455>, <2700, 5240>, <345, 13455>, <11345, 13000>} You can think of these like time segments. Here is the class to give you brief idea import java.util.ArrayList; import java.util.List; class Sector { int start; int end; public Sector(int start, int end) { this.start = start; this.end = end; } List<Sector> sectors = new ArrayList<Sector>(); for (int i = 0; i <7; i++) { } } }

Member Avatar
Member Avatar
+0 forum 2

Situation: My VBA program compiles, but fails at runtime when I try to access a specific method. It doesn't seem to matter whether I set the method up as a function or a property get. Here is the code fragment which calls the method: ****** Function roots() As Variant ' array of variant(string, double or ratio): real roots only Dim fs() As MPolyFactor Dim f As Polynomial Dim result() As Variant Dim nFactors As Integer, i As Integer traceIn "entered roots; me = " & Me.toString() & "; f = " & stringify(f) On Error Resume Next ReDim result(1 To …

Member Avatar
Member Avatar
+0 forum 1

I want to filter my datagrid view in my winform with a date range. I have 2 label with StartingDate(lblStart) and EndingDate(lblEnd) which is called from the datepicker on another form. Filter = "(DATE >= '" + Convert.ToDateTime(lblStart.Text).ToString("dd/MM/yyyy") + "' and DATE <= '" + Convert.ToDateTime(lblEnd.Text).ToString("dd/MM/yyyy") + "')"; And this code does not works. Can someone tell me that is it any wrong on my code, or any changes need to be done on datagridview in order make the filter works. My DATE column data is in the format of dd/MM/yyyy which loaded from my SQL db. Thanks

Member Avatar
Member Avatar
+0 forum 4

Using Visual Basic 10, and I am trying to identify min/max statistics and display the results. My calculations are working, but the display is not (line 68 & 80). With the way the code is written now, I don't get the error but my results are displayed as "The minimum monthly rainfall was *correct result* ("*g*"). "g" should be the month that corresponds to the minimum monthly rainfall. The same issue occurs on the maximum display. The line was initially written as *lblMinMonthly.Text = ("The minimum monthly rainfall was " & intMinRainfall.ToString() & "(" & strMonths(Me.intCount) & ")")* but received …

Member Avatar
Member Avatar
+0 forum 4

Hey! I am making a new gaming computer (http://pcpartpicker.com/p/QLYy) and I have heard that nVidia is much better. I'm not going to use more than one monitor, and if I do, it'll only be two so the lower memory is too important. Which nVidia card should I get that's around the price range of my current video card (Gigabyte Radeon HD 7970 3GB Video Card, ~$390) that's the same or better? Thanks!

Member Avatar
Member Avatar
+0 forum 3

Hi need some help suggestion I am trying to search data form two date range but it seems not working properly when i search for $from_date = "2013-04-01"; $to_date = "2013-04-04"; $query = mysql_query("SELECT * FROM date WHERE Date between '" . $from_date . "' AND '" . $to_date . "' ORDER by id DESC"); it will only return Guest 1 2013-04-01 Guest 2 2013-04-02 Guest 3 2013-04-03 Guest 4 2013-04-01 it is omitting Guest 5 2013-04-04 and i also try uisng this query `$query = mysql_query("SELECT * FROM date WHERE Date >= '" . $from_date . "' AND Date …

Member Avatar
Member Avatar
+0 forum 15

SELECT Facility.[Facility Name] FROM Facility LEFT OUTER JOIN Reservation on Facility.FacilityID = [Reservation].FacilityID AND [Check-in time] = '" & Integer.Parse(cboHour.Text) & "' AND [Check-in date] = '" & lstDate.SelectedItem.ToString & "' WHERE Reservation].ReservationID Is NULL AND Facility.[Facility Type] = '" & cboFacilityType.Text & "' I have this sql statement which only return me the facilities that are available. The problem is, I wanted it to check for the check-out time as well. Eg, A user make a reservation on 3/11/2013 10am and the duration is 2 hours. When the another user make a reservation on 11am on the same date, …

Member Avatar
Member Avatar
+0 forum 16

what i want is to put a range in the textboxes like 1-100 and will not accept if it is greater than 100 or a negative number... hoping for your response...

Member Avatar
Member Avatar
+0 forum 4

Hey Everyone, I have table called vdet_sa_archive and in that table there are so many fields and i want to access the data on datetime range. sample data in table starttime endtime 1 14-02-13 01:30:15.000000000 AM 14-02-13 02:01:57.000000000 AM 2 14-02-13 4:30:01.000000000 AM 14-02-13 5:30:01.000000000 AM 3 14-02-13 01:30:01.000000000 PM 14-02-13 01:45:01.000000000 PM So i want to access the data between 14-02-13 1:00:00 AM to 14-02-13 5:00:00 AM So how can i get this data i wrote like select count(*) from vdet_sa_archive where starttime >= TO_DATE('14/FEB/2013 01:00:00 AM', 'dd/mm/yyyy HH:MI:SS AM') and endtime<=TO_DATE('14/FEB/2013 04:00:00 AM', 'dd/mm/yyyy HH:MI:SS AM'); But its …

Member Avatar
Member Avatar
+0 forum 2

suppose the input is 1,2,3,5-14,16-20,-25,31- :the program must print output: 1 2 3 5 6 7 8 9 10 11 12 13 14 16 17 18 19 20 0 1 2 3 ...........25 31 32 33..... til end of file I WAS REJECTED FROM MY LAST ROUND OF INTERVIEW BECAUSE I MADE THE CODE BIG.. PLZ CAN ANY1 HELP ME WIT OPTIMISED CODE. :)

Member Avatar
Member Avatar
+0 forum 5

WHERE Category = '" + CategorySorter.Text + "' AND DateAdded = '" + DateValue("DateEnd.Text") + "' " thats my query and its not working, if the user input a date(like this 12/25/12) in DateEnd.Text, i want to confirm if it is existing on a database

Member Avatar
Member Avatar
+0 forum 10

Hello all: I have the following mysql query statement: SELECT COUNT(*) as ttl_rows FROM (SELECT DISTINCT(date(timeentry)) AS day, COUNT(*) AS total FROM history where MONTH(CAST(timeentry as date)) = MONTH(NOW()) AND YEAR(CAST(timeentry as date)) = YEAR(NOW()) GROUP BY DATE_FORMAT(timeentry, '%d') ASC) as ttl_row the statement performs a search for all records entered for the current month and thus would produced the following: day total 2012-12-01 1 2012-12-02 6 2012-12-04 4 2012-12-05 3 As you can see, there is no record for 2012-12-03. My interest here is to modify the query to return all dates with the date range and where there …

Member Avatar
Member Avatar
+0 forum 6

Hello All!! I have an assignement that I am working on and for some reason I cannot for the life of me recall how to do something so simple lol. The directions are too "Write a function named Exam, which takes one argument n where n>2. Your function creates a list (list1) of n random integers in range (1,5) and print all elements of list1 on one line. So far what I have is : def Exam(n): import random random.randrange(1,5) I am not sure where to insert the n>2 and even really what it means. If anyone can assist or …

Member Avatar
Member Avatar
+0 forum 1

My professor asks me to program the Game Of Life with some required and I find unnecessary classes. But anyhow as I am coding and running the program midway I run into this problem void Life::setup_grid() { cout << "Size of Grid: " << grid.size() << endl; cout << "rows: " << rows << endl; cout << "cols: " << cols << endl; for(int i = 0; i < rows; i++) { for(int j = 0; j < cols; j++) { if(cell == 'A') grid[i][j] = new ACell(); //I get "Expression: vector subscript out of range." here. else grid[i][j] = …

Member Avatar
Member Avatar
+0 forum 6

This is my code for creating a url list and Im getting an index out of range error? Please help! #! /usr/bin/env python import re TOTAL_PAGES = 619 idFile = open("listOfURLs2", "r") outFile = open("output", "w") idList = [] urlList = [] temp = "" tempStr = "" currentList = [] index = 1 for line in idFile: idList.append(line) for i in range(TOTAL_PAGES): #iterates through all input files try: f = open('detailedData/exchange_view.php?id=' + str(idList[index][:-1]), 'r') fullFile = f.read() except IndexError,e: print e temp = re.search('Publics_mPage=\d*">\d*</a> of.*?(\d*) ', fullFile, re.S) if temp is not None: i = 1 while i <= int(temp.group(1)): tempStr …

Member Avatar
Member Avatar
+0 forum 4

Hello! I've got a question here that has me scratching my head - I've got a table of IP addresses. Each octet has its own field (OCT1,OCT2,OCT3,OCT4). The first two octets are fixed, and will never change (so, the IP addresses on my table are between X.Y.0.0 and X.Y.255.255). As such, I've got a range form where the user can type in the third and fourth octets of the low and high IP search range. The problem is, is I can't figure out the proper format of the SELECT statement. I've tried a bunch of ideas and looked up several …

Member Avatar
Member Avatar
+0 forum 12

I get this issue but i dont understand it completly. Found some suggestions online but seems they depend on the source code. This is my code and i get the error where the arrow is int j; float aa=0, modanum, count=0, temp; float[] mod =null; float[] fin = null; int[] arr = q.OfType<int>().ToArray(); for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { -----> if(arr[i]==arr[j]) count+=1; } the array arr is delacred correctly and there are no resizes throught the process, this suggests that my arr is just not big enought, but for example i am sending a list q of 7 items and it still …

Member Avatar
Member Avatar
+0 forum 3

Hi all, I am currently trying to generate a number from a specified range using a function int number_range(int from, int to) { return (from + rand() % (to-from+1)); } but negative numbers cause the program to crash. How can i go about doing this so it can take numbers of all kinds?

Member Avatar
Member Avatar
+0 forum 4

Ok, so, this code snippet is a reply to this thread: http://www.daniweb.com/software-development/cpp/threads/425821/prime-number-c From what I understood form the OPs request, is that, he wanted an algorihm which would check for prime numbers in a given range, applying these conditions: a number is to be considered valid if: a. the number itself is a prime number. b. the digits composing the number are prime, like this: 37397 is a prime number: 3 is a prime number 37 is a prime number 373 is a prime number 3739 is a prime number I would not recommend this algorithm thou because it's slow, …

Member Avatar
Member Avatar
+0 forum 8

i was on the site pyschools working through the exercises, but i dont understand why it wont accept the code i input. [url]http://www.pyschools.com/quiz/view_question/s4-q2[/url] Create a function generateNumbers(start, end, step) that takes in three numbers as arguments and returns a list of numbers ranging from start to the end number (inclusive)and skipping numbers based on the step specified in the arguments. Note: The function range(x, y, z) can takes in 3 arguments. For example, range(1, 11, 2) will return a list of numbers [1,3,5,7,9]. Examples [CODE] >>> generateNumber(2, 10, 2) [2, 4, 6, 8, 10] >>> generateNumber(10, 10, 1) [10] >>> …

Member Avatar
Member Avatar
+0 forum 7

Dear All, Please suppose that I have this line of code, and that my selection range goes from div element with id=1, starting at '2', to div element with id='2', ending at '8'. `<div id='1'>1`2`3</div>456<div id='2'>7`8`9</div>`. I'm using chrome, I would like to get the position of the cursor inside each element. I would get position 1 in div with id='1', and position 1 as well in div with id='2'. Thank you so much for yout help, Regards

Member Avatar
Member Avatar
+0 forum 1

Hey all, Some rows of a single table in a database that I administer manage to have gone missing. Not that big of a problem: I have a backup. The issue is that there has been more information added since the old data was lost, so I can't do a wholesale replacement. I've isolated the range of rows that were removed based on the primary key, but I'm not sure about the rest of the steps: 1) Export the rows based on the unique row id number; 2) Re-import the old rows without disturbing the new data. Anyone have some …

Member Avatar
Member Avatar
+0 forum 2

Hi, I would like to know how to set the textbox to only accept numbers, also that will only accept numbers 1,2 & 3 only. Thanks in advanced. :icon_mrgreen: i tried but i really don't know how.

Member Avatar
Member Avatar
+0 forum 5

The End.