现在位置: 首页 > malformed发表的所有文章
  • 09月
  • 30日
综合 ⁄ 共 1390字 评论关闭
原文:When does layoutSubviews get called? It’s important to optimize any UIView layoutSubviews method you create, as it can be frequently called, and has the potential for creating recursion (triggering a setNeedsLayout from layoutSubviews can create a loop that will grossly affect your apps performance). Layout subviews is called once per run loop on any view that has had setNeedsLayout or setNeedsDisplayWithRect: called on it. So in addition to any time you manually call these metho......
阅读全文
  • 08月
  • 29日
算法 ⁄ 共 2146字 评论关闭
题意:求n个矩形面积的并(1 <= n <= 100,坐标范围:0 <= x1 < x2 <= 100000;0 <= y1 < y2 <= 100000)。 题目链接:http://poj.org/problem?id=1151 ——>>思路是这样的,提取出所有矩形的所有纵向边作为扫描线,从左往右扫描,每处理一条扫描线时,下一条扫描线与当前扫描线的距离乘上当前已覆盖纵向边的长度是一个部分面积,将这些面积累加起来就是n个矩形面积的并。。 而当前覆盖到纵向边长度可通过线段树来维护。。空间上则要求先对所有点的纵坐标进行离散化。。 总时间复杂度为O(nlogn)。。 #......
阅读全文
  • 03月
  • 27日
综合 ⁄ 共 1604字 评论关闭
转自 http://zhidao.baidu.com/s/daily/2013-12-12/1390514818.html 什么是PM 2.5? 在分析防御手段之前,我们首先要了解“敌人”究竟是什么。所谓PM,其实是英文particulate matter(颗粒物)的首字母缩写,而2.5代表的是其空气动力学直径为 2.5 微米。这些可以长期悬浮在空气中的微小颗粒物可以是固态也可以是液态,形态也千差万别不可能用尺量,于是科学家把在检测仪器中空气动力学表现和直径 2.5 微米及以下且密度为1克每立方厘米的颗粒物相同的颗粒称为 PM2.5,同理 PM10的定义也是这么来的。 普通纱布口罩或者医用手术口罩......
阅读全文
  • 02月
  • 22日
综合 ⁄ 共 3470字 评论关闭
题目链接~~> 做题感悟:只要会线段树区间更新再加上剖分就搞定了。 解题思路:                主要注意怎样区间更新就ok了 。树链剖分就是树上的线段树。 代码: #include<iostream> #include<sstream> #include<map> #include<cmath> #include<fstream> #include<queue> #include<vector> #include<sstream> #include<cstring> #include<cstdio> #include<stack> #include<bitset> #include<ctime> #include<string> #include<ccty......
阅读全文
  • 07月
  • 28日
综合 ⁄ 共 1302字 评论关闭
    在开始写一个程序时,首先要做的是需求分析。      拿骰子游戏来说,现实生活中,人们玩骰子可能需要2个或2个以上骰子(在这应该想到可以定义一个骰子类Die)。骰子上应该有6面数字分别为1到6(在这应该想到面上的数字应为骰子的属性)。这个时候,我们就实现了现实生活中的实物与代码中的类相对应起来,也就是实现了抽象。 package deigame;//定义名为deigame包 import java.util.Random; /**  * 定义一个骰子类  * @author Angela  *  */ public class Die {     //定义一个faceValue属性private int faceValue;//定义roll......
阅读全文
  • 05月
  • 16日
综合 ⁄ 共 1780字 评论关闭
rsync实现网站的备份,文件的同步,不同系统的文件的同步。 一、什么是rsync   rsync,remote synchronize顾名思意就知道它是一款实现远程同步功能的软件,它在同步文件的同时,可以保持原来文件的权限、时间、软硬链接等附加信息。 rsync是用 “rsync 算法”提供了一个客户机和远程文件服务器的文件同步的快速方法,而且可以通过ssh方式来传输文件,这样其保密性也非常好,另外它还是免费的软件。   rsync 包括如下的一些特性:   能更新整个目录和树和文件系统;  有选择性的保持符号链链、硬链接、文件属于、权限、设备以......
阅读全文
  • 05月
  • 13日
