출처 : https://www.raspberrypi.org/blog/raspberry-pi-zero-w-joins-family/


라즈베리파이 ZERO W 출시



기존 라즈베리파이에 무선랜, 블루투스가 추가된 모델임에도 불구하고 가격은 10$




스팩


1GHz, single-core CPU

512MB RAM

Mini-HDMI port

Micro-USB On-The-Go port

Micro-USB power

HAT-compatible 40-pin header

Composite video and reset headers

CSI camera connector

802.11n wireless LAN

Bluetooth 4.0


공식 케이스


앞면이 카메라, 핀 연결, 덮개 형태로 구성되어 있어 쓰임새에 맞게 활용할 수 있도록 되어 있다.



아래 속성값을 활용하여 


아래와 같이 활용할 수 있다.


1
2
3
body {
    cursor : pointer;
}
cs


alias

all-scroll

auto

cell

context-menu

col-resize

copy

crosshair

default

e-resize

ew-resize

grab

grabbing

help

move

n-resize

ne-resize

nesw-resize

ns-resize

nw-resize

nwse-resize

no-drop

none

not-allowed

pointer

progress

row-resize

s-resize

se-resize

sw-resize

text

url(smiley.gif),url(myBall.cur),auto

vertical-text

w-resize

wait

zoom-in

zoom-out

initial


출처 : https://www.w3schools.com/cssref/pr_class_cursor.asp

역시 고가의 제품을 사전에 파악도 안하고 만든것이 문제 인거 같았다.


지금 만들고 있는 매직미러는 사전/후 조사를 잘해야 될거 같음.


에몬스 등 가구업계가 시도한 IoT 거울 '매직미러' 판매 중단


출처 : http://biz.newdaily.co.kr/news/article.html?no=10124472




CSS로

selector { cursor: none; }

예시

<div class="nocursor">
 <!-- some stuff -->
</div>
<style type="text/css">
    .nocursor { cursor:none; }
</style>

자바스크립트로 처리한 예제 (특정 DIV 구간에만 적용)

<div id="nocursor"><!-- some stuff --></div>
<script type="text/javascript">
    document.getElementById('nocursor').style.cursor = 'none';
</script>

BODY  전체에 적용한 예제

<script type="text/javascript">
    document.body.style.cursor = 'none';
</script>

참조, 마우스 감추기를 하면 타인에게 화를 불러들일 수 있음 !


출처 : http://stackoverflow.com/questions/1071356/is-it-possible-to-hide-the-cursor-in-a-webpage-using-css-or-javascript



날짜 유효성 검증


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
/* 날짜 관련 유틸리티 */
const WsDate = {
        
    /* 날짜 일 수 관련 배열 */
    WS_DAYS : [31,28,31,30,31,30,31,31,30,31,30,31],
    
    /* 유효한 날짜인지 여부 검사 */
    isValid : function(yyyymmdd){
        if!yyyymmdd.match(/^[0-9]{8}$/) ){
            return false;
        }
 
        var yyyy = yyyymmdd.substr(0,4);
        var mm = yyyymmdd.substr(4,2);
        var dd = yyyymmdd.substr(6,2);
 
        // 윤년에 2월 계산 
        if(this.isLeaf(yyyy) && mm == 2){
            if(dd <= this.WS_DAYS[mm-1+ 1){
                return true;
            }
        }
 
        // 그 외
        if(dd <= this.WS_DAYS[mm-1] ){
            return true;
        }
 
        return false;
    },
    
    /* 윤년 여부 검사 */
    isLeaf : function(yyyy){
        if( yyyy%4==){
            if( yyyy%400==){
                return true;
            }
            if( yyyy%100==){
                return false;
            }
            return true;
        }
        return false
    },
    
};
cs


파이썬 카메라 관련 메뉴얼 링크


시작하기

https://www.raspberrypi.org/learning/getting-started-with-picamera/worksheet/


관련 메뉴얼

