extract numbers from string
i have a data file with a header that has several lines, which i read
firstline is a string that looks like
xpixels = 1024
i am trying to convert this to a variable called nx which has the value
is there a clean and easy way to do this?
> i have a data file with a header that has several lines, which i read
> firstline is a string that looks like
> xpixels = 1024
> i am trying to convert this to a variable called nx wh...Fitness Evaluation or Function Evaluation?
I'am a little embarressed to ask this question but here goes :)
Now the way i've seen it describe or i understand it, a fitness
evaluation for a genetic algorithm, usually used as a measure for
performance is basically the number of calls to evaluate an indivduals
fitness throughout the cycle of the GA, for example calls during
intialisation of the a popualtion of a 1000 individuals and workign
out there fitness is 1000 fitness evaluations.
For a truncation selection producing 1000 new offspring each GA cycle
i.e replace all is another 1000 fitness evaluations.
This goes on until co...evaluating generic inline functions
Say I have an inline function
which I would like to evaluate at N values from an Nx2
matrix (the columns of the matrix are x1 and x2,
respectively). If the inline function is fixed, there is no
problem in providing the input values for the calculation
of the output of the function itself.
I am trying to generalize this process to any inline
function, i.e. I would like to be able to define the inline
function as an input to a function e.g. Y=MYFUNCTION
('NAMEOFINLINEFUNCTION',datamatrix), and would like Matlab
to be able to recognize which columns...how to enter rows of string into one row ??
I am working on IPTV traffic . I have the following data
a=['9A 24 08 15 E2 FB 45 41 C2 66 00 CB C5 F7 61
B3 36 20 16 A6 EE 6C F1 7C 69 93 B3 36 1B 22
17 E2 F9 B1 70 DE 5B B5 CD CD 83 68 6B 8B E6
C1 A6 5B B0 6B DE 6E 34 C9 D9 E2 F9 B0 D9 8D
32 54 CB C5 F5 4C 95 32 D5 32 C4 71 7C 27 DD
7C 24 60 69 C7 C6 69 A0 42 22 03 4C 10 C8 02
26 28 69 34 97 20 9F 11 A2 DB DF 96 12 EA 8F
C7 FE 16 08 EC 0B 3F 19 2F 2F 7B 85 99 66 81
8B CB C5 31 07 96 62 9C 53 DA E2 A0 89 EF CD
8B 67 AA 16 1F 80 50 BB 2F 19 66 33 3B 0A 1E
60 A8 E0 B8 1A D7 30 00 06 66 A7 8C 8A 62 E7
71 9C 3...help parsing strings
in MS VC++ Express I need to know how to get from one comma delimited
text string to many strings.
main_string = "onE,Two,Three , fouR,five, six "
string1 = "one"
string2 = "two"
string3 = "three"
string4 = "four"
string5 = "five"
string6 = "six"
the white space needs to be removed and the case needs to be all upper
The result needs to be strings and not pointers or addresses in memory
so I can test:
I have it working but I have pointers for strings and can't convert
them back to...String replacement script
I have the following strings in a file:
Line 1: 10.34,6.78,9.45,9.19,ABB,ABB Grain Ltd,9.25,-15,"3,473",
Line 2: 1.23,0.86,1.08,1.04,AAH,Arana Therapeutics L,
The difference between both lines being that field 9 in line 1 is
encapsulated in inverted commas, whereas in line 2 it isn't.
I need a command which will remove the comma in field 9 and also
remove the inverted commas, so line one now appears as:
10.34,6.78,9.45,9.19,ABB,ABB Grain Ltd,9.25,-15,3473,9.19,9.25,10,f,
0.49,3.63,1.08...Read value and string from file
I have seen some post on this question but I have a bit of confusion, My task is, I want to read some values and corresponding string from the file
2.2 4.3 Red
3.4 2.1 Green
1.1 4.4 Blue
I stored this values in one of excel file so i want to read these values from file and I have to compare these values with the value I take from DAQ board,
for example i measure the value fro...String increment
I want a code that would generate strings like A1,A2.......A23, the reason I want it is because I am controlling excel with matlab and to enter the range I need those values to be incremented.....plz help me as my whole project depends on this
Adi gahlawat wrote:
> I want a code that would generate strings like A1,A2.......A23, the
> reason I want it is because I am controlling excel with matlab and to
> enter the range I need those values to be incremented.....plz help me
> as my whole project depends on this
I'm new to java and could use some help with a program that reads a string
and counts the Upper Case letters. I tried isUpperCase but it was only doing
a character not the whole string. Do I need some sort of next command or can
I change the string to something else? any help would be appreciated.
> I'm new to java and could use some help with a program that reads a string
> and counts the Upper Case letters. I tried isUpperCase but it was only
> a character not the whole string. Do I need some sort of next command or
> I change the string to something els...Tcl based Internet Toolkit is now available for download and evaluation #2
...Why some thing evaluate to #t when they should evaluate to false
Having some experience with Python, the following things evaluate to
False in a boolean sense:
False, None, , 0 etc
However in scheme the following evaluate to #t when passed as a
boolean to another function:
'(), 0, etc.
leading to extra typing such as
(if (not (null? x)) (do-when-list-has-stuff) (do-when-list-is-empty))
(if (zero? x) (do-false-thing) (do-true-thing))
when it seems more natural to me to do:
(if x (do-true-thing) (do-false-thing)) where x can be a null list and
works "like python" , since that is more familiar to me.
How/why? Is it un-idiomatic or un-s...binutils "strings" like functionality?
I am working on a little script that needs to pull the strings out of a
binary file, and then manipulate them with python.
The command line utility "strings" (part of binutils) has exactly the
functionality I need, but I was thinking about trying to implement this
in pure python.
I did some reading on opening and reading binary files, etc., and was
just wondering if people think this is possible, or worth my time (as a
learning exercise), or if something like this already exists.
I don't know anything about binutils strings, other than that a quick
google reve...Strings with Templates not working?
I'm using a template to simulate a LinkedList from Java.It works without
problems, but when I want to use strings in main.cpp instead of char*, I
get the following error message:
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct NULL not valid
I tried to import <string> both in main.cpp and listT.h, but the
errormsg was the same.
The classes look like this:
using namespace std;
int main(void)...Evaluate & catch problems
The word FFF isn't defined.
: y s" : x 1 2 fff ;" evaluate ;
: z ['] y catch ;
This stays in compilation state with -13 (undefined) on the stack. If
terminated with ; then X is defined as
: x 1 2 -13 ;
I suspect a really subtle bug. What should be the outcome?
Op Wed, 5 Jan 2011 13:49:59 -0800 (PST) schreef Alex McDonald:
> The word FFF isn't defined.
>: y s" : x 1 2 fff ;" evaluate ;
>: z ['] y catch ;
> This stays in compilation state with -13 (undefined) on the stack. If
How do you know -13 is on the stack, as Forth...Extract Number From Text String
Does xHarbour have a function to extract Number from a text string?
Dear Otto Haldi:
On Monday, September 17, 2012 11:48:58 AM UTC-7, Otto Haldi wrote:
> Does xHarbour have a function to extract
> Number from a text string?
David A. Smith
On Mon, 17 Sep 2012 12:05:13 -0700 (PDT), dlzc <email@example.com> wrote:
Thanks for your help. Yes, I know the function val()
I mean for that kind of string : "abc-2344-2323".
>Dear Otto Haldi:
>...String manipulation #2
I'm writing a program that requires some string manipulations. Let's say
I have a string
Now, the ascii code for 'x' is 0x78. I want to be able to perform
operations on this number, and print the character corresponding to the
results of the operation. For example, the pseudo-code looks like:
-read in string s from external file (for simplicity, we'll keep s='x')
-determine the code for s (should be 0x78 or 120 in base 10), store it in
-add a literal to c (let's say c=c+1)
-find out which character corresponds to the new co...How to "evaluate position" & "evaluate tangent" as Max 5 does with NURBS, math need?!
"evaluate position" "evaluate tangent"
as Max 5 does with a set of controll points forming a NURBS curve.
...strftime with format string %x
I want to use %x as directive to get the locale specific date
representation. But, at the same time, i want to know the format of
the output for interpreting it through program. Is there a way to get
the format of the %x directive (it differs across locales)? For ex,
default (locale is C), %x gives like %m/%d/%y.
> Hi All,
> I want to use %x as directive to get the locale specific date
> representation. But, at the same time, i want to know the format of
> the output for interpreting it through program. Is there a way to get
> th...dynamic evaluation from a database
I am writing some functional testing applications in watir and I am most
likely going to have this application store the data in a MySQL or
Oracle database. Since the tests are going to be in a constant state of
change I figure it might be best to store the scripts in the DB as well,
since this would allow me to re-deploy any code changes by updating the
clobs in the DB.
The are several ways to go about this, but was curious as to writing
stubs that just fetch the source directly from the DB using DBI to
evaluate it. In a general sense is this asking for too much trouble in
debugging or...Re: Count a string variable
You already have an answer. For your concete variables,
count = count (lowcase (catx (",", of cre:)), "yes") ;
or, more robustly,
count = count (lowcase (catx (",", of cre1-cre10)), "yes") ;
On Wed, 30 Sep 2009 07:39:50 -0700, Monisan <mokaesa04@HOTMAIL.COM> wrote:
>On Sep 29, 5:16 pm, Monisan <mokaes...@hotmail.com> wrote:
>> I need to count the number of Yes in a group of variables. The
>> variables are strings, so Yes is Yes not 1. Can I do this with...evaluating quote
(As context for my question: I am working on evaluating procedure
applications for the interpreter project in a class that is approximately
(define exp (quote (+ 1 2)))
(pair? exp) ; => #t
(symbol? exp) ; => #f
QUESTION 1: It is correct to say quote inhibits the normal evaluation of (+
1 2), but it does not inhibit the conversion of (+ 1 2) from an external
representation as a sequence of characters to an internal representation as
QUESTION 2: Is the value of exp a chain of 3 pairs?
"Marlene Miller" <firstname.lastname@example.org> writes:
...How to mid string on a binary string?
I'm needing to take a binary string start at a certain position and return a
pointer from that postion to the end of the binary stirng.
something like this:
pos=mid(bstr,35); / *return a pointer of the rest of the binary string
starting at element 35 */
Any help showing me how I can do this? I don't know how I can do a char
"jt" <email@example.com> wrote in message
> I'm needing to take a binary string
I'm not familiar with the concept of a...string templates
I was justing wondering how safe python string templates are to use with
unicode. I was just scanning pep 292 and it seems to say that they are --
or can by with inheritance... but I don't quite understand.
-- let me buy your intellectual property, I want to own your thoughts --
David Bear wrote:
> I was justing wondering how safe python string templates are to use with
> unicode. I was just scanning pep 292 and it seems to say that they are --
> or can by with inheritance... but I don't quite understand.
What do you mean with "safe"? I use string...Menu/Kernel/Evaluation/Evaluate Notebook
Is there a way to "know" whether the evaluation has been launched by
the Front-End Menu command Kernel/Evaluation/Evaluate Notebook ? Is
there an environment variable associated to this ?
...How to underline a string in Java?
I thinked direct draw a line is not a good way.Also,I don't need the
method of using HTML to implement this.Are there a good method to
underline a string in java?
"Bruce Sam" <firstname.lastname@example.org> schreef in bericht
>I thinked direct draw a line is not a good way.Also,I don't need the
> method of using HTML to implement this.Are there a good method to
> underline a string in java?
If the API would support underlining, then directly drawing a line isn't a
good way. But it isn't supp...