自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(60)
  • 资源 (7)
  • 收藏
  • 关注

原创 mysql权限问题

mysql中,若更改用户密码,那么此用户的权限将丢失,需要重新grant。可以使用show grants for user@'address' 来查看用户的权限,特别是表的权限,因为它们没有在mysql数据库的user表中记录。

2012-02-16 14:26:48 505

原创 rails 3.1 assets route error

rails 3.1 采用特殊机制引用CSS和JS仅仅将CSS或JS放到public 或者 assets上,浏览器是无法获取到的解决方法如下:在Gemfile中添加gem 'sprockets', '= 2.0.0.beta.10'此方法适用于rails 3

2011-08-10 23:46:20 652

原创 git problems

发送本地branch到远程branchgit push git push :获取远程branchgit remote show origingit fetchgit checkout -b local-name origin/r

2011-08-10 10:21:40 669

原创 yammer

rails console test> require './spec/support/blueprints' this will load blueprints, checkout the file which predefine objects for your te

2011-08-06 11:06:35 537

原创 rails testing environment setup

在Gemfile中添加group :development do gem 'rspec-rails', '2.6.1'endgroup :test do gem 'rspec-rails', '2.6.1'endbundle install

2011-08-06 09:51:41 698

原创 rails action controller

default_url_optionsclass ApplicationController < ActionController::Base # The options parameter is the hash passed in to 'url_for' def d

2011-08-04 17:36:06 1063

原创 rails form helpers

You can create a similar binding without actually creating  tags with the fields_for helper. This is useful for editing additional model

2011-08-04 15:40:03 670

原创 rails layout and rendering

Using render You can render the default view for a Rails template, or a specific template, or a file, or inline code, or nothing at al

2011-08-04 13:57:51 1168

原创 rails active record querying

Retrieving Multiple Objects in Batchesfind_eachUser.find_each(:batch_size => 5000) do |user| NewsLetter.weekly_deliver(user)end

2011-08-04 01:27:45 738

原创 rails active record associations

The has_many :through Associationclass Physician < ActiveRecord::Base has_many :appointments has_many :patients, :through => :appoin

2011-08-02 19:33:03 994

原创 rails active record validation and callbacks

Active Record uses the new_record? instance method to determine whether an object is already in the database or not.The following meth

2011-08-02 17:08:29 1717 1

原创 rails migration tutorial

class AddReceiveNewsletterToUsers < ActiveRecord::Migration def self.up change_table :users do |t| t.boolean :receive_newslet

2011-08-02 14:39:58 845

转载 rails routes

If you want to route /posts (without the prefix /admin) to Admin::PostsController, you could usescope :module => "admin" do resources :posts, :commentsendorresources :posts, :module =>

2011-08-02 13:11:02 1630 1

原创 rails web application deploy

$ heroku create$ git push heroku master$ heroku rake db:migrateIf you want to push the data up, too, you can do so using the taps g

2011-08-01 12:32:07 634

原创 rails tutorial--git

$ git config --global user.name "Your Name"$ git config --global user.email [email protected]$ git config --global alias.co checkoutgit

2011-08-01 00:31:19 564

原创 rails web 国际化

You can implement it like this in yourApplicationController:before_filter :set_locale def set_locale I18n.locale = extract_locale_

2011-07-31 20:11:41 476

原创 ubuntu rails 开发环境

1. 先下载我的rails项目设置机子上的git,说明在此:http://help.github.com/linux-set-up-git/然后在想要保存项目的目录下执行下列命令:git clone [email protected]:gitfly/Quan.git     被

2011-07-30 23:51:02 767

原创 ruby on rails 在ubuntu下的安装

1.首先安装一些基础库apt-get install curl git-core build-essential zlib1g-dev libssl-dev libreadline5-dev2.接着安装ruby虚拟机bash  https://rvm.beginrescueend

2011-07-22 23:16:49 593

原创 今天intel面试总结

1. 印象最深刻的,一针见血地指出我没有精通一门技术。2. 因为工作内容是做Django网站开发,又在linux下,shell,正则表达式以及python问得比较多。3. 项目做太少了,5个面试官几乎每个都要问项目。4. C语言编译的过程5. 做事情最好要保持兴趣,我一说做网站烦

2011-07-08 22:35:17 539

原创 Qt book read records

1. But if you are curious, you can read the QMetaObject class documentation and have a look at the C++ source files generated by moc to see how the implementation works. 2.Now run qmake to create

2011-06-08 15:35:00 569

原创 oss的问题