https://picamera.readthedocs.io/en/release-1.12/install.html





[설치]


#1 소스 다운로드 받아서 컴파일하는 방법 

http://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/


#2 그냥 리파지토리에서 다운로드 받아 설치 하는 방법 

http://cosmosjs.blog.me/220723901506


물론 2번이 쉽다.


$ sudo apt-get install libopencv-dev python-opencv


[장단점 정리]


#1) 소스컴파일 

장점 

  최신버전 사용가능 2017년 2월 현재 3.2.0 버전 사용 가능  


단점

  느리다 : 대략 반나절 이상 걸림, python2.7 버전용 / 3.4에서 안됨


#2) apt-get 

장점

  빠르다 : 1분도 안되서 가능


단점

  구식 버전임 2017년 2월 현재 2.4.9.1 버전을 다운로드 받음


[총평]


일단 apt-get으로 다운로드 받아서 감좀 익혀 본 이후 소스 컴파일 하여 cv2.so 파일을 site-packages에 넣어 사용하는 방법을 추천 함.


[기타링크]


imutils 사용 예제 - opencv 활용 유틸리티 메소드

http://www.pyimagesearch.com/2015/02/02/just-open-sourced-personal-imutils-package-series-opencv-convenience-functions/

컨피그 설정 페이지 #3을 추가하면 된다.


#1 : 스프링 어플리케이션 시작 

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}


#2 : 컨트롤러 생성

@Controller
public class GreetingController {
    @RequestMapping("/greeting")
    public String greeting() {
        return "greeting";
    }
}


#3 : 뷰리졸버 설정

@Configuration
@EnableWebMvc
public class MvcConfiguration extends WebMvcConfigurerAdapter{
    @Bean
    public ViewResolver getViewResolver() {
        InternalResourceViewResolver resolver = new InternalResourceViewResolver();
        resolver.setPrefix("/WEB-INF/");
        resolver.setSuffix(".html");
        return resolver;
    }

    @Override
    public void configureDefaultServletHandling(
            DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }    
}


출처 : http://stackoverflow.com/questions/29953245/configure-viewresolver-with-spring-boot-and-annotations-gives-no-mapping-found-f

요약하면, 생성자는 ModelAndView(View, Pointer, Holder); 형태로 구성이 되어 있으며

화면(View)에 그것을 가르치는(Pointer)것에 내용을 담아서(Holder) 설정하는 것이다.


Here in this case, we are having 3 parameter's in the Method namely ModelandView

According to this question, the first parameter is easily understood from the question. It represents the View which will be displayed to the client.
The other two parameters are just like The Pointer and The Holder
Hence you can sum it up like this 

ModelAndView(View, Pointer, Holder);

The Pointer just points the information in the The Holder

When the Controller binds the View with this information, then in the said process, you can use The Pointer in the JSP page to access the information stored in The Holder to display that respected information to the client. 
Here is the visual depiction of the respected process.



출처 : http://stackoverflow.com/questions/5055358/what-is-model-in-modelandview-from-spring-mvc


설정 방식으로 적용하는 예제


@Configuration
public class MyConfiguration {

    @Bean
    public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurerAdapter() {
            @Override
            public void addCorsMappings(CorsRegistry registry) {
                registry.addMapping("/api/**");
            }
        };
    }
}


Filter 방식으로 적용하는 예제


@Configuration
public class MyConfiguration {

	@Bean
	public FilterRegistrationBean corsFilter() {
		UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
		CorsConfiguration config = new CorsConfiguration();
		config.setAllowCredentials(true);
		config.addAllowedOrigin("http://domain1.com");
		config.addAllowedHeader("*");
		config.addAllowedMethod("*");
		source.registerCorsConfiguration("/**", config);
		FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
		bean.setOrder(0);
		return bean;
	}
}


출처 :

https://spring.io/blog/2015/06/08/cors-support-in-spring-framework

+ Recent posts