I am reading a file that sometimes has chinese and characters of languages other than english.
How can I write a regex that only reads english words/letters?
should it just be /^[a-zA-Z]+/ ?
If I do the above then words like eété will still be picked but I don't want them to be picked:
"été".match(/^[a-zA-Z]+/) => #nil good I didnt want that word
"eété".match(/^[a-zA-Z]+/) => #not nil tricked into picking something i did not want
Is this equivalent to a LEFT JOIN?
SELECT DISTINCT a.name, b.name
FROM tableA a,
(SELECT DISTINCT name FROM tableB) as b
It seems as though there is no link between the two tables.
Is there an easier / more efficient way to write this?
I have:
tXML = "<type p_type=\"All\"/>";
if I do
Response.Write(tXML);
I get a blank space.
Is there anyway to output this string so I know it is being created?
I need to write a tool to clone a database, instead of detaching it and copying the .mdf and .ldf, wouldn't it be better to just back it up and restore a newly created db?
Is there a way using SQL to create a database from a .bak?
hi,
in my application (asp.net) i have a filed ( phone code) and it contain a text box. and i want to restrict the user to enter only 4 letter after that the cursor should not print any character how can i write the code can u help me thank you
the thing is that I have a form with a textbox and a button and a hidden field, now what i want to do is to write something in the textbox ,pass it to the hidden field and then access that thing written in the hidden field in the controller . how can i do that?
I have a file containing the following content 1000 line in the following format:
abc def ghi gkl
how to write perl script to convert it into :
abc ghi
??
I'm trying to write a function :
Input:
Source range, Source value, output range, curve type (Linear, smooth)
Output:
The output is the "source value" converted into the "output range"
according to the curve type.
I hope I am making sense here...
Any ideas ?
Thanks.
I want to write a socket channel program using which I can send a file from the client program to the server program. I want to create this program using Java.
Is there any other on-line help is available
So how to overcome this problem.
Thanks
Sunil Kumar Sahoo
Say you had a timestamp function and then wanted to create a new function to combine your timestamp and Console.WriteLine(), e.g.
public static void Write(string msg)
{
WriteTimeStamp();
Console.WriteLine( msg );
}
But the WriteLine() method has 18 or so overloads, which will not be reflected in the signature of the wrapper function. How would you have the wrapper take non-strings and pass them on to WriteLine()?
In jQuery you can do :
$("a[href$='.img']").each(function(index) {
alert($(this).attr('href'));
}
I want to write a jQuery function which crawls x-levels from a website and collects all hrefs to gif images.
So when I use the the get function to retrieve another page,
$.get(href, function(data) {
});
I want to be able to do something like
data.$("a[href$='.img']").each(function(index) {
});
Is this possible ?
Hi,
I've had to write an application that lists and plays tutorial videos along with accompanying text. It works well but since the videos are added by the user I need a way of checking to see whether or not a video can be played on the machine.
I'm not sure whether or not there is an easy way to try test the file (and catch errors) or if I need to start looking at codecs installed.
Does anybody have any experience with this?
Hello
How can I demonstrate for students the usability of likely and unlikely compiler hints (__builtin_expect)?
Can you write an sample code, which will be several times faster with these hints comparing the code without hints.
I'd like to write a templated function which changes its behavior depending on template class types passed in. To do this, I'd like to determine the type passed in. For example, something like this:
template <class T>
void foo() {
if (T == int) { // Sadly, this sort of comparison doesn't work
printf("Template parameter was int\n");
} else if (T == char) {
printf("Template parameter was char\n");
}
}
Is this possible?
In Workflow for reading and writing files the authors use these two lines of code:
var file = air.File.documentsDirectory;
file = file.resolvePath("AIR Test/testFile.txt");
But I think that it's using one variable for two different meanings, isn't it?
Wouldn't it be better to write them as:
var myDocumentsDirectory = air.File.documentsDirectory;
var myTestFile = myDocumentsDirectory.resolvePath("AIR Test/testFile.txt");
I was looking at Ch from SofIntegration and it looks pretty interesting as a possible teaching tool. It would allow the you to let someone learning to program "play" while preparing them to write full fledged C programs. I was wondering if anybody had "good" experiences using a C interpreter or weather it would be a better to go with a language that is typically interpreter to start with?
I've got some experience with Bash, which I don't mind, but now that I'm doing a lot of Windows development I'm needing to do basic stuff/write basic scripts using
the Windows command-line language. For some reason said language really irritates me, so I was considering learning Python and using that instead.
Is Python suitable for such things? Moving files around, creating scripts to do things like unzipping a backup and restoring a SQL database, etc.
Hello,
I am writing a piece of code in which i have to find only complete words for example if i have
String str = "today is tuesday";
and i am searching for "t" then i should not find any word.
Can anybody tell how can i write such a program in java?
I've set up a view which combines all the data across several tables. Is there a way to write this so that only columns which contain non-null data are displayed, and those columns which contain all NULL values are not included?