w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Ignoring specific errors on Shell Script
In order to prevent bash to ignore error for specific commands you can say: some-arbitrary-command || true This would make the script continue. For example, if you have the following script: $ cat foo set -e echo 1 some-arbitrary-command || true echo 2 Executing it would return: $ bash foo 1 z: line 3: some-arbitrary-command: command not found 2 In the absence of || true in the command line, it'd have produced: $ bash foo 1 z: line 3: some-arbitrary-command: command not found Quote from the manual: The shell does not exit if the command that fails is part of the command list immediately following a while or until keyword, part of the test in an if statement, part of any command executed in a && or || list except the command following the final && or |

Categories : Bash

How to catch timeout/errors in a CURL shell script?
Execute following as script.sh http://www.google.com/. -D - dump headers to file -o - write response to file -s - be silent -w - display value of specified variables #!/bin/bash RESPONSE=response.txt HEADERS=headers.txt status=$(curl -s -w %{http_code} $1 -o $RESPONSE) # or #curl -s -D $HEADERS $1 -o $RESPONSE #status=$(cat $HEADERS | head -n 1 | awk '{print $2}') echo $status Use $status and $RESPONSE for further processing.

Categories : Bash

Perl script suffers random __fortify_fail errors, but continues to run without any errors. Should I be worried?
Given the updated screen shot in your most recent edit, it appears there's a bug in an XS module overflowing a buffer, and that's what the stack backtrace is complaining about. You can see in the screen shot the backtrace: /lib64/libc.so.6(__fortify_fail+0x37)[0x7fb026838637] /lib64/libc.so.6(+0xf8690)[0x7fb026836690] /home/ex2-user/j_authority/_Inline/lib/auto/author_da35/author_da35.so(profiles_c+0x27fd)[0x7fb008a529ad] /home/ex2-user/j_authority/_Inline/lib/auto/author_da35/author_da35.so(XS_author_profiles_c+0x32a)[0x7fb008a55afa] So, it appears you're in the middle of this XS module when Fortify detected a stack overflow. This suggests a function-local array to some function internal to author_da35 got overrun. This could happen if, for example, it sized some structure expecting

Categories : Perl

shell start / stop for python script
It is because ps aux |grep SOMETHING also finds the grep SOMETHING process, because SOMETHING matches. After the execution the grep is finished, so it cannot find it. Add a line: ps aux | grep -v grep | grep YOURSCRIPT Where -v means exclude. More in man grep.

Categories : Python

Python Import Script Naming Errors
If you're using linux you could make a symbolic link to your module that doesn't include dots and numbers :) But this isn't a portable solution. More about module naming.

Categories : Python

os.system commands in python script causing errors
For your original problem, (without the sleep), your output redirection needs some work, try: /usr/local/bin/mpirun -np 4 /home/mike/bin/Linux-ifort_XE_openmpi-1.6_emt64/v2_0_1/Pcrystal </dev/null > mgo.out 2>&1 & will direct both standard output and standard error to the file.

Categories : Python

Stop Python script from shutting down on small errors
First of all, the PHP language made many bad design decisions, this is just one of them. Be happy that python detects and handles these problems in a nice way. I personally always wrote PHP code that never created any warnings. Once you have warnings it's hard to distinguish what's acceptable and what's a real problem. Second, you can handle the problem several ways: You can handle these exceptions in an upper layer (1 or 2, instead of a dozen) You can use a defaultdict. You can use a utility function. Example: def getkey(d, k): try: return d[k] except KeyError: return "" Note that all these solution have the serious flaw that they make your code brittle. You won't detect all the possible typos you can make for the keys. I think the most clear way would be to fill your

Categories : Python

Hudson server running app engine, duplicate shell script executions result in duplicate property errors
It might be the case that the dev_appserver is already running and then you run it again with hudson job. The best way will be to stop the dev_appserver instance first and then pump it up again.

Categories : Python

how to pass variable from python to shell script when shell script is getting called inside python script
You can: Step through the list, and then call mail.sh once for each file. This is the most reliable way. Convert the items in the list to a space delimited string, and then pass it in to mail.sh (assuming mail.sh is setup correctly, it should accept multiple arguments). What you cannot do is pass ['a.txt','b.txt','c.txt'] wholesale to the script.

Categories : Python

