Ȥ Blog

Ruby,C#

2011ǯ03

ޥꥢ󡦥ݡ (100ǯ񤭲) ļϺ

ǶϻŻطܤФɤǤΤǡʸݺʤϤʤפ֤ꡣ
οͤκʤϼ¤Ϥޤ깥ǤʤäΤǤκʤϤȤƤɤäǤ
ĥդˤǽäΤäƤϤޤĥäԤʤΤΤޤǤ
󡢤äȶ̣ͯƤ

ȥޥꥢ󡦥ݡ (100ǯ񤭲)
//Artist Ϻ
, 1,575 ̼
ɾ
 2011-03-28



īͺ̴٤ 渶ٴ뤫3ǯ ˤ١ͥή̱λҤ²ĹˤΤꡢĤˤڤ줫αͺĥäΡʤǴ ļϺ14ǯ֤ν񤭲ĹԾ⡣ 3ǯ64̤ĥä褻֤ܤδ췳ˤäˤ줿λ¾θǤǰŻ˽ˡŷĤϷܤï⶯ֿ¡פΤꤿȴä ֻο𤻤סŷĤ̩Ȥ֤񡣤˲񤫤졢񤫤ʤä ޲־»ˤΰǡס©ݤŸ׷Ρֿס¤ʤưĹӾ

ơʡBOOKץǡ١ˡ

3ǯ64̤ĥä褻֤ܤδ췳ˤäˤ줿λ¾θǤǰŻ˽˾ŷĤϷܤï⶯ֿ¡פΤꤿȴä٤ĥ餵줿櫡׻ȸ줿ֿ¡ס

ĶñHTMLơ֥ǥΥȥե륿ߤʤΤ¸饤֥

ŻHTMLơ֥ǥΥȥե륿Τ褦ʤΤȤȤ˾ꡢ¿ʬõФʥץȤ󤸤ʤȻפõȤäѤꤢޤ
http://www.javascripttoolbox.com/lib/table/index.php

ϡtablethǤclass°table-autofilterȤtable-filterableȤƤ, Ȥե륿󥰤ڡ󥰤ʤ⥯饤¦ǽˤñǤƤޤȤĶΤǤ

®äƤߤ롣
ޤɤơȤꤢ table.js Ȥ̾¸ƥ󥯥롼ɡJavaScript˴ؤƤϤǡʬǤʤˤɬפȤϤޤ

	<%= javascript_include_tag "table.js" %>	

ˡե륿󥰤ơ֥class° class="table-autofilter" ɲäơե륿th class="table-filterable"ꡣ
ʴǤ礦

 

<table class="table-autofilter">
  <thead>
    <th class="table-filterable">ʸ</th>	 

ơ֥إå thead, ǡԤ tbody˽񤫤ʤȥʤ褦ǤJavaScript餽ʤäƤޤ

Ŭ˥ǡäơڡɽƤߤ롣

22
35
 00
06

Java: POI IFؿǤ̤Ǥ뤫

ȡ롣

 50

23

Rails3 mongrel

ʤRails3ˤǡ
rails server
äƤȡmongrel󥹥ȡ뤵Ƥˤؤ餺webrickư롢

Ĵ٤Ƥߤ顢
Gemfileʤޤˤ
gem 'mongrel'

ȤǤ餷

3Ϥʤ󤫿ѤäƤʡ 
 

Rails: postgresǤϤޤ rake aborted! libpq.so.5: cannot open shared object file

ޤ
gem install pg 
Ǥ롣

gem install pg -- --with-pg-config=/usr/local/pgsql/bin/pg_config

ǥ󥹥ȡϤǤɡrake db:create 褦Ȥ顢٤ɽΥ顼Ф롣

libpq.so.5
ĤʤȸäƤ褦Ǥ

Ǥ
/usr/local/pgsql/lib
ˤϤȤ롣
äƤȤñ˥ѥ̤äƤʤǤ⡢̤ƤϤʤɤʡ̤Υޥ󤫡

.bash_profileȤ .zshrcȤ

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib

ǤȤǤޤ

ɤѥ̤˺ǥϥޤ뤳Ȥ¿

Java POI ǴؿͤƤߤ

POIȤäƥΥǡɤ뤳ȤϤ狼äΤǤؿ̥ͤλͤϤɤʤ ºݤ٤δؿ仲ȤϰʤȻȤΤˤʤʤ

Ĵ٤Ƥߤȡ٤ΤϥݡȤƤ餷
  • References: single cell & area, 2D & 3D, relative & absolute
  • Literals: Number, text, boolean, error and array
  • Operators: arithmetic and logical, some region operators
  • Built-in functions: over 350 recognised, 280 evaluatable
  • Add-in functions: 3 from Analysis Toolpack
ȤꤢʬΤ褦Ǥ

