induction

Trouble connecting to Postgresql database in Vagrant guest box with Induction from host machine?

為{幸葍}努か 提交于 2019-12-01 13:53:46
I'm trying to connect to my PostgreSQL database which is inside of a guest machine (using Vagrant and VirtualBox). I'm trying to connect to it with Induction , but I am getting an error saying: Connection Error Could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.1234" I have Vagrant doing a port forward to port 1234 on my host machine. My settings for the Induction connection are: Adapter: postgres Host Name: 127.0.0.1 Username: vagrant Password: [i don't have a password for the vagrant user

Trouble connecting to Postgresql database in Vagrant guest box with Induction from host machine?

末鹿安然 提交于 2019-12-01 13:12:08
问题 I'm trying to connect to my PostgreSQL database which is inside of a guest machine (using Vagrant and VirtualBox). I'm trying to connect to it with Induction, but I am getting an error saying: Connection Error Could not connect to server: Permission denied Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.1234" I have Vagrant doing a port forward to port 1234 on my host machine. My settings for the Induction connection are: Adapter:

Structural induction in Haskell

≡放荡痞女 提交于 2019-11-29 04:29:22
Is the following a definition of structural induction? foldr f a (xs::ys) = foldr f (foldr f a ys) xs Can someone give me an example of structural induction in Haskell? You did not specify it, but I will assume :: means list concatention and use ++ , since that is the operator used in Haskell. To prove this, we will perform induction on xs . First, we show that the statement holds for the base case (i.e. xs = [] ) foldr f a (xs ++ ys) {- By definition of xs -} = foldr f a ([] ++ ys) {- By definition of ++ -} = foldr f a ys and foldr f (foldr f a ys) xs {- By definition of xs -} = foldr f

Structural induction in Haskell

為{幸葍}努か 提交于 2019-11-27 22:25:04
问题 Is the following a definition of structural induction? foldr f a (xs::ys) = foldr f (foldr f a ys) xs Can someone give me an example of structural induction in Haskell? 回答1: You did not specify it, but I will assume :: means list concatention and use ++ , since that is the operator used in Haskell. To prove this, we will perform induction on xs . First, we show that the statement holds for the base case (i.e. xs = [] ) foldr f a (xs ++ ys) {- By definition of xs -} = foldr f a ([] ++ ys) {-

Understanding recursion in Python

有些话、适合烂在心里 提交于 2019-11-27 14:53:05
I'm really trying to wrap my brain around how recursion works and understand recursive algorithms. For example, the code below returns 120 when I enter 5, excuse my ignorance, and I'm just not seeing why? def fact(n): if n == 0: return 1 else: return n * fact(n-1) answer = int (raw_input('Enter some number: ')) print fact(answer) lets walk through the execution. fact(5): 5 is not 0, so fact(5) = 5 * fact(4) what is fact(4)? fact(4): 4 is not 0, so fact(4) = 4 * fact(3) what is fact(3)? fact(3): 3 is not 0, so fact(3) = 3 * fact(2) what is fact(2)? fact(2): 2 is not 0, so fact(2) = 2 * fact(1)

Understanding recursion in Python

心不动则不痛 提交于 2019-11-26 02:24:52
问题 I\'m really trying to wrap my brain around how recursion works and understand recursive algorithms. For example, the code below returns 120 when I enter 5, excuse my ignorance, and I\'m just not seeing why? def fact(n): if n == 0: return 1 else: return n * fact(n-1) answer = int (raw_input(\'Enter some number: \')) print fact(answer) 回答1: lets walk through the execution. fact(5): 5 is not 0, so fact(5) = 5 * fact(4) what is fact(4)? fact(4): 4 is not 0, so fact(4) = 4 * fact(3) what is fact(3