Use only tabs for indentation. Do not use spaces. Yes, spaces would be better :), it's for historical reasons.
- Always put opening curly braces on new line.
- Add a space after control flow keywords.
- Use braces for single line ifs as well
->brew doctor | |
Error: no such file to load -- requirements/minimum_macos_requirement | |
Please report this bug: | |
https://github.com/mxcl/homebrew/wiki/troubleshooting | |
/usr/local/Library/Homebrew/requirements.rb:4:in `require' | |
/usr/local/Library/Homebrew/requirements.rb:4 | |
/usr/local/Library/Homebrew/dependency_collector.rb:4:in `require' | |
/usr/local/Library/Homebrew/dependency_collector.rb:4 | |
/usr/local/Library/Homebrew/formula.rb:1:in `require' |
[ | |
{ | |
"description": "2234 Brant Street, San Diego, CA, USA", | |
"id": "9e4be32037a103ef7668e65330a6200518e59c42", | |
"matched_substrings": [ | |
{ | |
"length": 4, | |
"offset": 0 | |
}, | |
{ |
J'utilise les services offerts par Alwaysdata depuis plus de deux ans maintenant. J'y ai deployé des applis Rails, Django. Cette fois, j'ai voulu m'essayer à du Python une nouvelle fois, mais par l'intermédiaire de Flask. Ce ne fut pas si facile que cela. Pour votre informationm je suis totalement débutant en tout ce qui concerne déploiement et administration système (malgré le fait d'être un utilisateur Linux quotidien). Je fus découragé rapidement devant le manque de documentation concernant le déploiement d'une appli flask sur alwaysdata. C'est pourquoi j'ai décidé d'écrire cet article qui va vous tenter de vous guider pas à pas.
'use strict'; | |
module.exports = { | |
up: function(queryInterface, Sequelize) { | |
return queryInterface.createTable('pictures', { | |
id: { | |
allowNull: false, | |
autoIncrement: true, | |
primaryKey: true, | |
type: Sequelize.INTEGER | |
}, |
<?php namespace Testing\Traits; | |
trait DatabaseTruncate | |
{ | |
/** | |
* Define hooks to truncate the database before each test. | |
* | |
* @return void | |
*/ | |
public function runTruncateDatabase() |
-- problem 48 | |
tablen f n = do | |
let r = generateResultsAsStrings f n | |
mapM_ putStrLn r | |
generateResultsAsStrings :: ([Bool] -> Bool) -> Int -> [String] | |
generateResultsAsStrings f n = map unwords $ map (\x -> (map show x ++ [show (f x)])) $ sequence $ replicate n [True, False] |
infixl 4 `and'` | |
and' :: Bool -> Bool -> Bool | |
and' False _ = False | |
and' _ False = False | |
and' _ _ = True | |
infixl 4 `or'` | |
or' :: Bool -> Bool -> Bool | |
or' True _ = True | |
or' _ True = True |
import Data.List (nub, group) | |
-- problem 31 | |
isPrime :: Int -> Bool | |
isPrime n = length (filter (\x -> (mod n x) == 0) [2..n-1]) == 0 && n > 1 | |
-- problem 32 | |
pgcd :: Int -> Int -> Int | |
pgcd a 0 = a | |
pgcd a b = pgcd b (mod a b) |
import Data.List (nub, group) | |
-- problem 31 | |
isPrime :: Int -> Bool | |
isPrime n = length (filter (\x -> (mod n x) == 0) [2..n-1]) == 0 && n > 1 | |
-- problem 32 | |
pgcd :: Int -> Int -> Int | |
pgcd a 0 = a | |
pgcd a b = pgcd b (mod a b) |