现在位置: 首页 > cassis发表的所有文章
  • 10月
  • 05日
综合 ⁄ 共 937字 评论关闭
1. 在一个Layout中添加的自定义的ProgressBar: <ProgressBar android:id="@+id/pb" style="@android:style/Widget.ProgressBar.Horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="6dp" android:layout_marginTop="6dp" android:minHeight="0dp" android:progressDrawable="@drawable/progress_horizontal" /> 2. 自定义ProgressBar的drawable文件progress_horizontal.xml: <?x......
阅读全文
对于C++来说,存在函数重载,例如: 1 2 void CCNode::setScale(float scale) void CCNode::setScale(float scaleX,float scaleY) 这两个函数的函数名是一样的,但是参数表不同。最终在编译器编译后的函数签名不一样。 但是在JavaScript中并没有这种机制。怎么破?存在两种情况: 第一种、JS需要调用重载的C++函数接口 我们就以上面的函数为例,来看看在cxx-generator的自动生成代码中,函数重载是如何处理的。打开jsb_cocos2dx_auto.cpp,找到如下代码: 1 2 3 4 5 6 7 8 9 10 1......
阅读全文
  • 01月
  • 09日
综合 ⁄ 共 910字 评论关闭
// example13.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "string.h" #include "windows.h" /* 我们的应用程序往往有许多配置项,而应用的配置项往往在每个类中都要用到, 所以把配置数量规整到一个类中来吧。然后用单例模式来实现。 */ class config { private: config() { }; config(const config& con) { }; config& operator= (const config& con) { }; public: ~config(){}; public: static config* getI......
阅读全文
  • 04月
  • 08日
综合 ⁄ 共 3082字 评论关闭
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int dp[30][30]; int ord[30]; int stu[30]; int main() { //freopen("in","r",stdin); int n,i,j,t; cin>>n; for(i=1;i<=n;i++) { cin>>t; ord[t]=i; } while(cin>>t) { stu[t]=1; for(i=2;i<=n;i++) { cin>>t; stu[t]=i; } memset(dp,0,sizeof(dp)); for(i=1;i<=n;......
阅读全文
  • 04月
  • 03日
综合 ⁄ 共 9266字 评论关闭
在Barsky的程序中,有关Crank-Nicolson algorithm的算法,所以那来看了一下。以下是 1.摘自:http://sepwww.stanford.edu/sep/prof/bei/fdm/paper_html/node15.html The Crank-Nicolson method The Crank-Nicolson method solves both the accuracy and the stability problem. Recall the difference representation of the heat-flow equation (27).   (29) Now, instead of expressing the right-hand side entirely at time t, it will be averaged at t and t+1, giving       (30) This is called the Cran......
阅读全文
  • 02月
  • 06日
综合 ⁄ 共 5178字 评论关闭
        Log4j由三个重要的组件构成:日志信息的优先级,日志信息的输出目的地,日志信息的输出格式。日志信息的优先级从高到低有ERROR、WARN、INFO、DEBUG,分别用来指定这条日志信息的重要程度;日志信息的输出目的地指定了日志将打印到控制台还是文件中;而输出格式则控制了日志信息的显示内容。 一、定义配置文件   其实您也可以完全不使用配置文件,而是在代码中配置Log4j环境。但是,使用配置文件将使您的应用程序更加灵活。Log4j支持两种配置文件格式,一种是XML格式的文件,一种是Java特性文件(键=值)。下面我们介绍使......
阅读全文
  • 01月
  • 19日
综合 ⁄ 共 3444字 评论关闭
Flipper Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 521    Accepted Submission(s): 334 Problem Description Little Bobby Roberts (son of Big Bob, of Problem G) plays this solitaire memory game called Flipper. He starts withn cards, numbered 1 through n, and lays them out in a row with the cards in order left-to-right. (Card 1 is on the far left; cardn is on the far right.) Some cards are face up and some are face down. Bobby then......
阅读全文
  • 01月
  • 16日
综合 ⁄ 共 2008字 评论关闭
看到一些人经常会问QTreeWidget的列宽怎么设啊,怎么固定列宽哦,行宽怎么设啊什么的.其实慢慢看manual就会找到了,下面就列下常用的方法: 1.基本用法: 初始化用基本用到的: //this->setMouseTracking(true); this->setRootIsDecorated(false); this->setSelectionMode(QAbstractItemView::ExtendedSelection); this->setStyleSheet("QTreeWidget::item{height:25px}"); //设置行宽, 我也找不到提供的接口 setStyleSheet很强大建议看 this->setColumnWidth(0, 100); //设置列宽 this->setColumnCount(2); QStringLi......
阅读全文
  • 12月
  • 19日
综合 ⁄ 共 26594字 评论关闭
test.html <html> <head> <title>全国省市县无刷新多级关联菜单</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style> body,select {  font-size:9pt;  font-family:Verdana; } a {  color:red;  text-decoration:none; } a:hover{  text-decoration:underline; } </style>  <SCRIPT LANGUAGE = JavaScript> <!-- //** Power by Fason(2004-3-11) //** Email:fason_pfx@hotmail.com  var s=["s1","s2","s3"]; var opt0 = ["省份","地级市",......
阅读全文
  • 12月
  • 18日
综合 ⁄ 共 661字 评论关闭
appwidget  http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#templates AnalogClock ◾  Button ◾  Chronometer ◾  ImageButton ◾  ImageView ◾  ProgressBar ◾  TextView ◾  GridView (only Android 3.0+) ◾  ListView (only Android 3.0+) ◾  StackView (only Android 3.0+) ◾  ViewFlipper (only Android 3.0+) ◾  ViewStub (only Android 4.1+) ◾  AdapterViewFlipper (only Android 3.0+) 另外需要本章末尾讲到了30分钟的更新限制,那么那些时间更新之类的widget是如何打破的呢?研究下呢 an......
阅读全文
  • 12月
  • 08日
综合 ⁄ 共 337字 评论关闭
今天提交代码时提示本地代码与服务器端代码有冲突,根据错误提示解决完代码冲突以后,打开xcode重新运行程序,xcode报_OBJC_CLASS_$_ errors错误,详细信息可见下图:   在网上搜了一下造成这个错误,存在两种原因: 1.项目未添加一个 CoreData  framework; 2.由于某个或某几个.m文件没有被标记(打钩)的原因造成的; 从上图中可以知道我的错误原因是第二种原因造成的, 我的解决方法是将与服务器端冲突的几个先在项目中删除,然后再将删除的文件重新拖拽到xcode中,注意在添加文件是要记得打钩。 如果再次运行发现Failed to u......
阅读全文
  • 11月
  • 22日
综合 ⁄ 共 1414字 评论关闭
Antimonotonicity Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 2428   Accepted: 995 Description I have a sequence Fred of length n comprised of integers between 1 and n inclusive. The elements of Fred are pairwise distinct. I want to find a subsequence Mary of Fred that is as long as possible and has the property that: Mary0 > Mary1 < Mary2 > Mary3 < ... Input The first line of input will contain a single integer T expressed in decimal with no lea......
阅读全文