Hello all,
I am not sure if its possible but I would like to create some sort of function where you pass in a string such as "yellow" or "green" and it returns its hex code or the range of hex codes that greens or yellows fit into.
Is this possible in PHP? If not possible, I am willing to try anything else that can do this!
Thanks all
I was wonding if there was an alternative to itoa() for converting an integer to a string because when I run it in visual Studio I get warnings, and when I compile my program under Linux, it won't even compile.
Thanks,
tomek
Example: I want to do this:
METHODNAME(5) {
// do something
}
which results in:
- (void)animationStep5 {
// do something
}
Is there any way to do this? Basically, what I need is a way to generate a real source code string before the program is compiled, so the compiler does see - (void)animationStep5...
Or maybe there's something different than a macro, which can help here to auto-generate method names (not at run-time)?
given an xml string like this:
<some><nested><xml>value</xml></nested></some>
what's the best option (using ruby) to format it into something readable like:
<some>
<nested>
<xml>value</xml>
</nested>
</some>
I'm parsing some code and want to match the doxygen comments before a function. However, because I want to match for a specific function name, getting only the immediately previous comment is giving me problems.
Is there a way to search backward through a string using the Python Regex library?
Is there a better (easier) approach that I'm missing?
In Perl, I would write:
$x = "abbbc";
$x =~ s/(b+)/z/;
print "Replaced $1 and ended up with $x\n";
# "Replaced bbb and ended up with azc"
How do I do this in Python -- do a regular-expression string replacement and record what it was that got replaced?
Some app is hitting my site excessively from GAE. Here is the browser string in the logs:
AppEngine-Google; (+http://code.google.com/appengine; appid: ware)
Can that app be identified ? "appid" would seem to indicate this but it doesn't seem to be the case.
Hi there,
I'm using Visual Studio 2005 and have a DataTable with two columns and some rows that I want to output to the console. I hoped there would be something like:
DataTable results = MyMethod.GetResults();
Console.WriteLine (results.ToString());
What's the best way (i.e. least amount of coding from me) to convert a simple DataTable to a string?
Thanks,
Mark.
int i = 4;
string text = "Player ";
cout << (text + i);
I'd like it to cout "Player 4"
^ The above is obviously wrong but it shows what I'm trying to do here. Is there an easy way to do this or do I have to start adding new includes?
I have a method which has domain name as a String parameter.
def modelName="Equity"
I want to use it like
def results=modelName.findAll()
Please guide me!
Definition:
A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction
How to check if the given string is a palindrome?
This was one of the FAIQ [Frequently Asked Interview Question] a while ago but that mostly using C.
Looking for solutions in any and all languages possible.
My string looks like:
$fullPath = $dirName . "/" . $file;
If I replace / with \, it gives error: "Expecting identifier or variable". I want to store in the latter way itself. How to override anything coming in between?
I'm reading a comma-delimited list of strings from a config file. I need to check whether another string is in that list. For example:
"apple,banana,cheese"
If I check for "apple" I should find it, but if I check for "app" I should not.
What's the most straight-forward and concise way to do this? It doesn't have to be fast.
(I'll add my solution as an answer, but I'm hoping someone has something better.)
while xml parsing, i have a string value like this :
android & iphone
but my parsed value(output what i am getting) is just:
android
then i used the normalize method it comes :
android iphone
But i need a output like:
android & iphone
How to do that? Any Idea?
i have a string like this
"o1 1232.5467 1232.5467 1232.5467 1232.5467 1232.5467 1232.5467"
how do i extract only "o1 1232.5467"
the no.of characters to be extracted are not the same always..hence i want to extract until second space is encountered..plz help..
I need to create multiple /testcontainer: parameters to feed into a task that exec's MsTest.
I have the following :
<ItemGroup>
<TestFiles Include="$(ProjectPath)\**\UnitTest.*.dll" />
</ItemGroup>
for each match in TestFiles I would like to build a string like so:
"/testcontainer:UnitTest.SomeLibrary1.dll"
"/testcontainer:UnitTest.SomeLibrary2.dll"
"/testcontainer:UnitTest.SomeLibrary3.dll"
I am trying to use the internals of MSBuild without having to create a custom task, is this possible ?
TIA
Let's say using Javascript, I want to match a string that ends with [abcde] but not with abc.
So the regex should match xxxa, xxxbc, xxxabd but not xxxabc.
I am utterly confused.
How can I convert a JSON string to an object in JavaScript? Is there a method that does this?
Something like:
var x = "{ id: 5, name: 'hello' }";
var y = /*something*/(x);
alert(y.id + " " + y.name);
i have a string like this
"o1 1232.5467 1232.5467 1232.5467 1232.5467 1232.5467 1232.5467"
how do i extract only "o1 1232.5467"
the no.of characters to be extracted are not the same always..hence i want to extract until second space is encountered..plz help..
Dear experts,
I download the Android code and "make sdk" to build out my own SDK, but the emulator from this SDK does not work well -- it only shows the black window with the "ANDROID" string, but I can't see any desktop picture or any applications. what's wrong here? anyone could please provide me a hint? Thanks a lot.
I use the command:
$./emulator @jiawelin -debug all
and the last output message is:
emulator: android_hw_control_init: hw-control qemud handler initialized
The following unicode and string can exist on their own if defined explicitly:
>>> value_str='Andr\xc3\xa9'
>>> value_uni=u'Andr\xc3\xa9'
If I only have u'Andr\xc3\xa9' assigned to a variable like above, how do I convert it to 'Andr\xc3\xa9' in Python 2.5 or 2.6?