Posted on 2010/02/16 14:27
Filed Under Development/Ajaxian

The title need no more flushing out. Brian Leroux has created WTFJS to capture some of the rough edges of JavaScript. The stuff that made Crocky write about the Good Parts.

Brian Leroux Tlsms 씨는 자바스크립트의 거친 가장자리의 한부분을 캡쳐하여 보여주기의해 WTFJS라는 사이트를 만들었습니다. 자바스크립트의 문제점에 대하여 썼습니다.

Fun side effects such as:

JAVASCRIPT:
  1.  
  2. NaN === NaN // false
  3.  
  4. Number.MIN_VALUE> 0;
  5. // true? really? wtf.
  6. // It turns out that MIN_VALUE is the smallest number
  7. // GREATER THAN ZERO, which of course totally makes sense.
  8.  
  9. parseInt('06'); // 6
  10. parseInt('08'); // 0
  11. // remember to pass in the radix!
  12.  
  13. typeof null // object
  14. null === Object // false
  15.  

Got a fun one? Add it to the site!

재미있는것을 가지고 있나요? 이사이트에 추가해주세요

2010/02/16 14:27 2010/02/16 14:27
TAG :

Posted on 2010/02/10 09:52
Filed Under Development/Ajaxian

James Coglan has ported a Ruby/EventMachine Comet server to offer a new Node.js server on the Bayeux protocol. The project is Faye and you can check out the code on GitHub.

James Coglan 루비/이벤트머신 혜성 서버 새로운 Bayeux 프로토콜안에 Node.js 서버로 제공되고있다. 이 프로젝트는 Faye 이고 당신은 GitHub의 코드에서 확인할수 있다.

On the client side:

클라이언트 코드

HTML:
  1.  
  2. <script type="text/javascript" src="/comet.js"></script>
  3.  
  4. <script type="text/javascript">
  5.     CometClient = new Faye.Client('/comet');
  6.     CometClient.connect();
  7. </script>
  8.  
JAVASCRIPT:
  1.  
  2.   CometClient.subscribe('/path/to/channel', function(message) {
  3.     // process received message object
  4.   });
  5.  
  6.   CometClient.publish('/some/other/channel', {foo: 'bar'});
  7.  

And the backend....

그리고 백엔드단

JAVASCRIPT:
  1.  
  2.   var http  = require('http')
  3.       faye  = require('./faye');
  4.  
  5.   var comet = new faye.NodeAdapter({mount: '/comet', timeout: 45});
  6.  
  7.   http.createServer(function(request, response) {
  8.     if (comet.call(request, response)) return;
  9.  
  10.     response.sendHeader(200, {'Content-Type': 'text/plain'});
  11.     response.sendBody('Hello, non-Comet request!');
  12.     response.finish();
  13.  
  14.   }).listen(9292);
  15.  

Nice!

좋았어

2010/02/10 09:52 2010/02/10 09:52
TAG : , ,

Posted on 2010/02/10 09:43
Filed Under Development/Ajaxian

If you know you think you know your objects from your arrays and your nullfrom your undefined, here's a quiz for you from Perfection Kills.

만약 당신이 객체와 배열, null과 undefined에 대해 잘 알고 있다고 생각한다면 여기 완벽하게 당신을 위한 퀴즈로 죽여라

I was recently reminded about Dmitry Baranovsky’s Javascript test, when N. Zakas answered and explained it in a blog post. First time I saw those questions explained was by Richard Cornford in comp.lang.javascript, although not as thoroughly as by Nicholas.

I decided to come up with my own little quiz. I wanted to keep question not very obscure, practical, yet challenging. They would also cover wider range of topics.


나는 최근에 N.Zakas의 블로그 표현과 대답했을때 Dmitry Baranovsky's의 자바스크립트 테스트에 대해서 상기했다. 처음 나는 comp.lang.javascript안의 Richard Cornford에 의해 표현되어진 아닐만큼 철저하게 Nicholas에 의해 질문을 보았다.

There are fourteen questions in all, starting here:

