How can I encode strings on UTF-16BE format in PHP? For "Demo Message!!!" the encoded string should be '00440065006D006F0020004D00650073007300610067006'. Also, I need to encode Arabic characters to this format.
i need to do this.
document.styleSheets[i].rules[1].style.cssText = "cursor: url(images/grabbing.cur), default !important;";
and if i m checking
alert(document.styleSheets[i].rules[1].style.cssText);
its giving "cursor: !important"
why its not setting the whole string in this css.
its a problem in ie only . in firefox its not a problem
Hello,
I'm about to develop some commercial software that will run on OSX and Linux. The program will be doing some heavy string manipulation, base64 encoding, zlib compression and may require http libraries in the future.
Does anyone have a suggestion?
Many thanks in advance,
Toby.
I have a string like this:
<span style="font-weight: bold;">Foo</span>
I want to use PHP to make it
<strong>Foo</strong>
…without affecting other spans.
How can I do this?
I have the following function:
listorder = listorder.replace('projectlist-','');
Problem with this is it only finds and replace the first instance and there are many. How can this be updated to Find/Replace All instances in the string?
Thanks
Hello!Need your help!
How to get displayed text in RichTextBox?
I mean if RichTextBox is scrolled to the end, I'd like to receive only those lines, which are visible for me.
P.S.It'll be enough to get fisrt displayed string
Hello,
I want to write fastest possible algorithm for 2 number multiplications.
Each number has max digits around 1000000 and is contained in string.
Anyone want to tell about this problem? I searching really speed solution.
Why the following line of code:
private static List list = new ArrayList<String>();
... generates the following warning:
List is a raw type. References to
generic type List should be
parameterized.
There's something really weird, I have (in C++):
func();
cout << "Heeey" << endl;
And func, throws an exception: "throw string("ERROR");".
But the cout is done, and the exception is successfully catched.
Why it prints "Heeey" if there was an exception before?.
Hi,
I'm using PDO for connect to the database in a system where I want implement memcached.
I don't know what keys use for caching the results because I can't get the string of the final query with PDO (because the prepared statements).
Any good idea for resolve this?
Thanks in advance.
I am trying to assign a cell in Excel for the user to type the printer name where they want the print out to go and then use that value in the
Application.ActivePrinter = (use the cell value)
Even though I have done the programming assigning a name to the cell and using it in a variable it is giving me an error.
I have set my variable as string, text, object and variant already and it's not working.
Do you know what code should I use to be able to do this?
really basic question, I have a string to generate as SQL statement that I need to run through a loop to add all the relevant criteria. How do I concetatate the statement.
I am trying to extract a number from a string. The number might be zero. Numbers appear like this: '+123', '-8' or '0'.
alert( '+123'.match(/[-?|+?]\d+/) );
alerts +123
alert( '-8'.match(/[-?|+?]\d+/) );
alerts -8
alert( '0'.match(/[-?|+?]\d+/) );
alerts null // why oh why?
How do I get '0'.match(/[-?|+?]\d+/) to return 0 instead of null?
Hi!
I wish to set some properties in MyFilter with constructor injection but it seems impossible with Zend_View::addFilter(string $filter_class_name) since it loads a new instance upon usage. MyFilter implements Zend_Filter_Interface.
Can I somehow inject an instance of a filter to an instance of Zend_View?
Translate the vb6 code to vb.net or c# or java, too difficult to me, thank you.
Dim dom As New DOMDocument
Dim http As XMLHTTP
Dim strRet As String
If not Dom.load(c:\voucher.xml)then msgbox “file not exist”
http.Open "Post", "http://127.0.0.1/import.asp", True
http.Send dom.xml
KeyDown Event is not responding till any user control is clicked or setFocus implicitly . I want to fire the key event after the page loads , anytime.
I tried like :
private void Page_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key.ToString() == "Escape")
{
string uri = "/Views/Music/ArtistbyAlbum";
this.NavigationService.Navigate(new Uri(uri, UriKind.Relative));
}
}
void LayoutRoot_KeyDown(object sender, KeyEventArgs e)
{
MessageBox.Show("hi");
}
Please help.
Thanks,
Subhen
I'm trying to use Ajax to call a PHP script to write to two different HTML tags. The PHP script generates a string that is unique every time. So, I cannot call the PHP script twice. Are there any creative ways to write to two different HTML tags using the same call to the script?
I want to pass a rest in a netconnection call, something like this:
public function requestData(service : String, ...params) : void
{
nc.call(service, params);
}
this doesn't work since the call is expecting each parameter to be separated by commas, like:
nc.call(service, params[0], params[1], params[2]);
I've read some posts about apply, but I can't find a solution for this specific case.
I'm writing an identi.ca client, and seems that @reply isn't working.
After investigation I found that @ prefix is used by curl to indicate file upload, and escaping with \@reply doesn't work; curl doesn't remove the \ at the front.
I also can't format the postfields to query string, as I need to send files on that request too.
Is there any method to send both @reply and file upload in the same request?
Hi,
i found a way to send plain text email using intent:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new
String[]{"[email protected]"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Test");
But I need to send HTML formatted text.
Trying to setType("text/html") doesn't work.
hello,
How to pass nsdata in below of the string
NSData *myData = [NSData dataWithContentsOfFile:pathDoc];
pathDoc = [NSString stringWithFormat:@"<size>%d</size><type>%d</type><cdate>%@</cdate><file>%c</file><fname>File</fname>",fileSizeVal,filetype,creationDate,file];
Any idea about this?
Thanks you,
Milan
Ok,
I have a RelativeLayout with a few TextViews as children
<RelativeLayout
android:id="@+id/shift_parent_name"
android:layout_width="fill_parent"
android:layout_weight="0.25"
>
<TextView
android:id="@+id/shift_parent_nametitle"
android:text="@string/shift_parent_nametitle"
style="@style/header_text"
/>
<TextView
android:id="@+id/shift_parent_namefield"
android:layout_alignParentRight="true"
android:layout_below="@id/shift_parent_nametitle"
style="@style/wrap"
/>
How do I go about using the RelativeLayout as the button to react to a click event if any part of the area is pressed?
I want to get use of dictionary items like I do in List generic class,
e.g;
foreach(item in ItemList)
{
item.BlaBla;
}
but in dictionary there s no chance, like e method above...
Dictionary<string, HtmlInputImage> smartPenImageDictionary;
I mean I got to know the key item for the dictionary item.. but what I want, I want to travel from beginning of the list till the end..
I'm using std::getline() to enumerate through the lines in a file, and it's mostly working. It's left me curious however - std::getline() is skipping the very last line in my file, but only if it's blank. Using this minimal example:
#include <iostream>
#include <string>
int main()
{
std::string line;
while(std::getline(std::cin, line))
std::cout << "Line: “" << line << "”\n";
return 0;
}
If I feed it this:
Line A
Line B
Line C
I get those lines back at me. But this:
Line A
Line B
Line C
[* line is present but blank, ie, the file end is: "...B\nLine C\n" *]
(I unfortunately can't have a blank line in SO's little code box thing...)
So, first file has three lines ( ["Line A", "Line B", "Line C"] ), second file has four ( ["Line A", "Line B", "Line C", ""] )
This to me seems wrong - I have a four line file, and enumerating it with getline() leaves me with 3. What's really got me scratching my head is that this is exactly what the standard says it should do. (21.3.7.9)
Even Python has similar behaviour (but it gives me the newlines too - C++ chops them off.) Is this some weird thing where C++ is expected lines to be terminated, and not separated by '\n', and I'm feeding it differently?
Edit
Clearly, I need to expand a bit here. I've met up with two philosophies of determining what a "line" in a file is:
Lines are terminated by newlines - Dominant in systems such as Linux, and editors like vim. Possible to have a slightly "odd" file by not having a final '\n' (a "noeol" in vim). Impossible to have a blank line at the end of a file.
Lines are separated by newlines - Dominant in just about every Windows editor I've ever come across. Every file is valid, and it's possible to have the last line be blank.
Of course, YMMV as to what a newline is.
I've always treated these as two completely different schools of thought. One earlier point I tried to make was to ask if the C++ standard was explicitly or merely implicitly following the first.
(Curiously, where is Mac? terminated or separated?)