string

Converting graph to canonical string

I'm looking for a way of storing graphs as strings. The strings are to be used as keys in a map, so that two topologically identical graphs will map to the same value in the map. Does anybody know of such an algorithm? The nodes of the tree are labeled with duplicate labels being allowed. The program is in java and an implementation in...

How would you design an 8-bit encoding?

How would you design an 8-bit encoding of a set of 256 characters from western languages (say, with the same characters as ISO 8859-1) if it had not to be backward-compatible with ASCII? I'm thinking to rules of thumb like these: if ABC...XYZabc...xyz0123...89 were, in this order, the first characters of the set (codes from 0 to 61), th...

How do I get String value out of NSMutableArray

Code: [self.menuList addObject:[NSDictionary dictionaryWithObjectsAndKeys: NSLocalizedString(@"PropertySubtype2fTitle", @""), kTitleKey, publishNoOfRoomsViewController, kViewContro...

How to extract numeric values from a string in SQL Server

I have a string in a SQL Server table whose format is like this... nvarchar int nvarchar int nvarchar There are no obvious delimiters other than some chars are numeric and others are alpha. How do I reference the second int value? ...

Question about input data that should not be assumed except that there is one white space.

I'm writing a program that asks the user to enter their birth date. For it, I'm not suppose to know how the numeric data is to be enter except that there is one white space between the month, day and year. Right now, I have it reading the date as a String on one line and I am unsure how to do it so it meets the specifications of the prog...

reading a os.popen(command) into a string

I'm not to sure if my title is right. What I'm doing is writing a python script to automate some of my code writing. So I'm parsing through a .h file. but I want to expand all macros before I start. so I want to do a call to the shell to: gcc -E myHeader.h Which should out put the post preprocessed version of myHeader.h to stdout. Now...

jquery split textbox value into lines

What I am doing is creating a simple html page in which there is a textbox. A user posts some input to that textbox such as first last first last first last first last Imagine these are different names. What I would like to do is take the input in the textbox, and display it to the screen with the repeating names taken out, in alphabe...

Check if a string contains a string in C++

I have a variable of type string. I want to check if it contains a certain string. How would I do that? Is there a function that returns true if the string is found, and false if it isn't? ...

Python 3.1.1 string to hex

I am trying to use str.encode() but I get >>> "hello".encode(hex) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: must be string, not builtin_function_or_method I have tried a bunch of variations and they seem to all work in Python 2.5.2, so what do I need to do to get them to work in Python 3.1? ...

How to find a formatted number in a string?

If I have a string, and I want to find if it contains a number of the form XXX-XX-XXX, and return its position in the string, is there an easy way to do that? XXX-XX-XXX can be any number, such as 259-40-092. ...

How to find out if a character in a string is an integer

Let's say I want to look at the character at position 10 in a string s. s.at(10); What would be the easiest way to know if this is a number? ...

How to find the location of two consecutive spaces in a string

I want to check if my string has two consecutive spaces in it. What's the easiest way to find out? ...

Optimization of method for string replacement

Can anyone help me how to optimize this method? public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { VirtualPathData path = base.GetVirtualPath(requestContext, values); if (path != null) { string virtualPath = path.VirtualPath; string condition = string...

How can I resolve this case of `Useless use of a variable in a void context`?

How can I resolve this case of Useless use of a variable in a void context? For example: my $err = $soap_response->code, " ", $soap_response->string, "\n"; return $err; I get warnings like Useless use of a variable in a void context? Why? How can I resolve it ? ...

std::string formating like sprintf

Hi guys, I have to format std::string with sprintf and send it into file stream. How can I do this? ...

How to convert string to integer in C#

How do I convert a string to an integer in C#? ...

SSAS error when deploying cube in BIDs

I am getting the following error when deploying. This is in a cube which was working fine, all that has changed is a key column in one of the dimensions. Internal error: Failed to generate a hash string I have no idea what is causing this but even if I change the dimension back to how it was and try to deploy I get the same error. If...

What is the Python code to split up a string so that it prints out normally in an 80-character window without wrapping?

When I run my program (which decrypts a paragraph from a certain document), I have: W E T H E P E O P L E O F T H E U N I T E D S T A T E S I N O R D E R T O F O R M A M O R E P E R F E C T U N I O N E S T A B L I S H J U S T I C E I N S U R E D O M E S T I C T R A N Q U I L I T Y P R O V I D E F O R T H E C O M M O N D E F E N S E P R ...

How to test if a string contains any digits in C++

I want to know if a string has any digits, or if there are no digits. Is there a function that easily does this? ...

How to find the first character in a C++ string

I have a string which starts out with a lot of spaces. If I want to find out the position of the first character that is not a space, how would I do that? ...