综合 ⁄ 共 3625字 评论关闭
From http://rjlipton.wordpress.com/2010/08/08/a-proof-that-p-is-not-equal-to-np/   A serious proof that claims to have resolved the P=NP question. Vinay Deolalikar is a Principal Research Scientist at HP Labs who has done important research in various areas of networks. He also has worked on complexity theory, including previous work on infinite versions of the P=NP question. He has just claimed that he has a proof that P is not equal to NP. That’s right: . No infinite version.......
阅读全文
  • 04月
  • 06日
综合 ⁄ 共 7909字 评论关闭
用Boost.Python将C++代码封装为Python模块 一.     基础篇 借助Boost.Python库可以将C/C++代码方便、快捷地移植到python模块当中,实现对python模块的扩充。首先,将C++下的代码编译为动态库,并将生成的动态库命名为封装模块的名字,如:用BOOST_PYTHON_MODULE(Module_Name)宏对需要导出的函数、全局变量、类等导入Python的Module_Name模块,此时生成的动态库需要更名为Module_Name.pyd。然后,将Module_Name.pyd放在python的系统搜索目录中(通常是%PYTHON_PATH%\DLLs目录)。最后,在IDLE GUI界面或是python脚本中执行import ......
阅读全文
  • 03月
  • 30日
综合 ⁄ 共 6277字 评论关闭
/* * * */ MEMORY { flash : ORIGIN = 0x00000000, LENGTH = 512k sram : ORIGIN = 0x1FFF0000, LENGTH = 128k } OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm","elf32-littlearm") OUTPUT_ARCH(arm) SEARCH_DIR(.) GROUP(-lgcc -lc -lm -lcs3 -lcs3unhosted) ENTRY(system_start) /* These force the linker to search for particular symbols from * the start of the link process and thus ensure the user's * overrides are picked up */ EXTERN(__cs3_start_c main __cs3_stack __cs3_heap_end)......
阅读全文
  • 03月
  • 21日
综合 ⁄ 共 399字 评论关闭
学习社区 https://www.v2ex.com/go/swift http://swift.sh http://swift-china.org CocoaChina的Swift讨论区 Apple发布了3个示例程序,初窥Swift开发的项目 Lister: A Productivity App Built in Swiftapple/github UICatalog: Creating and Customizing UIKit Controls in Swiftapple/github Adventure: Building a SpriteKit Game Using Swiftapple/github GestureRecognizers: Using standard UIGestureRecognizers in Swiftapple/github 学习视频 《SwiftV课堂》 免费Swift学习视频 《Apple Swift语言基础教程》极客学院
阅读全文
  • 02月
  • 18日
综合 ⁄ 共 1175字 评论关闭
    一年一度的Esri美国开发者大会,刚刚在上周结束。大会上,依旧是看点不断精彩频出。又一大波新技术来袭,你是否满怀期待呢?     在这里,我们网罗了大会中最新的产品技术资讯,将最精彩的内容做了盘点与总结。下面,就邀请大家同我们一起回顾。   综述:ArcGIS平台,为组织提供制图平台、为开发者提供位置平台、为企业提供GIS软件。开发策略上,Esri倡导构建以Web为中心的应用模式,分为数据层(GIS Web Services)、门户机制(Portal for ArcGIS)、应用层(Apps和SDK)三层架构。Esri为广大开发者提供了资源获取门户ArcGIS ......
阅读全文
  • 01月
  • 13日
综合 ⁄ 共 1046字 评论关闭
A. George and Accommodation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory. George and Alex want to live in the same room. The dormitory has n rooms in total. At the moment the i-th room has pi people living in it and the room can......
阅读全文