I have a couple of tables with a many-to-one relationship, and I'm trying to create a string that contains a comma-delimited string as follows.
Let's call them State and City - City table has a FK to State.ID, and States belong to Countries:
var foo = from item in _ctx.State
where item.country_id == country_id
...
i have a query that retruns rows that i want, e.g.
QuestionID QuestionTitle UpVotes DownVotes
========== ============= ======= =========
2142075 Win32: Cre... 0 0
2232727 Win32: How... 2 0
1870139 Wondows Ae... 12 0
Now i want to have a column returned that con...
I am trying to create a matrix that is 3 x n, with each of the columns being the same. What's the easiest way of achieving it? Concatenation?
...
var os = $.client.os; // mac
var browser = $.client.browser; // firefox
var browserversion = $.client.browserversion; // 3
$('#root').addClass( os + browser + browserversion );
.. results in <div id="root" class="macfirefox3">. How do I add spaces between them?
...
I have 4 string variables name, quest, favorite_color, speed that might be empty. I want to concatenate them all together, putting spaces between those that aren't empty.
So:
name = 'Tim'
quest = 'destroy'
favorite_color = 'red'
speed = 'fast'
becomes
'Tim destroy red fast'
and
name = 'Steve'
quest = ''
favorite_color = ''
speed...
I am using kottke.org's old JAH example to return some html to a div in a webpage. The code works fine if I use static text. However I need to get the value of a field to add to the string that is getting passed as the parameter to the function.
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveX...
I have a method in Java that concatenates 2 Strings. It currently works correctly, but I think it can be written better.
public static String concat(String str1, String str2) {
String rVal = null;
if (str1 != null || str2 != null) {
rVal = "";
if (str1 != null) {
rVal += str1;
}
if (str2 != null) {
rVal ...
I have a data.frame from this code:
my_df = data.frame("read_time" = c("2010-02-15", "2010-02-15",
"2010-02-16", "2010-02-16",
"2010-02-16", "2010-02-17"),
"OD" = c(0.1, 0.2, 0.1, 0.2, 0.4, 0.5) )
which produces this:
> my_df
r...
In Java I would like to concatenate an array (a[], fixed length) to an array of the same length, to create a matrix M[2][length of a]. This way I would like to subsequently paste more of those arrays onto the matrix. (Comparable to the Matlab vertcat function..C=[A;B])
Is this possible?
Thanks
...
I need to concatenate some relatively large text files, and would prefer to do this via the command line. Unfortunately I only have Windows, and cannot install new software.
type file1.txt file2.txt > out.txt
allows me to almost get what I want, but I don't want the 1st line of file2.txt to be included in out.txt.
I have noticed that...
Suppose I have a table (tblEmp) whose structure is like as under
Dept Emp
----- ------
d1 e1
d1 e2
d1 e3
d2 e4
d2 e5
d3 e6
If I need to bring the output as
Dept DepartmentSpecificEmployees
------ ----------------------------
d1 e1,e2,e3
d2 e4,e5
d3 ...
Hi,
I am reading from several files, each file is divided into 2 pieces, first a header section of a few thousand lines followed by a body of a few thousand. My problem is I need to concatenate these files into one file where all the headers are on the top followed by the body.
Currently I am using two loops; one to pull out all the h...
So I essentially need to do this:
String text = "line1\n";
text += "line2\n";
text += "line3\n";
useString( text );
There is more involved, but that's the basic idea. Is there anything out there that might let me do something more along the lines of this though?
DesiredStringThinger text = new DesiredStringThinger();
text.append( "li...
Hello, I've recently been bitten by the (way too commmon in my opinion) gotcha of Concat returns it's result, rather than appending to the list itself.
For instance.
List<Control> mylist=new List<Control>;
//.... after adding Controls into mylist
MyPanel.Controls.Concat(mylist); //This will not affect MyPanel.Controls at all.
MyPane...
<c:forEach items="${myParams.items}" var="currentItem" varStatus="stat">
<c:set var="myVar" value="<c:out var="myVar" />" />
</c:forEach>
I want to concatenate the values of currentItem.myVar and output it at the end of the loop, problem is I can't figure out how to do this...
(Preferably not using Java)
...
Using the Visual Studio Data Generation Plan, I have two columns, FirstName and Lastname, populated from a Data Bound Generator (referencing a database seeded with actual valid First and Last Names). I want to generate another column for email with the format @test.com.
For example:
Fred, Smith => [email protected]
Right now I am us...
YQL gives out result only in tree view. Is there any way to get the result in Formatted view??
...
Hello:
In short, currently I am using the following code to pull records from multiple tables in a Sqlite Db and insert them in a single combobox ($SearchBar):
set SrchVals1 [db eval {SELECT DISTINCT Stitle From Subcontract Order By Stitle ASC}]
set SrchVals2 [db eval {...
set SrchVals3 ...
set SrchValsALL [concat $SrchVals1 $SrchVals...
This is a followup to my last question.
I now have a byte[] of values for my bitmap image. Eventually I will be passing a string to the print spooler of the format String.Format("GW{0},{1},{2},{3},", X, Y, stride, _Bitmap.Height) + my binary data; I am using the SendBytesToPrinter command from here.
Here is my code so far to send it t...
I need to pass a string literal to a function
myfunction("arg1" DEF_CHAR "arg1");
now part of that constructed string literal needs to be a function return
stmp = createString();
myfunction("arg1" stmp "arg2"); //oh that doesn't work either
is there any way to do this in one line?
myfunction("arg1" createString() "arg2"); //what i...