Hello,
I have the following struct in C# class
public struct Employee
{
public const string EMPID = "EMP_ID";
public const string FName = "FIRST_NAME";
public const string LNAME = "LAST_NAME";
public const string DEPTID = "DEPT_ID";
}
Is there an easy way to build a string as follows
const string mainquery="INSERT INTO EMP(EMP_ID,FIRST_NAME,LAST_NAME,DEPT_ID) VALUES(:EMP_ID,:FIRST_NAME,:LAST_NAME,:DEPT_ID)"
Instead of doing as follows
and then concatenating it.
const string EMP_COLS=
EMPLOYEE.EMPID + "," +
EMPLOYEE.FNAME + "," +
EMPLOYEE.LNAME + "," +
EMPLOYEE.DEPTID;
const string EMP_Values=
EMPLOYEE.EMPID + ":" +
EMPLOYEE.FNAME + ":" +
EMPLOYEE.LNAME + ":" +
EMPLOYEE.DEPTID;
I was given an interview question:
// The first example:
char text[] = "henri";
char *p;
p = text;
*(p + 1) = 'E'; // Output = hEnri
// Now If we want to remove the "e" ie hnri, we would go for?????
*(p + 1)=?????
The obvious answer is to copy the rest of the array "back" one position. But this seems... unpleasant. Surely there is some better way?
To be specified:
function getLength($str)
{
//function i need
}
$str1 = 'aabbcccc';
$str2 = 'aabbccccaaaaa';
echo getLength($str1); //will get 4
echo getLength($str2); //will get 5
Any good ideas?Thanks in advance!
For example, a user entered "I love this post!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
the consecutive duplicate exclamation mark "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" should be detected.
Hello
I have some data inthe format of
C222 = 50
C1234P687 = 'some text'
C123YYY = 'text'
C444 = 89
C345 = 3
C122P687 = 'some text'
C122YYY = 'text'
....
....
so basically 3 different forms
"C" number = value, example - C444 = 89
"C" number "P" number = value, example - C123P687 = 'some text'
"C" number "YYY" = value
Only number is of variable length on the left side of (=) sign. Values vary.
I want to store the data in db as
INSERT INTO datatable
c_id = "number after C"
p_id = "number after P" // if it exists for a line of data
value = 'value'
yyy = 'value'
Any ideas how to retrieve these numbers?
Thanks
For example, a user entered "I love this post!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
the consecutive duplicate exclamation mark "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" should be detected.
This code is compiling clean. But when I run this, it gives exception "Access violation writing location" at line 9.
void reverse(char *word)
{
int len = strlen(word);
len = len-1;
char * temp= word;
int i =0;
while (len >=0)
{
word[i] = temp[len-1]; //line9
++i;--len;
}
word[i] = '\0';
}
The latest version of the Scribes text editor lets us select some text, hit Alt+X, and then run an arbitrary command. For example, I can run the sort command andthe selected text is replaced appropriately.
This is quite useful but I am also not very well-versed in awk andthe like. Is there something I can grab that will provide more of these commands like sort? Maybe a package with a whole bunch of handy, task-specific string manipulation commands?
I'm totally new to JSON, and have a json-string I need to display as a user-friendly table.
I have this file, http://ish.tek.no/json_top_content.php?project_id=11&period=week, witch is showing ID-numbers for products (title) andthe number of views.
The Title-ID should be connected to this file; http://api.prisguide.no/export/product.php?id=158200 so I can get a table like this:
ID | Product Name | Views
158200 | Samsung Galaxy SIII | 21049
How can I do this?
Since the last weeks we see many 404's on our sites caused by Chrome adding /cache/[hex-string]/ to the current page URL.
The hex strings we have seen are:
e9c5ecc3f9d7fa1291240700c8da0728
1d292296547f895c613a210468b705b7
408cfdf76534ee8f14657ac884946ef2
9b0771373b319ba4f132b9447c7060a4
b8cd4270356f296f1c5627aa88d43349
If you search for these strings you get matches from different sites, but they are most likely auto-generated (/search/cache/e9c5ecc3f9d7fa1291240700c8da0728/ for example).
Is this a known issue with Chrome (or an extension)?
Many times we want to split a string into an array and get a list of each word separately. The sys.dm_fts_parser function will help us in these cases. More over, this function will also differentiate the noise words and exact match words. The sys.dm_fts_parser can be also very powerful for debugging purposes. It can help you check how the word breaker and stemmer works for a given input for Full Text Search.
An optimized Damerau-Levenshtein Distance (DLD) algorithm for "fuzzy" string matching in Transact-SQL 2000-2008
Learn Agile Database Development Best PracticesAgile database development experts Sebastian Meine and Dennis Lloyd are running day-long classes designed to complement Red Gate’s SQL inthe City US tour. Classes will be held in San Francisco, Chicago, Boston and Seattle. Register Now.
When you are first learning PowerShell, it often seems to be an 'Alice through the looking-glass' world. Just the simple process of comparing and selecting strings can seem strangely obtuse. Michael turns the looking-glass into wonderland with his wall-chart of the PowerShell string-comparison operators and syntax
The Future of SQL Server MonitoringMonitor wherever, whenever with Red Gate's SQL Monitor. See it live in action now.
I am building a new PC with the intel i7-930 processor. I am wanting to use 12gb of RAM for it (6x2gb sticks).
Here is some of the RAM I am looking at G.SKILL 6GB (3 x 2GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Triple Channel Kit Desktop 2 of these 3 stick kits.
They are rated at 1600 however some of the user reviews on that product say they xcould not get it to run at 1600 andthe supplier who makes the RAM made a comment that "I7 doesn't support over DDR3 1066"
So I am curious, I do not know much about this, I know the more GB of RAM the better but as for the speeds, I am not sure how much of a difference it makes.
So can someone explain to me whatthedifferencein performance may be based on speeds of 1200 vs 1600 ram?
There is a Xen vs. KVM in performance question on ServerFault.
What will be the performance difference if the choice isbetween Xen and OpenVZ?
How is it best to measure?
Some may say "you're comparing apples and oranges" but I have to choose one of the two and it needs to be wise choice. Performance is most important to us. We may switching to Xen from OpenVZ because Xen is more ubiquitous but only if performance differenceis not significant. In January 2011 I'm thinking of doing a head to head performance comparison - here is my project proposal to our Bioinformatics facility director.
I would like to understand some fundamental VS version differences,
Whatisthedifferencebetween Visual Studio 2008 and Visual Studio 2008 Team System? Does the Team System 2008 include VS2008, TFS 2008 & Team Explorer 2008?
Furthermore, whatisthedifference betwene Team System 2008 and Team Suite 2008?
I beleive there are no more Team Suites or Team Systems in 2010?
Does Visual Studio Ultimate 2010 include all Team System components, like TFS 2010 & Team Explorer 2010, so in effect it is like an upgrade of Visual Studio 2008 Team System? Or does TFS 2010 & Team Explorer 2010 need to be installed separately?