adding string as integer
in my application i have got 0.00 in edit text.next when i enter 2or3 or
any digit its getting concat with 0.00 and getting 0.003.
if(item.equals("0.00")){
item=item+string;}
i changed the code.but this time too its getting an error
if(item.equals("0.00")){
int a=Integer.parseInt(item.toString());
int b=Integer.parseInt(string.toString());
int c=a+b;
item=String.valueOf(c);}
Thursday, 3 October 2013
Wednesday, 2 October 2013
syntax error in commands
syntax error in commands
I have an iframe to send the commands from control panel when the user
clicks the button. Using the code below, nothing happens with the button
when the user clicks as there is a syntax error in the code.
$items['googledotcom'] = array
(
'description'=>'DNS resolution test',
'1'=>1,
'0'=>0,
'fixCommand'=>'EXC service network restart; echo "nameserver
8.8.8.8" >> /etc/resolv.conf; sleep 10; curo health check',
);
The above code doesn't work, because of this line: echo "nameserver
8.8.8.8" >> /etc/resolv.conf;
But the code will work when I remove the above line. But I need to add the
above line as well.
Any suggestions for the syntax?
Thanks!
I have an iframe to send the commands from control panel when the user
clicks the button. Using the code below, nothing happens with the button
when the user clicks as there is a syntax error in the code.
$items['googledotcom'] = array
(
'description'=>'DNS resolution test',
'1'=>1,
'0'=>0,
'fixCommand'=>'EXC service network restart; echo "nameserver
8.8.8.8" >> /etc/resolv.conf; sleep 10; curo health check',
);
The above code doesn't work, because of this line: echo "nameserver
8.8.8.8" >> /etc/resolv.conf;
But the code will work when I remove the above line. But I need to add the
above line as well.
Any suggestions for the syntax?
Thanks!
Heroku db:pull 'db:pull is not a heroku command'
Heroku db:pull 'db:pull is not a heroku command'
I'm getting this message even though I've used heroku db:pull a million
times. For some reason it's no longer working even though I haven't even
touched my code. Any ideas?
The full error message is
db:pull is not a heroku command. Perhaps you meant pg:pull See heroku help
for a list of available commands.
I'm getting this message even though I've used heroku db:pull a million
times. For some reason it's no longer working even though I haven't even
touched my code. Any ideas?
The full error message is
db:pull is not a heroku command. Perhaps you meant pg:pull See heroku help
for a list of available commands.
It`s a quick fix, but i`ve tried it all, nothing works
It`s a quick fix, but i`ve tried it all, nothing works
So i made this code:
$a = 0;
$rezultat = "SELECT id, materie
FROM materii
ORDER BY id";
$rezultat1 = mysql_query($rezultat);
while($plm = mysql_fetch_array($rezultat1))
{
if($a++ %5 == 0) echo "<tr>";
?>
<td align="center"><input type="checkbox" name="checkbox2[]" value="<?php
echo $plm['id']; ?>" /></td>
<td style="text-align:left"><?php echo $plm["materie"];
?> </td>
<?php
if($a %5 == 0) echo "</tr>";
}
?>
</table>
</div>
<br/>
<input type="reset" value="Sterge" /> <input type="submit"
value="Salveaza" name="savebtn" />
</form>
<?php
if(isset($_POST['savebtn']))
{
foreach($_POST["checkbox2"] as $loc_id)
{
$query = "INSERT INTO materii_pe_clase(id_scoala,id_clasa,id_materie)
VALUES('$scoalalui','$clasalui','$loc_id')"; //aici cauta ! :))
$result5 = mysql_query($query)
or die('sa iti bagi pula in mata');
}//sfarsit foreact
}//sfarsit if isset
Why does the last query not work? p.s. its a school project, so mysql is
ok, no need for mysqli. p.p.s I defindet the $scoalalui and $clasalui
somwhere a little up the page. but they are not the problem, i tried
replacing them with values. the query simply does not work. thanks!
thank you all!
So i made this code:
$a = 0;
$rezultat = "SELECT id, materie
FROM materii
ORDER BY id";
$rezultat1 = mysql_query($rezultat);
while($plm = mysql_fetch_array($rezultat1))
{
if($a++ %5 == 0) echo "<tr>";
?>
<td align="center"><input type="checkbox" name="checkbox2[]" value="<?php
echo $plm['id']; ?>" /></td>
<td style="text-align:left"><?php echo $plm["materie"];
?> </td>
<?php
if($a %5 == 0) echo "</tr>";
}
?>
</table>
</div>
<br/>
<input type="reset" value="Sterge" /> <input type="submit"
value="Salveaza" name="savebtn" />
</form>
<?php
if(isset($_POST['savebtn']))
{
foreach($_POST["checkbox2"] as $loc_id)
{
$query = "INSERT INTO materii_pe_clase(id_scoala,id_clasa,id_materie)
VALUES('$scoalalui','$clasalui','$loc_id')"; //aici cauta ! :))
$result5 = mysql_query($query)
or die('sa iti bagi pula in mata');
}//sfarsit foreact
}//sfarsit if isset
Why does the last query not work? p.s. its a school project, so mysql is
ok, no need for mysqli. p.p.s I defindet the $scoalalui and $clasalui
somwhere a little up the page. but they are not the problem, i tried
replacing them with values. the query simply does not work. thanks!
thank you all!
#EANF#
#EANF#
I Have created a C# application. I want it to run from my browser. When
admin clicks on Run 'SMS Server' it opens the application from the path. I
tried to use but its not working. Kindly tell me the way to do it.
I Have created a C# application. I want it to run from my browser. When
admin clicks on Run 'SMS Server' it opens the application from the path. I
tried to use but its not working. Kindly tell me the way to do it.
Tuesday, 1 October 2013
remove duplicates in a column
remove duplicates in a column
I have the following query to basically find all duplicates in my username
column:
SELECT `username`
FROM `instagram_user`
GROUP BY `username`
HAVING COUNT( * ) >1
How do I remove all the duplicates, such that it will only leave me with
one unique username in the table? I don't care which entity it is that is
persisted or removed, as long as there's one unique username in the table.
I have the following query to basically find all duplicates in my username
column:
SELECT `username`
FROM `instagram_user`
GROUP BY `username`
HAVING COUNT( * ) >1
How do I remove all the duplicates, such that it will only leave me with
one unique username in the table? I don't care which entity it is that is
persisted or removed, as long as there's one unique username in the table.
4 Views involving auto generating?
4 Views involving auto generating?
First View:
User inputs # of Terms # of Letters and # of Letters on each side of the
equal sign.
Second View:
I need it to auto generate TextFields that the user can input the
individual letters/number/terms into. 1 per TextField. All for the Left
side of the equal sign only.
Third View:
Same as second, except for the right side of equal sign.
Forth View:
Takes and lines up all the items from the second and third view as Label =
Label so that all the user's input is shown with second View as the left
Label, and third View as the right View.
What would I do code wise to get this to work? If you need more info let
me know I'll add it in edits below this.
First View:
User inputs # of Terms # of Letters and # of Letters on each side of the
equal sign.
Second View:
I need it to auto generate TextFields that the user can input the
individual letters/number/terms into. 1 per TextField. All for the Left
side of the equal sign only.
Third View:
Same as second, except for the right side of equal sign.
Forth View:
Takes and lines up all the items from the second and third view as Label =
Label so that all the user's input is shown with second View as the left
Label, and third View as the right View.
What would I do code wise to get this to work? If you need more info let
me know I'll add it in edits below this.
Properties for internal stability of a discrete-time system
Properties for internal stability of a discrete-time system
These are two parts of a larger proof I'm working on, can't figure how i)
implies ii) though.
Dynamic system:
$x_{(k+1)} = Ax_{k}, x(0)=x_0$
Where $A \in \mathbb{R}^{n\times n} $ is a real constant matrix.
Properties:
i) All the eigenvalues of A are located on the open unit disc
ii) $\bigvee x_{0} \in \mathbb{R}^{n}, \sum\limits_{k=0}^\infty
||x_{k}||^2 < +\infty$
I understand that the eigenvalues are bounded in the disc, and that ii)
shows the system is finite and won't blow up, but I honestly just can't
find a way to show that i) implies ii). Here are some other tidbits I
have:
$x(k) = A^kx_{0}$
$A^k \backsim e^{At}$
$||A^k|| \leqq \beta |\lambda|^k$
$||e^{At}|| \leqq \beta e^{-\alpha t}$
These are two parts of a larger proof I'm working on, can't figure how i)
implies ii) though.
Dynamic system:
$x_{(k+1)} = Ax_{k}, x(0)=x_0$
Where $A \in \mathbb{R}^{n\times n} $ is a real constant matrix.
Properties:
i) All the eigenvalues of A are located on the open unit disc
ii) $\bigvee x_{0} \in \mathbb{R}^{n}, \sum\limits_{k=0}^\infty
||x_{k}||^2 < +\infty$
I understand that the eigenvalues are bounded in the disc, and that ii)
shows the system is finite and won't blow up, but I honestly just can't
find a way to show that i) implies ii). Here are some other tidbits I
have:
$x(k) = A^kx_{0}$
$A^k \backsim e^{At}$
$||A^k|| \leqq \beta |\lambda|^k$
$||e^{At}|| \leqq \beta e^{-\alpha t}$
Can chmod 777 be a security risk on a personal machine?
Can chmod 777 be a security risk on a personal machine?
Can 777 permissions increase security risk on an average Ubuntu
single-user machine? How? What are other downsides of it?
Thanks
Can 777 permissions increase security risk on an average Ubuntu
single-user machine? How? What are other downsides of it?
Thanks
Subscribe to:
Comments (Atom)