自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

野草志

As you will.

  • 博客(180)
  • 资源 (2)
  • 收藏
  • 关注

原创 iOS UIlable根据内容多行显示

textLabel.lineBreakMode = NSLineBreakByWordWrapping;textLabel.numberOfLines = 0;iOS

2014-07-21 22:28:36 1193

原创 iOS Code Sign error: Provisioning profile can't be found 解决方案

出现error的过程:在运行另外一个xcode项目重置了code sign,回到原来的项目的时候出现这个error修复方法:targe-build settings-code signing identity-choose iOS Developer然后Provision File选择对应的file参考链接:https://developer.apple.com/leg

2014-07-21 17:44:32 1240

原创 iOS 修改toolbar里面文字的字体和大小

使用NSDictionaty来设置文本的属性:NSDictionary * attributes = @{NSFontAttributeName: [UIFont fontWithName:@"Heiti SC" size:20]}; [confirmBarButton setTitleTextAttributes:attributes forState:UIControlStateN

2014-07-18 21:43:56 2308

原创 iOS 去掉导航栏的边界黑线&去掉搜索框的边界黑线和其中文本输入框的阴影 - 解决方案

去掉导航栏的边界黑线in viewDidload: [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; self.navigationController.navigationBar.shad

2014-07-11 21:54:46 3839

原创 iOS 根据文本内容为TextView动态定义高度

解决方案:1.定义一个textview,在storyboard中设定constraints。2.将高度的constraint定义到头文件中:(直接拖拽)@property (weak, nonatomic) IBOutlet NSLayoutConstraint *textviewHeightConstraint;3.待在实现文件中为textview加载了内容之后,获取文本高度,为

2014-07-10 00:09:04 2671

原创 iOS 为导航栏自定义按钮图案Button Image 运行出来的颜色与原本颜色不一样 -解决方案

为相机制作闪光灯,在导航栏自定义了“闪光”图案,希望点击时变换图片,但是一直没有改变,原来是因为设置了Global Tint的颜色,所以系统会自动把图片的颜色改为Global Tint的颜色。解决方案,设置图片时,添加:imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal源码:/* ====================

2014-07-08 16:10:34 3673

翻译 iOS 运行时ScrollView上出现空白空间-解决方案

iOS7 中的UIViewControllers设置了automaticallyAdjustsScrollViewInsets。如果是YES,scrollview会根据status bar, navigation bar以及tool bar或者tab bar的高度自动调整。可以通过在storyboard的右侧进行设置,在Attributes Inspector中,不勾选“Adjust Scroll

2014-07-03 17:31:41 4912

原创 iOS 追踪限制textfield输入位数

实现效果:强制用户只能输入16位数,这里是运用在信用卡号码的输入。输入字符数大于16,把字的颜色设为黑色,且不管继续输入什么内容,只取前16位;若小于16位,把字的颜色设为红色,且设置“无效”。

2014-07-03 15:29:20 1471

转载 iOS double类型的数据设置小数点后保留两位

[NSString stringWithFormat: @"%.2lf", total]效果:

2014-07-02 23:26:27 17110

转载 iOS TableView横向滑动删除记录

首先,需要在跟tableview添加实现

2014-07-02 23:11:49 1329

原创 iOS 搜索框search bar开始搜索

- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {// things to be done regarding the textNSSting *text = seachBar.text;}

2014-06-20 23:17:03 1237

转载 iOS 按钮set Enable or Disable

在 .h 文件中:

2014-06-20 20:50:11 4746

转载 iOS Xcode中设置 横屏,竖屏

方法一:程序中控制,每一个自定义的 UIViewController 都有一个方法:[html] view plaincopyprint?- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{         //看下

2014-06-19 16:51:05 7894

转载 Ruby on Rails 临时文件类Tempfile Class

A utility class for managing temporary files. When you create a Tempfile object, it will create a temporary file with a unique filename. A Tempfile objects behaves just like a File object, and you

2014-06-13 17:16:29 2960

转载 Ruby on Rails 使用Sidekiq实现多现场后台操作

资源:SidekiqSidekiq WikiSidekiq on GitHubCelluloidEpisode 271: ResqueEpisode 365: Thread-Safety (pro)terminalbrew install redisredis-server /usr/local/etc/redis.confbundle exec sidekiq

2014-06-12 00:14:11 2240

原创 Ruby on Rails 上传照片到数据库,在从数据库中找出发送给其他服务器

接受图片发送图片

2014-06-11 17:38:47 1789

原创 iOS 现阶段(iOS 6+)如果获得iOS设备的ID

According to official documents: "uniqueIdentifier: An alphanumeric string unique to each device based on various hardware details. (read-only) (Available in iOS 2.0 through iOS 6.1. Usetheidentif

2014-06-10 17:10:29 713

原创 iOS 向服务器POST参数

- (IBAction)sendPhoto { /* resize the image to a lower resolution */ // genarate the new size based on the original image ratio UIImage *image = _imageView.image; float actua

2014-06-10 17:05:02 1287

转载 Ruby on Rails 查看文件夹是否存在,不存在则新建路径(多重路径)

path = "/tmp/a/b/c"FileUtils.mkdir_p(path) unless File.exists?(path)

2014-05-26 21:59:01 5243

转载 Ruby on Rails 在link_to的链接中加入span的tag

'button white' do %> My span 转载自:http://stackoverflow.com/questions/7563911/adding-span-tag-in-rails-link-to

2014-05-26 18:32:18 1467

原创 Javascript & HTML5 使用Ajax自动更新页面数据

通过设置interval和ajax,来实现页面数据的更新,亮点是只更新一个

2014-05-20 20:39:23 7378

转载 Ruby on Rails 查询数据库 where 和 find 的区别

u = User.find(1) returns one User #return a Set of users. In your case its only one user. u = User.where("username = ?", "percent20") The result type is ActiveRecord::Relation --> [User, Us

2014-05-16 16:25:39 3365

转载 Ruby on Rails 关于object的方法create 和 new 的区别

From the ActiveRecord::Base documentation:create(attributes = nil) {|object| ...}Creates an object (or multiple objects) and saves it to the database, if validations pass. The resulting obje

2014-05-16 16:16:21 1625

转载 Ruby on Rails delete 和 destroy 的区别

Basically "delete" sends a query directly to the database to delete the record. In that case Rails doesn't know what attributes are in the record it is deleteing nor if there are any callbacks (such a

2014-05-16 16:08:46 2421

转载 Ruby on rails 使用image_path为图片设置打开自己的链接

"wine_pic"), image_path(@request.picture) %>

2014-05-16 16:04:49 3330

转载 Ruby on rails 点击链接,在新标签页打开页面

'new' %>转载自:http://stackoverflow.com/questions/13107229/open-a-new-page-tab-in-the-background-ruby

2014-05-16 15:59:18 1710

原创 Javascript + Ruby on Rails: 提交上传文件之前检验文件类型

HTML:" action="" method="post" enctype="multipart/form-data" onsubmit="return validateFile('')"> File: " name="file_to_upload"> " /> "hidden", :name => request_forgery_protection_toke

2014-04-29 23:00:03 1463

转载 Ruby on Rails: 给button_to添加图标

Add To Cart"), line_items_path(product_id: product), class: "btn btn-success", method: :put %>转载自:

2014-04-29 22:54:34 1322

转载 Ruby on Rails 导入CSV文件至数据库

config/application.rbrequire 'csv'view: index.html.erb

2014-04-25 23:07:50 2582

转载 Ruby On Rails 导出数据库至CSV文件

config/application.rb

2014-04-25 22:56:22 3176

转载 Html Javascript Checkbox 全选/全不选

HTML: 全選 book1 book2 book3 book4 book5JavaScript:Demo:

2014-04-25 22:45:24 960

原创 Ruby on Rails 对静态网页的处理

方案一:为每个静态页面在controller中创建方法:

2014-04-25 22:38:14 1999

转载 Rails Render和Redirect_to区别

Redirect_to是跳转到一个新的action中继续执行,相当于浏览器发送了一个新的请求,并且默认返回302状态码def redirect_to(options = {}, response_status = {}) #:doc:raise ActionControllerError.new("Cannot redirect to nil!") if options.nil?

2014-04-14 18:07:42 2646

原创 Ruby on Rails 时间加上N天

问题:在RoR中需要在某个时间

2014-04-10 17:51:39 1946

转载 Ruby 时间规范化函数strftime使用大全

通过Time.new获取当前时间:

2014-04-10 17:44:43 6161

翻译 Ruby on Rails 错误“Rails 4.0.0, Gemfile requires rake 10.1.0 for Rake” 解决方案

问题:在 rake db:migrate 出现问题:Joses-MacBook-Air:crumblr JRV$ rake db:migraterake aborted!You have already activated rake 10.1.1, but your Gemfile requires rake 10.1.0. Using bundle exec may s

2014-04-10 17:39:13 1744

转载 JavaScript Form Validation 示例

使用onsubmit:HTML:First name: Javascri

2014-04-10 17:34:49 890

转载 Ruby 字符串分割示例

a = "hello there"a[1] #=> "e"a[2, 3] #=> "llo"a[2..3] #=> "ll"a[-3, 2] #=> "er"a[7..-2] #=> "her"a[-4..-2]

2014-04-10 17:32:00 6231

原创 Ruby on Rails: 错误“ActionController::InvalidAuthenticityToken when disable JS/Ajax request”解决方案

问题:在RoR项目中提交表格时出现:ActionController::InvalidAuthenticityToken when disable JS/Ajax request

2014-04-10 17:26:00 1334

原创 Ruby on Rails: 建立seed database

问题:如何在Ruby on Rails中创建数据库的最基本的数据项jiejue

2014-04-10 17:20:08 2418

大型共享数据库数据的关系模型

《大型共享数据库数据的关系模型》原名叫:《A Relational Model of Data for Large Shared Data Banks》是E.F Codd在1970年写的一篇论文。在数据历史上具有转折性的意义。

2012-02-18

新浪微博数据挖掘方案

摘 要: 随着新浪微博用户群体的增长, 新浪微博的数据获 取是微博研究首先需要解决的问题。该文提出了基于新浪 微博API 与基于页面解析的新浪微博数据获取方案。程序 逻辑控制API 调用方法与频率, 获取JSON 对象并解析实现 高效数据获取。同时将传统的网络爬虫结合网页解析技术 结合API 同时使用, 解决了因API 接口开放不完善, 且因在 返回结果数量上限与调用频率方面的限制, 导致不能有效实 现新浪微博数据的全面获取的问题。经过实验测试, 通过2 套方案的结合可以实现新浪微博数据高效全面的获取。

2012-08-28

空空如也

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

TA关注的人

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