How can I add newline("\n") on Dialog.alert(textfromxml)? - blackberry

this '\n' doesnt work. Also I tried with LabelField and TextField. Result is same.:(
my code:))
Dialog.alert(errorString);
and my xml line.
1) Check your camera's ip address and port number.'\n'2) Try Again

I found a solution.
I use
for \n. It works good.

This should work:
String errorString =
"1) Check your camera's ip address and port number.\n2) Try Again";
Dialog.alert(errorString);

If it doesn't work, you can implement your own Dialog class. Just do like this:
Dialog d = new Dialog(Dialog.D_OK,"your message here",Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Screen.DEFAULT_CLOSE);
//you can add customized fields here, like a LabelField
d.show();

Related

In Code By Zapier how to append a field to a constant URL?

In Code by Zapier how to append a field to a constant URL? I need the whole code block to insert since I don't know even how to make it output. In the form field above where the code is entered I entered an address. This is so the address can be found in google maps. Ideally I hope to send the street view image to email rather than having to click the link in email. Below is one variation of what I've tried. Thank you
let address = inputData.address;
var mylink = "https://www.google.com.au/maps/place/" + address;
output = mylink;
Your posted code will work, except for returning a string instead of an object type. Try this:
const address = inputData.address;
const mylink = "https://www.google.com.au/maps/place/" + address;
return { result: mylink }
If that doesn't work, please update your question with info about what's not working.

Scheme not starting with alphabetic character (at character 1) DART

i just tried to get an image from network using this function
Completer<ImageInfo> completer = Completer();
Future<ui.Image> getImage(String path) async {
[var img = new NetworkImage(path);
img.resolve(ImageConfiguration()).addListener(ImageStreamListener((ImageInfo info,bool _){
completer.complete(info);
}));][1]
ImageInfo imageInfo = await completer.future;
return imageInfo.image;
}
but i got a problem which i couldn't solve. Full error in attached screenshot.
Look around for any non-alphabetic character in URI. For me, it was a space char before 'https'.
This worked for me. I was using a localhost but forgot to add the http:// before my IP address and port number. Adding that resolved the issue for me.
well, it works now, just be sure to copy a link of an image and not an html page (right click and cpy the image Location)
remove the (") from both the start and end
url.replaceAll('"', '');

php str_replace produces strange results

I am trying to replace some characters in a text block. All of the replacements are working except the one at the beginning of the string variable.
The text block contains:
[FIRST_NAME] [LAST_NAME], This message is to inform you that...
The variables are defined as:
$fname = "John";
$lname = "Doe";
$messagebody = str_replace('[FIRST_NAME]',$fname,$messagebody);
$messagebody = str_replace('[LAST_NAME]',$lname,$messagebody);
The result I get is:
[FIRST_NAME] Doe, This message is to inform you that...
Regardless of which tag I put first or how the syntax is {TAG} $$TAG or [TAG], the first one never gets replaced.
Can anyone tell me why and how to fix this?
Thanks
Until someone can provide me with an explanation for why this is happening, the workaround is to put a string in front and then remove it afterward:
$messagebody = 'START:'.$messagebody;
do what you need to do
$messagebody = substr($messagebody,6);
I believe it must have something to do with the fact that a string starts at position 0 and that maybe the str_replace function starts to look at position 1.

How to make text roll over into another textbox? Visual Basic

So, I want to make it so that, when the user pastes something into a textbox, once it pastes the first 24 characters into that textbox, it will send the rest to a richtextbox.
I've tried splitting, joining, with no luck. I don't know what else I can do. Any ideas?
I've tried:
If TextBox1.Text > TextBox1.MaxLength Then
RichTextBox4.Text = TextBox1.Text
End If
And some other weird things that didn't work out. I would appreciate some help.
Thank you.
use Substring....
Dim input = textbox1.text
Dim substring As String = input .Substring(0, 24)
richtextbox4.text = substring
http://www.dotnetperls.com/substring-vbnet

OpenLayers print map

How can I print a map from the OpenLayers? I want to add print button in my OpenLayers page =) I have MapFish extension for my geoserver, but don`t know how to make request to it. Any other ideas are welcome) Help please.
I had a similar problem using a reverse proxy, because I discovered the answer from info.json contais local ip reference instead of the public url
to solve brutally i replaced the ip referenze with the public url in the ajax request (see the following code. I hope it can be usefull for others...
this.capabilities.createURL = this.capabilities.createURL.replaceAll("192.168.0.0:8080", "mypublicurl");
this.capabilities.printURL= this.capabilities.printURL.replaceAll("192.168.0.0:8080", "mypublicurl");
Ext.Ajax.request({
url:this.capabilities.createURL,
jsonData:jsonData,
success:function(response){
response.responseText = response.responseText.replaceAll("192.168.0.0:8080", "mypublicurl");
window.open(Ext.decode(response.responseText).getURL);
}
});
The simplest way is to use GeoExt.PrintMapPanel (geoext example). And be sure to read GeoServer Printing Module.
UPD GET request example. You must modify url, "baseURL", "layers". If you specify an existing layer, this request must return pdf file.
http://demo.opengeo.org/geoserver/pdf/print.pdf?spec={"units":"degrees","srs":"EPSG:4326","layout":"A4","dpi":75,"mapTitle":"Printing Demo","comment":"This is a simple map printed from GeoExt.","layers":[{"baseURL":"http://demo.opengeo.org/geoserver/wms","opacity":1,"singleTile":true,"type":"WMS","layers":["topp:tasmania_state_boundaries"],"format":"image/jpeg","styles":[""]}],"pages":[{"center":[146.56000000001,-41.56],"scale":8192000,"rotation":0}]}

Resources