How to compare 2 string value?
i am creating a change password page, but having some problem,
i use this
if ( oldpassword == OrgPass)
out.println("correct pass");
else
out.println("incorrect pass");
both oldpassword and OrgPass are string, but even though the value of oldpassword and Orgpass are the same, it will still return a incorrect pass. Can anyone please help me with this?
instead of this
if ( oldpassword == OrgPass)
out.println("correct pass");
try this
if ( oldpassword.equals(OrgPass))
out.println("correct pass");
Similar Messages
-
How to compare the value of a specied attribute to a string
I am looking for an example of how to compare the value of an attribute to a string. (I think)
I have been trying to:
if (attrs.get("title")== "Vampire") -- you already know this did not work.
How can I check to see if the title="Vampire"?
The code below will get me the title of admin (which should be Vampire)
import javax.naming.Context;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.DirContext;
import javax.naming.directory.Attributes;
import javax.naming.NamingException;
import java.util.Hashtable;
class Giles {
public static void main(String[] args) {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://192.168.1.55:389/o=sunnydale");
try {
DirContext ctx = new InitialDirContext(env);
Attributes attrs = ctx.getAttributes("cn=admin");
System.out.println("Title: " + attrs.get("title").get());
ctx.close();
} catch (NamingException e) {
System.err.println("Problem getting attribute: " + e);
Thank you!!
SteveI guess, you are looking for searching for attributes of an user object.
Here is the sample code to list all the attributes of an 'user' objectclass.
Tell me if it helps or not.
import java.util.Hashtable;
import javax.naming.ldap.*;
import javax.naming.directory.*;
import javax.naming.*;
public class GetAttributes
public static void main (String[] args)
Hashtable env = new Hashtable();
//Must use either the userPrincipalName or samAccountName,
//Cannot use the distinguished name
String adminName = "cn=abcd,cn=Users,dc=ssotest,dc=com";
String adminPassword = "DEF1234";
String ldapURL = "ldap://pni3w067:389";
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,adminName);
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
//connect to my domain controller
env.put(Context.PROVIDER_URL,ldapURL);
try {
// Create the initial directory context
DirContext ctx = new InitialLdapContext(env,null);
// Create the search controls
SearchControls searchCtls = new SearchControls();
//Specify the search scope
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user))";
//Specify the Base for the search
//cn=policygroup,ou=policyusers,ou=ssoanay,;
//String searchBase = "ou=policyusers,ou=ssoanay,dc=ssotest,dc=com";
String searchBase = "cn=abcd,cn=users,dc=ssotest,dc=com";
//initialize counter to total the results
int totalResults = 0;
// Search for objects using the filter
NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
//Loop through the search results
while (answer.hasMoreElements()) {
SearchResult sr = (SearchResult)answer.next();
totalResults++;
System.out.println("\nName of Object : " + sr.getName());
// Print out some of the attributes, catch the exception if the attributes have no values
Attributes attrs = sr.getAttributes();
//System.out.println("6");
if (attrs != null) {
try {
/*NamingEnumeration enum = attrs.getIDs();
while(enum.hasMore()) {
System.out.println("IDs:"+enum.next().toString());
NamingEnumeration enum2 = attrs.getAll();
while(enum2.hasMore()) {
System.out.println("Attribute - "+enum2.next().toString());
catch (Exception e) {
System.out.println("Exception:" +e.getMessage());
else {
System.out.println("attribute is null");
System.out.println("Total results: " + totalResults);
ctx.close();
catch (NamingException e) {
System.err.println("Problem searching directory: " + e);
//return 0;
} -
How to get string value from xml in JSF??
In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF
Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization. -
Newbie Question: Rules: Functions: How to compare String based type?
I have some XML facts in my rules dictionary defined by the following schema (fragments shown)
<xs:simpleType name="VarType">
<xs:restriction base="xs:string">
<xs:enumeration value="Foo"/>
<xs:enumeration value="Bar"/>
<xs:enumeration value="Baz"/>
<xs:enumeration value="Qux"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ProgType">
<xs:sequence>
<xs:element name="ID" type="xs:string"/>
<xs:element name="var" type="VarType" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
Which means that a Prog of ProgType has an ID and a "list" of "var" strings restricted to bounds specified by VarType.
The issue comes when I try to create a Rules Function operating on these types.
Function-> boolean containsVar(ProgType prog,VarType var) (built using the Functions tab of the Rules editor)
for (String v : prog.var ){
if (v == var){
return true
return false
The problem we run into here is typing. If v is declared a String, as here, then v == var is invalid because types don't match. But I can't declare v a VarType due to
RUL-05583: a primitive type or fact type is expected, but neither can be found.
This problem may stem from the fact the Java's String is declared final and can't be subclassed, so the JAXB translation to Java may have to wrap it, futzing ==/equals() in the process.
SO... How do I create this method and compare these values?
TIA
Edited by: wylderbeast on Mar 10, 2011 9:15 AM - typos
Edited by: wylderbeast on Mar 10, 2011 9:18 AMAnd here's the answer.
var.value() seems to return the String value of the type
so the comparison becomes
(v == var.value())
Live and learn.... -
Friends
Could some one help me with Time values...
I would like to compare two time values one of which is stored as a string. so i would like to how to compare the system time with another column which has a string stored in time format..
i mean Sysdate - 10:30:00
Thanks in advance..select 'Y' from dual
where to_char(sysdate, 'HH24:MI:SS') = '10:30:00'
SQL> ed
Wrote file afiedt.buf
1 select 'Y' from dual
2* where to_char(to_date('10-02-2006 10:30:00', 'DD-MM-YYYY HH24:MI:SS'), 'HH24:MI:SS') = '10:30:0
SQL> /
Y
SQL> Cheers
Sarma.
Message was edited by:
Radhakrishna Sarma -
Comparing String values against a collection of Names in a Hash Table
Objective:
Is to make a script that will import a csv file containing two values: "Name" and "Price". This would ideally be stored in a hash table with the key name of "Name" and the value being "Price". The second part would be
importing a second csv file that has a list of names to compare too. If it finds a similar match to a key name in the hash table and then it will add that to a new array with the price. At the end it would add all the prices and give you a total value.
The Problem to Solve:
In the real world people have a tendency to not write names exactly the same way, for example I am looking at a list of books to buy in an eBay auction. In the auction they provide a text list of all the names of books for sale. In my price guide it has all
the names and dollar values of each book. The wording of the way each book is named could differ from the person who writes it and what is actually in my reference pricing list. An example might be "The Black Sheep" vs "Black Sheep" or
"Moby-Dick" vs "Moby Dick".
I've tried making a script and comparing these values using the -like operator and have only had about 70% accuracy. Is there a way to increase that by
comparing the characters instead of likeness of words? I'm not really sure how to solve this issue as it's very hard to do quality check on the input when your talking about hundreds of names in the list. Is there a better way to compare values in power-shell
then the "like" operator? Do I need to use a database instead of a hash table? In the real world I feel like a search engine would know the differences in these variations and still provide the desired results so why not for this type of application?
In other words, create a bit more intelligence to say well it's not a 100% match but 90% so that is close enough, add it to the array as a match and add the price etc..
I'd be curious as to any thoughts on this? Maybe a scripting language with better matching for text?Have you considered setting up a manual correction process that "learns" as you make corrections, automatically building a look up table of possible spellings of each Name? If you get an exact match, use it. If not, go to the look up
table and see if there's been a previous entry with the same spelling and what it was corrected to.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
How to compare single value with multiple values
In my query I have something like this:
A.SOR_CD=B.SOR_CODE where A and B are 2 different tables. This condition is in the where clause. The column in table A has single values but some values in table B have multiple comma separated values (822, 869, 811, ..). I want to match this single
value on the left side with each of the comma separated values. Please let me know how will I be able to do it. The number of comma separated values on the right side may vary.Hi MadRad123,
According to your description, you want to compare single value with multiple values in your query. Right?
In this scenario, the table B has comma separated values, however those comma separated values are concatenated into a string. So we can use charindex() function to return the index of the table A value. And use this index as condition in
your where clause. See the sample below:
CREATE TABLE #temp1(
ID nvarchar(50),
Name nvarchar(50))
INSERT INTO #temp1 VALUES
('1','A'),
('2','A'),
('3','A'),
('4','A'),
('5','A')
CREATE TABLE #temp2(
ID nvarchar(50),
Name nvarchar(50))
INSERT INTO #temp2 VALUES
('1','a,A'),
('2','A,B'),
('3','c'),
('4','A,C'),
('5','d')
select * from #temp1 a inner join #temp2 b on a.ID=b.ID
where CHARINDEX(a.Name,b.Name)>0
The result looks like below:
Reference:
CHARINDEX (Transact-SQL)
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
How to compare the values stored in the list
Hi,
I am having the requirement that i want to compare the values stored in the list.How to store the values in the list and compare the list values stored inside it.
Regards,
Ahamadhttp://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#sort(java.util.List,%20java.util.Comparator)
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html -
How to compare string in a case-insensitive manner using JavaScript?
Hello everyone,
Now I have a javascript to compare checkbox's value with user's input, but now seems it only can compare case-sensitively, does some one know if there is a function in javascript that it can compare string case-insensitively ?
Here is my script :
function findOffice(field)
var name;
name=prompt("What is the office name?");
var l = field.length;
for(var i = 0; i < l; i++)
if(field.value==name)
field[i].checked=true;
field[i].focus();
field[i].select();
break;
<input type="button" name="Find" value="Find And Select" onClick="findOffice(form1) >
Thanks in advance !
RachelThank you so much, I already solved the problem with your advice.
You really have a beautiful mind, :-).
I appreciate your help !
Rachel -
How to compare, current value in :block.text_item with the database value
Hi
Could you please tell me
How to compare the current value in :block.text_item with the corresponding database column value.
I am using forms 10g
There is block and there is an text Item in that block.
When I run the form and query the block (tabular), the :block.text_item shows me, whatever value there in the database.
Now I add some value in the :block.text_item to the existing value.
now
the :block.text_item contains old+ new added value
whereas
the database table contains 'old' value
Now on a button click , I want to find out what is the value that I have added
Could you please tell me, is it possible without writing a select query?Hello,
Now on a button click , I want to find out what is the value that I have addedSo you mean always user will add value in the existing value. Because this way will fail in one case. Let say
Value in Database is = ABCD
User opened the form and he removed the D and write E and now value is ABCE and length is still same 4. So, there is no addition.
Anyway you can know the database value at runtime there is one property for item called DATABASE_VALUE. It gives the value which is in database while you are running the form before save. and you can use like this..
Trigger = WHEN-MOUSE-DOUBLE-CLICK on item level
DECLARE
vItemValue DATATYPE; -- Set the data type according to your desired field.
vValueAdded DATATYPE; -- Set the data type according to your desired field.
BEGIN
vItemValue:=GET_ITEM_PROPERTY('ITEM_NAME',DATABASE_VALUE); -- It will return you the database value in vItemValue variable.
IF LENGTH(vItemValue)>LENGTH(:FORM_ITEM_NAME) THEN -- It mean something change or added
vValueAdded:=SUBSTR(:FORM_ITEM_NAME,LENGTH(vItemValue)+1);
MESSAGE('Added value is : '||vValueAdded); -- It will show you the added value.
END IF;
-- now suppose you want to show the old and new value in message not the added one
-- Then no need of IF condition. You can just use message like this
-- And i would prefer to use like this way
MESSAGE('Old Value : '||vItemValue||' New Value - '||:FORM_ITEM_NAME);
MESSAGE('Old Value : '||vItemValue||' New Value - '||:FORM_ITEM_NAME);
END;Hope it is clear.
-Ammad -
How to get string value from database table using Visual Studio 2005?
Hi,
Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
Im using the below code to get the values from database table
bool Table::Get(char* FieldName,int& FieldValue)
try
_variant_t vtValue;
vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
FieldValue=vtValue.intVal;
CATCHERRGET
sprintf(m_ErrStr,"Success");
return 1;
Im using the below code to get the values.
AIErr getProjects()
char buf[5000];
int i;
std::string catName;
::CoInitialize(NULL);
Database db;
Table tbl;
errno_t err;
err = fopen(&file,"c:\\DBResult.txt","w");
fprintf(file, "Before Connection Established\n");
//MessageBox(NULL,CnnStr,"Connection String",0);
if(!db.Open(g->username,g->password,CnnStr))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
fprintf(file, "After Connection Established\n");
if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
db.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
int ProjectID;
int UserID;
int ProjectTitle;
char ProjectName[ProjectNameSize];
if(!tbl.ISEOF())
tbl.MoveFirst();
ProjectArrCnt=0;
for(i=0;i<128;i++)
buf[i]='\0';
int j=0;
while(!tbl.ISEOF())
if(tbl.Get("ProjectID",ProjectID))
fprintf(file,"Project ID: %d ",ProjectID);
ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
sprintf(buf,"%d",ProjectID);
//MessageBox(NULL, buf,"f ID", 0);
j++;
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
//if(tbl.Get("ProjectTitle",ProjectName))
if(tbl.Get("ProjectName",ProjectName))
MessageBox(NULL,"Inside","",0);
fprintf(file,"ProjectTitle: %s\n",ProjectName);
//catName=CategoryName;
ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
//sprintf(buf,"%s",ProjectName);
MessageBox(NULL,(LPCSTR)ProjectName,"",0);
else
tbl.GetErrorErrStr(ErrStr);
fprintf(file,"Error: %s\n",ErrStr);
break;
ProjectArrCnt++;
//MessageBox(NULL, "While", "WIN API Test",0);
tbl.MoveNext();
//MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
::CoUninitialize();
//sprintf(buf,"%s",file);
//MessageBox(NULL,buf,"File",0);
fprintf(file, "Connection closed\n");
fclose(file);
for(i=0;i<ProjectArrCnt;i++)
sprintf(buf,"%i",ProjectInfo[i].ProjectID);
//MessageBox(NULL,buf,"Proj ID",0);
//MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
return 0;
In the above code im geeting project D which is an integer value. But not able to get the project name.
Please some one guide me.As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.
-
How to compare previouse value in pl/sql array
DECLARE
CURSOR stg_raw_cur IS
SELECT RAW_STG_ID,
DEVICE_CD,
MODEL_VERSION,
PLATFORM_CD,
PROFILE_COOKIE,
LOCATION_CD,
SAMPLE_RATE,
EVENT_TYPE_CD,
to_char(to_date(to_date(substr(EVENT_DATE_TIME,1,8),'yyyymmdd')-1 ||
'T' ||
substr(EVENT_DATE_TIME,10,8)
|| 'Z','DD-MON-RR"T"HH24:MI:SS"Z"'), 'YYYYMMDDYY"T"HH24:MI:SS"Z"' ) EVENT_DATE_TIME,
EVENT_SPECIFIC,
BATCH_ID,
DWH_ARVL_DT,
DWH_ARVL_DT_ID,
DWH_CREATE_DT from dwh_stg.stg_raw where batch_id >= 200
order by batch_id asc;
TYPE stgrawarr IS TABLE OF stg_raw_cur%ROWTYPE;
stg_raw_rec stgrawarr;
l_batch_id NUMBER :=0 ;
v_ctr NUMBER :=0;
l_temp_batch_id number :=0;
BEGIN
OPEN stg_raw_cur;
LOOP
FETCH stg_raw_cur BULK COLLECT INTO stg_raw_rec LIMIT 100;
EXIT
WHEN stg_raw_cur%NOTFOUND;
END LOOP;
CLOSE stg_raw_cur;
for i in stg_raw_rec.first..stg_raw_rec.last
loop
dbms_output.put_line('batch id is '|| stg_raw_rec(i).batch_id );
IF l_batch_id != stg_raw_rec(i).batch_id
then
dbms_output.put_line('Different');
end if;
l_temp_batch_id := stg_raw_rec(i).batch_id;
commit;
end loop;
END;
I want to compare previous value of stg_raw_rec(i).batch_id if differnet then increament the value
else leave the same.
thanks.Try this,
FOR i IN stg_raw_rec.FIRST .. stg_raw_rec.LAST
LOOP
IF l_temp_batch_id != stg_raw_rec (i).batch_id
THEN
--increment
l_temp_batch_id := l_temp_batch_id + 1;
END IF;
DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id||' unique batch id is '||l_temp_batch_id);
-- DBMS_OUTPUT.PUT_LINE ('batch id is ' || stg_raw_rec (i).batch_id);
-- IF l_batch_id != stg_raw_rec (i).batch_id
-- THEN
-- DBMS_OUTPUT.PUT_LINE ('Different');
-- END IF;
l_temp_batch_id := stg_raw_rec (i).batch_id;
COMMIT;
END LOOP; -
Hi All,
I have two tables - TABLE1 & TABLE2 and both the tables are having STATUS column. The requirement is like if the STATUS column of TABLE1 is updated as "HOLD" then the same value has to be updated to the STATUS column of TABLE2.
create or replace trigger "TEST_TRG"
BEFORE
update of "STATUS" on "TABLE1"
for each row
begin
if(:new.STATUS ='HOLD')then
insert into TABLE2 (STATUS)
value (:new.STATUS);
end if;
end;
COMPILATION ERROR:
Compilation failed, line 3 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00103: Encountered the symbol "{" when expecting one of the following: ( begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "{" was ignored. Compilation failed, line 7 (02:40:14) The line numbers associated with compilation errors are relative to the first BEGIN statement. This only affects the compilation of database triggers.
PLS-00103: Encountered the symbol "}" when expecting one of the following: ( begin case declare else elsif end exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << continue close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe purge The symbol "}" was ignored.
I am getting the compilation errors as above when the trigger is compiled. Can anyone please help me to correct it.
Thanks and Regards,
SuhasCREATE OR REPLACE TRIGGER "TEST_TRG"
BEFORE UPDATE OF "STATUS"
ON "TABLE1"
FOR EACH ROW
BEGIN
IF (:NEW.status = 'HOLD')
THEN
INSERT INTO table2
(status
VALUES (:NEW.status
END IF;
END;You should learn how to write PL/SQL code.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.apress.com/9781430235125
http://apex.oracle.com/pls/apex/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Help needed on how to assign string value to variables in process designer
Hi,
I am using LC Workbench 8.0.1 version, I have a business requirement where in my form I have a dropdown box which contains two options i.e,
1. Accept
2. Decline
If the user selects Accept, I have to route the form to user some "x" or if the user selects Decline then the form should be routed to some user "y" .
To implement this I need to capture the user selected value which is a String.
can someone explain me how to reslove this..?
thanks and regards,
sudheerI'm assuming you're using a xfaForm variable that points to an XDP in the repository to render your document.
In that case, you set the Form Data Mapping to point to that xfaForm variable in the User step.
When the user submits the form the xfaForm variable contains the data for the form in an XML format. You can have multiple routes that come out of your user step that will check a certain value in the xfaForm variable.
The xml data for you form will be located under the /process_data/xfaForm/data/datasets/data node.
You can use an xPath similar to /process_data/xfaForm/object/data/xdp/datasets/data/myNode/MyField
you can also use the // notation to do a full search within the data node if you're not sure of the structure:
/process_data/xfaForm/object/data/xdp/datasets/data//MyFieldValue
I hope this helps.
Jasmin -
How to compare the value of a cell before changing and after changing.
Hey there,
Now I want to implement a JTable. And the requirement is that users can edit a cell in the Table only once. I think there are two possible ways. One is that after user edited a cell, I will set this cell read only. Another way is to compare the vaule before and after the changing. If it is different, then write back the previous value.
But I did not know how to implement in Java. Can anybody help me?
Thanks alot!
Shellyinevitably, you will have to save a before copy of
the data, what this many times amounts to is that you
will need to have 2 identical data structures before
you start or some type of locking mechanism for each
piece of data.Why is this inevitable? I don't see it as inevitable at all. In fact, it's quite simple to implement a TableModel that returns false when isEditable(int, int) is invoked for any cell that has already had setValueAt(Object, int, int) inovked on it, for example. Depending on the requirements and implementation a different methodology may be needed for determining when the edit has taken place, such as a custom editor that notifies the TableModel when stopCellEditing() is invoked. Heck, overriding editingStopped() in JTable to do it might even work.
So, create a TableModel that returns isEditabe(int, int) as true only if the cell hasn't been edited yet. The only problem to solve from there is how you know when it's been edited. I've already given you a few leads on that, it's not particularly hard but depending on your exact implementation it may require different solutions. -
How to compare 3 values in array
Hi all
This is my first post so please be tolerant
I need to find "bad values" in array, it will be easier to explain it using example so:
I have array like this: 0 0 0 0 0 0 0 0 5 0 0 0 0 <- so "5" is the bad value, my method is to check two of nearby values so x(i-1) = 0, x(i)=5 x(i+1)=0, and if checked value is more than 25% bigger or smaller it should be replaced by average of neighborhood.
next example: 0 1 2 3 4 9 6 7 8 <- bad value is 9, and result of my filter should be (4+6)/2 = 5
I've done it using formula node (not 20% and not average, but the point is the same) and it's working but now I want to do it without C and I had lots of problems with memory cause the size of array is 10000.
I attached vi and signal thah you can check that it's working fine
Thanks
Mike
Solved!
Go to Solution.
Attachments:
vi+signal.zip 62 KBMeeHow wrote:
next example: 0 1 2 3 4 9 6 7 8 <- bad value is 9, and result of my filter should be (4+6)/2 = 5
Shouldn't e.g. the value 4 be outside too, because the average of 3 and 9 (=5.5) is more that 25% different to 4?
Here is a quick draft comparing three versions (LabVIEW 8.2):
Your formula node version
the same algorithm in G
Something along the lines you are proposing here.
As you can see, the new idea is not quite satisfactory. It needs more thought. Still, these drafts should give you some ideas how to do it. Modify as needed.
Also your data is similar to a square wave and has these large step functions where the value changes dramatically. These should probably be ignored. Maybe you should look at the first derivative and replace parts where a large positive slope is immediately followed by a negative slope of similar size, for example.
You should also look at absolute steps instead of percentages. If you use percentages and the value is zero, everything is outside, because even 5000% of zero is still zero, right?
LabVIEW Champion . Do more with less code and in less time .
Attachments:
filter testMOD.vi 41 KB
Maybe you are looking for
-
Finder no longer showing full file name of mp3
How do i get finder to show me the full and complete file name (in my case, artist-title-label) for these mp3s? i can see the full name in the path at the bottom but i want to see it when i search it. My workflow with Ableton and creating text trackl
-
Game port already in use quit other application and try again?
ok didnt know where to post it but, i got a mac mini and im up to date on all updates. I play warcraft three frozen throne computer game on it. I play a few matches or so in custom games then boom a message pops up saying that another application is
-
Installing Mac OS 10.0 on PowerMac G4
I just got Mac OS 10.0 for my PowerMac G4, which currently runs Mac OS 9.1, and every time I try to install 10.0 using the install disk, the Happy Mac comes up at start-up as usual, but there is a small colorful spinning disk that freezes several sec
-
IPod wont sync - says corrupt no matter what i do
I have a late 2009 iPod that has had games put on it - how do i get them off? All of the music and everything has been wiped off. The iPod freezes iTunes and everything else when connected. I have reset it, then tried to restore it (when I finally
-
Why isn't my app installing?
I need to update my app on my ipad, and I am. But it won't load! It won't update! It just stays like that. And I don't wanna lose my high score.