Shell command syntax errors
The direct cause of the first problem is that you are executing the following command because the contents of $message ends in a newline. echo ... | /usr/usb/mail ... Both problems are the result of improper construction of the shell command. Fixed: use String::ShellQuote qw( shell_quote ); my $echo_cmd = shell_quote('echo', $message); my $mail_cmd = shell_quote('/usr/ucb/mail', '-s' => 'X Detected an Invalid Thing', $people_list, ); system("$echo_cmd | $mail_cmd"); Or avoid echo and the shell entirely: use IPC::Run3 qw( run3 ); my @cmd = ('/usr/ucb/mail', '-s' => 'X Detected an Invalid Thing', $people_list, ); run3 @cmd, $message;

Categories : Perl

Running python script on crontab is causing permissions errors but running via terminal is fine
@Lucas Ou-Yang @Hyperboreus as Hyperboreus said it depends on the user privilege who run it . i think that if you give the /tmp/ dir a 777 permission from the root account it'll be fixed : chmod 777 -R /tmp/ okay try with : chmod 777 /tmp/ if the error still check if the directory /tmp/ exist !

Categories : Python

JSLint has reached the limit of 1,000 errors or it is confused by earlier errors and can't continue
You've got some JS*H*int options (like eqeqeq, apparently) in the jslint line. It's choking there. So change... /*jslint browser: true, forin: true, white: false, on: true, fragment: true, eqeqeq: true */ ... to ... /*jslint browser: true, forin: true, white: false */ ... and I bet it works. Note: It's almost always a good idea to get a simplest case example of code that's screwing up in JSLint and paste it into JSLint.com. Crockford keeps that URL all but up to the minute with JSLint's github repo, and it was reporting a much more user-friendly error (Unexpected 'on'.) than the unfortunate "JSLint's confused" it was telling you. Just to make sure there wasn't something else making JSLint think there were 1000+ errors, I changed your white to true, removed the unused w and d, and

Categories : Javascript

