포인트는.. li의 display : inline


끄면 이렇게 처참하게! 듀둥!


2015/09/16 - [Programming/Javascript / HTML] - ul / li로 메뉴 꾸미기


'Programming > javascript & HTML' 카테고리의 다른 글

HTML5용 슬라이더 바  (0) 2016.01.13
반응형 웹... w3cshool 링크  (0) 2016.01.11
div 쪼금 이해 될락말락...  (0) 2016.01.08
setTimeout()와 setInterval()  (0) 2016.01.07
html5 live video streaming...  (0) 2015.11.23
Posted by 구차니

내가 원하는 레이아웃이 있는데

그걸 만들려고 지금까지 몇달 걸렸던가 ㄷㄷㄷ


얘는 쉬운데..

top;

menu; float

content; float

라면...

얘는 답이 안나온다.. -_-?!?!?


위와 같은 방법으로 하면

이런식으로 깨어지기만 하니까?


결론은.. div로 싸고 싸고 또 싸고 ㅋ

absolute를 하는 것도 방법이지만 고정 위치이고 여러가지 이유로 웬지 끌리지 않으니


menu ; float

container ; float

    top

    content

식으로 하면 깔끔하게 해결!



[링크 : http://yongja.tistory.com/48]

[링크 : http://mkyoon.com/56]

'Programming > javascript & HTML' 카테고리의 다른 글

반응형 웹... w3cshool 링크  (0) 2016.01.11
ul li 메뉴 .. 2?  (0) 2016.01.11
setTimeout()와 setInterval()  (0) 2016.01.07
html5 live video streaming...  (0) 2015.11.23
div span 블럭구조 및 원형테두리  (0) 2015.09.23
Posted by 구차니

서버에서 시간을 받아와서 웹 브라우저 상에서 

setTimeout()으로 구현된 예제를 보고 있노라니..

pc의 시간과 다르게 가서 고민..


생각해보니까

setTimeout은 1회성으로

내부 루틴에서 처리할거 처리하고 지정을 지정하면

조금씩 조금씩 시간이 밀려 날 걸로 예상이 된다.


그런 이유로 setInterval이 조금은 더 정확한 시간간격으로 수행이 가능하지 않을까? 라고 예상


[링크 : http://www.w3schools.com/js/js_timing.asp]



[링크 : http://honjoo.tistory.com/32]

[링크 : http://charlie0301.blogspot.com/2014/11/javascript-timer.html]


<body onload="setInterval(function(){ function1(); function2();}, 500);">

[링크 : http://stackoverflow.com/questions/6660755/can-a-body-tag-hold-multiply-onload-setinterval]



----

setInterval 버전

<body onload="setInterval(function(){realtimeClock();},1000);">


<script type="text/javascript">

var systime = 20;


function realtimeClock()

{

var cTime = new Date((systime++)*1000); // EN672 System Time

svrTime.innerHTML = getTimeStamp(cTime);

}


function getTimeStamp(d)

{

var s = leadingZeros(d.getFullYear(), 4) + '-' +

leadingZeros(d.getMonth() + 1, 2) + '-' +

leadingZeros(d.getDate(), 2) + ' ' +

leadingZeros(d.getHours(), 2) + ':' +

leadingZeros(d.getMinutes(), 2) + ':' +

leadingZeros(d.getSeconds(), 2);

return s;

}


function leadingZeros(n, digits)

{

var zero = '';

n = n.toString();

if (n.length < digits)

{

for (i = 0; i < digits - n.length; i++)

zero += '0';

}

return zero + n;

}

</script>


<div id="svrTime"></div>


</body> 


setTimeout 버전

<body onload="realtimeClock();">


<script type="text/javascript">

var systime = 20;


function realtimeClock()

{

var cTime = new Date((systime++)*1000); // EN672 System Time

svrTime.innerHTML = getTimeStamp(cTime);

setTimeout("realtimeClock()", 1000);

}


function getTimeStamp(d)

{

var s = leadingZeros(d.getFullYear(), 4) + '-' +

leadingZeros(d.getMonth() + 1, 2) + '-' +

leadingZeros(d.getDate(), 2) + ' ' +

leadingZeros(d.getHours(), 2) + ':' +

leadingZeros(d.getMinutes(), 2) + ':' +

leadingZeros(d.getSeconds(), 2);

return s;

}


function leadingZeros(n, digits)

{

var zero = '';

n = n.toString();

if (n.length < digits)

{

for (i = 0; i < digits - n.length; i++)

zero += '0';

}

return zero + n;

}

</script>


<div id="svrTime"></div>


</body> 


완전하진 않지만 대충.. refresh 해서

setInterval은 2초 늦고 setTimeout은 1초 정도 늦게 시작 했으나


setTimeout은 30분이 지난 시점에서 상당히 벗어나 있음

'Programming > javascript & HTML' 카테고리의 다른 글

ul li 메뉴 .. 2?  (0) 2016.01.11
div 쪼금 이해 될락말락...  (0) 2016.01.08
html5 live video streaming...  (0) 2015.11.23
div span 블럭구조 및 원형테두리  (0) 2015.09.23
ul / li로 메뉴 꾸미기  (0) 2015.09.16
Posted by 구차니
Programming/C Win32 MFC2015. 12. 21. 14:54

엥? 이런 넘도 있었나? -ㅁ-?



$ g++ float.c -lm

float.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]

float.c:3:11: error: ‘::main’ must return ‘int’

float.c: In function ‘int main()’:


$ gcc float.c -lm

float.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]

float.c: In function ‘main’:



If you are familiar with C++ and macros, then


#import "Class.h" 

is similar to


{

#pragma once


#include "class.h"

}

[링크 : http://stackoverflow.com/.../what-is-the-difference-between-import-and-include-in-objective-c] 

'Programming > C Win32 MFC' 카테고리의 다른 글

윈도우에서 dll 동적 라이브러리 사용하기  (0) 2016.04.04
가변 매크로 __VA_ARGS__  (0) 2016.03.18
"\n" 의 cpu 점유율?  (0) 2015.10.12
rand()와 RAND_MAX  (0) 2015.10.05
Cppcheck  (0) 2015.09.30
Posted by 구차니
Programming/web 관련2015. 12. 9. 14:51

서버 사이드 스크립트 언어 라고 규정되는데

<!--#directive parameter=value parameter=value -->

위와 같은 문법으로 사용되며 shtml 이라는 확장자로 사용된다(어?)


[링크 : https://en.wikipedia.org/wiki/Server_Side_Includes]


[링크 : https://www.linux.co.kr/unixwebhosting/ssi/index.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi01.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi02.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi03.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi04.htm]

  [링크 : https://www.linux.co.kr/unixwebhosting/ssi/ssi05.htm]

'Programming > web 관련' 카테고리의 다른 글

NPAPI / PPAPI - VLC ...  (0) 2016.01.14
HTML5 video player 720p/1080p 재생여부  (0) 2016.01.13
홈페이지 검증  (0) 2015.09.17
웹 서버별 특징  (0) 2015.09.11
DASH - Dynamic Adaptive Streaming over HTTP  (0) 2015.09.11
Posted by 구차니
Programming/openCV2015. 11. 27. 15:25

혹시 imshow가 바로 그리지 않아서 일려나?

나중에 복사 이후 imshow에서

바로 updateWindow() 해주고

그거까지 묶어줘봐야 겠다


[링크 : http://docs.opencv.org/2.4/modules/highgui/doc/user_interface.html#updatewindow]

'Programming > openCV' 카테고리의 다른 글

opencv stitch  (0) 2016.07.14
opencv rtsp  (0) 2016.07.13
openMP + openCV 미스테리..  (0) 2015.11.09
휴 모멘트?  (0) 2015.10.20
opencv 카메라 왜곡 수정  (0) 2015.10.20
Posted by 구차니

canvas에 직접 그리는 느낌이긴한데..

차이점은 모르겠지만...


html5의 video 태그가 live video는 안되는데 반해

웹소켓을 통해서 전송해주고

office-ambient.mpg 파일로 해서 스트리밍을 하는 것 같긴한데 ... 흐음...


[링크 : http://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets]

'Programming > javascript & HTML' 카테고리의 다른 글

div 쪼금 이해 될락말락...  (0) 2016.01.08
setTimeout()와 setInterval()  (0) 2016.01.07
div span 블럭구조 및 원형테두리  (0) 2015.09.23
ul / li로 메뉴 꾸미기  (0) 2015.09.16
<link> 관련 약어 정리  (0) 2015.09.14
Posted by 구차니
Programming/openMP2015. 11. 10. 09:43



[링크 : http://stackoverflow.com/questions/2396430/how-to-use-lock-in-openmp]

[링크 : https://computing.llnl.gov/tutorials/openMP/#OMP_SET_LOCK]


[링크 : http://www.mathcs.emory.edu/~cheung/Courses/355/Syllabus/91-pthreads/openMP.html]

'Programming > openMP' 카테고리의 다른 글

openMP g++ -E -S  (2) 2015.10.12
openmp 관련 정리글(win32)  (0) 2015.10.08
openmp 테스트 on rpi  (0) 2015.10.06
openCV + openMP  (0) 2015.09.30
openMP affinity 관련..  (0) 2015.07.23
Posted by 구차니
Programming/openCV2015. 11. 9. 11:30

되거나


안되거나

OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /usr/src/packages/BUILD/opencv-2.4.1+dfsg/modules/core/src/array.cpp, line 2482

terminate called after throwing an instance of 'cv::Exception'

  what():  /usr/src/packages/BUILD/opencv-2.4.1+dfsg/modules/core/src/array.cpp:2482: error: (-206) Unrecognized or unsupported array type in function cvGetMat 


소스는 간단한데..

구동이 될때도 있고 안될때도 있고.. 머지?


+2015.11.10

생각해보니 mutex 변수는 별도 프로세스에서 공유가 안되니..

실질적으로는 lock이 안되는 걸지도?


$ cat cvmp.cpp

#include <opencv2/core/core.hpp>

#include <opencv2/highgui/highgui.hpp>

#include <iostream>

#include <mutex>

#include <omp.h>


#define WIN_CAPT        "capture"

#define WIN_PROC        "process"

#define WIN_DISP        "display"


using namespace cv;

using namespace std;


Mat vcap;

Mat vproc;

Mat vdisp;


VideoCapture cap;


std::mutex mproc;

std::mutex mdisp;


void init_wiringpi()

{

}


void init_video()

{

        cap.open(0);

        if(cap.isOpened())

        {

                cap.set(CV_CAP_PROP_FRAME_WIDTH, 320);

                cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240);

        }

}


void video_capture()

{

        mproc.lock();

                cap.read(vcap);

               imshow(WIN_CAPT, vcap);

        mproc.unlock();

}


void video_process()

{

        mproc.lock();

                vcap.copyTo(vproc);

        mproc.unlock();

        imshow(WIN_PROC, vproc);

}


void video_display()

{

        mdisp.lock();

                vproc.copyTo(vdisp);

        mdisp.unlock();

        imshow(WIN_DISP, vdisp);

}


int main(int argc, char **argv)

{

        init_wiringpi();

        init_video();


        namedWindow(WIN_CAPT, WINDOW_AUTOSIZE );

        namedWindow(WIN_PROC, WINDOW_AUTOSIZE );


        for(;;)

        {

                #pragma omp parallel sections

                {

                        #pragma omp section

                        {

                                video_capture();

                        }

                        #pragma omp section

                        {

                                video_process();

                        }

                }


                if(waitKey(30) >= 0) break;

        }


        return 0;

} 


아무튼.. 멀티프로세스로 돌아가는 가는데

$ pstree

     ├─sshd─┬─sshd───sshd───bash───cvmp.o───3*[{cvmp.o}]

     │      └─sshd───sshd───bash───pstree


htop 상으로는 그닥.. 분리되는 기분이 안든다고 해야하나...?

top으로 보면 조금 분리되서 cpu를 잡아먹는거 같긴하다.

$ top

top - 11:42:15 up  2:32,  2 users,  load average: 0.62, 0.24, 0.16

Tasks: 111 total,   2 running, 109 sleeping,   0 stopped,   0 zombie

%Cpu0  : 45.3 us,  4.3 sy,  0.0 ni, 47.0 id,  0.0 wa,  0.0 hi,  3.3 si,  0.0 st

%Cpu1  : 11.0 us,  0.3 sy,  0.0 ni, 88.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st

%Cpu2  : 33.1 us,  1.4 sy,  0.0 ni, 65.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st

%Cpu3  :  4.0 us,  0.0 sy,  0.0 ni, 95.7 id,  0.0 wa,  0.0 hi,  0.3 si,  0.0 st

KiB Mem:    883160 total,   182500 used,   700660 free,    19316 buffers

KiB Swap:   102396 total,        0 used,   102396 free,   102840 cached


그나저나 mutex가 제대로 되는진 어떻게 검증하지? ㅠㅠ



+

[링크 : http://what-the-pixel.blogspot.kr/2013/05/getting-started-with-openmp.html]

'Programming > openCV' 카테고리의 다른 글

opencv rtsp  (0) 2016.07.13
openMP + openCV 실패한 이유가..  (0) 2015.11.27
휴 모멘트?  (0) 2015.10.20
opencv 카메라 왜곡 수정  (0) 2015.10.20
opencv sift surf  (0) 2015.10.20
Posted by 구차니
Programming2015. 10. 21. 10:52

먼가해서 찾아봐도.. 일본식 조어인가?

多倍長整数

多 (많을 다)

倍 (곱 배, 등질 패)

長 (길 장, 어른 장)

整 (가지런할 정)

数 (셈 수, 자주 삭, 촘촘할 촉)


[링크 : https://en.wikipedia.org/wiki/Arbitrary-precision_arithmetic] >> 일본어 판으로


gmp 라는 녀석으로 gnu 라이브러리 존재

[링크 : https://gmplib.org/]

'Programming' 카테고리의 다른 글

swift 문법(함수/변수)  (0) 2014.06.08
apple 차세대 언어 swift  (0) 2014.06.03
ARToolKit / openVRML  (0) 2012.12.25
윤년 계산하기  (2) 2012.05.21
TBB/IPP  (2) 2012.02.12
Posted by 구차니