I'm trying to do an INSERT into a mysql db and it fails when any of the values are longer than 898 characters. Is there somewhere to get or, better, set this maximum value? I'll hack the string into chunks and store 'em in separate rows if I must, but I'd like to be able to insert up to 2k at a time.
I'm guessing this is php issue as us...
I have often wondered this, is there a performance cost of splitting a string over multiple lines to increase readability when initially assigning a value to a string. I know that strings are immutable and therefore a new string needs to be created every time. Also, the performance cost is actually irrelevant thanks to today's really fas...
I want to pull out a string from an array by index.
e.g array with object: @"Hello", @"World"
How to get @"World" from it? I use array[1], but it seems not work.
...
I want to add some marks to separate some strings.
How to add a char to a string?
e.g. add '\x01' to "Hello", add '\x02' before "World" and add '\x03' after "World".
So I can create a string "\x01 Hello \x02 World \x03" which has some separate marks.
...
I have a div which collapses clicking on a text header. I want to change the header from "+ filters" to "- filters" accordingly (when the div is collapsed or expanded)
How can I perform this with jQuery:
if (headerDiv.text() starts with "+")
replace "+" with "-"
else
replace "-" with "+"
?
...
Given a list of assorted length words, what is the best way to find the maximum length of any words?
For example, the following should return 6
findMaxLen("a,set,of,random,words")
Of course, it's fairly trivial to do this...
<cffunction name="findMaxLen" returntype="Numeric">
<cfset var CurMax = 0 />
<cfset var CurItem = 0...
Is there a native way to sort a String by its contents in java? E.g.
String s = "edcba" -> "abcde"
...
Hi,
How can I pass a char * from C dll to VB
Here is sample code:
void Cfunc(char *buffer,int len)
{
BSTR buf_bstr = SysAllocString((BSTR)buffer);
VBptr.VBfunc(buf_bstr,len);
}
This function is not working, In actual some other values are sent to the VB rather than the actual value.
Can Anyone .. tell me how the solution for ...
Hi,
I'm using this code to get standard output from an external program:
>>> from subprocess import *
>>> command_stdout = Popen(['ls', '-l'], stdout=PIPE).communicate()[0]
The communicate() method returns an array of bytes:
>>> command_stdout
b'total 0\n-rw-rw-r-- 1 thomas thomas 0 Mar 3 07:03 file1\n-rw-rw-r-- 1 thomas thomas 0...
I found a simple function to remove some undesired characters from a string.
function strClean($input){
$input = strtolower($input);
$b = array("á","é","í","ó","ú", "ñ", " "); //etc...
$c = array("a","e","i","o","u","n", "-"); //etc...
$input = str_replace($b, $c, $input);
return $input;
}
When I use it on accents or other characte...
Just trying to understand how to address a single character in an array of strings. Also, this of course will allow me to understand pointers to pointers subscripting in general.
If I have char **a and I want to reach the 3rd character of the 2nd string, does this work: **((a+1)+2)? Seems like it should...
...
The following displays a ComboBox with the text "Select One":
*This is pseudo code
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:ComboBox prompt="Select One">
<mx:dataProvider>
<mx:Array>
<mx:Object label="Obj 1" />
...
I want to add some tail marks to several strings. Are there any marks like '\n' on iPhone?
...
I'm trying to find a way to replace all instances of a string token in a file with another string.
How can I do this in C++ with the win32 API?
In other languages this is an easy thing to do, but in C++ I am just lost.
EDIT: For some context, this is for a WiX custom action. So portability is not a main priority, just the most simpl...
Hello,
I'm extensively using hash map data structures in my program. I'm using a hash map implementation by Barry Kelly posted on the Codegear forums. That implementation internally uses RTL's CompareText function. Profiling made me realize that A LOT of time is spent in SysUtils CompareText function.
I had a look at the
Fastcode site...
Using C#, I need to build a connection string from a few AppSettings. If I do this:
Connection = string.Format("Data Source={0};Initial Catalog={1);User Id={2};Password={3};",
ConfigurationManager.AppSettings.Get("CartServer"),
ConfigurationManager.AppSettings.Get("CartDatabase"),
ConfigurationManager.AppSettings.Get("CartUserName...
I heard a few people expressing worries about "+" operator in std::string and various workarounds to speed up concatenation. Are any of these really necessary? If so, what is the best way to concatenate strings in C++?
...
I am writing a web application that requires friendly urls, but I'm not sure how to deal with non 7bit ASCII characters. I don't want to replace accented characters with URL encoded entities either. Is there a C# method that allows this sort of conversion or do I need to actually map out every single case I want to handle?
...
Can anyone think of an efficient way (time wise) to trim a few selected characters from the middle of a string?
Best I came up with was:
public static string Trim(this string word, IEnumerable<char> selectedChars)
{
string result = word;
foreach (char c in selectedChars)
result = result.Replace(c.ToString(), "");
re...
I have a WPF ListView (GridView) and the cell template contains a TextBlock. If I add: TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" on the TextBlock, an ellipsis will appear at the end of my string when the column gets smaller than the length of the string. What I need is to have the ellipsis at the beginning of the string.
I....