I have a string representing an integer with spaces -- digits are grouped by three.
I was considering using strchr and strcat, as in:
char* remove_spaces (char* s)
{
char* space;
while (space = strchr(s, ' '))
{
*space = '\0';
strcat(s, space + 1);
}
return s;
}
But, first, I'm not sure it is safe...
I want to compile my C# code. I was parsing a string by "....",
string[] parts = line.Split(new[] { '....' }, 2);
Then I got an error:
Too many characters in character literal
The line looks like this:
abc.... starting word in english
I think that I need to convert .... to =. Then everything would work fine. Is there any oth...
Is anyone familiar with a Java library that helps with parsing the fields (date, subject, from, to) of the email below?
Message-ID: <19815303.1075861029555.JavaMail.ss@kk>
Date: Wed, 6 Mar 2010 12:32:20 -0800 (PST)
From: [email protected]
To: [email protected]
Subject: some subject
Mime-Version: 1.0
Content-Type: text/plain...
$var = '<img src="http://site.com/some_directory/filename.png"/>';
png can be replaced with any extension.
How to cut everything, except "filename" part?
And write into new variable. In this case:
$name = 'filename';
One more example:
$var = '<img src="http://site.com/directory/subdirectory/Pakahontos.txt"/>';
$name = 'Paka...
I am trying to retrieve a stock quote for EAG and embed it into a website.
The only info I need to get is the current price and the change. I know Yahoo offers an API and the URL I want to use is http://download.finance.yahoo.com/d/quotes.csv?s=EAG&f=l1n1
What I am lacking is the knowledge of how to parse the CSV file and display...
I'm wondering what would be the best way to parse this format:
map=
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...
I'm writing a little parser and I would like to know the advantages and disadvantages of the different ways to load the data to be parsed. The two ways that I thought of are:
Load the file's contents into a string then parse the string (access the character at an array position)
Parse as reading the file stream (fgetc)
The former wil...
Hello, constructing a tree given it's inorder is easy enough.
But, let's say you are supposed to construct a tree based on it's preorder (+ + y z + * x y z for example).
It's easy to see that + is the root, and how to continue in the left subtree from there.
But.. how do you know when you are supposed to "switch" to the right subtree?
...
I know we can grab information (with php) from any site and create own.
I'm talking about parsing some additional content like movie information (dates, budget, persons, etc) or video file properties from youtube (size, duration).
I'm excited on realizing of grabbing process from big sites and large amounts of information.
Seems there...
Hi
I have an XML feed coming in:
<?xml version="1.0" encoding="UTF-8"?><product>
<name>John</name>
<contact_email>[email protected]</contact_email>
<contact_telephone>01234 567</contact_telephone>
<url>www.johnsone.com.com</url></product>
I need to get this loaded to MySQL using php - have seen a few examples but all of them take a f...
Hi,
I have a database where one field gives spatial coordinates. I have learned the field is a serialised MSDN geometry Data Type (http://msdn.microsoft.com/en-us/library/bb933973.aspx).
I want to access this database from Python and was wandering if anyone knew the format of the Geometry Data Type, or any libraries capable of parsing ...
Hi,
I just wanna know using org.eclipse.jdt.core.dom.ASTParser if it is possible to parse only a java function?
This is how I tried: I passed the code of a function to the ASTParser.setSource(char[] s) as follows:
ASTParser parser = ASTParser.newParser(AST.JLS3);
parser.setKind(ASTParser.K_COMPILATION_UNIT);
parser.setSour...
My programmer's block is especially bad today, maybe you can help get me moving again?!
Supplement
I'm trying to parse out some CSV's from a legacy program we are trying to support. The part I'm trying to abstract is stored by the old program in a string
"Channel.Device.Element1.Element2.Tag:Description"
I am now storing this data ...
Hi this is my first post here hope you all are well. So Im just starting erlang and I ran into a problem im not sure how to tackle yet.
So I have a binary I am recieving in the form of
<<56, 23, 67, 34, 45, 78, 01, 54, 67, 87, 45, 53, 01, 34, 56, 78>>
My goal is to split it into a sub list (or binary if more efficient) based on t...
Hi guys,
I am trying to convert CSV file to MS Excel file.
one of the issue, is that my CSV file , which I am getting from client, is not well formed. I tried to parse it with different approach but none of them end up with expected results.
therefore I had to manually open the CSV file in Excel and save it as .xlsx and then use it for ...
Given:
A text (optional with HTML tags)
a database table with abbreviations and acronyms (like "etc.", "s.o.", ...)
Goals:
Build a parser that finds all occurrences in the given text
Build a small gui to let the user choose if the found occurrence matches (this will be swing by demand)
User has the option to ignore a matc...
Hi,
I'm using this code to parse XML in the instance variable response:
@implementation Delegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
MKFacebook *fbConnection = [[MKFacebook facebookWithAPIKey:@"----" delegate:self] retain];
[fbConnection login];
NSMutableDictionary *parameters = [[[NSMutableDictio...