I have a text file test.txt with the following content:
text1
text2
And I want to assign the content of the file to a UNIX variable but when I do this:
testvar=$(cat test.txt)
echo $testvar the reult is:
text1 text2
instead of
text1
text2
Can someone suggest me a solution for this?
I need to put a javascript variable as image source.That is my image tag should be in this format
here i am adding my script
document.getElementById("pricefilter").innerHTML =''
here variablename carries my image path.How can i put this in double quates.Please help to solve this
I want to call require_once("test.php") but not display result and save it into variable like this:
//pseudocode
$test = require_once('test.php');
//some operations like $test = preg_replace(…);
echo $test;
Is it possible?
class B {
public:
static int a;
}
class C:B {
}
I want to use a variable through any inherited classes but it has problem when I declare a.
B::B() {
a=1;
}
Do I do it right ?
Thanks for reading and waiting for your comments.
hi,
i am doing a shopping cart.i had a variable $total.when i add 1st product of price 200 i get $total=200 , when i add 2nd product of price 100 i get $total=200100 when i add 3rd product of price 400 i get $total=200100400 . i want to get $total=700. how to fix this problem?
please help me........
thanks,
Hmwd
I have a stored procedure that will return xml. I have delared a variable of type xml and trying to execute the following code
declare @v xml
set @v = execute get_xml @id, 33
whereas id is returned by another query. now it keeps compalinng about the following error
Incorrect syntax near the keyword 'execute'.
Say I have my class
@interface Person : NSObject { NSString *name; }
I need to get the name of NSString's within my class
Person *person = [[Person alloc] init];
NSLog(@"Name of variable %s\n", NameofVariable(person.name));
I am running a query from the VBA editor of Access:
select max(somerow) from sometable
I want to put the result of this query into a VBA variable. How do i do it?
I try to declare a variable in a code like this, but it's doesn't work. Can you tell me what's the problem?
ERROR: syntax error at or near "VARCHAR"
LINE 2: p_country VARCHAR;
DECLARE
p_country VARCHAR;
p_country : = '';
SELECT p_country;
Hi,
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4
5 my @array = qw[a b c];
6 foreach my($a,$b,$c) (@array) {
7 print "$a , $b , $c\n";
8 }
I receive following error: Missing $ on loop variable
What is wrong?
I am using: perl v5.10.1 (*) built for x86_64-linux-thread-multi
hi
function liveUpdate(fld,value,id) {
$.ajax({
type: 'POST',
url: 'myurl.html',
data: { fld:value, 'id': id },
success: function(data){//console.log(data);
}
});
}
i want fld to be posted as fld's value not the variable name fld? i've tried to wrap around with eval but no luck
any ideas?
thanks
I have a string of a variable length and at the end of the string are some digits. What would be the best / efficient way, to parse the string and get the number from the end as an Integer?
The String and the digits at the end can can be of any length. For example:
abcd123 -- 123
abc12345 -- 12345
ab4cd1 -- 1
hello java guys,
im thinking of a simple java app (command line) that connects to the internet to download xml file, the problem is that my ubuntu is using a proxy to connect to internet with username and password (tru http_proxy ="http://:@:" ). So My question is, could it be possible to write a java app to use http_proxy variable? instead of programmatically setting http proxy and host in every app i will write.
Hi
I need to do periodical background task fetching data from a weather site.
How in rails can I fetch json from a remote url and store it on the server? Also, there doesn't seem to be any point in storing this in a db so how in rails can I store a variable available to all users?
i can't read the variable in the function, i want to use it outside the function, here is my code.
var contentLoader:URLLoader = new URLLoader();
contentLoader.load(new URLRequest("http://localhost/data.php"));
function onComplete(event:Event):void
{
var txtu:String = event.target.data;
}
contentLoader.addEventListener(Event.COMPLETE, onComplete);
trace(txtu);
thanks.
INFORMIX-SQL or any other SQL-based DB:
Suppose I have an app where depending on the value of some columns, example:
company.code char(3) {abc}
company.brach char(2) {01}
Can I construct table name "abc01" for inclusion in SELECT * FROM abc01; ?
In other words, a variable table name.. same question applies for column names.
How to create a function with variable number of arguments in visual basic?
ex.
x = Sum(1,2,3)
y = Sum(1,2)
Function Sum('how to declare argument here')
'Is there any special argument manipulation inside function before it is usable?
End Function
I tryed to email me debug_backtrace() but it just prints out the array.
I need to assign it to a variable so that var_export can work with it.
How can i do that?
I would like to have direct access to the text inside a textbox on another form, so I added a public variable _txt to a form and added an event like so:
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
_txt = richTextBox1.Text;
}
But the form is loaded like this:
public FrmTextChild(string text)
{
InitializeComponent();
_txt = text;
richTextBox1.Text = _txt;
Text = "Untitled.txt";
}
Is there a better way to directly link the two?
Hi
In my mode I am selecting a field as
$query1 = $this->db->query("SELECT dPassword
FROM tbl_login
WHERE dEmailID='[email protected]'");
How to return dpassword as a variable to my controller
I tried this way return dpassword;
I want to display a certain in the template only if a certain GET variable is set....I thought using {% if request.get.my_var %} would work, but it's not giving me the results.