how would I print a 2d array in c using scanf for user input, array called grid[ ][ ] and a for loop?
say if the user types in 3 5, the output will be:
.....
.....
.....
Hi,
I'm using ASP.NET MVC and have a model which has an image (byte array) in one of the fields. I'm trying to output this image into the src attribute of the img tag. I'm looking to do something like '. How can I do this?
How can I replace the slash inside the variable?
$string = 'a\cc\ee';
$re = 'a\\cc';
$rep = "Work";
#doesnt work in variable
$string =~ s/$re/$rep/og;
print $string."\n";
#work with String
$string =~ s/a\\cc/$rep/og;
print $string."\n";
output:
a\cc\ee
Work\ee
Hi, I'm just starting with Propel and for more rapid development I'm curious if there is anything like automatic forms. Something like default administration in Django.
I want to be able to output a form or to get all information I'll need. Even in the objects I didn't find all information which should be necessary to have everything for the form (name, type, length, related object, etc).
I frequently come across this problem. I have a file:
something
something2
something3
which I want output as:
"something","something2","something3"
any quick tool for this, preferably online?
I am writing a application that monitor the system's health, user should know when they need to defrag the volumes.
What I am thinking is calling the "defrag.exe /A" then analyze the output result to see whether it contains "You do not need to defragment this volume."
But it's slow and very bad, I fount that the "Analyze" is really quick on the MyDefrag.exe.
Anyone could tell me what's the best and simplest way?
Warning (2): Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/iframeworking/iframe/app/models/frame.php:7) [COREcake/libs/controller/controller.php, line 647]
here is the code from frame.php:
<?php
class Frame extends AppModel
{
var $name = 'Frame';
var $belongsTo = array('User' => array('className' => 'User', 'dependent' => true));
}
?>
I have this weird situation:
When I do on rails console Time.now or Time.zone.now I get the same values (suppose they run at the sime time: 2014-06-05 23:38:06 -0300)
But when I use Time.now in a query like: Match.where("datetime = ?", Time.now) it returns the time 3 hours ahead!
.to_sql output:
SELECT `matches`.* FROM `matches` WHERE (datetime = '2014-06-06 02:38:06')
any thoughts on that?
Rails 4
Mysql 5.5
The scenario is i have a file and contains a string "the date and time is 2012-12-07 17:11:50"
I had searched and found a command
grep 'the date and time is' 2012-12-07.txt | cut -d\ -f5
it just displays the 5th word and i need the combination of 5th and 6th, so i tried
grep 'the date and time is' 2012-12-07.txt | cut -d\ -f5 -f6
But its error.
Now, how to grep the 5th and 6th word with one command
I just need the output like 2012-12-07 17:11:50
I have a list containing a tuples and long integers the list looks like this:
table = [(1L,), (1L,), (1L,), (2L,), (2L,), (2L,), (3L,), (3L,)]
How do i convert the table to look like a formal list?
so the output would be:
table = ['1','1','1','2','2','2','3','3']
For information purposes the data was obtained from a mysql database.
i want to bind image in image control but according to the value in Eval
if Eval == True
then
imageurl = "image1"
else
imageurl = "image"
how to write if condition with eval to get above output
I am trying to open a remote shell via ssh to send commands from R.
As long as I send commands, I need to get results and send new commands that depends on the output of the previous ones.
For this reason I am looking for a solution to open a connection and manage it from within the R code until I have finished. I also need to open the connection with ssh key exchange (so without password authentication).
Looking at CRAN I didn't find anything useful.
Hi there,
I'm loosing my hair trying to figure out why net.sf.json.JSONObject add extra backslash where it shouldn't on my java code :
JSONObject obj = new JSONObject ();
obj.element ("column_name", "<a href=\"#\" title=\"test\">Test !</a>");
will output :
<a href=\"#\" title=\"test\">Test !<\/a>
with an extra "\" near <\/a.
How can I avoid this behavior ?
Thanks for your help !
sir,
l want to display resultset in jframe.i get output last record in the database displayed.
Lam intrested to place next button,back button in the frame.when i was click in the back button previosly viewed record is displayed and vice-versa.i don't know it will be possible.plz help me
Do you have any suggestions with my problem. I need to use get and post at the same time.
Get because I need to output what the user has typed. And post because I need to access the mysql database in relation to that input.
It looks something like this:
<form name="x" method="get" action="x.php">
<input name="year" type="text">
<select name="general" id="general">
<font size="3">
<option value="YEAR">Year</option>
</form>
This will output the contents of mysql depending on what the user will check:
<form name="y" method="post" action"y.php">
<input name="fname" type="checkbox">
</form>
And the form action of those two combined will look something like this:
<?php
if($_POST['general'] == 'YEAR'){
?>
<?php echo $_GET["year"]; ?>
<?php
$result2 = mysql_query("SELECT * FROM student
WHERE student.YEAR='$syear'");
?>
<table border='1'>
<tr>
<?php if ( $ShowLastName ) { ?><th>LASTNAME</th><?php } ?>
<?php if ( $ShowFirstName ) { ?><th>FIRSTNAME</th><?php } ?>
</tr>
<?php while ( $row = mysql_fetch_array($result2) ) {
if (!$result2) {
}
?>
<tr>
<td><?php echo $row['IDNO']?> </td>
<td><?php echo $row['YEAR'] ?> </td>
<?php if ( $ShowLastName ) { echo('<td>'.$row['LASTNAME'].'</td>'); } ?></td>
<?php if ( $ShowFirstName ) { echo('<td>'.$row['FIRSTNAME'].'</td>'); } ?>
I really get lots of undefined errors when I do this. What can you recommend that I should do in order to get the value inputted by the user together with the mysql data.
I'm using GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu). And this command:
echo "-e"
doesn't print anything. I guess this is because "-e" is one of a valid options of echo command because echo "-n" and echo "-E" (the other two options) also produce empty strings.
The question is how to escape the sequence "-e" for echo to get the natural output ("-e").
int val =233;
byte b = (byte)val;
System.out.println(b);
I have a simple case, like one integer with some value & i want to convert that value & place in the byte type for output. But in this case negative value is coming?
How to successfully place the int value to byte type.
Hi,
Could anyone please me why the output of the following programme is not " different different"?
public static void main(String[] args)
{
float f1=3.2f;
float f2=6.5f;
if(f1==3.2)
System.out.println("same");
else
System.out.println("different");
if(f2==6.5)
System.out.println("same");
else
System.out.println("different");
}
o/p :different
same
Hi everyone...
I'd asked a question about the splitting the a string like below:
Input string: "a=aa| b=b||b | c=cc"
and the output:
a=aa
b=b||b
c=cc
Kobi's answer was:
var matches = "a=aa|b=b||b|c=cc".match(/(?:[^|]|\|\|)+/g)
his answer was correct.
But I need to use "split" method and save store the outputs in a array.
so I can't use the Match Method.
So please help me...
How obtain the running process with absolute path name from ps command
13598 ? Ssl 0:00 /opt/something --run-id 2 -n /home/laks/f1 -l l.log
I need the output as -
/opt/something --run-id 2 -n /home/laks/f1 -l l.log
//output is "01234 00000" but the output should be or what I want it to be is
// "01234 01234" because of the assignment overloaded operator
#include <iostream>
using namespace std;
class IntArray
{
public:
IntArray() : size(10), used(0) { a= new int[10]; }
IntArray(int s) : size(s), used(0) { a= new int[s]; }
int& operator[]( int index );
IntArray& operator =( const IntArray& rightside );
~IntArray() { delete [] a; }
private:
int *a;
int size;
int used;//for array position
};
int main()
{
IntArray copy;
if( 2>1)
{
IntArray arr(5);
for( int k=0; k<5; k++)
arr[k]=k;
copy = arr;
for( int j=0; j<5; j++)
cout<<arr[j];
}
cout<<" ";
for( int j=0; j<5; j++)
cout<<copy[j];
return 0;
}
int& IntArray::operator[]( int index )
{
if( index >= size )
cout<<"ilegal index in IntArray"<<endl;
return a[index];
}
IntArray& IntArray::operator =( const IntArray& rightside )
{
if( size != rightside.size )//also checks if on both side same object
{
delete [] a;
a= new int[rightside.size];
}
size=rightside.size;
used=rightside.used;
for( int i = 0; i < used; i++ )
a[i]=rightside.a[i];
return *this;
}
Are there any example log4j configuration files (XML).
I have a java main application.
I want log4j to output to console AND write to file.
Any examples of this would be greatly appreciated.
I'm using netbeans if that matters.