archive-com.com » COM » N » NITOYON.COM

Total: 757

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Tag: JavaScript - TECH-NI Blog
    Visualizing K Means algorithm with D3 js 07 Nov 2013 JavaScript LiveReloadX Released Reload your Browser Automatically 27 Feb 2013 JavaScript Node js Back to tag list About Profile nitoyon I m a programmer in Japan Kyoto more Recent Entries

    Original URL path: http://tech.nitoyon.com/en/blog/tags/javascript/ (2016-02-13)
    Open archived version from archive

  • When grunt-contrib-watch uses too much CPU, try grunt-este-watch - TECH-NI Blog
    This module uses not only fs watch native API but also fs watchFile which periodically executes fs statSync read Difference between fs watch and fs watchFile for details Why does gaze use fs watchFile chokidar README md says fs watch had many problems Node js fs watch Doesn t report filenames on mac Doesn t report events at all when using editors like TextMate2 on mac Sometimes report events twice Has only one non useful event rename Has a lot of other issues How do I avoid it Use grunt este watch instead of grunt contrib watch Let s read grunt este watch README md What s wrong with official grunt contrib watch It s slow and buggy because it uses combination fs fileWatch and fs watch for historical reason From Node 0 9 2 fs watch is ok github com steida este Needs maximum performance and stability so that s why I had to create yet another Node js file watcher This watcher is continuously tested on Mac Linux Win platforms I m using grunt este watch now It uses no CPU when watching Nice Example Here is my Gruntfile js module exports function grunt grunt initConfig pkg grunt file readJSON package json shell jekyll build command jekyll build snip snip esteWatch options dirs posts layouts includes javascript apollo tutorial plugins stylesheets javascripts livereload enabled false function filepath return shell jekyll build grunt este watch s configuration is quite different from grunt contrib watch s grunt este watch requires directory list to watch When any file under watched directory is modified callback function is called My callback function returns shell jekyll build so grunt executes shell jekyll build when watched files are modified We can check filepath argument to determine the tasks returned means all extensions We can register

    Original URL path: http://tech.nitoyon.com/en/blog/2013/10/10/grunt-watch-slow/ (2016-02-13)
    Open archived version from archive

  • Tag: Node.js - TECH-NI Blog
    Node js Difference between fs watch and fs watchFile 02 Oct 2013 Node js Jekyll Use Grunt instead of watch option 25 Jun 2013 Jekyll Ruby Node js LiveReloadX Released Reload your Browser Automatically 27 Feb 2013 JavaScript Node js

    Original URL path: http://tech.nitoyon.com/en/blog/tags/node.js/ (2016-02-13)
    Open archived version from archive

  • Difference between fs.watch() and fs.watchFile() - TECH-NI Blog
    watch Let s look at implementation of fs watch We use source code for v0 10 19 After I looked at lib fs js and src fs event wrap cc I found fs watch is implemented by uv fs event init function The functions whose name start with uv is defined by libuv libuv is multi platform support library for Node js It has features like asynchronous IO thread pool timer and so on So look at uv fs event init function I grepped under deps uv src The results are as follows unix aix c unix cygwin c unix kqueue c unix linux inotify c unix sunos c win fs event c Each file has implementation for different platforms Platform How to implement Linux inotify MacOS BSD kqueue Windows ReadDirectoryChangesW Solaris Event Ports AIX Not supported Cygwin Not supported Conclusion fs watch uses native API fs watchFile Let s look at fs watchFile After I looked at lib fs js and src node stat watcher cc I found fs watchFile is implemented by uv fs poll start function OK Let s read uv fs poll start defined in deps uv src fs poll c int uv fs poll start uv fs poll t handle uv fs poll cb cb const char path unsigned int interval snip initialization if uv fs stat loop ctx fs req ctx path poll cb abort The point is uv fs stat This function executes asynchronous stat The callback poll cb is called when it completes Next poll cb static void poll cb uv fs t req snip trigger event error handling and so on Reschedule timer subtract the delay from doing the stat interval ctx interval interval uv now ctx loop ctx start time interval if uv timer start ctx timer handle timer cb

    Original URL path: http://tech.nitoyon.com/en/blog/2013/10/02/node-watch-impl/ (2016-02-13)
    Open archived version from archive

  • Use symlinks in git difftool --dir-diff on Windows - TECH-NI Blog
    working directory after difftool program exits I want to use symlinks on Git for Windows like Unix and MacOS Quick Hack Patch Environment Git for Windows 1 8 3 and Windows 7 64bit Patch for C Program Files x86 Git libexec git core git difftool git difftool Sun Jun 2 11 28 06 2013 git difftool Tue Jul 9 00 42 02 2013 283 7 283 7 exit cleanup tmpdir 1 if symlinks symlink workdir file rdir file or system git mklink workdir file rdir file or exit cleanup tmpdir 1 else copy workdir file rdir file or 448 7 448 7 my indices loaded 0 for my file worktree next if symlinks l b file next if symlinks next if f b file if indices loaded Save this patch to somewhere and run GitBash as administrator cd c Program Files x86 Git libexec git core patch git difftool patch patching file git difftool Create a file on C Program Files x86 Git libexec git core git mklink bin sh cmd exe c mklink 2 1 dev null This script is necessary for converting tmp directory to Windows path How to Use First configure difftool on gitconfig For example set

    Original URL path: http://tech.nitoyon.com/en/blog/2013/07/09/symlink-dir-diff-on-windows/ (2016-02-13)
    Open archived version from archive

  • Jekyll: Use Grunt instead of --watch option - TECH-NI Blog
    up it begins wasting our CPU For example my site has over 600 posts by which Jekyll generates 900 files And more there are 5000 files under git dir Suprisingly Jekyll 0 12 watches all files under the current directory which means that it execute stat to these 6 500 files every one second Jekyll 1 0 s jekyll build watch doesn t watch git and site directory Despite of such improvement ruby still uses up to 10 of CPU So I decided to use Grunt instead of using watch or auto option Grunt config files I m use following versions Jekyll 1 0 3 Grunt 0 4 1 grunt shell spawn plugin grunt contrib watch plugin At first I used grunt jekyll instead of grunt shell spawn but grunt jekyll plugin doesn t show Jekyll s output until it exits See Getting started Grunt to setup Grunt Here is my package json and Gruntfile js package json name tech ni version 0 1 0 devDependencies grunt 0 4 1 grunt shell spawn 0 2 4 grunt contrib watch 0 4 4 Gruntfile js module exports function grunt grunt initConfig pkg grunt file readJSON package json shell jekyll command jekyll build options async false watch jekyll files posts md layout html includes html tasks shell jekyll grunt loadNpmTasks grunt shell spawn grunt loadNpmTasks grunt contrib watch grunt registerTask default shell jekyll If you re using Jekyll 0 12 replace jekyll build to jekyll How to Use By entering grunt watch it starts watching files When some posts or HTML files are modified grunt executes jekyll build But CPU usage is not 0 It turns out that grunt contrib watch doesn t use native watch API fs watch It uses gaze module which execute fs statSync periodically Oh Nothing changes It

    Original URL path: http://tech.nitoyon.com/en/blog/2013/06/25/jekyll-grunt/ (2016-02-13)
    Open archived version from archive

  • Tag: Jekyll - TECH-NI Blog
    Grunt instead of watch option 25 Jun 2013 Jekyll Ruby Node js 3 ways to specify categories and tags in Jekyll 17 Apr 2013 Jekyll Back to tag list About Profile nitoyon I m a programmer in Japan Kyoto more

    Original URL path: http://tech.nitoyon.com/en/blog/tags/jekyll/ (2016-02-13)
    Open archived version from archive

  • Tag: Ruby - TECH-NI Blog
    Use Grunt instead of watch option 25 Jun 2013 Jekyll Ruby Node js IRBWEB Try Ruby on Your Browser 05 Apr 2009 Ruby Silverlight Back to tag list About Profile nitoyon I m a programmer in Japan Kyoto more Recent

    Original URL path: http://tech.nitoyon.com/en/blog/tags/ruby/ (2016-02-13)
    Open archived version from archive



  •