FormulaEvaluator Ȥ饹ѰդƤơĤǷ׻̤ʤǤ褦Ǥ
ˡϤĤѰդƤΤǤȤꤢִñ

 FormulaEvaluator.evaluateInCell(Cell cell)

ȤäƤߤ롣ϰǻꤵ줿뤬׻ʤ餽η̤ǥ֤ƤޤޤʸμϼϷ̤Ǿ񤭤ˡ
Ǥʤʤ鲿ⵯޤ 
 Ȥꤢsum()ؿ̥ȤΥ򻲾Ȥ褦ʥեäƻƤߤޤ

 31
50
	public class Main {
		public static void main(String[] args){
		    try {
		        InputStream file = new FileInputStream("data/hello_poi.xls");
		        Workbook book = new HSSFWorkbook(file);
		        FormulaEvaluator feval = book.getCreationHelper().createFormulaEvaluator();
		        Sheet sheet = book.getSheetAt(0);
		        for(int rowIndex = 0; rowIndex < 4; rowIndex++) {
		            Row row = sheet.getRow(rowIndex);
		            for (int colIndex = 0; colIndex < 2; colIndex++) {
	                    Cell cell = row.getCell(colIndex);
	                    String rawValue = cell.toString();
	                    feval.evaluateInCell(cell);
	                    System.out.printf("row=%d, cell=%d, rawValue=%s, evaluatedValue=%s\n" ,
	                            rowIndex, 
	                            colIndex,
	                            rawValue,
	                            cell);
	                }
		        }
		        file.close();
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
		}
	}
  • row=2, cell=1, rawValue=Sheet2!A1, evaluatedValue=̥
  • row=3, cell=1, rawValue=SUM(D1:D3), evaluatedValue=6.0
ȼʬɾ줿̤ǤƤ褦Ǥ
줬ʤˤʤꤽäΤǡ䡼褫ä褫ä



28


Rails3 RestfullʥѤǤ褦ˤ

Rails3Ǥ routes.rbΤ褦ˤʤäƤRestfullʪƤ٤ʤ褦ˤʤäƤޤľ̾Ȥͳ˻ȤΤǡȳƻȤ褦ˤޤ

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id(.:format)))'

äǤ

ܿͤΤȤ

ż֤ߤޤäƻŻ˹ԤʤΤǡȤdzΥ˥塼ȸƤ顢ܤϿ̺ҳ뵭̤ΥȤƤƤޤ
ʤɤǤ顢ܿͤäԻ׵ĤǤʤǤʤȤοãˤȤäƤϤǤʤ褦Ǥ

ޤ޻䤬ɤսȤ椷ƤΤΤޤ󤬡ޤˤ̤ʤΤɤޤǤʤʤ󤫥֥åȤޤȤäƤΤ빽ޤˡ

ΰʲΤ褦ʴ

-------------------------------------------------------------------
ƹä顢ʻάå԰٤Ԥ̵ˡӤˤʤΤˡܤǤϤΤ褦ʥ˥塼ʹʤ
-------------------------------------------------------------------
ܿͤ餷 ̤ˡ餬Ⱥ԰٤ȤȤܤؤȽˤȤ˥塼ʹƤʤ餬ƤΩ夬ȤȤοƤޤ
-------------------------------------------------------------------
ܿͤϼθؤȥץ饤ɤˤάåʤɤϤʤζϾ޻ͤޤ
-------------------------------------------------------------------
άå ʤȤϵʤǤ礦ܤ˲ǯǤޤޤ褿ФκΥ٥35mm֤˺ƤޤäȤޤָäƤߤȡϤޤˤޤϥ٥ˤ櫓ʤȻפäȤȤܤƱνäȤϲλ䤬ʥ餬٥ˤϤ⤦̵ȡ˻פäΤդԻ׵Ĥޤΰ㤤ǤϤफΩǤ礦
-------------------------------------------------------------------
ҤɤΤϤۡ

λ۵ʪ餦Τä¤ֻѤϳοͤˤȤäƴưͿƤ褦ǤǤ⡢餳롢Ȥư˼ܿͤǤ褫äȻפޤ

󡢲лɥܡŪʹ԰٤̵Ȥϻפޤ󤬡Τ褦ʹ԰٤̤ʤΤȡ˾ʤΤȤǤϤä㤤ʤȻפޤ

ż֤Ǥ⡢նƻϩǤ⡢Ǥ⡢ۤӤȤƤäƤ褦ʤ100ǤϤʤǤ礦ɡˡ

ϼ輫Ǥ⤤Ȼפޤ
 
ץե

Ȥ

C#ɻŻRubyФʳȯԡ
ǶDockerȤؿȤAngularJS˥ϥޤäƤ롣
¢ȤĮȤȤ˽ס

QR
QR
  • 饤֥ɥ֥