1.0 controller get请求type MainController struct { beego.Controller}func (this *MainController) Get() { this.Data["IsHome"] = true this.Data["W...
分类:
Web程序 时间:
2014-08-12 18:48:04
阅读次数:
203
我们有时会将一个整数与IP地址进行互换,用python代码实现很简单将一个整数如2000000,变为一个IP地址的方式>>> import socket>>> import struct>>> int_ip = 123456789>>> ip = socket.inet_ntoa(struct.pa...
分类:
编程语言 时间:
2014-08-12 18:39:44
阅读次数:
257
先定义一个最简化的事件数据结构typedef struct{ unsigned char event_flg; unsigned char event_cnt_buf[event_flg_wide]; void (*pEventCallback[event_flg_wide])(v...
分类:
其他好文 时间:
2014-08-12 18:20:04
阅读次数:
218
using System;using System.Threading;using System.Threading.Tasks;namespace Microsoft.AspNet.Identity{ internal static class AsyncHelper { private stat...
分类:
Web程序 时间:
2014-08-12 18:08:14
阅读次数:
278
Trie树模板
#include
using namespace std;
struct Trie
{
int word[100020<<2][26];
int ex[100020<<2];
int sz;
Trie()
{
sz=1;
memset(word,0,sizeof(word));
memset(...
分类:
其他好文 时间:
2014-08-12 17:15:24
阅读次数:
180
很容易想到递归,实现确实不是太容易,对本人来说。
平衡二叉树是有序的,要求链表也是有序。
代码:
#include
//平衡二叉树转化为双向链表
using namespace std;
typedef struct tree{
int data;
struct tree *lchild;
struct tree *rchild;
}Tree,*pTree;
void...
分类:
其他好文 时间:
2014-08-12 13:37:24
阅读次数:
189
解题报告
题目传送门
题意:
求矩形面积并
思路:
扫描线+线段树。要离散化,坐标是浮点型的。
对于线段树(区间)与点坐标对应起来可以这样
区间[1,4]对应的线段树。
#include
#include
#include
#include
using namespace std;
struct Seg
{
int v;
double lx,rx,...
分类:
其他好文 时间:
2014-08-12 13:35:04
阅读次数:
250
寻踪浅析 封装、继承、多态是面向对象语言的三大特性,熟悉C++的人对此应该不会有太多异议。C语言提供的struct,顶多算得上对数据的简单封装,而C++的引入把struct“升级”为class,使得面向对象的概念更加强大。继承机制解决了对象复用的问题,然而多重继承又会产生成员冲突的问题,虚继承在我....
分类:
其他好文 时间:
2014-08-12 13:25:04
阅读次数:
250
struct op( name = "ccc")coc = #( cc = op name: 20 , op name: "name" )--- 保存数组配置o = gt_max_namespace.gt_cl_hp_fileiooutin(); o. setfile "c://t.txt" ...
分类:
其他好文 时间:
2014-08-12 12:55:34
阅读次数:
146
题目一:Populating
Next Right Pointers in Each Node
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Popul...
分类:
其他好文 时间:
2014-08-12 09:03:43
阅读次数:
201