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

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 구차니
회사일/uclinux & rtos2016. 1. 6. 15:49


아직까지는 찾지를 못함..

직접 구현해야 하려나?


mjpeg 카메라 영상인데...

[링크 : http://141.89.114.98/demo/edu640x480v.html] mjpeg 예제


안드로이드(갤S2 LTE HD)는 그냥 다운로드..(재생불가)

IE 11 (edge)재생불가

IE 10 이하 재생불가


아이패드는 재생

크롬 재생

VLC 재생


It is natively supported by the QuickTime Player, the PlayStation console, and web browsers such as Safari, Google Chrome, and Mozilla Firefox.

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


M-JPEG over HTTP

HTTP streaming separates each image into individual HTTP replies on a specified marker. RTP streaming creates packets of a sequence of JPEG images that can be received by clients such as QuickTime or VLC.


In response to a GET request for a MJPEG file or stream, the server streams the sequence of JPEG frames over HTTP. A special mime-type content type multipart/x-mixed-replace;boundary=<boundary-name> informs the client to expect several parts (frames) as an answer delimited by <boundary-name>. This boundary name is expressly disclosed within the MIME-type declaration itself. The TCP connection is not closed as long as the client wants to receive new frames and the server wants to provide new frames. Two basic implementations of a M-JPEG streaming server are cambozola and MJPG-Streamer. The more robust ffmpeg-server also provides M-JPEG streaming support.

[링크 : https://en.wikipedia.org/wiki/Motion_JPEG#M-JPEG_over_HTTP]


VLC로 raw 덤프해서 보니...

--myboundary

Content-type: image/jpeg

이렇게 시작하고 그 아래로는 깨지는걸 봐서는 그냥 jpeg 프레임인듯..



심심..(?)해서 저기 MIME 관련 헤더들 삭제하고 jpeg으로 저장하니

아래와 같이 똮!



저장을 좀 오래 하니

--myboundary

Content-type: image/jpeg

가 반복적으로 나타난다.


video/x-jpegMotion-JPEG video.   There are currently no specific properties defined or needed for this type. Note that video/x-jpeg only applies to Motion-JPEG pictures (YUY2 colourspace). RGB colourspace JPEG images are referred to as image/jpeg (JPEG image).

[링크 : http://gstreamer.freedesktop.org/.../section-types-definitions.html#table-video-types]

    [링크 : http://stackoverflow.com/.../correct-mime-type-for-multipart-mjpeg-stream-over-http]




HTTP/1.0 200 OK

Server: en.code-bude.net example server

Cache-Control: no-cache

Cache-Control: private

Content-Type: multipart/x-mixed-replace;boundary=--boundary

 

--boundary

Content-Type: image/jpeg

Content-Length: [length of the image bytes]

 

[write jpeg bytes]

 

--boundary

Content-Type: image/jpeg

Content-Length: [length of the image bytes]

 

[write jpeg bytes]

 

[...] 


[링크 : http://en.code-bude.net/tag/how-does-mjpeg-work/]



mjpeg streamer

[링크 : http://www.acmesystems.it/video_streaming]

'회사일 > uclinux & rtos' 카테고리의 다른 글

freeRTOS + lwip or freeRTOS+TCP  (0) 2016.01.06
비선점형 마이컴 OS - csrtos  (0) 2015.11.12
uclinux / linux 벤치마킹  (0) 2015.11.11
µC/OS-II  (0) 2015.11.11
uclinux  (0) 2015.11.10
Posted by 구차니
회사일/uclinux & rtos2016. 1. 6. 15:16

두개에 대한 벤치마크는 안보이지만...

어느걸 택하던 상관없다 일려나?(좋은 의미던 나쁜 의미던..)


lwIP


lwIP is also a good stack when used in its intended, memory constrained, environment. It has a higher throughput than uIP, but also has a larger ROM and RAM footprint. Although the footprint is larger than uIP it is still smaller than most commercial TCP/IP offerings. In particular, lwIP saves RAM by making large data buffers by chaining smaller buffers together.

Most (if not all) the FreeRTOS demos listed here make use of quite an old lwIP version. There are however contributed demos available in the FreeRTOS Interactive forums that use a more up to date lwIP code base. Further lwIP related uploads would be gratefully received.


On the negative side, lwIP is undeniably quite complex to use at first, but time invested in its use will pay dividends in future projects. lwIP is also a moving target because it is constantly being developed and updated (which is not necessarily a negative thing).


[링크 : http://www.freertos.org/embeddedtcp.html]

[링크 : http://lwip.wikia.com/wiki/LwIP_Application_Developers_Manual]

[링크 : http://lwip.wikia.com/wiki/LwIP_Wiki]

freeRTOS+TCP 패키지

[링크 : http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/index.html]

'회사일 > uclinux & rtos' 카테고리의 다른 글

lwip RTSP over HTTP 가능성?  (0) 2016.01.06
비선점형 마이컴 OS - csrtos  (0) 2015.11.12
uclinux / linux 벤치마킹  (0) 2015.11.11
µC/OS-II  (0) 2015.11.11
uclinux  (0) 2015.11.10
Posted by 구차니
하드웨어/Storage2016. 1. 5. 13:29

음.. 5000번 포트 돌리고

외부에서 접속하게 하니 나쁘진 않은데..

자막이 안되네? ㅠㅠ


일단 동영상 / jpg 파일은 꽤 편리하게 보인다.

(안드로이드건-갤S2 LTE- 아이패드건 자막은 안된다)

zip은 메뉴가 떠서 아쉽지만...



[링크 : https://itunes.apple.com/us/app/ds-file/id416751772?mt=8]

[링크 : https://play.google.com/store/apps/details?id=com.synology.DSfile&hl=ko]

'하드웨어 > Storage' 카테고리의 다른 글

ipad용 ds file srt 자막 보기  (0) 2016.02.05
raid01 raid10  (0) 2016.01.31
synology undelete 시도 T.T  (0) 2015.12.27
synology port  (0) 2015.12.22
synology DS213j SVN server 설치  (0) 2015.10.19
Posted by 구차니
embeded/raspberry pi2016. 1. 5. 09:43

에뮬레이터 배포판(?)


[링크 : http://blog.petrockblock.com/retropie/]

[링크 : http://blog.petrockblock.com/retropie/retropie-downloads/]

'embeded > raspberry pi' 카테고리의 다른 글

지름신 강림! - 라즈베리 2b(본체만)  (0) 2016.03.10
라즈베리 3B?  (0) 2016.03.06
openELEC 6.0.0 릴리즈  (0) 2016.01.03
라즈베리 2b lirc + openELEC 설정  (0) 2015.12.12
라즈베리 파이 zero...???  (0) 2015.11.27
Posted by 구차니
Linux/Ubuntu2016. 1. 4. 17:55

network-manager가 기본이긴 하나..

wpa2가 안된다고하니 wicd를 써보라는 지인의 조언...


[링크 : https://help.ubuntu.com/community/WICD]

[링크 : http://wicd.sourceforge.net/]

-> [링크 : https://launchpad.net/wicd]



+

UI만 바뀌지 그게 그거인 기분..

어짜피 안 잡힐놈은 안 잡히는건 동일한건가..

'Linux > Ubuntu' 카테고리의 다른 글

LXDE 에서는... XDMCP 미지원?  (0) 2016.02.04
xdrp  (0) 2016.02.02
리눅스 콘솔 한글 출력?  (0) 2016.01.04
debian openbox 단축키  (0) 2016.01.04
lubuntu xtem scrollbar  (0) 2016.01.02
Posted by 구차니
Linux/Ubuntu2016. 1. 4. 17:30

될려나.. 나중에 해봐야지


LANG="ko_KR.eucKR"

SUPPORTED="en_US.UTF-8:en_US:en:ko_KR.eucKR:ko_KR:ko"

SYSFONT="lat0-sun16"

SYSFONTACM="8859-15"

[링크 : http://compeople.tistory.com/68]


/etc/sysconfig/i18n

LANG="en_US.UTF-8" 

SUPPORTED="en_US.UTF-8:en_US:en" 

SYSFONT="latarcyrheb-sun16"

[링크 : https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s2-sysconfig-i18n.html]


LANG="ko_KR.UTF-8"

SYSFONT="latarcyrheb-sun16"

[링크 : http://iwithjoy.tistory.com/entry/CentOS-ssh-접속-한글깨짐-수정]



+

$ ls -al /usr/share/consolefonts


$ vi /etc/default/console-setup

# Valid font faces are: VGA (sizes 8, 14 and 16), Terminus (sizes

# 12x6, 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBold (sizes

# 14, 16, 20x10, 24x12, 28x14 and 32x16), TerminusBoldVGA (sizes 14

# and 16) and Fixed (sizes 13, 14, 15, 16 and 18).  Only when

# CODESET=Ethiopian: Goha (sizes 12, 14 and 16) and

# GohaClassic (sizes 12, 14 and 16).

# Set FONTFACE and FONTSIZE to empty strings if you want setupcon to

# set up the keyboard but to leave the console font unchanged.

FONTFACE="Fixed"

FONTSIZE="16"


# You can also directly specify nonstandard font or console map to load.

# Use space as separator if you want to load more than one font.

# You can use FONT_MAP in order to specify the Unicode map of the font

# in case the font doesn't have it embedded.


# FONT='lat9w-08.psf.gz brl-8x8.psf'

# FONT_MAP=/usr/share/consoletrans/lat9u.uni

# CONSOLE_MAP=/usr/local/share/consoletrans/my_special_encoding.acm


# You can also specify a screen size that setupcon will enforce.  This can not

# exceed what the current screen resolution can display according to the size of

# the loaded font.

#

# SCREEN_WIDTH=80

# SCREEN_HEIGHT=25



$ consolechars
The program 'consolechars' is currently not installed.  To run 'consolechars' please ask your administrator to install the package 'console-tools'


[링크 : http://unix.stackexchange.com/questions/30855/how-to-list-console-and-kernel-fonts]


'Linux > Ubuntu' 카테고리의 다른 글

xdrp  (0) 2016.02.02
wicd / network-manager ?  (0) 2016.01.04
debian openbox 단축키  (0) 2016.01.04
lubuntu xtem scrollbar  (0) 2016.01.02
으악 lubuntu 였지 ㅋㅋㅋ  (0) 2015.12.30
Posted by 구차니

부디.. 67mm 컨버터 링에 맞길 ㅠㅠ

(무려 해외주문인데 ㅠㅠ)


이게 정상적으로 작동하면.. sx50hs가 50배에서 100배! ㄷㄷㄷ


[링크 : http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=A963806614]

'개소리 왈왈 > 사진과 수다' 카테고리의 다른 글

해피해피 똥강아지  (0) 2016.05.11
오래되어 간 것들에 대한 안타까움  (0) 2016.05.11
꽃과 개와 사진  (0) 2015.05.17
폭설  (0) 2015.01.18
10km 상공에서의 해맞이  (2) 2014.10.31
Posted by 구차니

출근길에 잠시 켜서 잡아 봤는데..

켜지는데 한 45초?

여전히 터치는 날뛰어서 쓰기 힘들고

그나마.. ctrl-alt-f6 ctrl-alt-f7을 통해 터미널 변경하면 마우스는 다시 진정하니

약간은 우회가 가능한 수준..

그래도 드래그는 못하니 무리무리..


예전에 막 죽어나가던 녀석을 포맷해서 해보니 10개도 잡긴한데..

드라이버 문제일것 같지만..

2014/12/26 - [개소리 왈왈/컴퓨터 / 노트북] - umid mbook m1 무선랜 .. 윈도우 XP용 드라이버가 문제인가?


잡히는 wifi 수가 너무 적을때가 많고 회사 wifi가 안 잡혀서 고민해보니..
WPA2 라서 인식을 못하는건가 싶은데.. 다르게 말하면
WPA2는 칩셋에서는 지원을 안하고 억지로 적용하려다 보니 뻗는 걸려나 싶기도 하고..

[링크 : http://www.marvell.com/wireless/assets/8686.pdf]





+ 수동으로 opengalax 설치 모니터 터치 됨

- 터치 좌표 날뜀, 드래그는 실질적 불가

- 날뛸때는 터미널 바꾸었다 돌아오면 복구는 가능

- wifi가 잘 안됨(내장 / 버팔로 외장 모두) 리눅스 드라이버 문제인가...




+ add

[링크 : https://wikidevi.com/wiki/Wireless_adapters/Chipset_table]

[링크 : https://wireless.wiki.kernel.org/en/users/Drivers/libertas]

 -> [링크 : http://linuxwireless.sipsolutions.net/en/users/Drivers/libertas/]


+

- 무선랜 marvell sd8686 sdio 칩셋 설치 방법 : /lib/firmware/sd8686.bin과 sd8686_helper.bin 파일이 있어야 하는데... sudo apt-get install firmware-libertas 로 설치해주면 suspend 모드만 빼고는 잘 작동한다.

[링크 : http://cafe.naver.com/umid/16190]



+ wli-uc-gnm 관련(버팔로 usb)

sudo apt-get install firmware-ralink

[링크 : http://dogwood.skr.jp/blog/2013/06/46/]

[링크 : https://wiki.debian.org/rt2800usb]

[링크 : https://help.ubuntu.com/community/HardwareSupportComponentsWirelessNetworkCardsBuffalo]


+

추가(독점)드라이버 사용하도록 해주어야 한다

[링크 : http://installion.co.uk/debian/wheezy/nonfree/f/firmware-ralink/install/index.html]


우분누 15.10(wily) 부터는 삭제 된 듯

[링크 : http://www.ubuntuupdates.org/package/core/wily/main/proposed/linux-firmware]

[링크 : https://launchpad.net/ubuntu/wily/+source/libertas-firmware]


[링크 : http://installion.co.uk/debian/wheezy/nonfree/f/firmware-ralink/install/index.html]



먼가 안 맞나..

linux-firmware 라는 패키지에 설치되어 있다고 에러가 발생한다

안되는건 마찬가지 ㅠㅠ

Posted by 구차니
Linux/Ubuntu2016. 1. 4. 10:34

lubuntu 에서 openbox를 채용하고 있는지 모르겠지만

윈도매니저에서의 단축키 찾는중..


Openbox default key combinations


Alt-F4 Close the active window

Alt-Space Show the client menu for the active window

Alt-Tab Cycle between windows on the desktop

Alt-Shift-Tab Cycle between windows on the desktop in reverse order

Control-Alt-Tab Cycle between panel and desktop windows on the desktop

Windows-D Hide all windows to show the desktop

Windows-E Run the Konqueror file manager (This is an example of how to run a program with a key binding)

Alt-Escape Lower the active window behind other windows, and activate the last window that was in use

Windows-F1 Go to the first desktop instantly

Windows-F2 Go to the second desktop instantly

Windows-F3 Go to the third desktop instantly

Windows-F4 Go to the fourth desktop instantly

Control-Alt-Left Open the desktop switching dialog, to go to the desktop to the left of the current one

Control-Alt-RightOpen the desktop switching dialog, to go to the desktop to the right of the current one

Control-Alt-Up Open the desktop switching dialog, to go to the desktop above the current one (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Control-Alt-Down Open the desktop switching dialog, to go to the desktop below the current one (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Shift-Alt-Left Open the desktop switching dialog, to go to the desktop to the left of the current one, and bring the active window with you

Shift-Alt-Right Open the desktop switching dialog, to go to the desktop to the right of the current one, and bring the active window with you

Shift-Alt-Up Open the desktop switching dialog, to go to the desktop above the current one, and bring the active window with you (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Shift-Alt-Down Open the desktop switching dialog, to go to the desktop below the current one, and bring the active window with you (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Alt-Left mouse button Move a window

Alt-Right mouse button Resize a window. The window is resized towards the edge that the mouse is nearest to. So use Alt-Right mouse button in the top right corner of a window to resize that corner.

Alt-Scroll wheel Change desktops forward and backward


[링크 : https://wiki.debian.org/Openbox#Keyboard_shortcuts]

'Linux > Ubuntu' 카테고리의 다른 글

wicd / network-manager ?  (0) 2016.01.04
리눅스 콘솔 한글 출력?  (0) 2016.01.04
lubuntu xtem scrollbar  (0) 2016.01.02
으악 lubuntu 였지 ㅋㅋㅋ  (0) 2015.12.30
우분투 hibernate(최대절전) / suspend(절전)  (0) 2015.12.29
Posted by 구차니