Guys,
I'm developing a log parser, and I'm reading files of strings of more than 150MB.- This is my approach, Is there any way to optimize what is in the While statement? The problem is that is consuming a lot of memory.- I also tried with a stringbuilder facing the same memory comsuption.-
private void ReadLogInThread()
{
...
How would I go about getting a string from a UITextField in the iPhone SDK? I'm trying to insert it into another concatenated string.
...
API:
namespace ClassLibrary1
{
public class Class1
{
public static string Test(string input)
{
if (input == null)
return "It's null";
if (input == string.Empty)
return "It's empty";
else
return "Non-empty string of length " + inpu...
Hi,
I have a string value and wish to get the engineers name only e.g. in this case "CARL HARRISON".
"{ Engineer = CARL HARRISON, HandHeldAvailability = H, HASHHT = True, HHTSTATUS = }"
The names can be diffrent lenths but will alway be in the same format.
...
I have a SQL statement similar to the one shown below in Perl:
my $sql="abc..TableName '$a','$b' ";
The $a is free text which can contain anything including single quotes, double quotes, back- and front-slash characters, etc.
How can these characters be escaped to make the SQL statement work?
Thanks.
...
In R, how can I import the contents of a multiline text file (containing SQL) to a single string?
The sql.txt file looks like this:
SELECT TOP 100
setpoint,
tph
FROM rates
I need to import that text file into an R string such that it looks like this:
> sqlString
[1] "SELECT TOP 100 setpoint, tph FROM rates"
That's so that I ...
Hello!
I have a string like " This is a test ". I want to split the string by the space character. I do it like this:
puts " This is a test ".strip.each(' ') {|s| puts s.strip}
The result is:
This
is
a
test
This is a test
Why is there the last line "This is a test"?
And I need, that if there are two or more s...
I want to transform a large xml file to sql statements with xslt. For example I have the author tag.
<author>Evans, Jim; Henderson, Mike; Coyier, Alan</author>
I have a column for last_name and first_name, so Evans, Henderson and Coyier should go to last_name and so on.
How can I pick them out of the tag and put it into sql statement...
So the question is whether or not string literals (or const strings) in Delphi 2009/2010 can be directly cast as PAnsiChar's or do they need an additional cast to AnsiString first for this to work?
The background is that I am calling functions in a legacy DLL with a C interface that has some functions that require C-style char pointers...
I have two long list, one from a log file that contains lines formatted like
201001050843 blah blah blah <[email protected]> blah blah
and a second file in csv format. I need to generate a list of all the entries in file2 that do not contain a email address in the log file, while maintaining the csv format.
Example
Log file contains:
2...
I have a command, which might resemble the following:
SYNC C:\Users\Fox Mulder\SyncClient C:\Users\Fox Mulder\SyncServer
This is a command that will be entered via a Console Application. It will be read by Console.ReadLine.
How can I parse the command so that I can get the two seperate directory path's?
I am unable to split on space,...
Hello folks,
I was wondering if there are any free implementations of a string compare, that tells the difference between two multiline strings. I'm lookin for something like the compare screen of Microsoft SourceSafe.
What I want to achieve is, is to compare two html websites and get an overview of the changes.
(The use case will be i...
We normally create objects using the new keyword, like:
Object obj = new Object();
Strings are objects, yet we do not use new to create them:
String str = "Hello World";
Why is this? Can I make a String with new?
...
Here is the problem, I have an app with a search bar, the user can input something like "18th Street" or "Starbucks" and it uses the Google Geocoding and Local Search APIs respectively to get results.
I'm wondering is there a smart way to determine whether or not a given input string is an address that needs to be Geocoded, or a busines...
I've a generic DB query function that runs the following checks every time an SQL query is issued:
if (preg_match('~^(?:UPDATE|DELETE)~i', $query) === 1)
if (preg_match('~^(?:UPDATE|DELETE)~iS', $query) === 1)
if ((stripos($query, 'UPDATE') === 0) || (stripos($query, 'DELETE') === 0))
I know that a simple strpos() call is way faster ...
Hi,
I need to convert the date from request parameter to string in dateformat 'yyyy-MM-dd'.
I have tried the following
String MyDate = request.getParameter("DayCal");
formatdate = new java.text.SimpleDateFormat("yyyy/MM/dd");
Date date = (Date) formatdate.parse(MyDate);
String DisplayDate= formatdate.format(date);
But i am getting i...
Hi All,
I have written following java code. It is throwing array index out of range exception
Exceptions: exception_name = java.lang.ArrayIndexOutOfBoundsException
exception_message = Array index out of range: 1
Can some resolve this issue plz
public class UnifiedClus1toNfastfastsamehost extends UnifiedClus1toNfastfastsamehostH...
PHP has an intval() function that will convert a string to an integer. However I want to check that the string is an integer beforehand, so that I can give a helpful error message to the user if it's wrong. PHP has is_int(), but that returns false for string like "2".
PHP has the is_numeric() function, but that will return true if the n...
In India and other Asian countries money is formatted as following:
The first three digits grouped in three then all other digits are grouped in pair of two.
eg : 2,54,255.12 5,22,54,255.12 etc
string money = String.Format("{0:#,##0.00}", 254255.12);
gives the output 254,255.12
but the output required is 2,54,255.12
...
In a WPF app I have objects, derived from a custom control:
...
<MyNamespace:MyCustControl x:Name="x4y3" />
<MyNamespace:MyCustControl x:Name="x4y4" />
...
I can reference these objects, using names:
x4y4.IsSelected = true;
Also such function works well:
public void StControls(MyCustControl sname)
{
...
...