Hi all,
I have a big ASP.NET project full of hard coded strings, that now have to be extracted to resources. Such strings can be found almost anywhere (in .cs files, .aspx files, .ascx files, etc.) and the amount of files is huge. What I'm looking for is a tool (or any way) to find all these hard coded strings in one shot and put them al...
I've tried the following code with both normal ifstreams and the current boost:iostream I'm using, both have the same result.
It is intended to load a file from physfs into memory then pass it to a handler to process (eg Image, audio or data). Currently when c_str is called it only returns a small part of the file.
PhysFS::FileStr...
Which is a better c++ container for holding and accessing binary data?
std::vector<unsigned char>
or
std::string
Is one more efficient than the other?
Is one a more 'correct' usage?
...
How to download webpage into string without saving this page to disk in C++?
URLDownloadToFile MSDN function only saving page into disk.
...
Right now, the only function that I am aware of is _snprintf_s like the following
double dMyValue = <some value>;
_snprintf_s(pszMyBuffer, sizeof(pszMyBuffer), 12, "%.10f", dMyValue);
...
hi all
I have a string with a number inside and I want to retrieve that number.
for example if I have a string "bla bla 45 bla bla" I want to get the number 45.
I have searched a bit and found out that this code should make the work
Matcher matcher = Pattern.compile("\\d+").matcher("bla bla 45 bla bla");
if(matcher.matches())
String...
I am parsing a HTML document with XPATH and I want to keep all the inner html tags.
The html in question is a unordered list with many list elements.
<ul id="adPoint1"><li>Business</li><li>Contract</li></ul>
I am parsing the document using the following PHP code
$dom = new DOMDocument();
@$dom->loadHTML($output);
$this->xpath = new ...
I'm trying to pass a string argument to a target function in a process. Somehow, the string is interpreted as a list of as many arguments as there are characters.
This is the code:
import multiprocessing
def write(s):
print s
write('hello')
p = multiprocessing.Process(target=write, args=('hello'))
p.start()
I get this output:...
I have text stored in SQL as HTML. I'm not guaranteed that this data is well-formed, as users can copy/paste from anywhere into the editor control I'm using, or manually edit the HTML that's generated.
The question is: what's the best way of going about removing or somehow ignoring <script/> and <form/> tags so that, when the user's te...
I have a view that I want to be converted into JSON. What is the SQL that I can use to produce on the server the JSON string needed to be returned?
...
hello,
i am reading in a binary file via the usual c++/STL/iostream syntax.
i am copying the whole content into an dynamically allocated char array and this works fine so far.
but since i want to serve parts of the content as lines to another part of the program,
i think it would be better/easier to stick to streams because i don't wan...
void reverse(char *str){
int i,j;
char temp;
for(i=0,j=strlen(str)-1; i<j; i++, j--){
temp = *(str + i);
*(str + i) = *(str + j);
*(str + j) = temp;
printf("%c",*(str + j));
}
}
int main (int argc, char const *argv[])
{
char *str = "Shiv";
reverse(str);
printf("%s",str);
return 0;
...
I'm working on a feature which requires me to get the contents of a webpage, then check to see if certain text is present in that page. It's a backlink checking tool.
The problem is this - the function runs perfectly most of the time, but occasionally, it flags a page for not having a link when the link is clearly there. I've tracked ...
004 2008-11-23 02:18:49 0 %%827|1.1.1593.0|{9CB31878-8FED-45F4-B45F-AF8A3EC94F7A}|||||WIN|108510|S-1-5-21-1229272821-838170752-1417001333-21676|Unknown||0|44|http://go.microsoft.com/fwlink/?linkid=74409|service%3AW32Times;file%3AC:\WINDOWS\system32\w32times.exe|0|%%807|||||||Not Yet Classified|Not Yet Classified||
I have the ab...
Hi guys.
I'd like to have a private static constant for a class (in this case a shape-factory).
I'd like to have something of the sort.
class A {
private:
static const string RECTANGLE = "rectangle";
}
Unfortunately I get all sorts of error from the C++ (g++) compiler, such as:
ISO C++ forbids initialization of
member ...
hello
as i am not very familiar with regex, is it possible (whether its hard to do or not) to extract certain text inbetween symbols? for example:
<meta name="description" content="THIS IS THE TEXT I WANT TO EXTRACT" />
thank you :)
...
Hi guys,
i think this would be really silly question , but iam not succesful with extratic srtings those within the angular barkets in a sentence .
var str = "MR. {Name} of {Department} department stood first in {Subjectname}"
i need to obtain the substrings (as array) those are within the angular brakets
like strArray should contai...
I have a Java socket connection that is receiving data intermittently. The number of bytes of data received with each burst varies. The data may or may not be terminated by a well-known character (such as CR or LF). The length of each burst of data is variable.
I'm attempting to build a string out of each burst of data. What is the fast...
Is there a decent way to declare a long single line string in C#, such that it isn't impossible to declare and/or view the string in an editor?
The options I'm aware of are:
1: Let it run. This is bad because because your string trails way off to the right of the screen, making a developer reading the message have to annoying scroll a...
Hi,
Does anyone have a simple function to hand for converting a date to a simple string (using .Net)?
E.g. 14-Oct-09 would read "Today", 13-Oct-09 would read "Yesterday" and 7-Oct-09 would read "1 Week Ago" etc...
Cheers,
Tim
...