Validate ascii value above a certain point javascript
Hi guys,
I'm wondering if it is possible to create a javascript function to validate within form items ascii values which are above a certain point, I would need to loop through the user input, through each character to check its ascii value but im unsure as to how to do this??
T.I.A
Stefan
Hi,
Something like
function LoopStr(pStr){
var a;
var c=160;
for(i=0;i<=pStr.length;i++){
a=pStr.charCodeAt(i);
if(a>c){j=i+1;alert('String '+j+' character '+String.fromCharCode(a)+' is not allowed');return false;}
}Br,Jari
Similar Messages
-
Remove Data values above a certain frequency
Hi,
I am analysing the resonance peaks of a vibration frequency spectrum with a bandwidth up to 10KHz, however am only interested in peaks situated between 1 and 4.5kHz. Is there a quick way to automatically remove the channel contents outside the area of interest, using a filter or a simple function?
Excuse my ignorance - Im new to the area!
Thanks
helHello Hel,
just use chnfiltcalc. Based on the channel your frequency values are held in you can set a FiltLowLimit (would be 1 Khz in your case) or a FiltHighLimit (would be 4.5 Khz). As FiltType you'll have to set 'Band pass' for only handling peaks between those limitations. You'll also have to decide on FilterType, FilterStructure and so on. Hope, you're familiar with filtering in general?
Hope this helps, just have a look at the help for further information on the other options required.
The simplest way to configure the chnfiltcalc function would be setting the parameters first (e.g. FiltLowLimit := 1 and afterwards just invoking the chnfiltcalc command.
Regards,
Julia -
Scan array for row above a certain value
Hello,
How do I go about scanning a string array of x and y data and output the row with data above a certain value. I have attached a vi that I started working on but do not know how to output the x and y data that is above -80.
Any help will be greatly appreciated.
Thanks,
hiNi.
Solved!
Go to Solution.
Attachments:
scan array.vi 11 KBHere's a version that might be better for large inputs, because it avoids constant resizing of arrays. Modify as needed.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
scan arrayMOD_CA.vi 14 KB
ScanArrayCA.PNG 8 KB -
Writing the ASCII value of a character found in a .txt file
I have a program that reads in a file and outputs certain characters to a new smaller file. The program works fine (thanks to some forum help) but I now need to print the ASCII value of the characters that are written to the file.
The problem I'm having (besides writing the ascii value of the char) is that the Unix .txt file has some weird properties. When I run the program on a .txt test file that I created with spaces in it, the program ignores the space characters.
Yet, when I run the program on the Unix file it wites the 'spaces' to the output file. That is why I want to write/print the ASCII value of the "blank "character in the Unix .txt file.
I already serached the forum and did a Google search for Char to ASCII conversion but I didn't find anything.
Thanks,
LS6v
Here's the code and the clips of the ouput files:
package source;
import javax.swing.*;
import java.io.*;
public class Scanner4
public static void main(String[] args)
getContents();
System.exit(0);
public static void getContents()
char charArray[] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'0','1','2','3','4','5','6','7','8','9','$','.', '#', '-', '/', '*', '&', '(', ')',' '};
String Chars = null;
String lineSep = System.getProperty("line.separator");
int iterator = 0;
int i = 0;
int charNum = 1;
int lineCount = 1;
// StringBuffer contents = new StringBuffer();
//declared here only to make visible to finally clause
BufferedReader input = null;
BufferedWriter out = null;
try {
//use buffering
//this implementation reads one line at a time
input = new BufferedReader( new FileReader( "C:\\testFile\\test1.txt" ));
out = new BufferedWriter( new FileWriter( "C:\\Scan file test\\Write\\test.txt" ));
String line = null;
out.write( "Character\tLine Number\tCharacter Number" + lineSep );
while (( line = input.readLine()) != null)
//contents.append(System.getProperty("line.separator"));
i = 0;
charNum = 1;
iterator = 0;
while( i < line.length() )
for( int count = 0; count < charArray.length; count++)
if( (charArray[count] != line.charAt(iterator)) && (count+1 == charArray.length) )
out.write( "[" + line.charAt(iterator) + "]\t\t" + "[" + lineCount + "]\t\t" + "[" + charNum + "]" + lineSep);
if( charArray[count] == line.charAt(iterator) )
break;
charNum +=1;
iterator +=1;
i++;
lineCount +=1;
catch (FileNotFoundException ex) {ex.printStackTrace(); System.out.println("File not found.");}
catch (IOException ex){ex.printStackTrace(); System.out.println("IO Error.");}
finally
try{
if (input!= null){
//flush and close both "input" and its underlying FileReader
input.close();
out.close();
catch (IOException ex){ex.printStackTrace(); System.out.println("IO Error #2.");}
My created .txt file:
1. a!asdsad
2. @
3. #
4. $
5. %sdfsdf
6. ^
7. &
8. *
9. (
10. )
11. _
12. +sdfsdfsdf
13. -
14. =
15. ~
16. `
17. dfgdfg;
18. :
19. '
20. "fghfghf
21. ,
22. dfgdfg<
23. .
24. >fghfghfg
25. /
26. gggggggggggggggggggggggg?
27. a
Output for my .txt file:
Character Line Number Character Number
[!] [1] [5]
[@] [2] [4]
[%] [5] [4]
[^] [6] [4]
[_] [11] [5]
[+] [12] [5]
[=] [14] [5]
[~] [15] [5]
[`] [16] [5]
[;] [17] [11]
[:] [18] [5]
['] [19] [5]
["] [20] [5]
[,] [21] [5]
[<] [22] [11]
[>] [24] [5]
[?] [26] [29]************************************************************************
Output generated after reading the .txt file from the unix box:
Character Line Number Character Number
[ ] [1] [17]
[ ] [1] [18]
[ ] [1] [19]
[ ] [1] [6530]
[ ] [2] [2041]
['] [29] [1834]
['] [29] [2023]
['] [30] [1834]
['] [30] [2023]
['] [30] [2066]
['] [47] [2066]
['] [67] [2067]
['] [77] [2066]
[+] [80] [28]Thanks I didn't even think to try and cast it to an int...
The tool I'm using to create my .txt in windows is Notepad.
I wrote a program to simply copy the original (3GB) Unix file and terminated it early so I could see what was there. What I found was some text and symbols and a lot of space between brief bursts of text. I can't really copy and paste an example because the amount of space is too large, it's basically a 3GB unformatted .txt file...
Unix file was created on: unknown
It sounds like the .txt file that I copied from the Unix box was formatted differently. But I thought that the formatting had more to do with end of line issues, not blank space between characters. Because a blank space should be seen by my program and ignored...
Here's the ASCII value of the "blank" spaces:
Character Line Number Character Number
[ ] [1] [17] Ascii Value: [0]
[ ] [1] [18] Ascii Value: [0]
['] [868] [2066] Ascii Value: [39]
[,] [877] [186] Ascii Value: [44]
[,] [877] [276] Ascii Value: [44]
Also, the Ascii value printed for the blank spaces looks like the number zero here but it looks like it has strange points on the bottom of it in my output file. It looks like the extended ASCII character 234 Ω -
How to find out the ASCII Values for Spanish character
Hi,
I had an requirement to store Spanish character and also need to fileter the records based on the Spanish character.
Kindly guide me for below.
To filter the Records which contains spanish characters?
To get the ASCII Values for the particular column?
E.g. we can find out the ASCII value of 'a' by using the syntax select ASCII('a') from dual.
But I want to find the ASCII Values for the particular column value. Ie. name.
E.g., Client name is "Suresh", I want to the ASCII Values for entire name of "Suresh".
Kindly do the needful help / Guidance on this.
Thanks,
OraharTo expand on what I said in my first post, you want to do something along these lines:
with t (thename) as
select 'Suresh' from dual
select thename
, substr(TheName, level, 1)
, ascii(substr(thename, level))
from t
connect by level <= length(thename);The output of the above query is:
THENAM S ASCII(SUBSTR(THENAME,LEVEL))
Suresh S 83
Suresh u 117
Suresh r 114
Suresh e 101
Suresh s 115
Suresh h 104
6 rows selected.Note that the WITH statement is only there to simulate a table for this example. With a table, all you do is get rid of the with and substitute the name "t" for the name of your table (also the name of the column to whatever name the column has in your table).
Lastly, I suggest you post your question along with, an example table and the output you'd like to get in the PL/SQL forum. There are people there that will give you all kinds of great ways of solving that problem.
HTH,
John. -
AIR application crashes at certain point in windows vista
Hi Dudes,
I am facing a problem in Window vista. It always crash when we open the window component using Adobe AIR. I am creating the Dynamic window and adding the child component as window.rawChildren.addChild(object) like this.. we made the setup , it is running perfect in all OS except Windows vista 32/64 bit.
When we work with our AIR application in conjunction with our own h/w product(Tablet Driver).[without connection of Tablet slate with PC it works fine but with it not].
S/w Details:- AIR Installer above 2 and SDK above 2.
OS- Win-Vista 32/64 bit.
AIR application crashes at certain point and shows the error like:-
Problem signature:
Problem Event Name: APPCRASH
Application Name: GTMP.exe
Application Version: 0.0.0.0
Application Timestamp: 4bde2f02
Fault Module Name: Adobe AIR.dll
Fault Module Version: 3.1.0.4880
Fault Module Timestamp: 4eb760e8
Exception Code: c0000005
Exception Offset: 003ca9be
OS Version: 6.1.7601.2.1.0.768.3
Locale ID: 2057
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txt
I found one more error in debugging mode..the Alert message is
Microsoft Visual C++ Runtime Library
R6025 -
pure virtual function Call.
As per my view it is about some .dll and .CPL file makes some issues with AIR Frameworks is it? !!!!..
Please give some ideas to resolve it.
by
BeerahamedkhanCould you try this against the released 3.2 version of AIR and our 3.3 beta to see if it still occurs? If so, please open a new bug report on this over at bugbase.adobe.com? Include any sample code or application to help us easily reproduce the problem. If you'd like to keep your code private, please feel free to send it to me directly at [email protected] In addition, if you can give us a .dmp of this crash it could be very helpful.
Please post back with the URL so that others affected can add their comments and votes. -
Duplex printing switches to single page at a certain point in pdf file
Hi everyone,
I have combined about ten separate pdf files into one complete pdf file for a client. The problem is that when they print the file using duplex printing, they're saying that at a particular point in the document it switches to single page printing instead of duplexing all the way through. It seems to be switching to this single page printing at the start of a particular section, ie. I mentioned that I had combined separate pdf files into the one document and it switches to the single pages where one of these separate documents start. I went back to the original Indesign file relating to this document and noticed that when I pdf this I can see the following in the range field that I assume is related to section numbering as the document contains sections:
Range: +1-+12
The other pdfs that were used to create the combined file also have sections but the abovementioned numbering doesn't appear in the Range section like the problematic pdf I mentioned above.
Can someone tell me why the duplexing stops at this certain point? Does it have something to do with the section numbering as explained above? Also, I have tried to reproduce the issue from my end but mine is printing it perfectly well, i.e it duplexes all the way through, so could it be an issue with their printer or some setting they have? Or can I fix it somehow from my end by manipulating the original indesign file that has the sections?
Really appreciate any help.It's probably on their Printer setup. Sometimes if you set print for duplex then another Operator comes in and uses the same printer and assumes it's simplex printing it can print duplex or whatever the previous print setting was used.
-
Can't link to a cell in another sheet at certain point
Hello,
this is the first time I use the support communities.
I have a continuing promblem with numbers ( v. 2.3). I'm working on a projekt for my univerity and are quite familiar with number. But at a certain point it get's impossible to link to another cell on a different sheet! This works fine until a certain point (which I actually don't know).....
I do the same stuff which I did very often before but it dosent work....
1. I click on the cell I want to have the linked value in it
2. I press = to start linking.
3. I go to the cell i want to take the data from (in another sheet).
4. The Box becomes white with the name and position of the source cell in it. But when I klick enter it dosn't work....
I really don't have an idea what this could be... It worke fine in the same way before a few hundered times... Is there any limitation of link's between the single sheets or something?
I'm very glad for any help in this issue
Regards,
GregorOn your last screenshot, you had moved off of the cell you were working on. The resulting formula/reference was not shown.
Becasue it is not in English, it is hard for me to tell for sure what might be going on. The reference in your third screnshot looked odd to me. In English it would be one of the following forms when referencing a cell on a different sheet:
Sheet name::Table Name::Cell address
Table Name::Cell Address
or, if "use header names as cell addresses" is on
Sheet name::Table name::column name row name
Table name:: column name row name
column name row name
The reference shown in your third screenshot doesn't seem to fit that pattern
I am assuming if you look at your resulting formula, the cell reference is not in a colored oval, it looks like plain text.
I've seen header names get misinterpreted by Numbers, like it can't figure them out and make a reference from them. If you are using header names as cell references, changing the names can fix it. Turning off that feature might also fix it. I don't use that feature usually; it often makes my formulas too long and complicated.
I have not seen a similiar problem with table and sheet names but you could try changing them to see if it helps.
Sometimes Numbers simply has a problem with a reference and you have to start over with the formula and it will work the next time. I don't know why, it just happens sometimes. -
How to validate the values inputted in Salestext view at MM02 before saving
Hello All,
Does anyone know what FM or user exit to use in order to validate the values inputted in Salestext view at MM02 transaction before saving it.
Regards,
AlfredHello,
Find the user exits if any after finding keep the break point in the exits and check that cursor is trigrring that exit or not. If it triggers check the value of the salestext exits in the exporting parameters or not.
if exits then keep do the validations.
UserExits MM02
MGA00001 Material Master (Industry): Checks and Enhancements
MGA00002 Material Master (Industry): Number Assignment
MGA00003 Material Master (Industry and Retail): Number Display -
Removing extra text after a certain point for a field
Post Author: ralph.devlin
CA Forum: Formula
Hello,
What we want to do is remove extra text, IE (PO12345.195) We would want to remove the .195 from the end of that data so that the groupings will group them correctly. How can I accomplish this. The defaul trim commands seem to only elimnate white space, I want to elimnate text up to a certain point. thanks
RalphPost Author: Charliy
CA Forum: Formula
You want to do an INSTR to locate the period, then a LEFT to only show the data before it. Something like:
IF INSTR({table.field},".") > 0 THEN LEFT({table.field},(INSTR({table.field},".") )-1) ELSE {table.field}
I subtracted 1 because in your example above the period is in position 8 and you want the first 7 characters. -
Validate a value against table validation value set within PL/SQL
Hi,
I am trying to import price list lines along with Pricing attribute values.
I have to validate the uploaded values against the pricing attribute value set, before I import them into base tables.
Value set defined is of type table validation.
I wanted to know if there are any public APIs that can be used to validate the value against the Value set values within my PL/SQL procedure
Also please point me to documentation that lists various public PL/SQL APIs
Regards,
MrutyunjayYou can find functions and procedure for Value sets in packages FND_FLEX_VAL_API or FND_FLEX_VAL_UTIL.
Example : get_table_vset_select gives you the select statement of your value set. Executing this statement will allow you to validate your values. -
Any std funtion(s) for Zero-padded, 2 decimal value, without the deci point
Hi,
We want Zero-padded, two decimal value, without the decimal point. For example if it is 14.31, we need 001431.
I have done "multiply" with 100 and "formatNumber" as '000000'
SFIeld --> multiply * 100 --> formatNumber (000000) --> TField
It works good for values with decimal like above 14.31, does it work for everything else too? I mean for 12 it is populating as 001200. Is this best approach? Is there any other std funtions or UDF sample available?
Regards,
N@v!n>
N@v!n Kumar wrote:
> Hi,
>
> We want Zero-padded, two decimal value, without the decimal point. For example if it is 14.31, we need 001431.
> I have done "multiply" with 100 and "formatNumber" as '000000'
>
> SFIeld --> multiply * 100 --> formatNumber (000000) --> TField
>
> It works good for values with decimal like above 14.31, does it work for everything else too? I mean for 12 it is populating as 001200. Is this best approach? Is there any other std funtions or UDF sample available?
>
> Regards,
> N@v!n
public void convert_number(String[] FieldValue,ResultList result,Container container){
FieldValue = FieldValue * 100;
result.addValue(FieldValue); -
How to find ASCII value of TAB ?
Hi Friends,
I am trying to find the ASCII value of the TAB character using the standard ASCII function like:
SELECT ASCII('<TAB>') FROM DUAL;
I am executing the above command in SQL*Plus.
It is not treating it as TAB.
It is treating it as space and giving ASCII value of Space -32.
Please let me know how to achieve this?
Database Version - 9i
Regards
Sreekanth Munagala.Well, evidently mine are smarter... :-)
SQL> select * from v$version;
BANNER
Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
PL/SQL Release 9.2.0.8.0 - Production
CORE 9.2.0.8.0 Production
TNS for 32-bit Windows: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production
SQL> select ascii(' ') from dual;
ASCII('')
9
SQL>
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> select ascii(' ') from dual;
ASCII('')
9
SQL> -
How to convert ascii value into character and vice versa
Hello the java world people,
I want to convert each characters from my array into their corespondent ascii value and vice versa, how can I do that ?The term "ASCII" is often used very loosely.
Java char values are UNICODE and the ASCII codes are indentical to UNICODE characters in the range 0 .. 127. UNICODE values 128 and above don't have coresponding ASCII values, though 128-255 corespond to ISO-8859-1 which is one of the encodings often called "extended ASCII".
As shown above you can covert between chars and coresponding int value simply with a cast, but you should be aware that the more exotic characters will not give you sensible values. -
Hey, I'm trying to install Adobe Flash on my Macbook Air. At a certain point it asks for my password but it doesn't take it. So I cannot continue installment. I have reset my password already. Still the same problem. How can I continue to install when it keeps asking for a password it doesn't recognize over and over again? How many times do I have to reset it then? Advice please
You have to provide your computer's administrator password in order to install Flash Player.
Maybe you are looking for
-
I got a new computer for home and I am trying to transfer all of my music, movies, photos and apps from my IPAD. I have been using my work computer ofr this in the past but want to change to my new home computer. I can't figure out how to do this w
-
Does time machine work with iphoto 6
Just connected an external drive and turned on time machine in Leopard. Doesn't seem to work with iphoto. Do I need to upgrade to 8?
-
Modify SOAP Namespace for ABAP WS
Hi Experts, I need to modify namespace on the web service, I have to provide this WS from an ABAP AS 7.0 SP10 (we don't have XI or PI infrastructure) but the request generated from SAP WSDL is like this: <soap:Envelope xmlns:soap="http://schemas.xmls
-
Hi All, i have 5 internal tables. Each table contains some data. in selection screen i have five files. i willenter the file name and i select the download radiobutton then it has to download the data. My question is i have to use single download fun
-
I am using DVDSP 3 and have been working along and all of a sudden, it won't let me import some files (from Compressor) into my project. It won't import anything (stills, etc). But, it will let me import these same assets into another project. Any re