勿躁

  汝有田舍翁,家资殷盛,而累世不识“之”“乎”。一岁,聘楚士训其子,楚士始训之搦管临朱,书一画,训曰“一”字;书二画,训曰“二”字;书三画,训曰“三”字。其子辄欣欣然,掷笔归告其父曰:“儿得矣,儿得矣;可无烦先生矣,重费馆谷也,请谢去。”其父喜,从之,具币谢遣楚士。
  逾时,其父拟征召姻友万氏姓者饮,令子晨起治状,久之不成,父趣之。其子恚曰:“天下姓字伙矣,奈何姓万,自晨至今,才完五百画也。”
  初机士偶一解,而即以訑訑自矜有得。殆类是已。

应谐录》刘元卿


传送到 JAVA WEB课程实验站


知识共享许可协议
于衡的鱼缸(个人博客)中的相关文章
转载请注明出处

二叉树的相关操作

BiTree() { bt = Creat(bt); } //创建树
~BiTree() { ReleaseTree(bt); } //销毁树
void PreOrder() { PreOrder(bt); } //前序遍历
void InOrder() { InOrder(bt); } //中序遍历
void PostOrder() { PostOrder(bt); } //后序遍历
void LeverOrder() { LeverOrder(bt); }//层序遍历
void swapLR() { swapLR(bt); } //交换子树
int leafCount() { return leafCount(bt); } //计算叶子
int nodeCount() { return nodeCount(bt); } //计算结点
int highOfTree() { return highOfTree(bt); } //计算树高 继续阅读二叉树的相关操作

  亏于一篑,败此垂成。久伏盐车,方登峻坂;岂期一蹶,遂失长涂。恨群马之皆空,忿前功之尽弃。素蒙剪拂,不弃驽骀;愿守门阑,再从驱策。溯风骧首,已伤今日之障泥;恋主衔恩,更蜀待明年之春草。 

——-李清照

【思维】Marjar Cola

Marjar Cola is on sale now! In order to attract more customers, Edward, the boss of Marjar Company, decides to launch a promotion: If a customer returns x empty cola bottles or y cola bottle caps to the company, he can get a full bottle of Marjar Cola for free!

Now, Alice has a empty cola bottles and b cola bottle caps, and she wants to drink as many bottles of cola as possible. Do you know how many full bottles of Marjar Cola she can drink?

Note that a bottle of cola consists of one cola bottle and one bottle cap.

Input
There are multiple test cases. The first line of input contains an integer T (1 ≤ T ≤ 100), indicating the number of test cases. For each test case:

The first and only line contains four integers x, y, a, b (1 ≤ x, y, a, b ≤ 100). Their meanings are described above.

Output
For each test case, print one line containing one integer, indicating the number of bottles of cola Alice can drink. If Alice can drink an infinite number of bottles of cola, print “INF” (without the quotes) instead.

Sample Input
2
1 3 1 1
4 3 6 4
Sample Output
INF
4
Hint
For the second test case, Alice has 6 empty bottles and 4 bottle caps in hand. She can return 4 bottles and 3 caps to the company to get 2 full bottles of cola. Then she will have 4 empty bottles and 3 caps in hand. She can return them to the company again and get another 2 full bottles of cola. This time she has 2 bottles and 2 caps in hand, but they are not enough to make the exchange. So the answer is 4.

继续阅读【思维】Marjar Cola

汉诺塔问题

描述

给定A、B、C三根足够长的细柱,在A柱上放有n个中间有孔的圆盘,共有n个不同的尺寸,现要将这些圆盘移到C柱上,在移动过程中可放在B柱上暂存。要求:
(1)每次只能移动一个圆盘;
(2)A、B、C三根细柱上的圆盘都要保持上小下大的顺序;
任务:设An为n个圆盘完成上述任务所需的最少移动次数,对于输入的n,输出An以及移动过程

输入盘子的个数输出移动的移动的路径和次数

样例输入

3

 

样例输出

move A->C
move A->B
move C->B
move A->C
move B->A
move B->C
move A->C
7

 

继续阅读汉诺塔问题

2019/4/26 服务器故障排查

今天不知道怎么回事发现媒体库进不去提示JS错误,富文本编辑器无法启动(似乎早就发生了,但是今天我才笨拙的发现)。。

具体情况是这样的

重大事故,各种还原,清理缓存,重启服务器,对照修改.php文件都没用。凭借三天前的那个备份大胆的试了十多种方法(还特意备份了这三天的十多篇文章),全都没用,百度上全都是骗人的。着急到自闭。。

于是想起来了类比windows系统的安全模式,是不加载外部程序的。那么我也全部关闭wordpress的外部插件,让wordpress的插件们逐一启动,然后看看是在哪出的问题,最终启动到tinyMCE advance(富文本编辑器增强工具)时,炸了。

原因据我推测,可能是我以前手动在function.php增强过自带的tinyMCE编辑器。然后这个插件在function.php插入增强函数和我写的名字一样,,就冲突无法显示了。。

我曾写的wordpress编辑器增强代码

//编辑器增强功能
function add_more_buttons($buttons) {
$buttons[] = 'hr'; //水平线
$buttons[] = 'fontselect'; //字体
$buttons[] = 'fontsizeselect'; //字号
$buttons[] = 'styleselect'; //样式,格式
$buttons[] = 'wp_page'; //分页符
$buttons[] = 'cut'; //剪切
$buttons[] = 'backcolor'; //背景色
return $buttons;
}
add_filter("mce_buttons_3", "add_more_buttons");//------------>在这一行发生冲突

//添加字体
function add_fontfamily($initArray){
  $initArray['font_formats'] ="幼圆='幼圆';英文可爱字体=comic sans ms,sans-serif;微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=v erdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats";
  return $initArray;
}

function.php的冲突直接导致了PHP编译生成的html的首行不是<!DOCTYPE html>

不符合标准(PS:<!DOCTYPE> 声明帮助浏览器正确地显示网页。

于是就崩溃了。

解决方案就是:禁用所有插件,控制变量,逐一启动,看看到底是谁在作妖,然后干掉。

抢救历时4个半小时,心态也炸了好几次。。。不过还好最后成功了!

血和泪的教训告诉我们:
一定要备份!
一定要备份!!
一定要备份!!!