Signup/Sign In

Answers

All questions must be answered. Here are the Answers given by this user in the Forum.

To make another symlink (will fizzle if symlink exists as of now):
***ln -s /path/to/file /path/to/symlink***
To make or improve a symlink:
***ln -sf /path/to/file /path/to/symlink***
3 years ago
You can utilize **grep - ilR**:
***grep -Ril "text-to-find-here" /***
**i** represents overlook case (discretionary for your situation).
**R** stands for recursive.
**l** means "show the document name, not simply the outcome".
**/** represents beginning at the root of your machine.
3 years ago
Use these some easy instructions:
***mysqldump -u username -p -v olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql***
Or on the other hand to decrease I/O utilize the following:
***mysqladmin -u username -p create newdatabase
mysqldump -u username -v olddatabase -p | mysql -u username -p -D newdatabase
***
3 years ago
Using JavaScript code:
***function hasClass(ele, cls) {
return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
}

function addClass(ele, cls) {
if (!this.hasClass(ele, cls)) ele.className += " " + cls;
}

function removeClass(ele, cls) {
if (hasClass(ele, cls)) {
var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
ele.className = ele.className.replace(reg, ' ');
}
}

function replaceClass(ele, oldClass, newClass){
if(hasClass(ele, oldClass)){
removeClass(ele, oldClass);
addClass(ele, newClass);
}
return;
}

function toggleClass(ele, cls1, cls2){
if(hasClass(ele, cls1)){
replaceClass(ele, cls1, cls2);
}else if(hasClass(ele, cls2)){
replaceClass(ele, cls2, cls1);
}else{
addClass(ele, cls1);
}
}***
3 years ago
You can get from a distant vault, see the distinctions and afterwards pull or consolidation.

This is a model for a distant storehouse called **origin** and a branch called **master** following the far off **origin/master**:
***git checkout master
git fetch
git diff origin/master
git rebase origin master***
3 years ago
Every time you are creating plots you might get this error - "**Error in plot.new() : figure margins too large**". To avoid such errors you can first check **par("mar")** output. You should be getting:

***[1] 5.1 4.1 4.1 2.1***
To change that write:

***par(mar=c(1,1,1,1))***
This should rectify the error. Or else you can change the values accordingly.

Hope this works for you.
3 years ago
In my case, I was sending input elements instead of their values:

***$.post( '',{ registerName: $('#registerName') } )***
Instead of:

***$.post( '',{ registerName: $('#registerName').val() } )***
This froze my Chrome tab to a point it didn't even show me the 'Wait/Kill' dialog for when the page became unresponsive...
3 years ago
If you send a PHP array into a function that expects a string like: **echo** or **print**, then the PHP interpreter will convert your array to the literal string **Array**, throw this Notice and keep going. For example:
***
php> print(array(1,2,3))

PHP Notice: Array to string conversion in
/usr/local/lib/python2.7/dist-packages/phpsh/phpsh.php(591) :
eval()'d code on line 1
Array
***
In this case, the function **print** dumps the literal string: **Array** to stdout and then logs the Notice to stderr and keeps going.

*Another example in a PHP script:*
***
$stuff = array(1,2,3);
print $stuff; //PHP Notice: Array to string conversion in yourfile on line 3
?>
***
3 years ago
You need to add the path of your pip installation to your PATH system variable. By default, pip is installed to **C:\Python34\Scripts\pip** (pip now comes bundled with new versions of python), so the path "C:\Python34\Scripts" needs to be added to your PATH variable.

To check if it is already in your PATH variable, type **echo %PATH%** at the CMD prompt

To add the path of your pip installation to your PATH variable, you can use the Control Panel or the **setx** command. For example:

***
setx PATH "%PATH%;C:\Python34\Scripts"
***
3 years ago
How about this one? lot cleaner and all in single line.
***
foreach ((array) $items as $item) {
// ...
} ***
3 years ago
If your source code name is HelloWorld.java, your compiled code will be **HelloWorld.class.**

You will get that error if you call it using:

***java HelloWorld.class***
Instead, use this:

***java HelloWorld***
3 years ago
Other posters are probably correct...there might be spaces mixed in with your tabs. Try doing a search & replace to replace all tabs with a few spaces.

Try this:

***
import sys

def Factorial(n): # return factorial
result = 1
for i in range (1,n):
result = result * i
print "factorial is ",result
return result

print Factorial(10)***
3 years ago