본문 바로가기
[PHP] 배열( array ) tutorial PHP Tutorial 배열 =====생성 $products = array ( 'Tires', 'Oil', 'Spark Plugs' );$numbers = range( 1, 10 );$odds = range( 1, 10, 2 );$letters = range( 'a', 'z' ); =====배열 element 추가 배열은 길이 상관없이 추가하는 것도 가능하고, 정의없이 사용하는 것도 가능하다. $products[4] = 'Fuses';$products2[0] = 'Good Tires'; =====foreach foreach( $products as $current ) 위와 같은 방식으로 foreach 를 쓰는 것이 general 하다. =====key-value array $prices = array( .. 2013. 11. 21.
[Java] 언제 ArrayList 써야 하고 언제 LinkedList 를 써야 하나? 자바, 언제 ArrayList 써야 하고 언제 LinkedList 를 써야 하나? ArrayList 이야기 ArrayList 는 일반 Array 와 비슷한 구조로 되어 있다.따라서 예를 들어 총 5개의 원소가 있는 ArrayList 가 있는 경우, 첫번째 있는 element 를 제거할 경우 뒤에 있는 4개의 원소를 한칸씩 앞으로 복사해야 하는 문제가 발생한다. 반면 맨 뒤쪽에 element 를 추가 삭제하는 경우에는 성능이슈가 발생하지 않는다. element 에 접속할 때는 일반 array 와 같이 일관성 있게 memory 에 접근할 수 있어 특정 element에 바로 접근할 수 있다. LinkedList 이야기 반면 LinkedList 의 경우는 한 element 간의 관계가 사슬처럼 이어져 있는 형태.. 2013. 9. 20.
[jQuery/Tutorial] Selector 를 통해 Element 선택하기. Selector 를 통해 Element 선택하기. [이전강좌] DOM의 Attributes 사용하기. jQuery 는 CSS3 가 제공하는 selector 대부분을 지원하고, 이외의 특별한 selector 들도 제공한다. ID 로 선택하기 $("#myID"); Class 이름으로 선택하기 $(".myClass"); Attribute 값으로 선택하기 $("a[href='newHtml.html']"); CSS 복합 selector 로 선택하기 $("#myID ul.myClass li"); Pseudo-selector $("a.external:first"); // external 이라는 class 를 가진 첫번쨰녀석$("tr:odd"); // tr 의 홀수번째 녀석들. $("#myForm:input") // .. 2013. 7. 17.
jQuery, CSS Selector 모음 ( Reference ) jQuery, CSS Selector 모음 ( Reference ) 출처 : w3 스쿨 Selector Example Selects * $("*") All elements #id $("#lastname") The element with id="lastname" .class $(".intro") All elements with class="intro" .class,.class $(".intro,.demo") All elements with the class "intro" or "demo" element $("p") All elements el1,el2,el3 $("h1,div,p") All , and elements :first $("p:first") The first element :last $("p:l.. 2013. 6. 16.
[CSS] position 속성에 대해 알아보자. CSS, position 속성에 대해 알아보자. CSS property 중에 position 값에 relative 라는 녀석을 만나게 되었다.이 녀석은 뭐하는 녀석일까? 궁금해하다 position 속성 자체에 대해 공부하게 되었다. position 값에 들어갈 수 있는 값은 static, absolute, relative, fixed, inherit 이다. position:static static 값은 기본값이기 때문에 position 값을 써주지 않으면, 자동으로 static position이 된다.이 static position은, 화면의 왼쪽상단부터 element 들을 배치한다.최초 element는 최좌상단에, 그리고 그 다음 element 는 그 오른쪽에 붙는데 만약 공간이 부족하다거나, bloc.. 2013. 6. 15.
반응형