Skip to content

Instantly share code, notes, and snippets.

View asika32764's full-sized avatar

Simon Asika asika32764

View GitHub Profile
請根據所給的振幅(Amplitude)及頻率(Frequency),你的程式要產生這樣的波。Input 資料由網址參數送進去。
Input
-------------------------------------
輸入的第一列有一個整數n,代表有幾組測試資料。接下來每組測試資料有2列,各有1個正整數(A、F),A代表振幅(A<=9),F代表頻率。
第一列以及各組測試資料間皆有一空白行。請參考Sample input。

Awesome PHP

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

Awesome PHP

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

/**
* Print Array or Object as tree node. If send multiple params in this method, will batch print it.
*
* @param mixed $data Array or Object to print.
*/
function show($data)
{
$args = func_get_args();
// Print Multiple values
<?php
$path = 'src/Component/Todo/View/../..';
$dl = new \DirectoryLocator($path);
// __toString
// -----------------------------
echo $dl; // src/Component
@asika32764
asika32764 / mysql.sock.sh
Last active January 28, 2021 21:23
Using this command to create a symbol link to mysql.sock in Mac
# XAMPP
sudo ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /var/mysql/mysql.sock
# MAMP
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
# AMPPS
sudo ln -s /Applications/AMPPS/mysql/tmp/mysql.sock /var/mysql/mysql.sock
<?php
// in your component
JPluginHelper::importPlugin('group');
$app = JFactory::getApplication();
$app->triggerEvent('onYourEventName', array($param1, $param2));
<?php
/**
* A PHP socket server demo file.
*
* @author Asika
* @email asika@asikart.com
* @date 2013-10-12
*
* @copyright Copyright (C) 2013 - Asika.
* @license GNU General Public License version 2 or later; see LICENSE
<?php
// index.php
$page = $_REQUEST['page'];
$page = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $page);
// page=aaa/bbb/ccc
// page=save_item
<script type="text/javascript">
// 三角形的高
var height = 4;
// 每一排加幾個星號
var add = 2;
// 起始的星號數量
var start = 1;