`
文章列表
# -*- coding: utf-8 -*- from urllib2 import urlopen,Request import urllib from lxml import * import lxml.html as HTML import time def error(txt): with open("../it/error.txt","a") as f: f.write(txt + '\n') def con(url,count=4): try: ...

[Ruby]$: 是什么意思

    博客分类:
  • RUBY
使用ruby将句中所有单词首字母大写 ruby本身的方法里面没有,可以用这个: str='this is a demo' puts str.gsub(/\b\w/) { $&.upcase } [Ruby]$: 是什么意思? ruby comes with a set of predefined variables $: = default search path (array of paths) 其他Ruby特殊变量: $! 最近一次的错误信息 $@ 错误产生的位置 $_ gets最近读的字符串 $. 解释器最近读的行数(line number) $& 最近一次与正 ...
$(".button-to-export-search-excel").click(function(){ $(".button-to-export-search-excel").attr('href', window.location.pathname+'.xls'+window.location.search) $(".button-to-export-search-excel").attr('target', 'blank'); }); 追加属性 $("#statement_< ...

图片etif信息

    博客分类:
  • RUBY
查看图片etif的gps信息 http://code.ciaoca.com/javascript/exif-js/demo/ http://api.map.baidu.com/lbsapi/getpoint/index.html gem: https://github.com/remvee/exifr 查看坐标: http://www.gpsspg.com/maps.htm http://api.map.baidu.com/lbsapi/getpoint/index.html 输出坐标: http://www.gpsspg.com/maps.htm?maps=3&s=39.9717 ...
http://pobing.iteye.com/blog/1545935

反爬虫方法收集

http://web.jobbole.com/92736/   反爬虫 https://www.zhihu.com/question/29054543/answer/49907955
get 'search/category/:q' => 'search#group_by_category', as: 'group_by_category' 实现类似: http://localhost:3000/search/category/api http://localhost:3000/search/category/catalyst 而不是之前的: http://localhost:3000/search/category?q=api http://localhost:3000/search/category?q=catalyst get "/duihuan& ...
你用一只眼告知我童年斑斓的色彩 你用一双手勤劳的托起一代人的梦 曾经下过的棋现在已经没人再爱下 曾经拉我走过的小路现在是否还在 你瘦小的身躯在离开时还是那样弱 你弯曲的背影已经永远的站不起来 现实中把你回忆而你只出现在梦里 七夕将至不敢忘却你的期望和眼神 遥寄一杯酒家下平安发财合想得钱 闯下一片天难以回报家人似海深情
使用carrierwave插件保存附件: 创建attachments多态表来实现附件的存储关联。 gem 'carrierwave' migration class CreateAttachments < ActiveRecord::Migration[5.0] def change create_table :attachments do |t| t.string :attachment_entity_type, limit: 64 t.integer :attachment_entity_id t.string :path ...
<div class="field "><%= select_tag "quantity", options_for_select( %w(100g 250g 500g 500ml 1kg 1L 2.5L 5kg 5L 10kg 10L).unshift(@chemical_info[:quantity]).uniq, @chemical_info[:quantity]), include_blank: "选择数量", class: 'ui search fluid dropdown J_quantity' ...
<div class="ui blue segment"> <div class="right floated ui mini buttons"> <button class="ui mini button green show_data">#</button> <button class="ui mini button show_rake">%</button> </div> <ta ...
class Inquiry::MsdsController < Admin::BaseController before_action :set_inquiry def index @msds = Msds.new(@inquiry) @msds_details = @inquiry.msds_details if @msds_details.present? @msds_name = @msds_details.where(title:"") @msds_details = @msds_de ...

excell导入导出

    博客分类:
  • RUBY
部分代码: module FileHandle extend ActiveSupport::Concern #Roo::Spreadsheet 直接读取文件导入 module ClassMethods def import_data(file,current_user) imports = { failed: []} messages = {color:"#ff0000"} unless file.blank? orig_name = file.original_filename ...
http://echarts.baidu.com/echarts2/doc/example/event.html 参考 option = { tooltip : { trigger: 'axis' }, legend: { data:['最高','最低'] }, toolbox: { show : true, feature : { mark : {show: true}, dataView : {readOnly:f ...
ajax异步无法返回下载文件 可以通过添加from表单隐藏域的方式实现。 另外也想过直接js调用excell插件来生成文件学艺不精放弃了。 Require: $(".feedback.button").click(function(){ var form = $("<form>"); form.attr('style', 'display:none'); form.attr('target', ''); form.attr('method', 'post'); ...
Global site tag (gtag.js) - Google Analytics