Search Results

Search found 8646 results on 346 pages for 'echo flow'.

Page 9/346 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • PHP Speed - Many Echos vs Building a String

    - by Chris
    Wondering if anyone knows if either of these methods would produce an output faster: Method 1 for ($i=1;$i<99999;$i++) { echo $i, '<br>'; } or Method 2 for ($i=1;$i<99999;$i++) { $string .= $i . '<br>'; } echo $string; Thanks for any input you have.

    Read the article

  • echo that outputs to stderr

    - by BCS
    Is there a standard bash tool that acts like echo but outputs to stderr rather than stdout? I know I can do echo foo 1>&2 but it's kinda ugly and, I suspect, error prone (e.g. more likely to get edited wrong when things change).

    Read the article

  • Trace File Source Adapter

    The Trace File Source adapter is a useful addition to your SSIS toolbox.  It allows you to read 2005 and 2008 profiler traces stored as .trc files and read them into the Data Flow.  From there you can perform filtering and analysis using the power of SSIS. There is no need for a SQL Server connection this just uses the trace file. Example Usages Cache warming for SQL Server Analysis Services Reading the flight recorder Find out the longest running queries on a server Analyze statements for CPU, memory by user or some other criteria you choose Properties The Trace File Source adapter has two properties, both of which combine to control the source trace file that is read at runtime. SQL Server 2005 and SQL Server 2008 trace files are supported for both the Database Engine (SQL Server) and Analysis Services. The properties are managed by the Editor form or can be set directly from the Properties Grid in Visual Studio. Property Type Description AccessMode Enumeration This property determines how the Filename property is interpreted. The values available are: DirectInput Variable Filename String This property holds the path for trace file to load (*.trc). The value is either a full path, or the name of a variable which contains the full path to the trace file, depending on the AccessMode property. Trace Column Definition Hopefully the majority of you can skip this section entirely, but if you encounter some problems processing a trace file this may explain it and allow you to fix the problem. The component is built upon the trace management API provided by Microsoft. Unfortunately API methods that expose the schema of a trace file have known issues and are unreliable, put simply the data often differs from what was specified. To overcome these limitations the component uses  some simple XML files. These files enable the trace column data types and sizing attributes to be overridden. For example SQL Server Profiler or TMO generated structures define EventClass as an integer, but the real value is a string. TraceDataColumnsSQL.xml  - SQL Server Database Engine Trace Columns TraceDataColumnsAS.xml    - SQL Server Analysis Services Trace Columns The files can be found in the %ProgramFiles%\Microsoft SQL Server\100\DTS\PipelineComponents folder, e.g. "C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\TraceDataColumnsSQL.xml" "C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\TraceDataColumnsAS.xml" If at runtime the component encounters a type conversion or sizing error it is most likely due to a discrepancy between the column definition as reported by the API and the actual value encountered. Whilst most common issues have already been fixed through these files we have implemented specific exception traps to direct you to the files to enable you to fix any further issues due to different usage or data scenarios that we have not tested. An example error that you can fix through these files is shown below. Buffer exception writing value to column 'Column Name'. The string value is 999 characters in length, the column is only 111. Columns can be overridden by the TraceDataColumns XML files in "C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\TraceDataColumnsAS.xml". Installation The component is provided as an MSI file which you can download and run to install it. This simply places the files on disk in the correct locations and also installs the assemblies in the Global Assembly Cache as per Microsoft’s recommendations. You may need to restart the SQL Server Integration Services service, as this caches information about what components are installed, as well as restarting any open instances of Business Intelligence Development Studio (BIDS) / Visual Studio that you may be using to build your SSIS packages. Finally you will have to add the transformation to the Visual Studio toolbox manually. Right-click the toolbox, and select Choose Items.... Select the SSIS Data Flow Items tab, and then check the Trace File Source transformation in the Choose Toolbox Items window. This process has been described in detail in the related FAQ entry for How do I install a task or transform component? We recommend you follow best practice and apply the current Microsoft SQL Server Service pack to your SQL Server servers and workstations. Please note that the Microsoft Trace classes used in the component are not supported on 64-bit platforms. To use the Trace File Source on a 64-bit host you need to ensure you have the 32-bit (x86) tools available, and the way you execute your package is setup to use them, please see the help topic 64-bit Considerations for Integration Services for more details. Downloads Trace Sources for SQL Server 2005 -- Trace Sources for SQL Server 2008 Version History SQL Server 2008 Version 2.0.0.382 - SQL Sever 2008 public release. (9 Apr 2009) SQL Server 2005 Version 1.0.0.321 - SQL Server 2005 public release. (18 Nov 2008) -- Screenshots

    Read the article

  • Trace File Source Adapter

    The Trace File Source adapter is a useful addition to your SSIS toolbox.  It allows you to read 2005 and 2008 profiler traces stored as .trc files and read them into the Data Flow.  From there you can perform filtering and analysis using the power of SSIS. There is no need for a SQL Server connection this just uses the trace file. Example Usages Cache warming for SQL Server Analysis Services Reading the flight recorder Find out the longest running queries on a server Analyze statements for CPU, memory by user or some other criteria you choose Properties The Trace File Source adapter has two properties, both of which combine to control the source trace file that is read at runtime. SQL Server 2005 and SQL Server 2008 trace files are supported for both the Database Engine (SQL Server) and Analysis Services. The properties are managed by the Editor form or can be set directly from the Properties Grid in Visual Studio. Property Type Description AccessMode Enumeration This property determines how the Filename property is interpreted. The values available are: DirectInput Variable Filename String This property holds the path for trace file to load (*.trc). The value is either a full path, or the name of a variable which contains the full path to the trace file, depending on the AccessMode property. Trace Column Definition Hopefully the majority of you can skip this section entirely, but if you encounter some problems processing a trace file this may explain it and allow you to fix the problem. The component is built upon the trace management API provided by Microsoft. Unfortunately API methods that expose the schema of a trace file have known issues and are unreliable, put simply the data often differs from what was specified. To overcome these limitations the component uses  some simple XML files. These files enable the trace column data types and sizing attributes to be overridden. For example SQL Server Profiler or TMO generated structures define EventClass as an integer, but the real value is a string. TraceDataColumnsSQL.xml  - SQL Server Database Engine Trace Columns TraceDataColumnsAS.xml    - SQL Server Analysis Services Trace Columns The files can be found in the %ProgramFiles%\Microsoft SQL Server\100\DTS\PipelineComponents folder, e.g. "C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\TraceDataColumnsSQL.xml" "C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\TraceDataColumnsAS.xml" If at runtime the component encounters a type conversion or sizing error it is most likely due to a discrepancy between the column definition as reported by the API and the actual value encountered. Whilst most common issues have already been fixed through these files we have implemented specific exception traps to direct you to the files to enable you to fix any further issues due to different usage or data scenarios that we have not tested. An example error that you can fix through these files is shown below. Buffer exception writing value to column 'Column Name'. The string value is 999 characters in length, the column is only 111. Columns can be overridden by the TraceDataColumns XML files in "C:\Program Files\Microsoft SQL Server\100\DTS\PipelineComponents\TraceDataColumnsAS.xml". Installation The component is provided as an MSI file which you can download and run to install it. This simply places the files on disk in the correct locations and also installs the assemblies in the Global Assembly Cache as per Microsoft’s recommendations. You may need to restart the SQL Server Integration Services service, as this caches information about what components are installed, as well as restarting any open instances of Business Intelligence Development Studio (BIDS) / Visual Studio that you may be using to build your SSIS packages. Finally you will have to add the transformation to the Visual Studio toolbox manually. Right-click the toolbox, and select Choose Items.... Select the SSIS Data Flow Items tab, and then check the Trace File Source transformation in the Choose Toolbox Items window. This process has been described in detail in the related FAQ entry for How do I install a task or transform component? We recommend you follow best practice and apply the current Microsoft SQL Server Service pack to your SQL Server servers and workstations. Please note that the Microsoft Trace classes used in the component are not supported on 64-bit platforms. To use the Trace File Source on a 64-bit host you need to ensure you have the 32-bit (x86) tools available, and the way you execute your package is setup to use them, please see the help topic 64-bit Considerations for Integration Services for more details. Downloads Trace Sources for SQL Server 2005 -- Trace Sources for SQL Server 2008 Version History SQL Server 2008 Version 2.0.0.382 - SQL Sever 2008 public release. (9 Apr 2009) SQL Server 2005 Version 1.0.0.321 - SQL Server 2005 public release. (18 Nov 2008) -- Screenshots

    Read the article

  • Zend Framework how to echo value of SUM query

    - by Rick de Graaf
    Hello, I created a query for the zend framework, in which I try to retrieve the sum of a column, in this case the column named 'time'. This is the query I use: $this->timequery = $this->db_tasks->fetchAll($this->db_tasks->select()->from('tasks', 'SUM(time)')->where('projectnumber =' . $this->value_project)); $this->view->sumtime = $this->timequery; Echoing the query tells me this is right. But I can't echo the result properly. Currently I'm using: echo $this->sumtime['SUM(time)']; Returning the following error: Catchable fatal error: Object of class Zend_Db_Table_Row could not be converted to string in C:\xampp\htdocs\BManagement\application\views\scripts\tasks\index.phtml on line 46 Line 46 being the line with the echo in my view. I've been searching now for two days on how to figure this out, or achieve the same result in a different way. Tried to serialize the value, but that didn't work either. Is there somebody who knows how to achieve the total sum of a database column? Any help is greatly appriciated! note: Pretty new to zend framework...

    Read the article

  • Finding distance travelled by robot using Optical Flow

    - by user280454
    Hi, I'm working on a project right now in which we are developing an autonomous robot. I have to basically find out the distance travelled by the robot between any 2 intervals. I'm using OpenCV, and using the Optical Flow functions of OpenCV, I'm able to find out the velocity/distance of each pixel in 2 different images. Using this information, I want to be able to find out the distance travelled by the robot in the interval between those 2 images. I thought of a way in which we could develop an input output mapping between the distance travelled by pixels and the distance travelled by the bot (using some tests). In this way, using neural networks, we would be able to find the relationship. However, the optical flow would depend on the distance of the camera from the pixel, which would cause problems. Is there any way to solve this problem?

    Read the article

  • spring faces without spring flow

    - by AgostinoX
    I'm starting a new JSF (2) project. I realize that pure JSF has some limitation and I'm planning to drop in spring. JSF is a relatively new approach in spring (there is not even a tag spring-faces in stackoverflow :-) ), jsp being the classic way. I need the best available adjustment of the technology stack. 1) do i need to use spring web flow too? 2) is it viable to use just spring faces (that seems to come as a part of web flow) + spring mvc+ JPA? 3) is there any good example of such a configuration?

    Read the article

  • Why wont this entire word doc file generate from my php script?

    - by CheeseConQueso
    Here's the php script I'm using on a linux environment: <?php include("../_inc/odbcw.php"); //connect string $cat = $_GET["cat"]; if($_GET["st"]){$crs_query = "select crs_no, title, credits, abstr, prereq, coreq, lab_fee from xxx where active = 'Y' and cat = '".$cat."' and spec_top = 'Y' and prog='UNDG' order by crs_no";} else {$crs_query = "select crs_no, title, credits, abstr, prereq, coreq, lab_fee from xxx where active = 'Y' and cat = '".$cat."' and prog='UNDG' order by crs_no";} $crs_result = @mysql_query($crs_query); header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=cat.doc"); echo "<html>"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; echo "<body>"; echo '<table border=0 width = 700>'; if($_GET["st"]){echo '<tr><td><font face=arial size=2><center>CATALOGUE<br>COURSE DESCRIPTIONS - '.$cat.'<br>SPECIAL TOPICS</center></font></td></tr>';} else {echo '<tr><td><font face=arial size=2><center>CATALOGUE<br>COURSE DESCRIPTIONS - '.$cat.'</center></font></td></tr>';} echo '</table>'; echo '<hr width=700>'; while($row = mysql_fetch_array($crs_result)) { $crs_no = $row['crs_no']; $title = $row['title']; $credits = $row['credits']; $abstr = $row['abstr']; $prereq = $row['prereq']; $coreq = $row['coreq']; $lab_fee = $row['lab_fee']; $rowspan = 2; if($prereq) {$rowspan++;} if($coreq) {$rowspan++;} if($lab_fee=="Y") {$rowspan++;} echo "<table border=0 width = 700>"; echo "<tr>"; echo "<td rowspan=".$rowspan." valign=top width=100><font face=arial size=2>".$crs_no."</font></td>"; echo "<td valign=top><font face=arial size=2><u>".$title."</u></font></td> <td valign=top align=right><font face=arial size=2>".$credits."</font></td>"; echo "</tr>"; echo "<tr>"; echo "<td colspan=2 valign=top align=justify><font face=arial size=2>".$abstr."</font></td>"; echo "</tr>"; if($prereq) { echo "<tr>"; echo "<td colspan=2 valign=top><font face=arial size=2>Prerequisite: ".$prereq."</font></td>"; echo "</tr>"; } if($coreq) { echo "<tr>"; echo "<td colspan=2 valign=top><font face=arial size=2>Coerequisite: ".$coreq."</font></td>"; echo "</tr>"; } if($lab_fee=="Y") { echo "<tr>"; echo "<td colspan=2 valign=top><font face=arial size=2>Lab Fee Required</font></td>"; echo "</tr>"; } echo "</table>"; echo "<br>"; } echo "</body>"; echo "</html>"; ?> Everything works fine before the inclusion of: header("Content-type: application/vnd.ms-word"); header("Content-Disposition: attachment;Filename=cat.doc"); echo "<html>"; echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=Windows-1252\">"; echo "<body>"; These lines successfully bring up the dialogue box to open or save cat.doc, but after I open it, the only lines printed are: CATALOGUE COURSE DESCRIPTIONS - and the <HR> beneath this echoed text. It seems to go on lunch break for the while loop echoing section. Any ideas?

    Read the article

  • dismissViewControllerAnimated completion block presenter view and modal view flow

    - by Patricia LaRue
    I did find an answer to this title and I did do a little research but I'm still not getting the flow. Here is what I want to happen: 1) click a button on the presenter view to open a modal view. 2) retrieve some value and click a button to close the modal view....sending the value to the presentor view and execute a method. I get that this works like a callback but I still can't figure out where to put the callback stuff. So, how exactly do I do this? A) In the presentViewController completion block, should I include the presenter view method to execute when modal view is completed? Or: B) In the modal view's dismissViewControllerAnimated completion block, should I include the presenter view method to execute when modal view is completed? Can somebody help me with some sample code? Or at least help me get the flow of which block to put the code in? Thank you, P

    Read the article

  • Optimally reducing maximum flow

    - by ArIck
    Given a parameter k, I'm trying to delete k edges from a directed graph such that the maximum flow is reduced by as much as possible. The graph has a source s and a sink t, and the capacity of each edge is one. The graph may or may not contain cycles. My proposed solution would be to first perform a topological sorting on the graph, using an algorithm that "forgives" cycles -- perhaps by ignoring edges that lead us back to the source. Then (assuming k = 1): i = 0 for each vertex u order by topological(u) for each edge (u, v) order by topological(v) descending if topological(v) > topological(u) then delete (u, v) if ++i = k then return else // edge doesn't contribute to max flow, ignore Would this work, or am I totally off-track here?

    Read the article

  • JQuery multiple id index with form submit

    - by RussP
    Hi folks, not sure how to do this as ID's are ment to be unique but this is a dynamically series of forms generated from a php array - based on reading the file names in a directory - with the same ID. What I need to do is identify which form so the data can be processed. Here is the form echo '<form method="post" action="" id="frmwidget">'; echo '<tr>'; echo '<td>'; echo ucfirst($comments[0]); echo '</td><td>'; echo $comments[1]; echo '</td><td align="center">'; echo '<input type="checkbox">'; echo '</td>'; echo '</td><td align="center">'; echo '<input type="checkbox">'; echo '</td>'; echo '</td><td align="center">'; echo '<input type="checkbox">'; echo '</td>'; echo '</td><td align="center">'; echo '<input type="submit" id="cmdwidgets">'; echo '</td>'; echo '</tr>'; echo '</form>'; And here is my start of the Jquery $j(document).ready(function() { $j('#cmdwidgets').live('click',function(){ alert('Your widgets will load'); I will want to Ajax the form in here .. not just an alert $j('#wall').load("admin/inc/ajax-widgets.php"); return false; }); }); Yes I know the form could be 1 form not multiples, but for this purpose it needs to be multiple forms. And yes I know the form is incomplete i.e. field names etc. Any help/suggestions please - thanks in advance

    Read the article

  • Understanding flow of object creation

    - by Boris Mandovskes
    I'm new to java and I wonder if there is simple way to know flow like the following of object creation, I'm using eclipse and when I write new ObjectInputStream and press CTRL+SPACE. I don't see any option that I can enter new BufferedInputStream (I have copied the code from example) and than to create new object for FileInputStream etc. in = new ObjectInputStream(new BufferedInputStream(new FileInputStream("emp.dat"))); List temp = (List)in.readObject(); I give that example since this is the first time that I saw this kind of creation new object flow and I want to use some best practice for the next times.

    Read the article

  • PHP will not Echo

    - by user2981166
    I've tried to look into why this isn't echoing but every result the persons trying use php on an html page so this is why I'm here asking. I have 3 php files, a login file, a global config file, and a theme file. The login page echo's the login script but it connects to the global file. The global file connects to the theme file and the db config file. The theme file is a simple table. Here's my files <? include('../tools/global.php'); switch($_POST[act]){ case "setlogin": set($login); break; case "refresh": refresh(); break; case "logout": lout(); break; default: login($mes); break; } function login($mes){ if (isset($_COOKIE["user"])){ $out[body]="<br /> <center> <table width='90%' border='0' cellspacing='1' cellpadding='1' bgcolor='#BDBDBD'> <tr bgcolor='##ff80ff'> <td width='100%' valign='center' align='left' colspan='2' background='#BDBDBD'> <strong>Login</strong> </td> </tr> <tr bgcolor='#BDBDBD'> <td width='100%' valign='center' align='left'><center> <b>You are already logged in! Would you like to <a href='http://www.fivedesignguys.com/dir/panel/login.php?act=refresh&type=logout'>Logout?</a></center></td></tr> </table> </center><br /><br /><br /><br />"; }else{ $out[body]=" <br /> <center> <table width='400' border='0' cellspacing='1' bgcolor='#BDBDBD' cellpadding='1'> <form method='post'> <tr bgcolor='$config[altcolor]'> <td background='#BDBDBD' width='100%' valign='center' align='left' colspan='2'> <strong>Login</strong>"; It continues but I know it's going to echo me the first option, Heres the global php file <?php include('../theme/default.php'); include('config.php'); ?> and finally the default.php theme file <table border='0'> <tr> <td colspan='2'> <center>bar</center> </td> </tr> <tr> <td width='10%'> hey<br>hey<br> </td> <td> hello <?php echo $out[body]; ?> </td> </tr> </table> as you can tell I want it to echo $out[body] but it doesn't want to. Yes all the files are PHP but this is where I'm stuck.

    Read the article

  • My simple PHP is outputting wrong things.

    - by Sergio Tapia
    EDIT: I forgot to add semi colons. Now there is another problems. I'm getting a error: Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\useraccess.php on line 12 It outputs: 0){ echo 'si'; } ?> When it should only output 'si' in the body. Here's the code: <html> <head> </head> <body> <? $user = mysql_real_escape_string($_GET["u"]) $pass = mysql_real_escape_string($_GET["p"]) $query = "SELECT * FROM usario WHERE username = '$user' AND password = '$pass'" mysql_connect(localhost, "sergio", "123"); @mysql_select_db("multas") or die( "Unable to select database"); $result=mysql_query($query); if(mysql_numrows($result) > 0){ echo 'si'; } ?> </body> </html>

    Read the article

  • Screen (command-line program) bug?

    - by VioletCrime
    fired up my Minecraft server again after about a year off. My server used to run 11.04, which has since been upgraded to 12.04; I lost my management scripts in the upgrade (thought I'd backed up the user's home directory), but whatever, I enjoy developing stuff like that anyways. However, this time around, I'm running into issues. I start the Minecraft server using a detached screen, however the script is unable to 'stuff' commands into the screen instance until I attach to the screen then detach again? Once I do that, I can stuff anything I want into the server's terminal using the -X option, until I stop/start the server again, then I have to reattach and detach in order to restore functionality? Here's the manager script: #!/bin/bash #Name of the screen housing the server (set with the -S flag at startup) SCREENNAME=minecraft1 #Name of the folder housing the Minecraft world FOLDERNAME=world1 startServer (){ if screen -list | grep "$SCREENNAME" > /dev/null then echo "Cannot start Minecraft server; it is already running!" else screen -dmS $SCREENNAME java -Xmx1024M -Xms1024M -jar minecraft_server.jar sleep 2 if screen -list | grep "$SCREENNAME" > /dev/null then echo "Minecraft server started; happy mining!" else echo "ERROR: Minecraft server failed to start!" fi fi; } stopServer (){ if screen -list | grep "$SCREENNAME" > /dev/null then echo "Server is running. Giving a 1-minute warning." screen -S $SCREENNAME -X stuff "/say Shutting down (halt) in one minute." screen -S $SCREENNAME -X stuff $'\015' sleep 45 screen -S $SCREENNAME -X stuff "/say Shutting down (halt) in 15 seconds." screen -S $SCREENNAME -X stuff $'\015' sleep 15 screen -S $SCREENNAME -X stuff "/stop" screen -S $SCREENNAME -X stuff $'\015' else echo "Server is not running; nothing to stop." fi; } stopServerNow (){ if screen -list | grep "$SCREENNAME" > /dev/null then echo "Server is running. Giving a 5-second warning." screen -S $SCREENNAME -X stuff "/say EMERGENCY SHUTDOWN! 5 seconds to halt." screen -S $SCREENNAME -X stuff $'\015' sleep 5 screen -S $SCREENNAME -X stuff "/stop" screen -S $SCREENNAME -X stuff $'\015' else echo "Server is not running; nothing to stop." fi; } restartServer (){ if screen -list | grep "$SCREENNAME" > /dev/null then echo "Server is running. Giving a 1-minute warning." screen -S $SCREENNAME -X stuff "/say Shutting down (restart) in one minute." screen -S $SCREENNAME -X stuff $'\015' sleep 45 screen -S $SCREENNAME -X stuff "/say Shutting down (restart) in 15 seconds." screen -S $SCREENNAME -X stuff $'\015' sleep 15 screen -S $SCREENNAME -X stuff "/stop" screen -S $SCREENNAME -X stuff $'\015' sleep 2 startServer else echo "Cannot restart server: it isn't running." fi; } #In order for this function to work, a directory 'backup/$FOLDERNAME' must exist in the same #directory that '$FOLDERNAME' resides backupWorld (){ if screen -list | grep "$SCREENNAME" > /dev/null then echo "Server is running. Giving a 1-minute warning." screen -S $SCREENNAME -X stuff "/say Shutting down (backup) in one minute." screen -S $SCREENNAME -X stuff $'\015' screen -S $SCREENNAME -X stuff "/say Server should be down for no more than a few seconds." screen -S $SCREENNAME -X stuff $'\015' sleep 45 screen -S $SCREENNAME -X stuff "/say Shutting down for backup in 15 seconds." screen -S $SCREENNAME -X stuff $'\015' sleep 15 screen -S $SCREENNAME -X stuff "/stop" screen -S $SCREENNAME -X stuff $'\015' fi sleep 2 if screen -list | grep $SCREENNAME > /dev/null then echo "Server is still running? Error." else cd .. tar -czvf backup0.tar.gz $FOLDERNAME mv backup0.tar.gz backup/$FOLDERNAME cd backup/$FOLDERNAME rm backup10.tar.gz mv backup9.tar.gz backup10.tar.gz mv backup8.tar.gz backup9.tar.gz mv backup7.tar.gz backup8.tar.gz mv backup6.tar.gz backup7.tar.gz mv backup5.tar.gz backup6.tar.gz mv backup4.tar.gz backup5.tar.gz mv backup3.tar.gz backup4.tar.gz mv backup2.tar.gz backup3.tar.gz mv backup1.tar.gz backup2.tar.gz mv backup0.tar.gz backup1.tar.gz cd ../../$FOLDERNAME screen -dmS $SCREENNAME java -Xmx1024M -Xms1024M -jar minecraft_server.jar; sleep 2 if screen -list | grep "$SCREENNAME" > /dev/null then echo "Minecraft server restarted; happy mining!" else echo "ERROR: Minecraft server failed to start!" fi fi; } printCommands (){ echo echo "$0 usage:" echo echo "Start : Starts the server on a detached screen." echo "Stop : Stop the server; includes a 1-minute warning." echo "StopNOW : Stops the server with only a 5-second warning." echo "Restart : Stops the server and starts the server again." echo "Backup : Stops the server (1 min), backs up the world, and restarts." echo "Help : Display this message." } #Forces case-insensitive string comparisons shopt -s nocasematch #Primary 'Switch' if [[ $1 = "start" ]] then startServer elif [[ $1 = "stop" ]] then stopServer elif [[ $1 = "stopnow" ]] then stopServerNow elif [[ $1 = "backup" ]] then backupWorld elif [[ $1 = "restart" ]] then restartServer else printCommands fi

    Read the article

  • PHP CLI Application on Debian: why can't I output a line break?

    - by Steffen Müller
    Hello! I have a really puzzling problem: I am writing a PHP CLI application running on a debian server. I am connected to the server via SSH, just the normal way. Everything runs as usual. Except the following: echo "My CLI fun\n\n"; echo "Is this."; Outputs on the SSH terminal, when executing the PHP script: My CLI funIs this. I am really puzzled as I have never had such a problem. The bash behaves normal in all other aspects. I already tried to output chr(10) and such, same problem. Does anybody have a clue?

    Read the article

  • running Echo from Java

    - by ripper234
    I'm trying out the Runtime.exec() method to run a command line process. I wrote this sample code, which runs without problems but doesn't produce a file at c:\tmp.txt. String cmdLine = "echo foo > c:\\tmp.txt"; Runtime rt = Runtime.getRuntime(); Process pr = rt.exec(cmdLine); BufferedReader input = new BufferedReader( new InputStreamReader(pr.getInputStream())); String line; StringBuilder output = new StringBuilder(); while ((line = input.readLine()) != null) { output.append(line); } int exitVal = pr.waitFor(); logger.info(String.format("Ran command '%s', got exit code %d, output:\n%s", cmdLine, exitVal, output)); The output is INFO 21-04 20:02:03,024 - Ran command 'echo foo c:\tmp.txt', got exit code 0, output: foo c:\tmp.txt

    Read the article

  • How to flush output after each `echo` call?

    - by CuSS
    Hi all! I've a php script that only produces logs to the client. When I echo something, i wan't it to be transfered to client on-the-fly. (Because while the script is processing, the page is blank) I had already played arround with ob_start() and ob_flush(), but they didn't worked. What's the best solution? PS: it is a little dirty to put a flush at the end of the echo call... EDIT: Neither the Answers worked, PHP or Apache Fault? Thanks in advance, José Moreira Sorry for my bad English. ;)

    Read the article

  • Is it better to echo javascript in raw format with php, or echo a script include that has been minif

    - by Scarface
    Hey guys quick question, I am currently echoing a lot of javascript that is based conditionally on login status and other variables. I was wondering if it would be better to simply echo the script include like <script type="text/javascript" src="javascript/openlogin.js"></script> that has been run through a minifying program and been gzipped or to echo the full script in raw format. The latter suggestion is messier to me but it reduces http requests while the latter would probably be smaller but take more cpu? Just wondering what some other people think. Thanks in advance for any advice.

    Read the article

  • Echo mysql results in a loop?

    - by Roy D. Porter
    I am using turn.js to make a book. Every div within the 'deathnote' div becomes a new page. <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page </div> //ends book What I am doing is trying to get 3 'content' (content being a name and cause of death) divs onto 1 page, and then generate a new page. So here is what i want: <div id="deathnote"> //starts book <div style="background-image:url(images/coverpage.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"></div> //creates new page <div style="background-image:url(images/paper.jpg);"> //creates new page but leaves it open <div> CONTENT </div> <div> CONTENT </div> <div> CONTENT </div> </div> //ends the page </div> //ends book Seems simple enough, however the content is data from a MySQL DB, so i have to echo it in using PHP. Here is what i have so far <div id="deathnote"> <div style="background-image:url(images/coverpage.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <div style="background-image:url(images/paper.jpg);"></div> <?php $pagecount = 0; $db = new mysqli('localhost', 'username', 'passw', 'DB'); if($db->connect_errno > 0){ die('Unable to connect to database [' . $db->connect_error . ']'); } $sql = <<<SQL SELECT * FROM `TABLE` SQL; if(!$result = $db->query($sql)){ die('There was an error running the query [' . $db->error . ']'); } //IGNORE ALL OF THE GARBAGE ABOVE. IT IS SIMPLE CONNECTING SCRIPT THAT I KNOW WORKS //THE METHOD I AM HAVING TROUBLE WITH IS BELOW $pagecount = 0; while($row = $result->fetch_assoc()){ //GETS THE VALUE (and makes sure it isn't nothing echo '<div style="background-image:url(images/paper.jpg);">'; //THIS OPENS A NEW PAGE while ($pagecount !== 3) { //KEEPS COUNT OF HOW MUCH CONTENT DIVS IS ON THE PAGE while($row = $result->fetch_assoc()){ //START A CONTENT DIV echo '<div class="content"><div class="name">' . $row['victim'] . '</div><div class="cod">' . $row['cod'] . '</div></div>'; //END A CONTENT DIV $pagecount++; //UP THE PAGE COUNT } } $pagecount=0; //PUT IT BACK TO 0 echo '</div>'; //END PAGE } $db->close(); ?> <div style="background-image:url(images/backpage.jpg);"></div> //BACK PAGE </div> At the moment i seem to be causing and infinite loop so the page won't load. The problem resides within the while loops. Any help is greatly appreciated. Thanks in advance guys. :)

    Read the article

  • Sending variables in URLs in PHP with echo

    - by alexpelan
    Hi all, I can't really find good guidelines through google searches of the proper way to escape variables in URLs. Basically I am printing out a bunch of results from a mysql query in a table and I want one of the entries in each row to be a link to that result's page. I think this is easy, that I'm just missing a apostrophe or backslash somewhere, but I can't figure it out. Here's the line that's causing the error: echo "<a href = \"movies.php/?movie_id='$row['movie_id']'\"> Who Owns It? </a> "; and this is the error I'm getting: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING If you could elaborate in your answers about general guidelines for working with echo and variables in urls, that would be great. Thanks.

    Read the article

  • php echo json in foreach loop

    - by Vidya Sagar
    i have product ids like this 1,2,3 in $product_ids var $product_ids = explode(',', $product_ids); $product_ids = array_filter($product_ids); foreach ($product_ids as $key => $product_id) { $sth = $this->db->prepare("SELECT * FROM products Where id =:id "); $sth->execute(array( ':id' => $product_id )); $final_data = $sth->fetchAll(); echo json_encode($final_data); } how can i format json whit this code in for loop echo json not working is there any other way plz help

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >