-
Lawyer Marketing 2011/08/18 14:36
굉장 뽀또! 고마워요 작성 prendre 조건 D' écrire quelque는 뀌 s'avrrre rrtre réellement 듀란테 valeur 시카고 과장되게 떠벌 리다를 결정했습니다. 파악 souvent 소련군하라는 전 정보 무익한 동부 표준시 됐기 quelque는 간략히 설명의 réellement의 appropriées을 결정했습니다. 감사합니다 채우기 겠지만 두어 labeur.
-
Jordan 4 Retro 2012/02/16 15:26
There are many the Jordan Retro IV's on the way. Over a single colorway of this shoe, like a Doernbecher edition, will release this upcoming year. http://www.airjordans4.net/ The White/Black/Grey colorway with the Jordan IV was originally retroed in 1999 and was a massive accomplishment. Retailers saw this shoe sell out inside a matter of hours.
number_to_helper(01020554335)의 경우
0102-055-4335 로 나온다.
그래서 우리나라 스타일로 나오게 고쳐봤다.
고치는 김에 삘받아서 1588-1588같은 경우도 잘 나올 수 있게 만들었다.
{3}은 3글자 연속이라는 의미.
[0-9]{3}은 숫자세개가 연달아 붙어있는 경우.
{2,3}은 1개이상 3개이하 연속이라는 의미.
소괄호는 그룹의 의미.
첫번째 소괄호에서 찾은 단어는 \\1에 대응.
- rails blog
- ruby script/generate post title:string post:text
/app/view/layout/post.html.erb
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Posts: <%= controller.action_name %></title>
<!-- Skin CSS file -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/assets/skins/sam/skin.css">
<!-- Utility Dependencies -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-min.js"></script>
<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.7.0/build/container/container_core-min.js"></script>
<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.7.0/build/editor/simpleeditor-min.js"></script>
<script>
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
var myConfig = {
height: '300px',
width: '800px',
dompath: false,
focusAtStart: false
};
var myEditor = new YAHOO.widget.SimpleEditor('post_post', myConfig);
myEditor.render();
YAHOO.util.Event.on('post_submit', 'click', function () {
myEditor.saveHTML();
var html = myEditor.get('element').value;
alert(html);
});
</script>
</head>
<body class="yui-skin-sam">
<p style="color: green"><%= flash[:notice] %></p>
<%= yield %>
</body>
</html>
/app/view/posts/new.html.erb
<h1>New post</h1>렌더링 후의 html
<% form_for(@post) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :post %><br />
<%= f.text_area :post %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', posts_path %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Posts: new</title>
<!-- Skin CSS file -->
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/assets/skins/sam/skin.css">
<!-- Utility Dependencies -->
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.7.0/build/element/element-min.js"></script>
<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
<script src="http://yui.yahooapis.com/2.7.0/build/container/container_core-min.js"></script>
<!-- Source file for Rich Text Editor-->
<script src="http://yui.yahooapis.com/2.7.0/build/editor/simpleeditor-min.js"></script>
<script>
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;
var myConfig = {
height: '300px',
width: '800px',
dompath: false,
focusAtStart: false
};
var myEditor = new YAHOO.widget.SimpleEditor('post_post', myConfig);
myEditor.render();
YAHOO.util.Event.on('post_submit', 'click', function () {
myEditor.saveHTML();
var html = myEditor.get('element').value;
alert(html);
});
</script>
</head>
<body class="yui-skin-sam">
<p style="color: green"></p>
<h1>New post</h1>
<form action="/posts" class="new_post" id="new_post" method="post"><div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="u6j/QJR03Phz6GkGJ+HrH7Q0ydRmTMfRwqxblGPXf5I=" /></div>
<p>
<label for="post_title">Title</label><br />
<input id="post_title" name="post[title]" size="30" type="text" />
</p>
<p>
<label for="post_post">Post</label><br />
<textarea cols="40" id="post_post" name="post[post]" rows="20"></textarea>
</p>
<p>
<input id="post_submit" name="commit" type="submit" value="Create" />
</p>
</form>
<a href="/posts">Back</a>
</body>
</html>
실행환경
rails version 2.3.2
YUI 2.7.0
자연인의 실행환경: suse리눅스, ruby 1.9, rails 2.2
먼저 ruby-debug를 설치한다.
>> sudo gem install ruby-debugSuccessfully installed ruby-debug-0.10.3
1 gem installed
Installing ri documentation for ruby-debug-0.10.3...
Installing RDoc documentation for ruby-debug-0.10.3...
그담에 config/environments/development.rb에 다음과 같이 삽입한다.
require "ruby-debug"
그담에 디버깅 할 소스코드에 'debugger' 문을 삽입하면 된다.
in app/controllers/story_controller.rb, like so:
def new
@story = Story.new(params[:story])
@story.user = @current_user
if request.post? and @story.save
debugger
@story.tag_with params[:tags] if params[:tags]
flash[:notice] = "Story submission succeeded"
redirect_to :action => 'index'
end
end
그런다음 해당 페이지를 열면 콘솔에 irb같은 것이 나온다. 그게 rdb다
irb처럼 변수명 처 가면서 값 확인하면 된다.
rdb용 명령어
backtrace: Display a trace of the execution stack, similar to what is displayed when your application raises an exception.break/delete: Display a list of breakpoints that have been set in your application. This command is also used to set new breakpoints, or delete existing ones, from within the ruby-debug shell.cont: Leave the current debugger shell and resume execution of the application until the next breakpoint is encountered.irb: Invoke an interactive Ruby interpreter at the current point of execution, similar to the shell used by the breakpoint library.list: Display the code fragments surrounding the current point of execution. (We'll make use of this command in a moment.)method/method instance: Explore the available class methods and instance methods, respectively.next/step: Continue execution one step at a time -- this is a huge improvement over the breakpoint library.p/pp: Short for print and pretty print respectively, these commands can be used to evaluate Ruby expressions and display the value of variables to the console.quit: Exit the debugger. Note that this will also exit the application server if it was invoked from the command line, as demonstrated above. To just exit the current debugging session, usecont.reload: Reload the Ruby source files from disk. This can be useful if you've changed class definitions and want to reload them dynamically without leaving the current debugging session.
<div id="cal1Container"></div>
<script type="text/javascript">
YAHOO.namespace("example.calendar");
YAHOO.example.calendar.init = function() {
//START_WEEKDAY를 0으로 지정해줘야 '일월화수목금토'로 변한다. 1일때는 '월화수목금토일'
YAHOO.example.calendar.cal1 = new YAHOO.widget.CalendarGroup("cal1","cal1Container", { START_WEEKDAY: 0, MULTI_SELECT:false, mindate:"1/1/2009" } );
// 한국식 포맷: yyyy/mm/dd, mm/dd, yyyy/mm
YAHOO.example.calendar.cal1.cfg.setProperty("MDY_YEAR_POSITION", 1);
YAHOO.example.calendar.cal1.cfg.setProperty("MDY_MONTH_POSITION", 2);
YAHOO.example.calendar.cal1.cfg.setProperty("MDY_DAY_POSITION", 3);
YAHOO.example.calendar.cal1.cfg.setProperty("MY_YEAR_POSITION", 1);
YAHOO.example.calendar.cal1.cfg.setProperty("MY_MONTH_POSITION", 2);
// 한국식 월/요일 표기
YAHOO.example.calendar.cal1.cfg.setProperty("MONTHS_SHORT", ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]);
YAHOO.example.calendar.cal1.cfg.setProperty("MONTHS_LONG", ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]);
YAHOO.example.calendar.cal1.cfg.setProperty("WEEKDAYS_1CHAR", ["일","월", "화", "수", "목", "금", "토"]);
YAHOO.example.calendar.cal1.cfg.setProperty("WEEKDAYS_SHORT", ["일","월", "화", "수", "목", "금", "토"]);
YAHOO.example.calendar.cal1.cfg.setProperty("WEEKDAYS_MEDIUM",["일","월", "화", "수", "목", "금", "토"]);
YAHOO.example.calendar.cal1.cfg.setProperty("WEEKDAYS_LONG", ["일요일","월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]);
// 달/해 한국식 표기
YAHOO.example.calendar.cal1.cfg.setProperty("MY_LABEL_YEAR_POSITION", 1);
YAHOO.example.calendar.cal1.cfg.setProperty("MY_LABEL_MONTH_POSITION", 2);
YAHOO.example.calendar.cal1.cfg.setProperty("MY_LABEL_YEAR_SUFFIX", "년");
YAHOO.example.calendar.cal1.cfg.setProperty("MY_LABEL_MONTH_SUFFIX", "");
function handleSelect(type,args,obj) {
var dates = args[0];
var date = dates[0];
var year = date[0], month = date[1], day = date[2];
var selMonth = document.getElementById("start_month");
var selDay = document.getElementById("start_day");
var selYear = document.getElementById("start_year");
selMonth.selectedIndex = month-1;
selDay.selectedIndex = day-1;
// document.getElementById("date1").value = date[1];
for (var y=0; y < selYear.options.length; y++) {
if (selYear.options[y].value == year) {
selYear.selectedIndex = y;
break;
}
}
}
function updateCal() {
var selMonth = document.getElementById("start_month");
var selDay = document.getElementById("start_day");
var selYear = document.getElementById("start_year");
var month = parseInt(selMonth.options[selMonth.selectedIndex].value);
var day = parseInt(selDay.options[selDay.selectedIndex].value);
var year = parseInt(selYear.options[selYear.selectedIndex].value);
if (! isNaN(month) && ! isNaN(day) && ! isNaN(year)) {
var date = year + "/" + month + "/" + day;
document.getElementById("date1").value = date;
YAHOO.example.calendar.cal1.select(date);
YAHOO.example.calendar.cal1.cfg.setProperty("pagedate", year + "/" + month);
YAHOO.example.calendar.cal1.render();
}
}
YAHOO.example.calendar.cal1.selectEvent.subscribe(handleSelect, YAHOO.example.calendar.cal1, true);
YAHOO.example.calendar.cal1.render();
YAHOO.util.Event.addListener(["start_month","start_day","start_year"], "change", updateCal);
}
YAHOO.util.Event.onDOMReady(YAHOO.example.calendar.init);
YAHOO.example.calendar.cal1.selected("1/2/2009")
</script>
<p>날짜
<%= select_datetime(@now,:prefix => 'start', :start_year => @now.year, :end_year => @now.year + 1,
:date_separator => '/', :time_separator => '시', :datetime_separator => '예약시간: ', :discard_minute => true,
:use_month_numbers => true) %>
</p>
<input type="text" name="date1" id="date1" />
<div style="clear:both" ></div>
div박스가 두배씩 길어지던 것.
해결방법을 이제서야 알아냈다.
float 된 div는 display: inline;을 지정해줘야트랙백 거는법도 오늘에서야 알았다.
IE에서 margin 두배 현상이 일어나지 않는다.
그래도 float 된 곳에는 margin을 주지 말자.
그러니까 어떤 포스트를 읽고 반론이나, 동의하는, 혹은 관련된 글을 쓰고 싶을때. 자신의 블로그에서 글을 쓰고, 그 포스트의 트랙백 주소를 입력해서 그 포스트로 정보를 보내는것이 트랙백을 거는 것입니다. 그림에서 쪽지 보내기에 비유한것 처럼요.쪽지 보내는 식이랜다.
장바구니에 누가, 무얼 담았나, 언제 담았나.
정도만 필요할 듯 하다.
장바구니니까 뭔가를 담아야 한다.
누가 담았는지를 모르면 담겨있는 상품이 누구의 것인지를 알 수 없다.
언제 담았는지 알아야 장바구니에 담겨 있는 묵은 상품을 정리 할 수 있다.
또한 장바구니에 담긴 상품에 관한 시계열 분석을 할 수 있을 것이다.
예상되는 테이블의 구조는 다음과 같다.
물품아이디:integer
시간:time
접속지IP:string
시간과 접속지는 옵션이다.
누가 담았나.
보통 우리나라 쇼핑몰은 거의 회원 가입을 유도한다.
그렇게 되면 누가 누군지 구분하기 위해 가입자의 아이디를 적어 넣으면 된다.
그러나 지금 만드는 쇼핑몰은 회원 가입을 따로 받지 않는다.
카트에 담긴 상품이 누구의 것인지를 알기 어려워진다.
누군지 구별하기 위한 임의의 값이 필요하다.
그래서, 처음 '장바구니에 담기'버튼을 눌렀을 때의 시간을 세션으로 저장하여 아이디의 대용으로 쓰려 한다. 그러나 시간만 숫자로 길게 적혀있다면 혹시나 장바구니를 뒤질 일이 있을때 각 고객을 구분하기가 쉽지 않을 것 같다. 우연히도 동일 시간에 '장바구니'버튼을 누르게 될 경우도 있을 것 같고. 그래서 시간 뒤에 랜덤 값, 기왕이면 읽기 쉬운 값을 붙이면 분석이 필요할때 쉽게 사용자를 구분 할 수 있게 될 것이다. 랜덤 값을 뭘로 할까 생각해보았다. 영어사전파일을 구해서 랜덤 단어를 붙일까? 그렇게 되면 읽기 힘든 생소한 단어도 있을것이고, 영어사전 파일도 구해야 한다. 귀찮지 그건. 상품 이름을 아무거나 꺼내와서 붙이면 되겠구나. 지금 만드는 쇼핑몰 같은 경우는 상품군의 가짓수가 500여가지 이상이다.
"#{상품이름랜덤추출}#{Time.now}"을 아이디 대신 세션에 저장하면 비회원 구매자를 위한 아이디로 쓰기에 괜찮을 것이다. 저 값은 순수한 랜덤값이긴 하지만, 저 값을 가진 사람이 해당 상품을 구매했을것이란 착각을 할 수도 있을 것 같은게 단점이긴 하다.
~/$ cat /etc/issue
Ubuntu 8.10
설치 할 애플리케이션 디렉토리로 이동
~/$ cd rentmoa
passenger 설치
~/rentmoa$ sudo gem install passenger
Building native extensions. This could take a while...
Successfully installed passenger-2.0.6
1 gem installed
Installing ri documentation for passenger-2.0.6...
Installing RDoc documentation for passenger-2.0.6...
passenger 설치파일 찾기
~/rentmoa$ sudo find / -name passenger-install-apache2-module
/usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/bin/passenger-install-apache2-module
/usr/bin/passenger-install-apache2-module
설치파일 실행
~/rentmoa$ /usr/bin/passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v2.0.6.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort.
다음단계로
엔터
Checking for required software...
* GNU C++ compiler... found at /usr/bin/g++
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/bin/rake
* Apache 2... found at /usr/sbin/apache2
* Apache 2 development headers... found at /usr/bin/apxs2
* Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config
* Apache Portable Runtime Utility (APR) development headers... found at /usr/bin/apu-1-config
* fastthread... found
* rack... found
--------------------------------------------
--------------------------------------------
Permission problems
퍼미션 문제가 있댄다. sudo 를 주고 실행해야겠다.
Apache 2 development headers 에 문제가 생길수도 있다.
그럴경우 설명이 나온다. 설명에 따라
~/rentmoa$ sudo apt-get install apache2-prefork-dev
를 입력해서 해결하면 된다.
다시입력
~/rentmoa$ /usr/bin/sudo passenger-install-apache2-module
설치가 진행된다.
...
...
...
The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.6
PassengerRuby /usr/bin/ruby1.8
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
Press ENTER to continue.
-
Nike Air Max 2011/09/29 18:23
That you are also likely to study the cultures and subcultures that shape the way in which individuals gown.No doubt, so as to turn into a professional merchandiser, a wonderful want and expertise for this specialty shouldn't be ample. If anyone really wants to get into this career and also have good results in it one needs to obtain the appropriate training and exercise to start with. A merchandising university will be of great support in your case. Do you want to invest your weekend strolling thru flea markets with the most up-to-date retro fashions? Or possibly your pals choose to borrow your fashionable shoes along with your defiant equipment? If so, perhaps you should consider a stroll down the trend runway. Staying a university student in style merchandising, you're going to get a chance to find out extra about fabrics and textiles.
그동안 깔짝깔짝 소개 글만 봤었다. 아는 명령어는 i, :q, :wq, :/검색 뿐이었다.
주위에 누가 쓰는걸 봤어야 자극을 받던지 하지.
좋다고 말만 들었지 실제로 쓰는 사람이 주위에 없다.
오늘 큰집 와서 vi + 레일즈로 검색하고 있는데,
사촌형이 아는체를 한다.
알고보니 사촌형은 회사에서 vi를 사용해 c 코딩을 하고 있었던 것!
윈도용 vi를 윈도+R+·"vi"로 가능하게 세팅을 해주고
vi 안에서 파일을 탐색하는걸 시연해줬다.
우왕 괜찮네.
그래서 얻은 오늘의 검색 결과물이다.
http://delicious.com/onesup/vim
성과라면, vim 설정하는 방법 - 드디어 이해했다; - 과
rails에 맞게 커스터마이징
hkl;, f1, f9 정도가 기억에 남게 되었다는 것이다.
rails -d mysql project_name
-
Coach Purse 2012/01/07 15:29
코치 가죽 지갑은 여러 가지 디자인과 스타일로 만들어집니다. 개인주의를 원하는 모든 여성이 핸드백 조사해야합니다. 그들에 나가 수많은 다른 지갑에 비해도 독특합니다.
-
Jordan 10 Chicago 2012/01/07 15:29
나이키는 항상 그 신발 진짜 가죽을 사용되었는지 확인합니다. 아무도이 신발이 너무 pricy 놀랄 없습니다. 그래서,이게 당신이 구입하기 전에 손에 새 신발에 공부 할 수 밖에 측면이다.
-
Jordan Retro 10 2012/01/07 15:29
그것은 저렴한 가격에이 신발을 찾을 수 있도록 설계하고 각 조던 농구 신발의 개념에 도달하기 위해 많은 사람들이 필요하고하는 것은 어려운 작업이 될 수 있습니다.

Prev

Rss Feed