여기 모든 14개의 문제가 있다. 여기서 시작하라:

    (function(){
      return typeof arguments;
    })();
  • “object”
  • “array”
  • “arguments”
  • “undefined”
  • takeone :
     달랑 두개 맞았습니다. 무지 어렵고 헷갈리네요 ;
    2010/02/10 09:43 2010/02/10 09:43
    TAG : ,

    Posted on 2010/02/10 09:37
    Filed Under Development/Ajaxian

    republish2

    eBooks have gone mainstream, and right now the open ePub format is getting a lot of attention, being the iPad's book format of choice. Often overlooked in gadget-centric media is the fact that ePub is based on web standards, and therefore amenable to being rendered in the browser, sans plugins. Pure Javascript ePub readers are starting to crop up, and Keith Fahlgren has written about several of them:

    이북은 주류를 가지고 있고 지금 오픈 ePub 포맷은 많은 주목을 받고 있으며 아이패드의 이북 포멧을 선택하고 있다. 종종 가잿중심의 미디어에서 간과되고 있는것은 ePub가 웹 표준에 기준되어 있고 따라서 snas 플러그인, 브라우저안에 랜더링 되야할 의무가 있다. 순수한 자바스크립트 ePub 리더기는 자르기를 시작하는것이다. 그리고 Keith Fahlgren 은 그들중 몇가지에 대해서 썼다:

    Just in the last few days, details emerged of two new JavaScript ePub readers, rePublish from Blaine Cook (@blaine) and JSEpub (screenshot) from August Lilleaas (@augustl). These two new readers join @liza’s epubjs, which will be a year old on Tuesday. An improved version of epubjs powers the ePub Zen Garden, which helps “dispel the myth that digital books can’t also be crafted works of visual design.”


    최근 몇일동안 새로운 자바스크립트 ePub 리더기인 Blaine Cook 의 rePublish 와 August Lilleaas의 JSpub 에 대해서 등장했다. 이들 두가지의 새로운 리더기는 @liza's epubjs에 가입한지 일년치 안될것입니다.  ePub Zen Garden 의 epubjs 힘의 개선된 버전은 "디지털 책이 비주얼 디자인에 의해 만들어진 미스터리를 푸는데 도움을 줄것입니다."

    All are open source, and as Keith notes in the comments, there's also the commercial BookGlutton project. BookGlutton (which we covered earlier) shows the promise of browser-based eBooks: it lets you embed books as lightbox-powered widgets, and supports annotation.

    모든것은 오픈소스이고 Keith 노트 안의 코멘트는 그들이 또한 상업의 BookGlutton project이다. BookGlutton( 우리가 이전에 어떤 커버)는 브라우저 베이스의 eBook을 약속해주는것을 보여준다. 이것은 당신이 책을 lightbox-powered 위젯으로 포함하고 주석을 제공할것이다.

    The underlying structure of ePub is described on wikipedia:

    ePub의 기본구조는 위키피디아에 서술되어있다.

    EPUB consists of three specifications:
    Open Publication Structure (OPS) 2.0, contains the formatting of its content.[5]
    Open Packaging Format (OPF) 2.0, describes the structure of the .epub file in XML.[6]
    OEBPS Container Format (OCF) 1.0, collects all files as a ZIP archive.[7]
    Basically, EPUB internally uses XHTML or DTBook (an XML standard provided by the DAISY Consortium) to represent the text and structure of the content document, and a subset of CSS to provide layout and formatting. XML is used to create the document manifest, table of contents, and EPUB metadata. Finally, the files are bundled in a zip file as a packaging format.


    ePub 3개의 사용으로 구성 :


    In the case of unzipping, Keith points out the inflate library has been around since 1999. One can imagine other applications for zip too; for example, it's often used as a format for bundling code (Java JARs, Python Eggs, Firefox and Chrome extensions), so reliable unzipping makes it possible to build browser-based IDEs and exploration tools against such archives.

    2010/02/10 09:37 2010/02/10 09:37
    TAG : ,

    Posted on 2010/02/06 10:16
    Filed Under Development/Ajaxian

    Aaron Boodman created Greasemonkey back in the day. He also worked on Gears. And most recently he created Chrome Extensions. I have a funny feeling that folks were pinging him daily "hey, when ya gunna give me Greasemonkey on Chrome" and he just delivered:

    아론 부드맨은 전에 그리스몽키를 만들었다. 그능 또한 기어스에서 일했다. 그리고 최근 그는 크롬 확장을 만들었다. 재미있게 느끼는것은 여러분이게 그가 메일 외치는것이다. "이봐 크롬 에서 그리즈 몽키를 나아게 줘라" 그리고 그능 배달했다.   

    One thing that got lost in the commotion of the extensions launch is a feature that is near and dear to my heart: Google Chrome 4 now natively supports Greasemonkey user scripts. Greasemonkey is a Firefox extension I wrote in 2004 that allows developers to customize web pages using simple JavaScript and it was the inspiration for some important parts of our extension system.

        Ever since the beginning of the Chromium project, friends and coworkers have been asking me to add support for user scripts in Google Chrome. I'm happy to report that as of the last Google Chrome release, you can install any user script with a single click. So, now you can use emoticons on blogger. Or, you can browse Google Image Search with a fancy lightbox. In fact, there's over 40,000 scripts on userscripts.org alone.


    구글 크롬 4는 사용자 그리즈 사용자 스크립트을 기본적으로 지원하게 되었다. 그리즈몽키는 파이어폭스 플러그인이다. 내가 2004에 웹페이지를 커스터마이징 할수 있게 개발자들을 따랐을때 간단한 자바스크립트와 이것에 영감을 었어 우리의 확장시스템의 일부로써 중요하다.

    Not all of the scripts will work. The deeper the integration, the less chance of success. We now have user scripts supported in a variety of browsers, and hopefully they get more and more portable.

    모든 스크립트가 동작하진 않는다. 이것은 깊숙하게 통합되어있고 성공적으로 바꾼다. 우리는 다양한 브라우저의 사용자 스크립트를 지원하는것을 가지고 있다. 그리고 그것들이 머 많은것이 가능하도록 희망하고 있다.

    If browsers could surface the functionality to mainstream users, good things could happen beyond us power users.

    만약 브라우져들이 주류 유져들의 기능저인 표면을 할수있다면 상품은 우리 파워유져들 뒤에 있을것이다.

    2010/02/06 10:16 2010/02/06 10:16

    Posted on 2010/02/05 15:44
    Filed Under Development/Ajaxian

    SVG-Edit is a nifty open source editing web app that uses SVG and doesn't need a server-side:

    SVG-Edit 는 서버사이드를 필요로 하지않고 SVG를 이용하는 실용적인 오픈소스 에디팅 웹 어플리케이션이다.

    svg-edit-screenshot1

    The SVG-Edit team recently announced SVG-Edit 2.4, code named Arbelos. New features include:

    SVG-Edit 팀은 최근 SVG-Edit 2.4를 내놨다. 코드 네임은 Arbelos이다. 새로운 기능은 다음을 포함한다.

    - Raster Images - 바둑판식 이미지
    - Group/Ungroup - 그룹, 언그룹
    - Zoom - 줌
    - Layers - 레이어
    - Curved Paths - 곡선경로
    - UI Localization - UI 지역화
    - Wireframe Mode - 와이어 프레임 모드
    - Change Background - 배경 바꾸기
    - Draggable Dialogs - 드러그 가능한 다이얼로그들
    - Resizable UI (SVG icons) - 크기조정 가능한 UI (SVG 아이콘들)
    - Convert Shapes to Path - 모양을 경로로 바꿈

    Try out the demo here:

    여기 데모가 있다.
    http://svg-edit.googlecode.com/svn/branches/2.4/editor/svg-editor.html

    Check out the project page:

    프로젝트 페이지를 체크하라
    http://svg-edit.googlecode.com

    Read the release notes:

    릴리즈 노트를 읽어라
    http://code.google.com/p/svg-edit/wiki/VersionHistory

    2010/02/05 15:44 2010/02/05 15:44
    TAG :

    Posted on 2010/02/02 11:18
    Filed Under Development/Ajaxian

    What can you do if you want to enable a fullscreen experience on the Web? You can't. Or, use Flash. Some claim that you shouldn't offer this ability as it is a security liability. Someone can put a fullscreen view that tricks the user into giving it information.

    만약 당신이 웹의 전체화면의 경홈을 사용하기를 원한다면 어떻게 하겠는가. 당신은 할수 없다. 또는, 플래시를 상용한다. 몇몇의 요구는 보한 책임에 의해 그것의 능력을 사용하지 않는다. 어떤이는 정보를 주는 수법으로 전체화면에 출력할수 있다.

    However, as much as I think user security is important, it doesn't seem like we can punt and not do anything because of this. A user agent can do a lot of things to help out.

    그러나, 내가 사용자 보안을 중요하다고 생각하는 만큼, 우리가 punt하기 좋아하지 않는것처럼, 이것의 이유는 아무것도 아니다. 한 유저는 돕기위해 많은것을 있다.

    Some (majority?) of the use cases revolve around full screen video. Eric Carlson has a WebKit checkin that enables that one case. You canwebkitEnterFullScreen() on a HTML5 video element and be on your way.

    You can see this in action on the SublimeVideo HTML5 player. Play the video in WebKit nightly and alt-click the "full size" arrows.

    html5sublimevideo

    Video is great, but what about general purpose? What if you could fullscreen any element? Robert O'Callahan threw up a strawman:

    1. Should be convenient for authors to make any element in a page display fullscreen
    2. Should support in-page activation UI for discoverability
    3. Should support changing the layout of the element when you enter/exit fullscreen mode. For example, authors probably want some controls to be fixed size while other content fills the screen.
    4. Should accommodate potential UA security concerns, e.g. by allowing the transition to fullscreen mode to happen asynchronously after the user has confirmed permission

    New API for all elements:

    JAVASCRIPT:
    1.  
    2. void enterFullscreen(optional DOMElement element, optional Screen, optional boolean enableKeys);
    3. void exitFullscreen();
    4. boolean attribute supportsFullscreen;
    5. boolean attribute displayingFullscreen;
    6. //"beginfullscreen" and "endfullscreen" events
    7.  

    While an element is fullscreen, the UA imposes CSS style "position:fixed; left:0; top:0; right:0; bottom:0" on the element and aligns the viewport of its DOM window with the screen. Only the element and its children are rendered, as a single CSS stacking context.

    enterFullscreen always returns immediately. If fullscreen mode is currently supported and permitted, enterFullscreen dispatches a task that a) imposes the fullscreen style, b) fires the beginfullscreen event on the element and c) actually initiates fullscreen display of the element. The UA may asynchronously display confirmation UI and dispatch the task when the user has confirmed (or never).

    The enableKeys parameter to enterFullscreen is a hint to the UA that the application would like to be able to receive arbitrary keyboard input. Otherwise the UA is likely to disable alphanumeric keyboard input. If enableKeys is specified, the UA might require more severe confirmation UI.

    In principle a UA could support multiple elements in fullscreen mode at the same time (e.g., if the user has multiple screens).

    enterFullscreen would throw an exception if fullscreen was definitely not going to happen for this element due to not being supported or currently permitted, or if all screens are already occupied.

    Much talking of exact API issues and more security.... but hopefully inertia does it job and we get something.

    Would you like a fullscreen API?

    2010/02/02 11:18 2010/02/02 11:18

    Posted on 2010/02/02 11:10
    Filed Under Development/Ajaxian

    As part of an upcoming article on geo location I am putting together a few Geo Toys for myself and here is the first one. Addmap.js is a JavaScript that analyses an elements text content, finds geographical locations and links them to Google Maps. It also adds a map preview and a list of the found locations to the element.

    지리적 위치의 문서의 일부로서 나는 나자신과 여기에 처음으로 지리적 장난감을 함께 걸었다. Addmap.js 는 하나의 엘리먼트 텍스트 컨텐츠를 분석하여 지리적 위치를 찾고 구글맵에서 그것을 링크하는 자바스크립트다. 이것은 또한 지도 미리보기가 추가되며 엘리먼트의 위치들의 리스트를 찾을수 있다.

    See addmap.js in action below - all the content in the green box is generated from the paragraph of text above it. You can try it out for yourself by clicking the screenshot.

    아래의 작업에서 addmap.js 를 봐라 - 모든 내용안의 녹색박스는 그위의 텍스트 단락에 의해 생성된것이다. 당신은 스크린샷에 클릭함으로써 스스로 시도해볼수 있다.

    Demonstration screenshot of addmap.js

    Using addmap.js is easy - sign up for a Google Maps Key and provide it as a configuration parameter. Then call the analyse function with the ID of the element to analyse as the parameter:

    addmap.js를 사용하는것은 쉽다. 이것이 제공하는 설정 매개변수를 위해 Google Maps Key에 가입하라. 그다음 매개변수를 분석하기위한 엘리먼트의 ID를 분석 함수를 호출하라

    XML:
    1. <script src="http://github.com/codepo8/geotoys/raw/master/addmap.js"></script>
    2. <script>
    3. addmap.config.mapkey = 'YOUR_API_KEY';
    4. addmap.analyse('content');
    5. </script>

    The script uses YQL and Yahoo PlaceMaker under the hood, for more info and updates on this, check the blog.

    스크립트는 YQL과 Yahoo PlaceMaker 후드 아래 쓰인며, 더 많은 정보와 업데이트는 여기 블로그를 확인하라

    2010/02/02 11:10 2010/02/02 11:10

    Posted on 2010/01/29 15:09
    Filed Under Development/Ajaxian

    Román Cortés is having a lot of fun with CSS tricks these days. He just built an example rolling CSS coke can that uses background-attachment, background-position, and a few other tricks to get the effect. No fancy CSS3 needed here!

    로마 코르테스는 CSS 트릭으로 매우 재미있는것을 최근에 가지고있다. 그는 background-attachment, background-position와 몇개의 효과를 얻기위한 다른 트릭들을 이용해 콜라켄을 돌릴수있는 예제를 많들었다. 여기서는 CSS3가 필요하지않다!

    The key pieces used:

    중요한 사용한 조각:

    p {
            background-image: url(coke-label.jpg);
            background-attachment: fixed;
            background-repeat: repeat-x;
            width: 1px;
    }
     
    #x1 {background-position: 5px 30px;}
    #x2 {background-position: 0px 30px;}
    #x3 {background-position: -3px 30px;}
    #x4 {background-position: -6px 30px;}
    #x5 {background-position: -8px 30px;}
     
    

    It helps to see the can and the wrapper that is placed around it.

    이것은 이것을 감싸는것을 도울수 있다.

    takeone

    당황스러울 정도의 예제네요. 이제 순수 CSS효과로도 멋진 효과를 만들수 있겠군요. 빨리 CSS3가 정착되었으면 합니다.

    2010/01/29 15:09 2010/01/29 15:09
    TAG : ,

    Posted on 2010/01/29 15:03
    Filed Under Development/Ajaxian


    The Freeciv.net crew has benchmarked a path in their canvas game. It is one data point, and tests more than just Canvas itself because a lot of code is running in the game. Thus, it ends up testing the union of a particular JavaScript path and the rendering of the canvas.

    Freeciv.net 승무원이 그들의 켄버스 게임안에 경로를 벤치마킹했습니다. 이것은 하나의 데이터 포인트로 다만 게임안에서 수많은 코드들이 실행되는거에 대한 테스트입니다. 하지만 이걸로 특정 조합의 자바스크립트 경로와 켄버스 랭더링을 테스트하는것을 끝냈습니다.

    Here are the results:

    그 결과 입니다.

    canvasbenchmark

    With Bespin we had slightly different results, and the bulk of the bottleneck was in the blitting of the canvas. Optimizations were made to canvas over the initial phase of Bespin so the various browsers would leap frog each other. Good times :)

    우리는 약간의 다른 결과와 함께 대량의 병목현상이 컨버스의 blitting 에 있습니다.

    굿타임! :)

    2010/01/29 15:03 2010/01/29 15:03
    TAG : ,

    Counter

    · Total
    : 361644
    · Today
    : 92
    · Yesterday
    : 110