Skip to content

Instantly share code, notes, and snippets.

@oott123
oott123 / 解一元二次方程.cpp
Created October 25, 2012 14:19
解一元二次方程,可以连续解多次
#include "iostream.h"
#include "math.h"
int main(){
float a,b,c;
float x1,x2,deta;
bool conti;
conti=true;
while(conti){
cout<<"ax^2 + bx + c\n";
cout<<"Input a,b,c with Enter between them:\n";
以下是和MaxCDN客服的聊天记录。括号里头是我手动翻译的,不保证准确性。……
me: I have a problem with order your service. I got the error message said
"Our order form detected an error with your network. Please try again later"
btw, i'm from China. do you accept order from China?
(我:我在订购你们的服务的时候遇到了一点问题。我得到了一条错误信息(我们的
服务在你的网络检测到了一个错误,请稍后尝试。)另外,我是来自中国的。你们接
收来自中国的订单吗?)
Just a moment...
(请稍候)
Jamie M: Hi
--------BEFORE--------
[oott123@MyVPS1580 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_501153278-lv_root
8.4G 3.7G 4.4G 46% /
tmpfs 249M 0 249M 0% /dev/shm
/dev/xvda1 485M 65M 396M 14% /boot
--------AFTER--------
[oott123@MyVPS1580 ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
[oott123@MyVPS1580 ~]$ sudo fdisk -l
[sudo] password for oott123:
Disk /dev/xvdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d68a3
@oott123
oott123 / tip.md
Last active December 14, 2015 08:28
访问被系统阻止提示页

糟糕!你的访问被阻止了。

  • 发生了什么?
    你所提交的参数被服务器认为是攻击行为,服务器自动禁止了你的 访问。

  • 我要如何解决?
    想想你刚刚提交了什么,其中是不是有一些奇怪的单词,比如单引 号或者SELECT,DELETE这样的单词。通常这样的单词会被认为是攻击而 被拦截。

@oott123
oott123 / gist:5071200
Created March 2, 2013 14:20
关于文件存取,BAE官方说明摘录

本地读写限制
为适应不同流量需求,使应用受访问能力更具有弹性。应用执行环境默认属于分布式环境。不同请求执行的服务器不同,本地读写的数据不同请求不确保能够正常读取,且本地读写数据不保证安全。因此允许但不建议本地读写数据,数据存储提供有缓存,云存储(见组件部分)。单次请求的临时数据所需的临时目录可正常使用,数据可写到sys_get_temp_dir()返回的目录中,确保单次请求内数据正常。

via http://developer.baidu.com/wiki/index.php?title=docs/cplat/rt/php#.E6.9C.AC.E5.9C.B0.E8.AF.BB.E5.86.99.E9.99.90.E5.88.B6

这说明本地读写的数据不能正常使用。所谓允许但不建议本地读写数据本地读写数据不保证安全的大致意思大概就是谁用谁倒霉。总之我实测用BAE是没有办法存取文件的。

#==============================================================================
# 〇 GAL用存读档界面 2.1
#
# 2.1 by orzFly.com
# 回滚为老版本 YesNoBox~好看!
# 标题调用时有单独背景图
# 可以隐藏掉那个坑爹的“旧的回忆”标题
# 可以透明化窗口用自己的背景
# 修正 bug:删不掉存档……
#
@oott123
oott123 / hotp.php
Last active October 13, 2020 05:24
<?php
//配置部分
$password = '这里是验证的密码';
$authkeypair = array(
'帐号标题' => 'Secret key',
'帐号标题2' => 'key2',
);
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@oott123
oott123 / isproxy.php
Created April 30, 2013 11:29
PHP代理检测
<?php
function isproxy(){
$ports = array(80, 88, 1075, 1080, 1180, 1182, 2282, 3128, 3332, 5490, 6588, 7033, 7441, 8000, 8080, 8085, 8090, 8095, 8100, 8105, 8110, 8888, 22788);
foreach ($ports as $port){
$sd = @fsockopen($_SERVER["REMOTE_ADDR"], $port, $errno, $errstr, 1);
if ($sd){
fclose($sd);
return true;
}
}
@oott123
oott123 / bae_bcms33_mail.php
Last active December 16, 2015 19:50
BCMS邮件发送函数简单封装(仅可用于BAE)
<?php
//BCMS发信函数简单封装(BAE Only)
//用法:bcms33_mail(收信人地址(必须为数组),主题,邮件内容,发信人)
//PS.要发送HTML邮件,需在邮件内容前加<!--HTML-->这个标记。
define('BCMS_QN','BCMS队列ID');
function bcms33_mail($reciver,$subject='test',$data='<!--HTML-->Test<br />Test Mail.',$sender='oott123@baidu.com'){
require_once 'Bcms.class.php';
$bcms = new Bcms();
$optional = array(
Bcms::MAIL_SUBJECT => $subject,