This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURL *url = [NSURL URLWithString:@"http://localhost:8080/tce/testsuites/json-sample.php"]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:url]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) { | |
NSLog(@"success: %@",[JSON valueForKey:@"name"]); | |
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON) { | |
NSLog(@"fail: %@", [error userInfo]); | |
}]; | |
[operation start]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->createTable('tbl_topic', | |
array( | |
'id' =>'pk', | |
'title' =>'string NOT NULL', | |
'description' => 'text COMMENT \'说明\'', | |
'project_id' => 'int(11) DEFAULT NULL', | |
'owner_id' => 'int(11) DEFAULT NULL', | |
'status_code' => 'int(11) DEFAULT NULL', | |
), | |
'ENGINE=InnoDB DEFAULT CHARSET=utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$rows = Yii::app()->db->createCommand() | |
->from('tbl_Topic') | |
->where('status_code > 0') | |
->order('id desc') | |
->queryAll(); | |
echo '<ul>'; | |
foreach ($rows as $row ) { | |
echo '<li>'.$row['id'].'</li>'; | |
} | |
echo '</ul>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
## Versao 0.22 | |
""" | |
Script de Backup MYSQL (backup_mysq.py) | |
Copyrighted by Nilton OS <jniltinho at gmail.com> | |
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prox="http://proxy.com:8080" | |
alias proxyon="export http_proxy=$prox && export https_proxy=$prox" | |
alias proxyoff='unset http_proxy && unset https_proxy' | |
echo "Turning http(s) proxies on" | |
proxyon | |
# investigate function is repeated here for portability but, we | |
# only define it if investigate isn't already a defined function | |
if ! type -t investigate &> /dev/null; then | |
function investigate { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "base.html" %} | |
{% block title %}{{report.title}}{% endblock %} | |
{% block titledemo %}{{report.demo_string}}{% endblock %} | |
{% block content %} | |
<div class="table-responsive" id="report"> | |
<table class='table table-striped'> | |
<thead> | |
{% for item in report.columes %} | |
<th>{{item}}</th> | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workbook = xlrd.open_workbook('1.xls') | |
sheet = workbook.sheet_by_index(0) | |
print sheet.nrows, sheet.ncols | |
teachers = [] | |
for row_index in range(sheet.nrows): | |
teachers_name = sheet.cell_value(row_index,1) | |
teachers.append(teachers_name) | |
workbook.release_resources() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="zh-cmn-Hans"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>欢迎页面</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{fontspec} | |
\setmainfont{Lantinghei SC Extralight} | |
\begin{document} | |
Hello world,欢迎来到 MacTex 的世界。 | |
\end{document} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$table_name = $this -> table_name; | |
$sqlstring = "select * from $table_name where meeting_id = $meeting_id"; | |
$db = new MyDB(); | |
$result = $db -> query($sqlstring); | |
$row = $result->fetch_array(MYSQLI_ASSOC); | |
$meeting = new meeting(); | |
while($finfo = $result->fetch_field()) | |
{ | |
$field_name = $finfo->name; | |
$meeting -> $field_name = $row[ $field_name ]; |
OlderNewer