1 2 3 4 5 6 7 8 9 10 11 12 |
#include <stdio.h> int main() { char s[200]; scanf("%[^\n]", s); printf("output : %s\n", s); return 0; } |
1 2 3 4 5 6 7 8 9 10 11 12 |
#include <stdio.h> int main() { char s[200]; scanf("%[^\n]", s); printf("output : %s\n", s); return 0; } |
HTML의 DOM이 완성된 이후에, 사용자 동작에 의해 jQuery나 JavaScript로 Text, Button, Select 등의 Element를 간혹 만드는 경우가 있습니다.
이렇게 만들어진 Element에 클릭을 한다던가, 마우스 오버를 했을 때의 동작을 제어가 필요할 때가 있습니다.
이렇게 생성된 Element는 $(document).ready(function() { … } 에서 선택자로 미리 선택하였을 때는, DOM에 해당 Element가 없기 때문에 Listener가 작동하지 않습니다.
이럴 때 아래와 같은 방법으로 하시면 되겠습니다.
1 2 3 |
$(document).on("click", ".save_store", function() { alert("까꿍!"); }); |
사용자가 생성하게 될 Element에 class의 이름을 선택하여 사용 할 수 있습니다.
(“save_store”는 사용자가 생성하는 버튼의 class 입니다.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
<!DOCTYPE html> <html> <head> <title>Maps Project</title> <style> #map-canvas { width: 500px; height: 400px; background-color: #CCC; } </style> <script src="https://maps.googleapis.com/maps/api/js"></script> <script> function initialize() { var mapCanvas = document.getElementById('map-canvas'); var myLatlng = new google.maps.LatLng(35.1466317,129.0596543); // 위경도 설정 var mapOptions = { // 구글 맵 옵션 center: myLatlng, zoom: 16, mapTypeId: google.maps.MapTypeId.ROADMAP }; // 구글 맵 생성 var map = new google.maps.Map(mapCanvas, mapOptions); var contentString = '<div style="width:100px;height:50px;">SSM</div>'; // 말풍선 내용 var infowindow = new google.maps.InfoWindow({ content: contentString, size: new google.maps.Size(200,100) }); var marker = new google.maps.Marker({ position: myLatlng, map: map, draggable:true, // 마커 드래그 가능 title: 'Hello World!' // 마커 : 도움말 풍선(마우스 오버 시) }); google.maps.event.addListener(marker, 'click', function() { infowindow.open(map, marker); if (marker.getAnimation() != null) { marker.setAnimation(null); } else { marker.setAnimation(google.maps.Animation.BOUNCE); } }); marker.setMap(map); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="map-canvas"></div> </body> </html> |
기본적인 구글 맵 셋팅 입니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<!DOCTYPE html> <html> <head> <title>Maps Project</title> <style> #map-canvas { width: 500px; height: 400px; background-color: #CCC; } </style> <script src="https://maps.googleapis.com/maps/api/js"></script> <script> function initialize() { var mapCanvas = document.getElementById('map-canvas'); var mapOptions = { center: new google.maps.LatLng(35.1466317,129.0596543), zoom: 16, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(mapCanvas, mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); </script> </head> <body> <div id="map-canvas"></div> </body> </html> |
옵션으로 zoom은 “0~22″ 사이의 레벨로 설정 할수 있고, mapTypeId는 “ROADMAP, SATELLITE, HYBRID, TERRAIN”으로 지정 할 수 있습니다.
웹 환경에서 C, C++ 컴파일을 제공하는 서비스를 구현하고자 합니다.
말 그대로 내 컴퓨터에 컴파일러를 설치하지 않고, 웹에서 C, C++ 프로그램을 컴파일 하여 실행 결과를 화면에 출력하는 것이 목적입니다.
이미 http://sphere-engine.com/ 에서 판매하는 제품도있고, http://ideone.com/ 에서도 가능 합니다.
이 사이트들을 모토로 삼아 개발 하고자 합니다.
개발 할 때의 문제점, 진행 상황들을 포스트 할 예정입니다.
보안 적인 문제점들이 많이 걱정 되나, 일단은 적당한 수준 까지 개발 후에 신경 쓰려고 합니다.