摘要: ##1. Razor```@*注释*@你在用 @Request.Browser.Browser, 发送邮件给support@qq.com, 转义@@qq@{ var amounts = new List {100, 25.00m, 30.0m, -40}; } @foreach (dec... 阅读全文
posted @ 2015-02-25 11:08 刘理想 阅读(423) 评论(0) 推荐(0) 编辑
摘要: [TOC]##1. Action###1.1 新建项目新建项目->Web->Asp.net Web应用程序,选择MVC,选择添加测试。在解决方案上右键,选择"管理NuGet程序包",在更新页更新全部程序包。###1.2 控制器控制器在Controllers文件夹内,命名规则是"名称+Controll... 阅读全文
posted @ 2015-02-25 11:05 刘理想 阅读(1887) 评论(0) 推荐(0) 编辑
摘要: 原文在此:https://code.djangoproject.com/wiki/DjangoCheatSheetDjango速查表Django教程已经非常好了。这个速查表的作用是创建一个快速开始指南,以便在读过一两遍教程之后能有一个更好的手册。创建一个项目…django-admin.py startproject AcmeIntranetcd AcmeIntranetmkdir templatesmkdir mediasettings.py数据库设置设置媒体文件夹( e.g. /home/joe/AcmeIntranet/media )media包含公共使用的文件,比如css和js文件等设置 阅读全文
posted @ 2014-03-04 21:16 刘理想 阅读(576) 评论(0) 推荐(0) 编辑
摘要: 部署django - Apache + mod_wsgi + windows1、环境django 1.6.2python 3.3 32位apache2.4.7 32位一个可以使用的django project(https://github.com/liulixiang1988/python_study_case/tree/master/django)2、安装apache 32位可以在这里下载(http://www.apachelounge.com/download/),或者这里下载(http://httpd.apache.org/download.cgi#apache24)3、安装mod_ws 阅读全文
posted @ 2014-02-10 15:45 刘理想 阅读(2770) 评论(0) 推荐(0) 编辑
摘要: 这里有一个使用python自带lib发送邮件的例子(http://my.oschina.net/leejun2005/blog/74416),这里面讲解的很全面,可以供大家参考。今天将的是使用envelopes这个第三方库来发送邮件。既然已经有了python自带的标准库,为什么还要使用这个呢?因为简单易用啊。envelopes项目地址:https://github.com/tomekwojcik/envelopes小例子#!/usr/bin/env python# -*- coding:utf-8 -*-__author__ = 'liulixiang'from envelop 阅读全文
posted @ 2014-02-08 11:47 刘理想 阅读(1147) 评论(0) 推荐(0) 编辑
摘要: 上次讲到如何使用BeautifulSoup解析XML文档,今天发现另外一个python库xmltodict(https://github.com/martinblech/xmltodict)也很简单。小例子一枚,因为很简单,不需要太多说明#!/usr/bin/env python# -*- coding:utf-8 -*-__author__ = 'liulixiang'import xmltodictdoc = xmltodict.parse(''' H00120030101081526 盛隆钢铁 0 1 ... 阅读全文
posted @ 2014-02-08 10:53 刘理想 阅读(3402) 评论(0) 推荐(0) 编辑
摘要: 使用UIWebView来显示//locale fileNSString *html = [NSString stringWithContentsOfFile:path1 encoding:NSUTF8StringEncoding error:nil];[self.webView loadHTMLString:html baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]bundlePath]]];//或者NSString *path = [[NSBundle mainBundle] pathForResource:@"docume 阅读全文
posted @ 2014-01-28 21:16 刘理想 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 有200多个XML文档,每个文档类似如下: H00120030101081526 盛隆钢铁 2# H001 铁水秤开关 铁水秤开关 2003-01-01 08:15:26 2 20030101081424.wave 20030101081424.wave 右方向来车<<<<<< Admin 0 1 2003-1-1 8:14:25 17.5 ... 阅读全文
posted @ 2014-01-23 11:27 刘理想 阅读(6282) 评论(0) 推荐(0) 编辑
摘要: Dapper是.Net下的一个简单orm框架,具有以下特点:1、简单,只需要一个文件即可(SqlMapper.cs)2、快速,下面是一个查询结果集在500以上的运行速度对比3、不要求特定的db provider,即不论是sqlite, sqlce, firebird, oracle, MySQL 还是 SQL Server,都能使用它。项目的github地址是:https://github.com/SamSaffron/dapper-dot-net 可以从这里下载SqlMapper.cs,然后添加到自己的项目中即可。下面通过一个例子来介绍Dapper的基本用法。假设有个数据库test,test 阅读全文
posted @ 2013-09-22 21:41 刘理想 阅读(2369) 评论(1) 推荐(2) 编辑
摘要: 一、string time datetime之间的相互转换1、string->time>>> time.strptime('2012-08-04', '%Y-%m-%d')time.struct_time(tm_year=2012, tm_mon=8, tm_mday=4, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=5, tm_yday=217, tm_isdst=-1)2、time->string>>> import time#方法1>>> time.strf 阅读全文
posted @ 2012-08-04 20:12 刘理想 阅读(753) 评论(0) 推荐(0) 编辑