To find out the position on a string..
Hi,
I want to write a oracle query where i will pass the string and it will give me the position of 'a' on that string.
I dont want to write the procedure, only the select statement. Could we do this..
Like if i will pass Haraprasad, it should give me 2,4,7,9
if i will pass Gopala, it should give me 4,6
Thanks,
Haraprasad..
Like if i will pass Haraprasad, it should give me 2,4,7,9
if i will pass Gopala, it should give me 4,6nice homework assignment.
How are YOU going to solve this?
Similar Messages
-
To find out the POSITION OF Nth OCCURANCE OF A PARTICULAR CHARACTER
Hi,
Is it possible to find out the POSITION OF Nth OCCURANCE OF A PARTICULAR CHARACTER IN A STRING in crystal reports?
Eg:
I have a string abcdabcdabcd
Now I want to know the position of the 2nd occurance of u2018au2019 in the string u2018abcdabcdabcdu2019hi,
dim MainStr as String=u2018abcdabcdabcdu2019
dim SubStr as String='a' 'Give which alphabet do you want.
dim Num as integer=2 'Give which 'a' do you want. i gave for second a.
dim ResultStr as string
dim ResultNum as integer=1
dim Position as integer=0
for i as integer=0 to MainStr.length-1
ResultStr=MainStr.SubString(i,1)
if ResultStr=SubStr then
ResultNum+=1
if ResultNum=Num then
position=i+1
exitfor
endif
endif
next
hope this solves your problem
regards,
varma -
How to find out the position in which an application hangs
Hi,
is there any possibility to find out the position in a source, in which a deployed application hangs?
For example, there is an endless loop in an application, which is already deployed. In runtime the application hangs in this loop. How can I findout in which line the application hangs?
In other words, how can I see the stack of a certain process,for example, http_workerx?
Regards,
Ali
Message was edited by:
Ali Maraschi-SchouschtariHi Ali,
With <b>SAP NetWeaver Composition Environment (CE) 7.1 SP3</b> it is very easy.
<i>1.) Open the SAP Management Console
2.) Go to AS Java Threads tree node - you will see all the threads that are currently started on the system
3.) Check for threads that are colored in red - it takes about 30 sec the system to detect that an HTTP thread (http_workerx), as it is in your case, is hanging/executing endless loop.
4.) Right click on the hanging thread (colored in red) and pick 'Callstack' from the pop-up menu
5.) In the new window you will see the stack-trace showing what exactly this hanging thread is doing at the moment.</i>
With the <b>previous versions (or SPs)</b> you need to apply a little bit more technical skills for the same result. <i>(1) you need to do produce thread dump of the server that is suspected to have hanging thread</i> and (<i>2) to analyze this thread dump (check what the threads in Running state are doing).</i> As it is in your case with the HTTP worker threads, their names are also printed in the thread dump, so you can focus only on them. -
How to use statement "search" to find out the asterisk in a string?
Hi Guys,
I encouter this question:I need to use "search" statement to find out the asterisk or the underscore in one string,you know these two symbols are wildcards. I don't know how to use statement "search" to find them??
could you please give me some help!!
Thanks a lot,Villy.Lv
Edited by: Villy Lv on Sep 26, 2010 6:50 AMHi,
You cant usesearch statement, rather did you try with CS using IF condition? even you can go with loop statement too.
DATA STRING TYPE STRING.
DATA C TYPE C.
DATA LEN TYPE I VALUE 0.
DATA I TYPE I VALUE 0.
LEN = STRLEN(STRING).
LOOP LEN > I
C = STRING+I.
IF(C == '*' OR C == '_').
ENDIF.
I = I + 1.
ENDLOOP.
This way also you can use.
Hope this may help you.
Regards!
Sheik -
Is a way to find out the encoding of a String?
Doesn anyone know how to find out the encoding?
There are some circumstances in which a file (or more
generally, a stream) may expose its own encoding,
IIRC. But of course that's the exception, not the rule.As part of a higher level protocol, sure. HTTP, for example, may have it in a couple places (headers or in the HTML head section). Plain text files do not, however.
But anyway at this point I'm not convinced that
anyone knows for sure what the OP wanted or needed.I agree with that. Not convinced the OP knows, either.
Was he really looking for a heuristic to correctly
y guess the encoding of a stream of bytes, so that
encoding could be used as input to a String
constructor? Or did he just not know how to use the
API?To the OP:
If you have a String, there's no encoding, it's all Unicode chars in the string.
If you have a bunch of bytes (byte[], file, input stream, whatever), then there is some encoding. If you don't know what the encoding is, there's no 100% sure way to figure it out. Some code exists, as mentioned, that can make educated guesses, particularly if you know it's one of a few possible choices. Beyond that, bytes are bytes are bytes, and how they are interpreted by character based classes/methods (like new String(byte[], String)) is defined by the encoding you tell it to use.
So aside from that, what's the issue you're trying to solve? -
Find out the peak position from graph
Hello All,,
Actually i want to run this algorithm real time,, to find out the peak position from graph ,, i need to generate the position automatically,,, firstly i try to use image processing by apply threshold followed by edge detection and the find out the center of each detected part. the drawpack of this procedure is that the obtained images are different and that lead to different threshold values,, so how can i directly find the position from the graph,,, here i attach the image and the graph of the image,,
thank you,,
Attachments:
11.png 15 KB
13.PNG 85 KBHello Klemen:
here i will explain in more details: the main objective of my work is to calculate velocity of small particle,, i perform my experiments by exposing the particle to 2 light pulses,, and i know the time between the two pulses,, so i need to know the distance to calculate the velocity,,, for that i apply correlation,,, the spot that appear in the correlation image is an indication of symmetry,,,so i should know the location of maximum intensity of each peak. The central peak (highest intensity) will be the reference (zero point) and the other peaks locations should be subtracted from the reference peak to determine the shift,,,
Here is the sequence of the process:
Acquiring raw image, correlation, position of central peak, shift calculation, velocity determination,,,,,
applying image processing is good idea in case of post processing condition,,, but in my case i need it real time, that mean if i need to apply image processing for calculation, i have to find out a universal criteria for threshold value that can be applied for all raw images,, from my experiments i didn't find specific criteria & i have to manually change the threshold value,,
If I choose the intensity (grey level) to be the criteria, then the small peaks (symmetry) will not take place,, because their intensity is very low compare to the central peak,,,
So the most reliable procedure is to directly find out the position of the two small peaks beside the central peak and save this values into an array and use it for calculation,,, I hope I am clearly explain my problem..
Thanks
Attachments:
7-2.png 36 KB
7-1.png 3 KB
7-700.PNG 123 KB -
How to find out that position is a chief position or not?
Hi All,
Kindly let me know to find out the position is a chief position or not?
I have to display various positions with Y if it is a manager and N if it is not.
Thanks!
SachinHi
1. tcode PPOME
2. select the position by double click
in the overview position, chief position will be differentiate by symbol a person with red clothes and wearing a hat
in the tab "Basic Data", chief position can be defined if the "Head of own organizational unit" is being ticked/flagged.
Head of Organizational Unit
If you flag this field, the position becomes the chief position of the organizational unit that it belongs to. When this position is displayed again, it is automatically flagged and is automatically the chief position.
Technically, a relationship (A/B 012) is created between the organizational unit and the position.
Field Name : OMLEADER
Data Element: HROMLEADER
hope this info helps you.
best regards,
dhenny muliawaty (pei pei) -
How to find out the index in string.
Hello Experts,
I have a requirement in which i have to find out the index of the last space before the 50th position in a string.
is there any way other than spliting the string.
e.g. if string is - 'aaaa aaaa aaa........ aaa aaa'(length is more than 50)
i want the last space before 50th char.because i want to split the string before last word withing 50 th character
please help.
Thanks,
ShwetaHi Shweta,
You can build up the logic from this below program.
data: line(75) value 'abcdefghijk lmnopqrstuvwxyz zyxwvutsrqponml kjihgfedc ba',
n_line(50),
off type i,
val1(50),
val2(50).
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
STRING = line(50)
LANG = ' '
IMPORTING
RSTRING = n_line
EXCEPTIONS
TOO_SMALL = 1
OTHERS = 2.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
SPLIT n_line at space into val1 val2.
off = strlen( val1 ).
off = 50 - off.
write: 'The index of the last space before the 50th position is at ', off.
Hope this may help you.
Regards,
Smart Varghese -
Looking for a way to find out the x,y coordinates of a string inside a PDF
Hi!
I'm looking for a way to find out the x,y coordinates of a string inside a PDF (with free java api's only)
I got a pdf, and a string to find inside it, what i need to do is to get this string x,y position inside that pdf....
If any one knows of such, plz let me know...
Thanx ahead
Daniel.vedmack wrote:
Hi!
I'm looking for a way to find out the x,y coordinates of a string inside a PDF (with free java api's only)
I got a pdf, and a string to find inside it, what i need to do is to get this string x,y position inside that pdf....
If any one knows of such, plz let me know...
Thanx ahead
Daniel.AFAIK, a string of text does not have an (x,y) location inside a PDF file. The location is exists on your screen, and will differ whenever you adjust the resolution of it. Text can have a location when it's stored as an image though, but than it's really the location of a certain number of pixels (not necessarily a string!). -
How to find out the type of the value stored in a string variable?
Hi,
How do i find out the type of the value stored in a string variable?
for example,
I have a string variable str, in which the following type of values wil be stored
1) Intger
2) Long
3) boolean
4) Char
Is there any method to find out the type of the value, anything like str.getType()?. Please kindly help me. Thanks in advance.Hi All, i'm sorry for the double posting, by mistake it occured.
Thanks for your replies, i have a string variable str, in which the value is stored and i have another string variable type, in which the type of the value is stored.
For example,
String str = "15";
String type = "Integer";
Is there any way to verify whether the value stroed in str is of type stored in the variable 'type'. I want to write a method of type boolean, it will throw true of the value stored in str is of type 'type'. Thanks -
How to find out the list of all user's whose passwords are expired
Hi
i had tried to find out the list of all user's whose passwords are expired.
i had written some jndi code by finding the max age and then find out the current time and subtracted this current time from max age using the following code
"Attributes attbts=ctx.getAttributes("cn=pwdpolicy");
String maxAge=(String)attbts.get("pwdMaxAge").get();
Date Today = new Date();
System.out.println("maxAge"+maxAge);
long curTime=(Today.getTime())-Long.parseLong(maxAge)*1000;"
and then parse it and create a string time as follows
String time=year+month+day+hour+minute+second+"Z";
where "year" "month" etc were parsed from curTime
now i can get the list by using following code
"String filterCriteria="(&(objectclass=person)(pwdChangedTime>="+time+")";
NamingEnumeration results = ctx.search(baseDN,filterCriteria, sc); "
but the current time which i am getting is the time of my system not the time of ldap server
so my questions are following;
1.Can there is any way by which i can get the tivole sever's system time.
2.If there is no way then can you suggest any other way to find out the list of user's whose passwords are expired.
please help me.
Thanks.
Krishan Rathi.Hi,
Thanx for ur reply..
I got the list from the table...
thanks,
sivagami -
Suppose that several VIs running simultaneously on the same computer. How can I find out the names of the running VIs, from another VI?
If the already running VIs are clones of the same basic VI, open and run with the option "Prepare to call and forget", how can I find out the names and index of each clone?I had an application where I spawned (= ran with Start Asynchronous Call) multiple (reentrant) copies of VIs, and would occasionally "lose control" of them. I needed a way to find all VIs that were running "Top Level" and stop them (so I didn't have to log off from Windows).
I used the Application Property "All VIs in Memory" to get an array of (wait for it ...) All VIs in Memory. I took each name, opened a VI reference to it (simply wire the name string in, as the VI is, by definition, "in memory"), looked at its VI Execution State, and if it was Run Top Level, Invoked the FP.Close and Abort VI Methods. [To prevent the VI that did all this from "committing Suicide", I compared the name string with the current Call Chain, and did nothing if there was a match].
I think you could adopt this idea to do what you need.
BS -
How do I find out the ID of a reminder created with an applescript?
I created an applescript to create a reminder from Quicksilver, but I want it to show the reminder once it has been created if Reminders was already open. If I use this, then another reminder with the same name sometimes gets shown. How do I find out the ID of a reminder when I create it and set it to a variable so that it will select the reminde I want it to, and if this is not possible, how should I do it?
Here is the applescript:
using terms from application "Quicksilver"
on process text reminderData
if reminderData is "help" then return "Syntax: \"Name:Priority Time Date List Notes\""
set isName to true
set isPriority to false
set hasBeenPriority to false
set priorityEntered to false
set isTime to false
set hasBeenTime to false
set timeEntered to false
set isDate to false
set hasBeenDate to false
set dateEntered to false
set isList to false
set hasBeenList to false
set listEntered to false
set isNotes to false
set reminderName to ""
set reminderPriority to ""
set reminderTime to ""
set reminderDate to ""
set reminderNotes to ""
set reminderList to ""
set reminderDataCharacters to the characters of reminderData
repeat with i from 1 to number of items in reminderDataCharacters
set currentItem to item i of reminderDataCharacters
if isName is false and hasBeenPriority is false then set isPriority to true
if hasBeenPriority and hasBeenTime is false then set isTime to true
if hasBeenTime and hasBeenDate is false then set isDate to true
if hasBeenDate and hasBeenList is false then set isList to true
if hasBeenList then set isNotes to true
if isName then
if currentItem is ":" then
set isName to false
else
set reminderName to reminderName & currentItem
end if
end if
if isPriority then
if currentItem is "!" or currentItem is "-" then
if currentItem is "!" then set reminderPriority to reminderPriority & "!"
set priorityEntered to true
else
if currentItem is " " and priorityEntered then
set isPriority to false
set hasBeenPriority to true
end if
end if
end if
if isTime then
if currentItem is " " then
if timeEntered then
set isTime to false
set hasBeenTime to true
end if
else
if currentItem is not "-" then set reminderTime to reminderTime & currentItem
set timeEntered to true
end if
end if
if isDate then
if currentItem is " " then
if dateEntered then
set isDate to false
set hasBeenDate to true
end if
else
if currentItem is not "-" then set reminderDate to reminderDate & currentItem
set dateEntered to true
end if
end if
if isList then
if currentItem is " " then
if listEntered then
set isList to false
set hasBeenList to true
end if
else
if currentItem is not "-" then set reminderList to reminderList & currentItem
set listEntered to true
end if
end if
if isNotes then set reminderNotes to reminderNotes & currentItem
end repeat
if reminderDate is not "" then
if reminderTime is "" then set reminderTime to time string of (current date)
end if
if reminderTime is not "" and reminderTime does not contain "am" and reminderTime does not contain "pm" then
try
if (item 1 of the characters of reminderTime) as number is greater than or equal to 8 and (item 1 of the characters of reminderTime) as number is less than or equal to 11 then
set reminderTime to reminderTime & "am"
else
set reminderTime to reminderTime & "pm"
end if
end try
end if
try
set reminderDateAndTime to date (date string of (date (reminderDate & "/" & last word of (date string of (current date)))) & " " & time string of (date reminderTime))
on error
set reminderDateAndTime to false
end try
createReminder(reminderName, reminderPriority, reminderNotes, reminderList, reminderDateAndTime)
tell application "Quicksilver" to show notification "The reminder was created successfully" text "Quicksilver successfully created your reminder."
end process text
on createReminder(theName, thePriority, theNotes, theList, theDate)
if thePriority is 1 then set thePriority to 9
if thePriority is "!" then set thePriority to 9
if thePriority is 2 then set thePriority to 5
if thePriority is "!!" then set thePriority to 5
if thePriority is 3 then set thePriority to 1
if thePriority is "!!!" then set thePriority to 1
tell application "System Events"
if exists process "Reminders" then
set wasOpen to true
else
set wasOpen to false
end if
end tell
tell application "Reminders"
if theDate is false then
try
make new reminder at list theList with properties {name:theName, body:theNotes, priority:thePriority}
on error
make new reminder with properties {name:theName, body:theNotes, priority:thePriority}
end try
else
try
make new reminder at list theList with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
on error
make new reminder with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
end try
end if
if wasOpen then
show reminder theName
else
quit
end if
end tell
end createReminder
end using terms fromThis seems to find the ID, which is sort of the answer to my question, but I still don't seem to be able to use it to show to right reminder. I get this error:
error "Reminders got an error: Can’t make reminder id \"1E436B16-561C-4F88-8CA6-78029BE68BBF\" into type integer." number -1700 from reminder id "1E436B16-561C-4F88-8CA6-78029BE68BBF" to integer
What is wrong, and how should I fix it?
Here is the createReminder block now:
on createReminder(theName, thePriority, theNotes, theList, theDate)
if thePriority is 1 then set thePriority to 9
if thePriority is "!" then set thePriority to 9
if thePriority is 2 then set thePriority to 5
if thePriority is "!!" then set thePriority to 5
if thePriority is 3 then set thePriority to 1
if thePriority is "!!!" then set thePriority to 1
tell application "System Events"
if exists process "Reminders" then
set wasOpen to true
else
set wasOpen to false
end if
end tell
tell application "Reminders"
if theDate is false then
try
set theReminder to make new reminder at list theList with properties {name:theName, body:theNotes, priority:thePriority}
on error
set theReminder to make new reminder with properties {name:theName, body:theNotes, priority:thePriority}
end try
else
try
set theReminder to make new reminder at list theList with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
on error
set theReminder to make new reminder with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
end try
end if
set theID to the id of theReminder
if wasOpen then
show theID
else
quit
end if
end tell
end createReminder -
How to find out the properties of a field's/object's?
Hello
I have field (say, its name is field_1) in my_form and i am coloring yellow by using below code of initialization event:
this.ui.oneOfChild.border.fill.color.value = "255,255,191"; (Actually, just for differentiating / tracing back purpose here am assigning this yellow color to this field, you can suggest me any thing else that marks / tags this field (i can not populate a value, bcz its visible to user), so that in the CHANGE event of this field, again i want to check/get/know that whether this field is tagged/marked or not)
fine. But, because of some/below reason, i need to find out its color by using JavaScript, pls. let me know how to figure out its color is as yellow by using JavaScrit?
Reason: If field_1's color is YELLOW (or you suggested any tag/mark as said in the above in red text), then i have to make HIDE the field_2
Field_0's position is extreme left, Field_1's position is middle and the Field_2's position is exterme right of the page.
I guess, i hv only one option of finding out color, hence am looking forward for JavaScript to find out the color of a field in question
(OR)
Also, pls. let me know the JavaScript that How can i make HIDE a check box for that COMLETE session (i mean, starting from launching the form in the browser until he closes the window/browser/tab/form), i guess, this idea also workes for my requirement, ( i want to put this code in the docReady event) .....no matter/what ever code is existing there in any event of that field level
Thank youThe unix file command:
file *
foo.doc ms-office file / word
bar.png png image, 32x32 pixels, no transparency
moo.hhml html text
note that as in the last - file names are ignored, it works by checking the beginning of each file's data against it's database, and as in #2 it can sometimes see a lot more than just the file format.
Don't know of a windows port, you could try cygwin -
How to find out the application server instance name?
Hi,
I installed an Oracle application server a long long while ago and completely forgot the things about the installation, including the name of the instance (I installed single instance, not cluster). Now I am trying to create a connection to the application server and I am prompted to fill in the instance name. Where in the installation can I find out the instance name?
The version of the server as displayed when the server is started:
$ ./oc4j -start
Starting OC4J from /oraInventory/j2ee/home ...
09/10/08 16:04:39 Oracle Containers for J2EE 10g (10.1.3.2.0) initializedThis 10.1.3.2.0 number is somewhat confusing. As I understand it, right now if you download a copy of the Application server from Oracle web site, the current version is 10.1.3.1.0.
I am also reading the installation guide now and when looking at the server starting messages on the screen, I realize that installing the server in the oraInventory directory is not quite right. Does that interfere with the correct functioning of the server? I installed it but have never tried to use it until now.
Many thanks for your help!
NewmanJ. Newman wrote:
Hi,
I installed an Oracle application server a long long while ago and completely forgot the things about the installation, including the name of the instance (I installed single instance, not cluster). Now I am trying to create a connection to the application server and I am prompted to fill in the instance name. Where in the installation can I find out the instance name?If you have access to that server, then the following should give the instance name.
grep 'IASname' $ORACLE_HOME/config/ias.properties
you should also see it in the AS Control Console page.
The version of the server as displayed when the server is started:
$ ./oc4j -start
Starting OC4J from /oraInventory/j2ee/home ...
09/10/08 16:04:39 Oracle Containers for J2EE 10g (10.1.3.2.0) initializedThis 10.1.3.2.0 number is somewhat confusing. As I understand it, right now if you download a copy of the Application server from Oracle web site, the current version is 10.1.3.1.0.
Regarding the version numbers, this fourth digit refers to the Component-specific release number. The OAS documentation says this about it.
"This digit identifies a release level specific to a component. Different components can have different numbers in this position depending upon, for example, component patch sets or interim releases."
I am also reading the installation guide now and when looking at the server starting messages on the screen, I realize that installing the server in the oraInventory directory is not quite right. Does that interfere with the correct functioning of the server? I installed it but have never tried to use it until now.
Many thanks for your help!
NewmanI think Oracle software should always be installed in a separate directory. I think it may also generate errors in its functioning but it will certainly create a whole lot confusion and mess in later administration and configurations.
hope that helps!
AMN
Edited by: AMN on Oct 8, 2009 5:14 PM
Maybe you are looking for
-
Configuring IdM7.1 on SJS application server 8.2 using Mysql DataSource
Hi all i tried to configure MysqlDatasource on Sun Application server EE 8.2.The operating system is Solaris10. i am able to successfully create the connection pool and JDBC datasource (jdbc/trialdb) but when i ran the command lh setRepo -v -tDatasto
-
Problem Syncing music to iPod....PLEASE HELP!!!
When I click on the sync ipod icon a warning message pops up saying that the songs can't sync because all playlists selected to sync no longer exist. What can I do to fix this problem???
-
Hello all, A company I work for is hosting an application at a popular managed hosting provider and are using the css11501s to do layer-5 load balancing between a set of application servers. We are seeing a strange error that seems to occur when the
-
DSO Activation duration / monitoring
Hi, in english: During the activation-process I like to know how long the rest of the activation process will last. This should be displayed either in percentage of the total amount or in minutes or hours. I found a couple of similar questions in the
-
Node strategy for managing many data points
Earlier with the older JavaFX there were issues where rendering many nodes could really slow the scenegraph down. Is there now some strategy for how to let the scenegraph efficiently render only the nodes for data that actually intersects the visible