Hey all,
I want to use \ in a string, like
string str="abc\xyz";
But this is giving me error.
I have also tried
string str="abc\\xyz";
But still it isnt working.
Can anyone help me out?
i cant understand whatthedifferenceisbetween a namespace and a scope inthe routing of ruby-on-rails 3.
could someone please explain?
namespace "admin" do
resources :posts, :comments
end
scope :module => "admin" do
resources :posts, :comments
end
thanks
My code tries to replace "," with "/" in a string. Should I escape "," inthe regex string? Both of the two code snippets generated the same results, so I am confused.
Code snippet 1:
String test = "a,bc,def";
System.out.println(test.replaceAll("\\,", "/"));
Code snippet 2:
String test = "a,bc,def";
System.out.println(test.replaceAll(",", "/"));
Should I use "," or "\,"? Which is safer?
Thanks.
Let's say I have the following array (which isthe returned value of a database query):
Array ( [0] => PHP [1] => Webdesign [2] => Wordpress [3] => Drupal [4])
Andthe following string:
Working With Wordpress Shortcodes
How can I compare the array with thestring to see if thestring contains any word stored inthe array? (hopefully that made sense to you :d )
When he finds a match (eg: Wordpress) it should create a hashtag like so:
Working With #Wordpress Shortcodes
when i convert a object to int by
(int)object
then when the object value is 0 then he give me error that specific cast not valid.
when i convert a object to int by
convert.toint32(object)
then he works and give me 0 means cast is valid.
and i want to know that whatisdifferencebetween both.
1. (int)object
2.convert.toint32(object)
To my understanding thedifferencebetween a macro and a function is, that a macro-call will be replaced by the instruction inthe definition, and a function does the whole push, branch and pop -thing. Is this right, or have I understand something wrong?
Additionally, if this is right, it would mean, that macros would take more space, but would be faster (because of the lack of the push,branch and pop instructions.), wouldn't it?
I have a string which is ultimately the id of a CheckBox.
What I need to be able to do is to access the CheckBox's properties from thestring
var myCheckBox:Object;
var myString:String;
myString = "checkbox_1"
myCheckBox = Object(myString); ?!?!
... and then I'd need to get to myCheckBox.selected, and myCheckBox.label etc
OK, I've got the code to allow me to index through thestring resources. Now, how do I get the value of a specific resource item without knowing its name?
Here's the index loop:
Field[] fLst = R.string.class.getFields();
for(Field f : fLst){
Log.i(dbgTag, "Field Entry: R.string." + f.getName());
}
Thanks for your efforts ...
Whats thedifferencebetween
SELECT DISTINCT field1
FROM table1 cd
JOIN table2
ON cd.Company = table2.Name
and table2.Id IN (2728)
and
SELECT DISTINCT field1
FROM table1 cd
JOIN table2
ON cd.Company = table2.Name
where table2.Id IN (2728)
both return the same result and both have the same explain output
Hello,
I'll begin this question with the claim that I have read the java networking guide before asking you.
I do not understand how to READ the socket and get all the info summed up into a string.
the socket might contains more than 1 line [trying to make a chat].
Please do no refer me to any other site unless it clearly states "this exact line does this.."
because I failed to understand what this code part does
BufferedReader stdIn = new BufferedReader(
new InputStreamReader(System.in));
String userInput;
while ((userInput = stdIn.readLine()) != null) {
out.println(userInput);
System.out.println("echo: " + in.readLine());
}
Please, I just want to make a loop that will receive information from a socket, get all the content together into one string [I also want it to know where to add another line].
Thanks allot for anyone who helps, I have been trying to get an answer from tuts for hours and just failed to understand!
I am new to Programming languages. I have a requirement where I have to return a record based on a search string.
For e.g. I am having the following 3 records and my search stringis 'Cal'
1)University of California
2)Pascal Institute
3)California University
If I try string.Contains, all 3 are returned. If I try string.starts-with, I get only 3 but my requirement is I need #1 and #3 inthe result.
Thank you for your help.
-Joel
During investigation of some problem I found that the reason was unexpected different conversion to string[] of seemingly same input data. Namely, inthe code below two commands both return the same two items File1.txt and File2.txt. But conversion to string[] gives different results, see the comments.
Any ideas why is it? This might be a bug. If anybody also thinks so, I’ll submit it. But it would nice to understand what’s going on and avoid traps like that.
# *** WARNING
# *** Make sure you do not have anything in C:\TEMP\Test
# *** The code creates C:\TEMP\Test with File1.txt, File2.txt
# Make C:\TEMP\Test and two test files
$null = mkdir C:\TEMP\Test -Force
1 | Set-Content C:\TEMP\Test\File1.txt
1 | Set-Content C:\TEMP\Test\File2.txt
# This gets just file names
[string[]](Get-ChildItem C:\TEMP\Test)
# This gets full file paths
[string[]](Get-ChildItem C:\TEMP\Test -Include *)
# Output:
# File1.txt
# File2.txt
# C:\TEMP\Test\File1.txt
# C:\TEMP\Test\File2.txt
I Have to calculate date time difference how to do that in PHP.
I need exact hours , mins and secs. any body have the scripts for that please give me :-P
Say I only need to find out whether a line read from a file contains a word from a finite set of words.
One way of doing this is to use a regex like this:
.*\y(good|better|best)\y.*
Another way of accomplishing this is using a pseudo code like this:
if ( (readLine.find("good") != string::npos) ||
(readLine.find("better") != string::npos) ||
(readLine.find("best") != string::npos) )
{
// line contains a word from a finite set of words.
}
Which way will have better performance? (i.e. speed and CPU utilization)
There is an existing question regarding differencebetween Mutex and Critical section but it does not deal with Locks also.
So i want to know whether Critical sections can be used for thread synchronisation between processes.
Also whatis meant by signalled states and non-signalled states
Is there a differencebetween 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).
scrollViewDidEndScrollingAnimation and scrollViewDidEndDecelerating
Looks like the last one is called when the bouncing effect is finished. But can't really understand what's thedifferencebetween first because they are called same time(well, decelerating called first).
I am using MVC design pattern in jsp-servlet web application, and want to whatisthe exact differencebetween MVC1 and MVC2 , can someone help?
EDIT newly I hear that there is 2 versions of using MVC in servlet programming, I hear that in MVC1 there is kind of coupling between controller and view , but in MVC2 they overtake it, if someone know whether this is right or wrong I'll be very thankful.
Is there a difference, performance or efficiency wise, between placing javascript calls such as blur, onclick etc. in $(document).ready(function(){ as opposed to placing them in DOM?
Thanks!
In some of my programs I have noticed that in some cases there is a differencein speed when using either the pre(++i or --i) and post(i++ or i--) decrement operators. Sometimes pre is faster and other times post is faster. I can't seem to figure out why. Could someone please explain this to me?
i am passing values from a textbox into a sql statement in ACCESS
i do not understand thedifferenceinthe usage of these two properties
when i set the the .text property to something, how does the .value property get affected?
when i do want something to be displayed inthe textbox should i be using the value or text property?
Please, could you answer my question.
How to remove digits from the end of thestring using SQL?
For example, thestring '2Ga4la2009' must be converted to 2Ga4la. The problem is that we can't trim them because we don't know how many digits are inthe end of thestring.
Best regards, Galina.