在linux 2.6内核中,默认的声卡驱动已经从OSS改成了ALSA(高级linux声音架构)。自己编写的一个程序使用了emiplib库,而这个库使用的是OSS,所以在运行程序的时候需要进行包裹。aoss ./abc

2011-06-07 23:52:00 517

原创 在visual studio环境中使用第三方库

将第三方库的1.头文件放入系统目录2.库文件(.lib)可以不放入系统库目录,在程序中添加下列语句即可:#pragma comment(lib, "abc.lib")

2011-06-07 23:47:00 641

原创 code blocks使用

<br />1. 只有在code blocks中建立的项目,在项目中新建的原文件,在编辑代码时才有完成代码功能。<br />2. 库链接选项在settings->compiler and debugger->linker settings->other linker options中添加。

2011-06-03 00:45:00 521

转载 GCC默认找头文件策略

<br />回答了这个问题,LZ就明白了一切了,GCC找头文件有三种策略:<br />1.会在默认情况下指定到/usr/include文件夹(更深层次的是一个相对路径,GCC可执行程序的路径是/usr/bin,那么它在实际工作时指定头文件头径是一种相对路径方法,换算成绝对路径就是/usr/include)<br />2.GCC还使用了-I指定路径的方式,这一点大家都知道<br />3.还可以使用一个参数来指示GCC不搜索系统默认路径,这个参数我忘了,你搜一下就知道了<br /><br />在

2011-05-28 10:10:00 863

原创 Linux P2P音视频聊天系统实现步骤

<br />1. Windows P2P 打洞的实现。<br />2. 将Win P2P 打洞实现移植到Linux中。<br />3. 利用emiplib实现音视频的局域网传输。<br />4. 将2中的打洞模块加入3中,实现广域网的数据传输。<br />5. 将视频利用Qt组件显示出来,并美化UI。

2011-05-26 19:53:00 1903

原创 emiplib调用声卡失败

<br />应用程序使用emiplib的API编写,但打开设备(指声卡)失败。/dev/dsp与/dev/audio也不存在。<br />使用padsp命令运行程序即可,具体内容看padsp手册。<br />例: padsp ./soundfileplayer

2011-05-25 12:44:00 655

原创 C++标准库阅读笔记

<br />p17<br />Thus, the general rule in C++ is that any identifier of a template is considered to be a value, except it is qualified by typ

2011-05-20 10:05:00 446

