This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
/** | |
* bidirectional hashMap | |
* 双向的HashMap对应关系 | |
* | |
* @author keating_andy_given | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import com.beiyanght.utils.dto.DtoException; | |
import com.beiyanght.utils.dto.DtoHelper; | |
/** | |
* | |
* @author keating_andy_given | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JDialog; | |
import javax.swing.JFrame; | |
import javax.swing.JTable; | |
import javax.swing.UIManager; | |
import javax.swing.UnsupportedLookAndFeelException; | |
import javax.swing.table.TableColumnModel; | |
/** | |
* Swing helper for column of JTable | |
* @author keating_andy_given |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DateFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
/** | |
* some helpers for java.util.Date | |
* @author keating_andy_given | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; | |
/** | |
* some helpers for file operation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.beiyanght.jpa.ThreadLocalEntityManager.em; | |
import java.math.BigDecimal; | |
/** | |
* | |
* @author keating_andy_given | |
*/ | |
public class SequenceHelp { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.beiyanght.masterdata.common.exception.DataNotFoundException; | |
/** | |
* helpers for String | |
* | |
* @author keating_andy_given | |
*/ | |
public class StringHelp { | |
private enum Flag{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rss' | |
p 'Downloading rss index' | |
rss_string = open('http://feeds.feedburner.com/railscasts').read | |
rss = RSS::Parser.parse(rss_string, false) | |
videos_urls = rss.items.map { |it| it.enclosure.url }.reverse | |
videos_filenames = videos_urls.map {|url| url.split('/').last } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
require "nokogiri" | |
require "open-uri" | |
domain = 'http://sample.com&page=' | |
begin | |
1.upto 1000 do |i| | |
html = open(domain + i.to_s, :proxy => "http://127.0.0.1:8087", :read_timeout => 1).read | |
html.force_encoding("gbk") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 给关联关系赋值,发生了什么? | |
@sme = Sme.find(params[:id]) | |
@sme.sme_inspections = @sme.build_inspections params[:inspections] | |
# @sme.sme_inspections的class是个array,@sme.build_inspections params[:inspections] 只不过构造了一个sme_inspection的数组,并且数组中sme_inspection的sme_id为空 | |
# 但接下来发生了这些 | |
#SmeInspection Load (0.7ms) SELECT "sme_inspections".* FROM "sme_inspections" WHERE "sme_inspections"."sme_id" = 29 |
OlderNewer