现在位置: 首页 > widen发表的所有文章
  • 09月
  • 05日
综合 ⁄ 共 271字 评论关闭
1.storyborad上面画图,然后绑定一个cocoa的界面文件,storyboard id 和 restoration id 填类名 2.然后 var sb = UIStoryboard(name: "Main", bundle:nil) var vc = sb.instantiateViewControllerWithIdentifier("dengluViewController") as dengluViewController self.navigationController?.pushViewController(vc, animated: true) 就可以了。
阅读全文
  • 04月
  • 13日
算法 ⁄ 共 2151字 评论关闭
Cleaning Shifts Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9273   Accepted: 2473 Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow working on cleaning things up and has divided the day into T shifts (1 <= T <= 1,000,000), the first being shift 1 and the last being shift T.  Each cow is only available at some interval of times during the day fo......
阅读全文
  • 09月
  • 02日
综合 ⁄ 共 4677字 评论关闭
ProgressBar是一个常见的组件,我们可以通过多种方式来实现一个progressBar,有一种方式是通过一个Activity的的window来放置一个bar,因为android中大家都知道的关联关系是:Activity->Window->View[ViewGroup]  ,那我们通过当前Activity的window来加载一个progressBar,当我们把这个Activity作为一个基类的时候,那么它的子类和我们附加在上面的Fragment就可以轻松的展示一个progressbar了[我们把这个自定义的progressbar做一个单例即可] 具体的实现流程如下: 1:需要展示的progressbar布局       一个linearLayout里面包含......
阅读全文
  • 04月
  • 28日
综合 ⁄ 共 1808字 评论关闭
C. Shorter Musical Notes Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class name: Main Submit Status PID: 4134  FJ is going to teach his cows how to play a song. The song consists of N (1 <= N <= 10,000) notes, and the i-th note lasts for B_i (1<= B_i <= 120) beats (thus no song is longer than 1,200,000 beats).The cows will begin playing the song at time 0; thus, they will play note 1 from time 0 through just before time B_1, not......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 3228字 评论关闭
UVa OJ Root :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) :: Volume 1. Elementary Problem Solving :: String A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is read from right to left. A mirrored string is a string for which when each of the elements of the string is changed to its reverse (if......
阅读全文
  • 04月
  • 14日
综合 ⁄ 共 5454字 评论关闭
public QQDataTransformer(String key) { this(key, "qq"); } public QQDataTransformer(String key, String name) { super(key, name); // TODO Auto-generated constructor stub } @Override public byte[] encode(byte[] data) throws TransformerException { MessageDigest md5; try { md5 = MessageDigest.getInstance("MD5"); byte[] keyBytes = md5.digest(StringTools.getUTF8Bytes(this.key)); swapBytes(keyBytes); reverseBits(keyBytes); byte[] enc = new QQCrypter().encrypt(data, ......
阅读全文
  • 03月
  • 17日
综合 ⁄ 共 4371字 评论关闭
原文地址:网络流题目集锦作者:咸蛋超人很动感很 网络流题目集锦(转) 最大流 POJ 1273 Drainage Ditches POJ 1274 The Perfect Stall (二分图匹配) POJ 1698 Alice's Chance POJ 1459 Power Network POJ 2112 Optimal Milking (二分) POJ 2455 Secret Milking Machine (二分) POJ 3189 Steady Cow Assignment (枚举) POJ 1637 Sightseeing tour (混合图欧拉回路) POJ 3498 March of the Penguins (枚举汇点) POJ 1087 A Plug for UNIX POJ 1149 Pigs (构图题) ZOJ 2760 How Many Shortest Path (边不相交最短路的条数) POJ 23......
阅读全文
  • 02月
  • 18日
综合 ⁄ 共 1930字 评论关闭
先上效果图: 当滚动到底部时,自动加载更多内容。 解决思路: 1、TextView外嵌套一个ScrollView; 2、监听ScrollView的滚动事件; 3、判断手机是否滚动到底部 4、追加内容 布局文件: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${packageName}.${activityClass}" > <ScrollView android:id="@+id/scr......
阅读全文
  • 02月
  • 16日
综合 ⁄ 共 1458字 评论关闭
function是Boost的函数指针。 //回调函数对象 #include <iostream> #include <vector> #include "boost/function.hpp" class notifier { typedef boost::function<void(int)> function_type; std::vector<function_type> vec_; int value_; public: template <typename T> void add_observer(T t) { vec_.push_back(function_type(t)); } void change_value(int i) { value_=i; for (std::size_t i=0;i<vec_.size();++i) { vec_[i](value_); } } }; cla......
阅读全文
  • 12月
  • 14日
综合 ⁄ 共 5822字 评论关闭
1、事务 (1)事务的概念 事务指逻辑上的一组操作,组成这组操作的各个单元,要不全部成功,要不全部不成功。 例如:A——B转帐,对应于如下两条sql语句 update account set money=money-100 where name=‘a’;  update account set money=money+100 where name=‘b’; 数据库默认事务是自动提交的,也就是发一条sql它就执行一条。如果想多条sql放在一个事务中执行,则需要使用如下语句。 (2)数据库开启事务命令 方式一:利用SQL语句管理事务 start transaction;--开启事务,这条语句之后的sql语句将处在一个事务当中,这些sql语句并......
阅读全文
  • 11月
  • 27日
综合 ⁄ 共 541字 评论关闭
今天发现网页上有好东西,复制粘贴嫌麻烦了,搜索了一下有没有好方法,别说,还让我找到了,就是使用虚拟打印机来完成。 1、安装cups-pdf包。 sudo apt-get install cups-pdf  2、在“System->Administration ->printing“下可以看到 3、试着打印网页。我用chrome,点击打印,出现如下界面:   4、选择“PDF”,点击“print”,OK 5、好像失败了一样,没有任何反应,此时想到查看配置文件: gedit  /etc/cups/cups-pdf.conf 看到 ### Key: Out ## CUPS-PDF output directory ## special qualifiers: ## ${HOME} ......
阅读全文
  • 11月
  • 24日
综合 ⁄ 共 1214字 评论关闭
函数如下 Private Function HZCount(strHZ As String) As Long     Dim b() As Byte    b = StrConv(strHZ, vbFromUnicode)    HZCount = UBound(b) + 1 - Len(strHZ)    End Function      StrConv   函数                         返回按指定类型转换的   Variant   (String)。         语法         StrConv(string,   conversion,   LCID)         StrConv   函数的语法有下面的命名参数:         部分   说明       string   必要参数。要转换的字符串表达式。       conversion   必要参数。Integer。其值的和决定转换的类......
阅读全文