Signup/Sign In

Answers

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

It gives you

a quasi-automatic way to organize your code by topic
strongly encourages you to write a help file, making you think about the interface
a lot of sanity checks via R CMD check
a chance to add regression tests
as well as a means for namespaces.
Just running source() over code works for really short snippets. Everything else should be in a package -- even if you do not plan to publish it as you can write internal packages for internal repositories.

As for the 'how to edit' part, the R Internals manual has excellent R coding standards in Section 6. Otherwise, I tend to use defaults in Emacs' ESS mode.
3 years ago
As of 2017 / Brew 1.3.2 @ macOS Sierra 10.12.6 all you have to do is:
***
$ brew install r
***
You don't even need to tap homebrew/science since r is now a part of core formulae for the Homebrew (homebrew-core).

It will also install all dependencies automatically:

==> Installing dependencies for r: gmp, mpfr, libmpc, isl, gcc
There are two additional options you might want to know:

--with-java
Build with java support
--with-openblas
Build with openblas support
3 years ago
SELECT column_Name1,column_name2,......
From tbl_name1,tbl_name2,tbl_name3
where tbl_name1.column_name = tbl_name2.column_name
and tbl_name2.column_name = tbl_name3.column_name
3 years ago
They Differ in Data Type Precedence
Decimal and Numeric are the same functionally but there is still data type precedence, which can be crucial in some cases.
***
SELECT SQL_VARIANT_PROPERTY(CAST(1 AS NUMERIC) + CAST(1 AS DECIMAL),'basetype')
***
The resulting data type is numeric because it takes data type precedence.
3 years ago
I just run:

show table status;
This will give you the row count for EVERY table plus a bunch of other info. I used to use the selected answer above, but this is much easier.

I'm not sure if this works with all versions, but I'm using 5.5 with InnoDB engine.
3 years ago
First of all open command prompt then open bin directory in cmd (i hope you're aware with cmd commands) go to bin directory of your MySql folder in WAMP program files.

run command
***
mysqldump -u db_username -p database_name > path_where_to_save_sql_file
***
press enter system will export particular database and create sql file to the given location.
3 years ago
It's an online database modeler that supports reverse enginnering.

Just create free of charge Vertabelo account, import an existing database into Vertabelo and voila - your database is in Vertabelo!

It supports following databases:

PostgreSQL,
MySQL,
Oracle,
IBM DB2,
HSQLDB,
MS SQL Server.
3 years ago
The max_allowed_packet variable can be set globally by running a query.

However, if you do not change it in the my.ini file (as dragon112 suggested), the value will reset when the server restarts, even if you set it globally.

To change the max allowed packet for everyone to 1GB until the server restarts:
***
SET GLOBAL max_allowed_packet=1073741824;
***
3 years ago
Red Hat, Fedora:
***
yum -y install gcc mysql-devel ruby-devel rubygems
gem install -y mysql -- --with-mysql-config=/usr/bin/mysql_config
***
Debian, Ubuntu:
***
apt-get install libmysqlclient-dev ruby-dev
gem install mysql
***
Arch Linux:
***
pacman -S libmariadbclient
gem install mysql
***
3 years ago
Reasons you may get a foreign key constraint error:

You are not using InnoDB as the engine on all tables.
You are trying to reference a nonexistent key on the target table. Make sure it is a key on the other table (it can be a primary or unique key, or just a key)
The types of the columns are not the same (exception is the column on the referencing table can be nullable even if it is not nullable on the referenced table).
If the PK/FK is a varchar make sure the collation is the same for both.
3 years ago
Wrapping setState in a promise allows to trigger an arbitrary action after completion:
***
import React, {useState} from 'react'

function App() {
const [count, setCount] = useState(0)

function handleClick(){
Promise.resolve()
.then(() => { setCount(count => count+1)})
.then(() => console.log(count))
}


return (

)
}
export default App;
***
3 years ago
create-react-app is broken out of the box. AS OF 2021 MAY

Inside of tsconfig, include was set only to /src, Change to:
***
"include": [
"./src/**/*.ts"
]
***
3 years ago