Separate internal errors from client errors in custom WCF error handling?
You should create your own exception class by deriving from System.Exception and throwing them where your validation fails. In your IErrorHandler implementation you should check if the exception is yours and return the Status code you want. For example if MyException was the derived exception: public void ProvideFault(Exception error, MessageVersion version, ref Message fault) { MyException me = error as MyException; if(me != null) // Set the status code. }

Categories : Wcf

Management errors and __init__ errors trying to implement nested formsets
This is because, Django adds data to your form for relating to managing the formset. You need to include it since you're rendering the form manually. See: django modelformset_factory - management form data is missing PS: A simple Google or Stack Overflow search would have yielded your answer.

Categories : Django

MainActivity.java - errors on start
Check in the Problems console if there are any errors, resolve and rebuild the project or try clean and building the project. Check if you have imported the correct R file. From your code it looks like you have not imported the R file.

Categories : Android

Errors in Android Studio myfirstapp : Gradle errors
when you create an activity, make sure you insert it into mainifest.xml as well, so your manifest should be like this: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myfirstapp" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme"> <activity android:name="com.example.myfirstapp.MainActivity" android:label="@string/app_name" android:parentActivityName="com.example.myfirstapp.Ma

Categories : Java

VBA: Errors with IF loop to rename worksheets (specific errors)
First, you should use Option Explicit which is a result of Require Variable Declaration option set to true in VBA editor options. If you did so I think some/all of your problems you could solve on your own. Second, your Results and DataEntries are recognised as empty variables. If so you try to change sheets names into empty string which is not allowed. So you need to make the following changes (adding some quotation marks): If ws.Name = "Sheet1" Then Sheet1.Name = "Results" ElseIf ws.Name = "Sheet2" Then Sheet2.Name = "DataEntries" End If Third, your loop will be run only once as you have Exit For line executed during first iteration- you should remove it as I can't find the reason to place it there. Fourth, there could be some more problems but not seeing

Categories : Excel

Process Start and Errors from Slow Applications
Maybe I'm missing something, but why don't you simply omit the logging if you found that specific exception? Catch ex As Exception ex.Source += " | " & LocalPathString if not ex.Message.Contains("The system cannot find the file specified") Then RaiseEvent ShowError(ex) end if

Categories : Vb.Net

Why am I getting compiler errors, "illegal start of expression"?
private String [] name = {"Tiny Tim", "Brad Pitt", "Madonna"}; private double [] payRate = {100.25, 150.50, 124.25}; private double [] hrsWorked = {40, 35, 36}; should be, just: String [] name = {"Tiny Tim", "Brad Pitt", "Madonna"}; double [] payRate = {100.25, 150.50, 124.25}; double [] hrsWorked = {40, 35, 36}; Remove private to make them as local variables; (OR) If you want as instance variable, move them directly inside class.

Categories : Java

Handling of errors in time of start activity
Your logcat shows that you are running out of memory: java.lang.OutOfMemoryError: bitmap size exceeds VM budget and you said that it works fine sometimes so what I can suggest is that you first download a software that stops any unwanted background processes like Advanced Task Manager which is available for free at the Google PlayStore, run your app and see again if that works. Another 'workaround' is WeakReferencing your bitmap so that it is the first to be garbage collected.

Categories : Java

How to Get The Given Months Number of Weeks and also week start from monday and end with friday. and also all week start date and end date
The following is part of a VERY simple PHP script for generating a calendar. You should be able to use/modify it to answer all your questions: class Calendar { public $calendar; public $current_date; public $current_month_days; public $current_date_str; public function __construct($month = FALSE, $expand = FALSE) { try { $date_obj = new DateTime($month); $this->current_date_str = $date_obj->getTimestamp(); } catch ( Exception $e ) { $this->current_date_str = time(); } $this->current_date = date('Y-m', $this->current_date_str); $this->get_current_month_days(); $this->build_calendar(); } public function get_current_month_days() { $days_in_m

Categories : PHP

"Illegal Start of action" and "; expected" compiler errors
You can't define a method inside another method. Move actionPerformed outside go block public void go(){ JFrame frame = new JFrame(); button = new JButton("Click"); button.addActionListener(this); frame.getContentPane().add(button); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(300, 300); frame.setVisible(true); } //close go() public void actionPerformed(ActionEvent event){ button.setText("I've been clicked."); } //close actionPerformed

Categories : Java

hadoop hbase cdh4 job fails to start with permission errors
Permissions are not so easy in Hadoop usually. Couple of debugging points: Please check from which user you run your job and which user is 'visible' on Hadoop cluster. Please check what happens inside method and what files are being modified. Assure required permissions are met. If not, you have option either to disable HDFS permissions or 'represent' yourself as different user to Hadoop cluster. These questions could be useful for you: Permission denied at hdfs HDFS access from remote host through Java API, user authentication

Categories : Hadoop

Errors For Background Script
the ipn listener is triggered by an arbitrary transaction sobeit incomplete, invalid etc. in the ipn listener itself you can specify what should be handled whether it be error logging or even mailing the error to a specified email address. I have implemented the ipn handler to update database values on a valid transaction

Categories : PHP

PHP download script throws errors in IE8
there is an error in your code. Use $mime = array('application/octet-stream'); header('Content-Type: '.$mime[0]); or header('Content-Type: application/octet-stream');

Categories : PHP

PHP Login Script/ Not working and no errors
This is your modified code which works but you need to greatly improve your code against sql injections and much more. Hope it works <?php session_start(); if(isset($_SESSION['Username'])) { $LoggedIn = $_SESSION['Username']; } include('config.php'); if(isset($_POST['login'])) { if(empty($_POST['username'])) { $error = "Username should not be left empty"; $displayError = true; } elseif(empty($_POST['password'])) { $error .= "<br />Password should not be left empty"; //Add new string to errors $displayError = true; }//Forgot this curly bracket too if($displayError==true) { echo "<div class='alert alert-danger' style='text-align:center; padding:10px; height:40px;margin: 0 auto;'><b>".$error."</b></di

Categories : PHP

Start a shell script from scala Build
Have you looked at the API of ProcessBuilder. The !! method says: Starts the process represented by this builder, blocks until it exits, and returns the output as a String. (My emphasis). I think you will want something like import sys.process._ val pb = Seq("sh", "target/akkesb/akkesb_startup.sh", "&") #> Console.out val p = pb.run() // future { blocking { println(p.exitValue()) }}

Categories : Scala

New Relic warning: the Xdebug extension prevents the New Relic agent from gathering errors. No errors will be recorded
I got help from New Relic support. Their response was basically that Xdebug indeed conflicts with New Relic, and they should not be used simultaneously. Uninstalling the Xdebug PHP extension made the warning go away. It may be possible to disable stack traces in Xdebug and continue to use other Xdebug features, but New Relic support didn't comment on this.

Categories : PHP

If range contains errors, clear errors VBA
You will need to add On Error Resume Next to your VBA method that contains your SpecialCells Clear(). This is needed because when the SpecialCells Method condition cannot be met, an error occurs!

Categories : Vba

How can I capture script errors when executed under jsdom?
Yeah, this appears to be a bug. If you output window.document.errors it should show you the error message. I've created a new issue [here].

Categories : Javascript

Calling PHP script from cron - does echo cause errors?
Output of cron scripts is often mailed to the server admin. Since this could be annoying you normally do not want any output if no errors happened. You can php_sapi_name() to check which type of interface was used ("cli" for cron jobs). See the php docs. Since other answers propose redirecting the output to /dev/null you should keep in mind that you will have no way to know if any errors happened. You cronjob could stop to work and you would not know for a long time...

Categories : PHP

Turn off or disallow fatal errors during script run?
That makes no sense. How would the program know where to resume? You must tell it where, and you do that using eval. You would surely be better writing a wrapper for the script that logs failures and restarts the script.

Categories : Perl

ASPxFileManager is not working. Script errors occur
It is likely that the ASPxHttpHandlerModule is missing in the Web.config: Why DevExpress ASP.NET controls scripts and styles may not work?

Categories : Asp Net

How to log SQL errors AND warnings with a Lua script on mysql-proxy
You can download this script and specify while configuring MySQL-proxy. Command line options are listed here: MySQL-proxy-configuration Typical MySQL-proxy configuration will look like this in your case: $ mysql-proxy --proxy-backend-addresses=192.168.x.x:3305 --proxy-address=192.168.y.y:4045 --proxy-lua-script=mysql-proxy-log-error-queries.lua I guess you might have to modify this script to connect to MySQL-proxy.

Categories : Mysql

Subroutine redefined errors with 'do' calling another Perl script
It sounds like you know this is an ugly setup, so I'll skip going into depth on it. You could use a scoped no warnings in your running block: { no warnings 'redefine'; local @ARGV = ( $arg1, $arg2 ); do 'perl_script.pl'; }

Categories : Perl

Monit errors when running "check program" for custom script
ok, fixed. for future reference for anyone reading this -- never put .sh files in /etc/monit.d/ that was the problem. i moved the .sh file to a different directory and everything is fine now.

Categories : Misc

Facebook like button/box causing "Stop running this script" errors in IE8
we had the same issue on website. It started to happen from yesterday 04/07/2013. It only happens in IE7 browser. We just omitted the browser from showing the Like box with below code. if (navigator.appVersion.indexOf("MSIE 7.") == -1) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }

Categories : Facebook

Ruby script does not work with weird errors about highline library
This is bad error handling in the HighLine gem for Ruby < 1.9. The offending line (identified by your error message) is: statement.force_encoding(Encoding.default_external) if defined?(Encoding) && Encoding.default_external You can handle this by either: Removing any include REXML commands in your script. This will keep REXML::Encoding from being associated with Encoding. Adding the following line somewhere early in your script: REXML::Encoding.instance_eval { def default_external; false; end } This line will prevent the missing method error and will prevent HighLine from trying to force encoding where it shouldn't.

Categories : Ruby

How do I keep the WebBrowser control from catching exceptions and displaying them as script errors?
I didn't end up with a universal solution, but this one works well enough for me. Communication between the browser and my application is only done through a single Javascript method. So I just wrapped all of the code in that method in a try/catch block and threw the exception on another thread. [ComVisible(true)] public class JavascriptBridge { public void Notify(string data) { try { // Process the data } catch (Exception ex) { System.Threading.ThreadPool.QueueUserWorkItem((state) => { throw new Exception("An unhandled exception ocurred while servicing a Javascript method call.", ex); }); } } } This completely bypasses the browser control's exception handler and retains the original exception's loca

Categories : C#

Ignoring errors and continuing to run when executing R script from command line Linux
Use try or tryCatch (the former is simpler and generally all you need). You're already using tryCatch later on, so use it to deal with your problematic query as well.

Categories : R



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.