原创 richtextbox的使用

        private void initTxtDiff()        {            DirectoryInfo di = new DirectoryInfo(curStdPath);            string stdcase="";            foreach (FileInfo file in di.GetFiles())            {                if (file.Extension == ".uof")

2011-03-30 10:20:00 754

原创 安装Linux gnome开发环境(ubuntu)

<br />sudo apt-get install gnome-devel<br />其他依赖的包会自动安装,比如GTK+

2011-03-29 21:14:00 1089

原创 正常显示被最小化的窗体

将最小化在任务栏的窗体显示出来,即正常显示。help.Activate();help.WindowState = System.Windows.Forms.FormWindowState.Normal;

2011-03-25 10:32:00 449

原创 账务管理软件开发中碰到的一些问题

<br />1. winform中有些控件,设置值即引发事件,即初始化控件属性值时会触发事件。<br />2. SQLServer中的convert方法只用来转化数据库字段值,不能转换C#的类型值<br />3. 对null无法更新,因为任何运算与null计算结果都是null,用isnull函数或者SET CONCAT_NULL_YIELDS_NULL OFF<br />4. 自增列清0:DBCC CHECKIDENT(Articles, RESEED, 0);

2011-02-24 12:55:00 459

原创 temp

//批量删除新闻记录,使用事务,返回实际删除的行数        public static int deleteNews(ArrayList idList)        {            SqlConnection conn = new SqlConnection(connStr);            conn.Open();            SqlTransaction tran = conn.BeginTransaction();            in

2011-02-01 16:18:00 559

原创 今天阿里云的电话面试

<br />题目一:如何防止头文件重复包含<br /> <br />问题二:比较两个浮点数(想减,值小于0.000001精度,就小于,大于等于同)<br /> <br />问题三:求N的阶乘,N很大。比如100000<br /> <br />问题四:malloc和new的区别<br /> <br />问题五:struct和class的区别<br /> <br />问题六:虚拟继承<br />http://www.cppblog.com/franksunny/archive/2008/10/16/64168.

2010-11-30 16:50:00 3690 1

原创 在windows下不小心删除了fedora的分区

<br />今天不小心干了RT的一件事,结果无法进入windows,只显示一个grub引导命令行。<br />最后在grub中依次输入以下命令(每行一个命令),来实现引导windows。<br />rootnoverify (hd0,1) #我只有一块硬盘,win7系统在第二块分区,因为我的C盘前面还有一个隐藏分区,在计算机管理中可以看到。<br />chainloader +1<br />boot<br />这样就成功引导windows了<br /> <br />自己这么想的:以前只有windows的时候

2010-11-21 23:43:00 816

转载 Windows硬盘安装Fedora

1. 下载最新版EasyBCD。不怕麻烦,下最新的,否则麻烦就有可能来了。2. 新建文件夹Fedora,里面放Fedora的iso文件。3. 解压Fedora的iso文件,将里面的images,isolinux两个文件夹放到Fedora文件夹中;同时再将isolinux文件夹复制到C:根目录下。4. 将isolinux中的initrd.img,vmlinuz两个文件复制到Fedora文件夹中。5. 打开EasyBCD,依次点击Add/remove a Entry--->NeoGRUB--->In

2010-11-21 23:34:00 1923 2

转载 删除旧版glib

<br />#cd glib-2.2.3<br />#make uninstall     //先反安装编译过的glib-2.2.3<br /><br />#rm /usr/bin/glib*  //将原来2.0.6版本的命令或者移动到其他在PATH变量里搜索不到目录<br /><br />#rm /usr/local/lib/glib-2.0 //其实这里面就一个目录和一个.h 文件了,为了保险起见删除<br /><br />重新编译安装 glib-2.2.3 还在/usr/local目录

2010-11-07 01:08:00 2566

转载 C#中索引器的实现过程

以下是具有索引器的类示例,通过索引器会返回一个字符串:class Sample { public string this [int index] { get {return "You passed " + index; } } } 注意,这里的属性名是this,意思是回引类的当前实例,参数列表包含在方括号而非括号之内。还有,这是一个只读索引器。为了把它改成读/写

2010-04-24 10:45:00 6144 3

转载 生成C# Winform 安装程序

1:新建安装部署项目打开VS,点击新建项目,选择:其他项目类型->安装与部署->安装向导(安装项目也一样),然后点击确定.(详细见下图)2:安装向导关闭后打开安装向导,点击下一步,或者直接点击完成.3:开始制作安装向导完成后即可进入项目文件夹:双击"应用程序文件夹"在右边的空白处右击,选择添加->文件,将你的做的应用程序的

2010-04-24 10:27:00 966

转载 jQuery与asp.net ajax文章两篇

 1.Using jQuery with ASP .NET http://dotnetslackers.com/articles/ajax/using-jquery-with-asp-net.aspx包括jQuery怎么调用asp.net web service 2.jQuery and ASP.NET AJAX UpdatePanel ht

2010-04-22 13:34:00 489

转载 (转)一些jQuery技巧

1、关于页面元素的引用通过jquery的$()引用元素包括通过id、class、元素名以及元素的层级关系及dom或者xpath条件等方法,且返回的对象为jquery对象(集合对象),不能直接调用dom定义的方法。2、jQuery对象与dom对象的转换只有jquery对象才能使用jquery定义的方法。注意dom对象和jquery对象是有区别的,调用方

2010-04-22 10:00:00 377

Apress - Practical Django Projects 2nd Edition

Chapter 1 Welcome to Django . Chapter 2 Your First Django Site: A Simple CMS . Chapter 3 Customizing the Simple CMS. Chapter 4 A Django-Powered Weblog . Chapter 5 Expanding the Weblog. Chapter 6 Templates for the Weblog . Chapter 7 Finishing the Weblog. Chapter 8 A Social Code-Sharing Site. Chapter 9 Form Processing in the Code-Sharing Application. Chapter 10 Finishing the Code-Sharing Application. CHAPTER 11 Practical Development Techniques. Chapter 12 Writing Reusable Django Applications.

2011-03-02

GoF设计模式源码(Java)

Java编写的GoF设计模式源码 每一个模式都用简单的一段程序来实现 帮助理解模式

2009-09-22

Socket通信(C#编写)

用C#编写的Socket简单文本通信程序,简单易懂,适合初学者

2009-09-22

IT项目管理相关表格

包括从IT项目启动到IT项目收尾阶段的所有可能会用到的表格,非常丰富

2009-09-22

MP3播放器(C#)

用C#编写的MP3播放器 功能:歌曲播放 暂停 停止 上下首切换 获取MP3文件IDV3信息

2009-09-22

Python核心编程第二版

循序渐进的教学 适合Python的初学者

2009-09-22

asp.net图书馆借书系统

用asp.net编写的图书馆借书系统 非常适合初学者

2008-09-22

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除