Split a file with mulitple classes into separate files.
Installation
git clone [email protected]:594adece80ad1e9ddbce0b207db8ed0c.git split-file
cd split-file
composer install
Usage:
Split a file with mulitple classes into separate files.
Installation
git clone [email protected]:594adece80ad1e9ddbce0b207db8ed0c.git split-file
cd split-file
composer install
Usage:
/* | |
How to use: | |
1)Create new file. | |
2) | |
*/ | |
function kana2upper(string) { |
* Update (12.09.2017): I have improved the trait so that it can be used with objects other than Eloquent Models.
Some days ago I came across a task where I needed to implement managable state for an Eloquent model. This is a common task, actually there is a mathematical model called "Finite-state Machine". The concept is that the state machine (SM) "can be in exactly one of the finite number of states at any given time". Also changing from one state to another (called transition) depends on fulfilling the conditions defined by its configuration.
Practically this means you define each state that the SM can be in and the possible transitions. To define a transition you set the states on which the transition can be applied (initial conditions) and the only state in which the SM should be after the transition.
That's the theory, let's get to the work.
language: php | |
cache: | |
directories: | |
- $HOME/.cache/pip | |
- $HOME/.composer/cache/files | |
php: | |
- 5.6 | |
- 7.0 |
web: | |
image: occitech/cakephp:5-apache | |
ports: | |
- 80 | |
links: | |
- db | |
volumes: | |
- .:/var/www/html | |
environment: |
更新: | 2017-05-09 |
---|---|
作者: | @voluntas |
バージョン: | 3.14 |
URL: | http://voluntas.github.io/ |
MQTT をググって調べた人向け
# Constructing a maze with a clustering algorithm | |
# (C) Copyright H. Watanabe 2015 | |
# Distributed under the Boost Software License, Version 1.0. | |
# (See copy at http://www.boost.org/LICENSE_1_0.txt) | |
class Maze | |
def initialize(s) | |
@lx = s | |
@ly = @lx*297/210 | |
@bond_h = Array.new((@lx+1)*@ly) { false} | |
@bond_v = Array.new(@lx*(@ly+1)) { false} |
<?php | |
namespace Fuel\Tasks; | |
/** | |
* @author Kenji Suzuki <https://github.com/kenjis> | |
* @copyright 2012 Kenji Suzuki | |
* @license MIT License http://www.opensource.org/licenses/mit-license.php | |
* @link https://github.com/kenjis/fuelphp-tools | |
* |
jibanyan_equation <- function(x,y) { | |
min(max(min(1-(x/108)^2-(y/94)^2,y),min(1-((abs(x)-119)/103)^2-((y-56)/86)^2,1-((abs(x)-15)/77)^2-((y-119)/100)^2),1-((abs(x)-42)/66)^2-(y/55)^2,min(55+y,51-abs(x),-y)),3*abs(y-100)-2*(x-75)) * | |
min(min(max(min(1-(x/106)^2-(y/92)^2,y),min(1-((abs(x)-119)/101)^2-((y-56)/84)^2,((abs(x)-99)/40)^2+((y-54)/86)^2-1,92-abs(x)),1-((abs(x)-42)/64)^2-(y/53)^2),min(((abs(x)-52)/26)^2+((y+28)/26)^2-1,((abs(x)-51)/13)^2+(y/13)^2-1,max(abs(x)-51,y))),abs(x/51+10/51*sin(abs(y/61.2)^(1.2)*pi*(7/2)))^(2/3)+abs(y/61.2)^(2/3)-1) * | |
min(1-(x/32)^2-((y+30)/32)^2,1-((abs(x)+5)/22)^2-((y-18)/22)^2) * | |
min(1-((abs(x)-18)/20)^2-((y+10)/20)^2,((abs(x)-20)/22)^2+((y+7)/20)^2-1) * | |
(1-((abs(x)-51)/11)^2-(y/11)^2) | |
} | |
x <- seq(-150, 150, length=400) | |
z <- outer(x,x, Vectorize(jibanyan_equation)) |
# coding: utf-8 | |
require 'open-uri' | |
require 'nokogiri' | |
url = "http://test.localhost/abc.plugin.html" | |
charset = nil | |
html = open(url) do |f| | |
charset = f.charset | |
f.read |