Equal numbers greater than each other?
Greetings all! Having a bit of difficulty with a very simple comparison inside a while loop. I'm using LV 8.5, trying to calculate a resistance value, then pick from an array of available resistors to meet said value. It's a dirt simple state machine, and it seems to work just fine until the very end when it's about to select the last resistor to meet the calculated value. For some reason, when the two values are equal, the greater than comparison gives a TRUE. I've tried the same comparison on it's own in a different VI, and sure enough, the comparison yields a FALSE. Am I dealing with a bug here?
I can attach the VI if needed.
Thanks!
Well If you don't use floating point calculation, this would be a very serious bug in LabVIEW. Without the code NI or we can't see if there's a bug, so please post the malfunctioning code.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Similar Messages
-
Can't add numbers greater than 100 in the Data Editor for a column chart
I'm trying to create a column chart in Keynote '09 but every time I add a data point with a value greater than 100 in the Data Editor it turns the number into a date. I have the Y Axis set to "Number" and it works fine for numbers less than 100 but I want to show a graph that goes from 0 - 1000. Is this happening to anyone else?
Chart Settings:
Y Axis Options:
- Max = 1000
- Steps = 5
- Format = Number
X Axis Options
- Show Axis
- Show Categories
- No Tick Marks
thanks in advance for the helpWelcome to the discussions, AlexEberts.
No, it's not happening for me. This is what I'm doing
1) Insert -> Chart -> Column
2) In the Data editor, for 2007, I enter 110.
The chart automatically expands to 110 (because, by default, it's set to autosize the Y-axis)
Does this work for you? If it does, then we can look at why it doesn't work when you add parameters. -
Any help would be appreciated
Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app. I am certain other applications also need this information. Although lengthy, I could not find a more comprehensive place to retrieve this information. Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
When a solution is found please mark the post that solves your issue.
Every problem has a solution! -
Query to find three times greater than the other records
hi All,
I am new to this forum, please help me out on this issue.
There is a table named as regions which has following columns like name, region, population, area with the following sample records
Region Name Population
AAA AAAA 1000
AAA BBBB 2000
AAA CCCC 500
BBB DDDD 900
BBB EEEE 300
I need to pick the record which has population more than three times that of any of their neighbours (in the same region). I need to get the region and name as the output. Please help me on how to write this query.with
your_data as
select 'AAA' as col1, 'AA' as col2, 7000 as col3 from dual union all
select 'AAA' as col1, 'BB' as col2, 2000 as col3 from dual union all
select 'AAA' as col1, 'CC' as col2, 500 as col3 from dual
select *
from
select
col1,
col2,
col3,
case when col3 >= lag(col3) over (partition by col1 order by col3 asc) * 3
then
dense_rank() over (partition by col1 order by col3 desc)
else
0
end as the_rank
from
your_data
where
the_rank = 1;
COL CO COL3 THE_RANK
AAA AA 7000 1
1 row selected.
Elapsed: 00:00:00.01
TUBBY_TUBBZ?This code will return AT MOST one name for each region (assuming 1 or more qualify based on your description).
Is that what you want? -
[Solved]Bash:Subtract a set of numbers from each other in pairs?
Solution: see my reply.
I know the description isn't exact, there really isn't an easy way to describe it with the limits of the title so the circumstances are these:
say I have arrays which contain small numbers like so:
ex. 12, 7 and 13
I which is greater than the other when comparing the following number in sequence and need to subtract the lower one from it. the 3 numbers above in that order will end up producing two simple problems:
(12 - 7) and (13 - 7). The results will be stored in an array in the order they were performed (left to right)
Currently I'm trying to accomplish this with a while loop and some if statements
Note: the array "Tree" is named such so I can print the results somewhat like so after performing this operation until only one result is left:
12 7 13
5 6
1
#!/usr/bin/env bash
Num_Set=( 12 7 13 )
A=0 ; B=1
while (( ${#Num_Set[B]} >= 1 )) ; do
if (( ${Num_Set[A]} >= ${Num_Set[B]} )) ; then
Tree[A]=$(( ${Num_Set[A]} - ${Num_Set[B]} ))
elif (( ${Num_Set[A]} < ${Num_Set[B]} )) ; then
Tree[A]=$(( ${Num_Set[B]} - ${Num_Set[A]} ))
fi
A=$(( A++ )) ; B=$(( B++ ))
done
echo "${Num_Set[@]}"
echo "${Tree[@]}"
I believe i'm on the right track but this becomes an endless loop for reasons unknown for to me.
Any bash hackers out there know whats happening here?
Last edited by Thme (2013-06-12 18:57:40)And bash has associative arrays as well. Your claim that the $ is not recommended is not valid at all:
declare -A aa
aa[bb]=100
aa[0]=1
bb=0
echo $(( aa[bb] + 1 ))
101
echo $(( aa[$bb] + 1 ))
2
My apologies however I tested my original post with http://www.shellcheck.net/ upon finding the site through an unrelated thread. This was an example test to illustrate what was commented on and what was not. This works in the shell:
A=( 2 1 10 )
B=2
echo $(( A[0] + A[B] - ${A[${A[$B]}]} - A[$B] + ${A[A[1]]} + A[0] - ${#A[2]} ))
23
However ${A[${A[$B]}]} and ${A[A[1]]} were commented on by shellcheck with "don't use $ on variables in (( ))". Aside from that it does still work. Also I tested this as well:
echo $(( A[${A[0]}] + 1 ))
And although it works in my bash it gets "This $((..)) expression is malformed." and "Unexpected "}". Fix any mentioned problems and try again." when tested in shellcheck. I suspect that maybe a fault on shellcheck but either way it looks less readable than just A[A[0]]. So what I've gathered from all this is that, although the above examples all work, the following ones below are probably the best practice here for use in (( )).
#!/usr/bin/env bash
declare -A AA
AA[BB]=3
AA[0]=1
BB=0
A=( 2 1 10 )
B=1
echo $(( A[0] + 1 ))
echo $(( B + 1 ))
echo $(( A[0] + 1 ))
echo $(( A[B] + 1 ))
echo $(( A[A[0]] + 1 ))
echo $(( ${#A[2]} + 1 ))
echo $(( ${A[2]/0/1} + 1 ))
echo $(( A[BB] + 1 ))
echo $(( AA[$BB] + 1 ))
echo $(( AA[BB]++ ))
So in the cases of using arrays in manners like ${#A[2]}, ${A[2]/0/1} and AA[$BB] ( AA[BB] being different. ) using $ would be necessary inside of (( )). If I missed any or there are any needed corrections please note them as I'm concerned with good practices here. I'll leave it at that. Again thanks for the help everyone.
Last edited by Thme (2013-06-15 00:49:54) -
If greater than, set equal to zero
Hi! I am trying to write a basic if statement at the very end of my VI (the far right side, outside the while loop).
I would like any numbers greater than 2.59 X10^6 to be written to the spreadsheet as zero. Any numbers less than that threshold, should be written as they are computed.
It seems like a very basic concept but I am running into problems with having the wrong form of data...? As well as getting the output of zero to write to the spreadsheet if it is, in fact greater than 2.59X10^6.
Thanks for your help!
Solved!
Go to Solution.
Attachments:
finally_working.vi 28 KBNot too bad, You laked a bit of data-dependance for initialization see the structure on the left.
A case statement wasn't needed as you had an array of booleans I simply autoindexed with a for loop and added the select primitive.
Enjoy
Jeff
Attachments:
finally_workingFXD.vi 41 KB -
User input formula variable with greater than/less than operators for KFG
Hello all,
I have used a formula in my query that is a difference of two key figures .For e.g:
Difference = tax from system A - tax from system B.
Now when the users run the report they should be prompted for the 'Difference' threshold for seeing the report say where difference is greater 100 or equal to 10 and so on.Currrently I have created a formula variable with 'user input' and created a 'condition' to display 'Difference' greater than the user entered value.
However,it is required to have various selection options for setting the threshold of difference.For e.g User should be able to set say 'equal to'/'greater than/less than/not equal to operator for 'difference' in the initial selection screen of the report.
With the current user-input formula variable I am not getting these 'greater than' etc operators.Any ideas on how to achieve this?Ya know, that's all well and good ... BUT ... WHAT IF you do want to sort text type columns with Greater Than and Less Than operatiors??
SQL does it just Fine ... so WHY does APEX have the limit??? This is an Oracle BUG ... it SHOULD NOT limit the operators ... I realize "they" may be trying to be helpful with proper constraints to field searches ... but ... if SQL can do it, then ... no need for a limit.
EG ...
Show the records where
the "Begin_Year-Wk" data is less than or equal to "2009-09" AND
the "End_Year-Wk" data is greater than or equal to "2009-04"
... to give everything that was running in that 5 week period whether or not it starts within that time frame
I can run this query perfectly fine via SQL ... but not in APEX ... unless I reconvert a lot of strings back to numbers, and for sorting / formatting / explain-to-user purposes, I really don't want them to be numbers.
So ... there's gotta be a hidden tweak for operators somewhere ... -
I have a table of calculated values in Numbers, and I want to disallow negative numbers in the entire table. Any numbers that would be negative I would like changed to/displayed as zeroes, that way future calculations that may be based on this cell use the value of 0 for the calculation rather than the negative value. I have seen ways of doing this to single cells at a time, but I am interested in applying it to a large selection of cells.
There is the Conditional Format option when you bring up the inspector, but I cannot get a custom rule to work for me. I select "Greater than or equal to" and I enter 0 in the box, but nothing changes. Can anyone help with this?
ThanksA step toward simplifying the application of MAX to the issue, Jerry.
This part, though:
Now apply your long, animal-modeling, expressions to this new, interposing, table rather than the original.
may still leave several references to be change from the original data table to the new one.
One way to get around that is to use the Duplicate ("DATA-1) as the new table for raw data, and the Original (DATA) as the interposing table, using the formula =MAX(DATA-1::A2) as above, starting in DATA::A2.
This way, the long expressions could continue to reference the original table (with its content now modified).
ALTERNATE process:
Find/Replace could also be used to speed the process of reassigning the modeling expressions to the duplicate table, as suggested by Jerry. But some cautions apply here.
Find/Replace can be limited to Formulas only, but not to Some formulas only.
Find/Replace can be limited to the Current Sheet only, but this can't be combined with Formulas only.
More on this later, when I've had a chance to check some possibilities.
Regards,
Barry -
Greater than or equal to problem.
Hey All,
I'm building a script for Final Cut Pro (7) this is a small part of the entire script and I am having some difficulties getting this to work. So, the objective is to get a number from the user, then to have the number escalate as it repeats. I also need to make this number "Paste" in. However I cannot use the cliboard functions at all because they will be in use in a different part of the script.
What this part was designed to do, (but doesn't do all the time ) is take the number submitted by the user, and break it down by digit and spit it back out in the form of a variable key code. Another part of the script would do the escalation of the number. But what I really need is to find out why the greater than or equal to/ less than or equal to are correctly segmentig the numbers, so the script doesn't try to do the input number more than once.
set start_value to text returned of (display dialog "Start number?: " default answer "") as number
if start_value is greater than or equal to 0 then
if start_value is less than or equal to 9 then
set start_value to start_value as string
set start_value01 to 0
set start_value02 to 0
set start_value03 to the first item of start_value as number
end if
end if
if start_value is greater than or equal to 10 then
if start_value is less than or equal to 99 then
set start_value to start_value as string
set start_value01 to 0
set start_value02 to the first item of start_value as number
set start_value03 to the second item of start_value as number
end if
end if
if start_value is greater than or equal to 100 then
if start_value is less than or equal to 999 then
set start_value to start_value as string
set start_value01 to the first item of start_value as number
set start_value02 to the second item of start_value as number
set start_value03 to the third item of start_value as number
end if
end if
if start_value01 is 1 then set O1 to 18
if start_value01 is 2 then set O1 to 19
if start_value01 is 3 then set O1 to 20
if start_value01 is 4 then set O1 to 21
if start_value01 is 5 then set O1 to 23
if start_value01 is 6 then set O1 to 22
if start_value01 is 7 then set O1 to 26
if start_value01 is 8 then set O1 to 28
if start_value01 is 9 then set O1 to 25
if start_value01 is 0 then set O1 to 29
if start_value02 is 1 then set O2 to 18
if start_value02 is 2 then set O2 to 19
if start_value02 is 3 then set O2 to 20
if start_value02 is 4 then set O2 to 21
if start_value02 is 5 then set O2 to 23
if start_value02 is 6 then set O2 to 22
if start_value02 is 7 then set O2 to 26
if start_value02 is 8 then set O2 to 28
if start_value02 is 9 then set O2 to 25
if start_value02 is 0 then set O2 to 29
if start_value03 is 1 then set O3 to 18
if start_value03 is 2 then set O3 to 19
if start_value03 is 3 then set O3 to 20
if start_value03 is 4 then set O3 to 21
if start_value03 is 5 then set O3 to 23
if start_value03 is 6 then set O3 to 22
if start_value03 is 7 then set O3 to 26
if start_value03 is 8 then set O3 to 28
if start_value03 is 9 then set O3 to 25
if start_value03 is 0 then set O3 to 29
tell application "TextEdit"
activate
tell application "System Events"
tell process "TextEdit"
key code O1
delay 0.1
key code O2
delay 0.1
key code O3
end tell
end tell
end tell
Text Edit being my test dummy for this part of the operation. I am on 10.8, a couple others will be on 10.7.
Thanks for any help on this!
GabeThe answer is clear when you step through the code.
It starts off OK...
set start_value to text returned of (display dialog "Start number?: " default answer "") as number
Let's use the hypothetical value of 44 as the input.
Your code progresses to the block:
if start_value is greater than or equal to 10 then
which evaluates to true (44 is greater than 10), so we proceed:
if start_value is less than or equal to 99 then
It is less than 99, so we're still good here...
set start_value to start_value as string
Well, now you've coerced start_value back to a string object "44", it is no longer a number. That's OK for the purposes of this block, however, when you continue:
if start_value is greater than or equal to 100 then
here's where the problem reveals itself - you're now comparing start_value (the string value "44") against the number 100. Comparing strings to numbers is inherently dangerous - as you're seeing. The string value "44" is, indeed greater (in AppleScript's terms) than the number 100 (technically, the second operand (number 100) gets coerced to the type of the first operand (string "44") before the comparison is performed, so you're really comparing the strings "44" and "100" and a string that starts with '4' will always be greater than a string that starts with '1')
The simplest solution is to not change the start_value variable mid-stream. So instead of:
set start_value to start_value as string
set start_value01 to 0
set start_value02 to the first item of start_value as number
set start_value03 to the second item of start_value as number
do something like:
set start_value_string to start_value as string
set start_value01 to 0
set start_value02 to the first item of start_value_string as number
set start_value03 to the second item of start_value_string as number
In this way you're making a text copy of your start_value, so the type doesn't change as your script progresses.
There are other ways of solving this, of course - changing the type back, or reversing the operands in your greater than statements (so the string "44" gets silently coerced back to a number), but at the end of the day I recommend not changing the class/type of your variables. -
How can I type the symbol for greater than or equal to
I wish to type the symbol for greater than or equal to in an equation but my keyboard does not have such a symbol
Mathematical Operators - 2200-22FF
:≥ &#x2265; 8805 GREATER-THAN OR EQUAL TO
:http://www.sql-und-xml.de/unicode-database/mathematical-operators.html
If this is for HTML use &ge; to create ≥
you can bring up CharMap (charmap.exe)
go down 11 windows (of 10 rows each) and it is on bottom row
You should be able to type as Alt+8805 on the Numeric keypad (not number row)
or on laptop with NumLock off as Fn+Alt+8805
but that is not working for me and I verified that hex(x2265) and decimal (8805)
values are equivalent. -
Greater than or equal symbol not working
Hi,
I cannot get the "greater than or equal to" symbol to display properly. I can get the less than or equal symbol to display by typing Ctrl+q #, and then formatting it as Symbol font.
According to the Character_Sets.pdf FrameMaker Online reference, the greaterequal symbol is Ctrl+q 3, but when I format it as Symbol, FrameMaker displays a box (which looks to me to be a non-printing character).
Any suggestions on how I get a "greater than or equal to" symbol to display?
Thanks,
John B.
FrameMaker 8 (8.0 p277)
Windows XP SP 3Error7103 wrote:
> I cannot get the "greater than or equal to" symbol to display properly.
Try this...
Click in margin.
Format > Characters > Designer...
Character Tag: [ Symbol ]
Family: [ Symbol ]
all else As Is or blank
Commands: New Format...
[*] Store in Catalog
Click in Body Flow A.
Special > Variable...
[Create Variable]
Name: [ char.symbol.greaterequal ]
Definition: [ <Symbol>\xb3 ]
[Add]
[Done]
[Insert]
Advantages:
Avoid frequent arcane typing: you only need to look up the special character entry sequence once per document (if that - we keep these var defs in a separate catalog for ease of application).
Isolates special char encodings for dealing with eventual replacement by native Unicode glyphs and/or ports to platforms lacking legacy Symbol overlay font
Isolates special char renderings for possible changes to font with native >= glyph
Assures text inserted adjacent to symbol will be in native paragraph font, and not Symbol.
Prevents spell checker from needlessly complaining.
Is portable between FM platforms and releases, although \xb3 does appear as Š (cap s caron above) in Windows dialogs.
Disadvantages:
If you apply a Default ¶ Font to the para, the variable is no longer in Symbol font (but this is always the case for variables that use alternate fonts). You have to re-select the var (which may be hard to even see), and re-insert it.
If you highlight the entire para, or just the text containing the var, and apply a new PgfTag, the variable likewise gets de-fonted. It has ever been thus.
You have to search by Variable, and not by special character.
So what do we suppose made this topic so popular that it's got over 1000 Views so far?
I tried these instructions with great anticipation, but alas, it did not work for me.
Maybe it works differently on FrameMaker 9. I even tried making a PDF to see if it just rendered differently on the screen, since you mentioned the display in Windows dialog boxes (even though I was just in the main flow).
See the screenshot below for my results. -
Greater than is giving me equal to's
So I'm writing a procedure in PL/SQL that has the logic below:
SELECT
FROM
WHERE
CASE
WHEN travel_time IS NULL THEN NULL
WHEN travel_time = 0 THEN NULL
ELSE miles/(travel_time/60)
END >
CASE
WHEN (SUBSTR(id, 2, 3) BETWEEN '099' AND '200')
THEN 60
ELSE 45
END;In the result set, I'm getting records where the result of the first and second case statement are both 60.
So basically, if the result of the first case statement is GREATER THAN the result of the second case statement, the record is supposed to show up, but I'm getting records that are GREATER THAN OR EQUAL TO. I'm sure I could just change the second case statement to give 61 rather than 60, and I'm sure it would work. But shouldn't this logic work without having to do that?
Thanks!
Edited by: jjmiller on Mar 26, 2010 7:24 AMAs Frank said, a small test case (with CREATE TABLE and INSERTs) would help.
Works for me.
SQL> select * from v$version ;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> create table travel(id varchar2(3), miles number, travel_time number) ;
Table created.
SQL> insert into travel values (1, 10, 10) ;
1 row created.
SQL> insert into travel values (2, 60, 10) ;
1 row created.
SQL> insert into travel values (3, 46, 10) ;
1 row created.
SQL> insert into travel values (4, 60, null) ;
1 row created.
SQL> commit ;
Commit complete.
SQL> select * from travel ;
ID MILES TRAVEL_TIME
1 10 10
2 60 10
3 46 10
4 60
SQL> select id, miles, travel_time, case when travel_time is null then null when travel_time = 0 then null else miles/(travel_time/60) end cmp1, case when id between '1' and '4' then 60 else 45 end cmp2 from travel ;
ID MILES TRAVEL_TIME CMP1 CMP2
1 10 10 60 60
2 60 10 360 60
3 46 10 276 60
4 600 60
SQL> select * from travel where case when travel_time is null then null when travel_time = 0 then null else miles/(travel_time/60) end > case when id between '1' and '4' then 60 else 45 end ;
ID MILES TRAVEL_TIME
2 60 10
3 46 10 -
Hi everyone. I have what I think is a simple query (see
below) that pulls date information from a table. As you can see
from the query, I want it to pull dates for anything greater than
and equal to today's date and anything less than and equal to a
date one week from today's date.
This works, however, CF does not output any events on today's
date; it begins outputting tomorrow's events. Can someone point me
in the right direction as how to fix this so dates for today are
output as well? Thanks!For the "up through day" portion, I truncate the time component off of now(), add a day, and then use only the less than comparison. Example:
<cfset variables.dt1 = dateAdd("d",1,int(now())) />
<cfset variables.dt2 = dateAdd("d",-8,variables.dt1) />
<p>dt1 = #variables.dt1# / dt2 = #variables.dt2#</p>
This results into:
dt1 = {ts '2013-09-28 00:00:00'} / dt2 = {ts '2013-09-20 00:00:00'}
Lastly, use the results in your query comparison:
where
[someDateField] < <cfqueryparam value="#variables.dt1#" cfsqltype="CF_SQL_DATE" />
and [someDateField] >= <cfqueryparam value="#variables.dt2#" cfsqltype="CF_SQL_DATE" />
Also, the cfsqltype of CF_SQL_DATE seems to truncate the time component off the date for you in CF9 & CF10, but I don't like dependencies like that as I've been burned in the past. If you don't mind the risk, you can simplify the logic by removing the int() function from the above. -
Greater than equal symbol are coming across as question mark
Hi:
Greater than equal symbols and Less than equal symbols are coming across as question marks in Jasper Reports. Do you have any suggestions of how to solve this?This is the same problem as your other thread, keep it in one thread please:
http://forum.java.sun.com/thread.jspa?threadID=5194766 -
Change "to equal" to "to be greater than" in Wait for Field to equal Value"
In Sharepoint Designer 2010, in the workflow Action "Wait for Field to equal Value", I could change the "to equal" to "to be greater than". I can't find how to do this in SPD 2013.
Can someone please help?
Thank you!Hi
PieterVanHeerden, is a big problem that gives us the change Microsoft . An option to mitigate this problem could be to use an additional workflow that runs whenever the item is updated . Workflow evaluate the condition that you need and when it is Ok, updates
the value of a field used as flag called eg " Control_Hora_Inicio_Completo " with " true " value.
In your current workflow you should modify the condition for the WorkflowF stops until the Control_Hora_Inicio_Completo field equal to " True " when it meets the Workflow continue and you're sure you have entered a value , whatever that is .
I hope you can try and you work.
Greetings from Argentina .
Maxi
Msorli
Maybe you are looking for
-
I want to get an output using group by function of there is no data in the table to display a particular value for eg: SELECT TRUNC(updated_date) DATE1 , COUNT(1) COUNT FROM table where TRUNC(updated_date) >=TRUNC(SYSDATE-18) AND TRUNC(updated_date)
-
ok, so i posted an issue with my photoshop software on here not to long ago and thought it got solved, but not quite. I have Photoshop elements 5.0 and am working on windows vista. Basically everytime i used to launch pse5 it got stuck on "scanning f
-
The photos printed in my iphoto '11 book have come out fuzzy?
The photos printed in my iphoto '11 book have come out fuzzy. they were fine the first time i had them printed, why have they come out fuzzy second time? I printed a book for a relative a couple of years ago to celebrate his 21st. then this year his
-
Importing and editing on GarageBand!
i'm new to garage band, and to music editing. what i would like to do somehow is import a song and take the lyrics of it. can someone please tell me if this is possible, if not is there another way of doing that. Many Thanks
-
I