Hi everyone,
I looked through the related questions for a similar question but I wasn't seeing quite what I need, pardon if this has already been answered already. In my database I have a list of records that I want represented to the user as files inside of a folder structure. So for each record I have a VARCHAR column called "FolderS...
Hello everyone.
How can I remove the . and .. from a path in Delphi (not using .NET).
I need a function, so I can pass it something like 'c:\program files..\program files...', and I want the function to return to me 'c:\'.
Can Delphi do that on its own? Or do I need to do it myself?
...
How to convert
x = "0x000000001" # hex number string
to
y = "1"
...
Hello, this is my first question.
I'm trying to execute a SQL query in django (south migration):
from django.db import connection
# ...
class Migration(SchemaMigration):
# ...
def transform_id_to_pk(self, table):
try:
db.delete_primary_key(table)
except:
pass
finally:
...
I use the following code to log a map, it is fast when it only contains zeroes, but as soon as there is actual data in the map it becomes unbearably slow... Is there any way to do this faster?
log_file = open('testfile', 'w')
for i, x in ((i, start + i * interval) for i in range(length)):
log_file.write('%-5d %8.3f %13g %13g %13g %1...
i am building a string that i check in mysql db.
eg:
formFields[] is an array - input1 is: string1
array_push(strings, formFields)
1st string and mysql query looks like this:
"select * from my table where id in (strings)"
formFields[] is an array - input2 is: string1, string2
array_push(strings, formFields)
2nd string and mysql query l...
I'd like to be able to create an object that is created like a String object, and when created verifies that the String value is an appropriate option.
I.E. SpecificString can be "Bob" or "Jim".
SpecificString BadName = "Sam" //Throws exception
SpecificString GoodName = "Bob" //Does not throw exception.
The most important functionali...
Hey everyone,
So I'm new to Rails (teaching myself as a senior project in high school), and I'm trying to figure out how to modify these strings.
Let's say someone writes the following string in a form: "you know you are a geek when"
How can I automatically change it to this: "You know you are a geek when..."?
I need Rails to check t...
After a lot of experimentations, I found a way to exchange PChar from a FreePascal compiled DLL with a Delphi compiled EXE. I'm in charge of both the DLL and EXE source code but one MUST BE in FreePascal and the other one in Delphi. My solution involves the following methods in the DLL:
function GetAString(): PChar;
var aString: string;...
Is there a difference between these ?
if(myString.equals("")){
}
if(myString.equals(null)){
}
if(myString == ""){
}
I have a string, I don't know is it empty or has some emtpy spaces I just wan't to stop it to be written in database if it is invalid(if empty or with some blank spaces).
...
When would you ever want to scope a String Builder inside a for loop?
Sample Code:
....
for (int i=0; i<cnt; i++) {
....
{
StringBuilder sb = new StringBuilder();
sb.append(",");
....
}
}
....
...
hi,
first of all thanks for taking your time!
I'm a junior Dev, working with PHP + mysql.
My issue:
I'm saving data from a form to my database. From this form, there's only need to save the contacts: Name, phone number, address. But, it would be nice to have a small reference to the user answers.
Let's say for each question we've go...
Hello
This is not homework, I need this for my program :)
I ask this question, because I searched for this in Google about 1 hour, and I don't find anything ready to run. I know that is trivial question, but if you will help me, you will make my day :)
Question:
How to copy text in string (from for
example 8 letter to 12 letter)...
I am developing a c# web application with VS 2008 where I am trying to capture the physical path of the selected file. Using IE, I am finally able to retrieve this now in text variable. But I want to capture this information in string. How do I do this?
Currently I am using:
lb3.Text = Page.Request.PhysicalPath;
And it gives me:
Tex...
Hello,
I'm currently trying to create a report using Crystal Reports that comes with Visual Studio 2008.
I would like to include a field of type boolean on my report that shows a string rather than true or false. The string should contain either contain a € or a % sign.
How would I go about doing this in the Formula Workshop?
I've tr...
Consider the following line:
readonly private string TARGET_BTN_IMG_URL = @"\\ad1-sunglim\Test\";
In this line, why does @ need to be attached?
...
I have a program in C using Solaris with VERY ancient compatibility it seems. Many examples, even here on SO, don't work, as well as lots of code I've written on Mac OS X.
So when using very strict C, what is the safest way to pass strings?
I'm currently using char pointers all over the place, due to what I thought was simplicity. So...
Sorry to put a post up about something so simple, but I don't see what I'm doing wrong here.
char data[1024];
DWORD numRead;
ReadFile(handle, data, 1024, &numRead, NULL);
if (numRead > 0)
printf(data, "%.5s");
My intention with the above is to read data from a file, and then only print out 5 characters. However, it prints out al...
Java's equivalence to Python's "Got value: %s" % variable?
...
When I compare two array values I see two strings that look the same. php doesn't agree.
$array1 = array('address'=>'32 Winthrop Street','state'=>'NY');
$array2 = array('address'=>'32 Winthrop Street');
$results = array_diff_assoc($array1, $array2);
var_dump($results)
//echos ['address'] => string(18) "32 Winthrop Street" ['state']=...