DIST.3 「Photoshop and me」にLT参加してきました。

DIST.3 「Photoshop and me」に「Photoshopで繰り返してる作業に効く!JSX自動処理!」というタイトルでLT参加してきました。

DIST.3 「Photoshop and me」 – connpass

LT参加の皆さん、登壇されたザ・マーズナレッジ株式会社のイシジマミキさんのPhotoshopにまつわる色々なお話が聞け、とても勉強になりました。

自分のLTに関しては、LTは5分という短い時間だったため急ぎすぎまして、50秒あまるという状況に(苦笑)

ついでに以下のURLも紹介させていただきました。

1ft-seabass.jp.MEMO – ある画像を決めた矩形で切り取るPhotoShopの自動処理(JSX)

1ft-seabass.jp.MEMO – PhotoShopの自動処理スクリプト JSXを作成するときの参考リンクをまとめておく

Photoshopはほんとに多機能で、他ツールと連携とも組み合わせながら、何かを行うために様々なアプローチがあると思っていて、登壇者の方々はいろいろな角度から、その事をおっしゃっていました。そして今後も、自分の滞ってるワークフローがあれば、随時見直して無駄や不便を減らし、JSX・機能・ツールでどんどん解決できたらなと思っております。

続きを読む →

IntelliJ IDEAでNode.jsプラグインをインストールする話

IntelliJ IDEAでNode.jsプラグインをインストールする際のメモです。

プラグインのインストール中、いつのタイミングでNode.js専用のコードヒントが出てくるかが、いまいち分からなかったのでキャプチャとってみました。

※執筆時点はIntelliJ IDEA 12でご説明します。バージョンが違うことで挙動が違うかもしれませんので、ご注意下さい。

続きを読む →

Node.jsでFunction.bind関数で非同期処理がだいぶ書きやすくなった話

皆様お疲れ様です。最近、Node.jsを書くことが多いのですが、Node.jsに標準で入っているFunction.bind関数を利用することで非同期処理がだいぶ書きやすくなった話を書いておきます。

Node.jsでは、性質上、非同期処理主体になるので、Functionのネストが深くなってしまい結構コードが追いにくくなります(自分で)。しかも、あまり深くなっていくと、自分の意図しないタイミングで動いてしまうこともあり、悩ましい。

もちろん、ネストせずに関数の参照で移すこともできなくはないですが、結局JavaScriptのスコープに影響を受けてしまうので、それはそれで組みにくくなるので苦しいところです。

asyncモジュール

こういう悩みで調べていくと、asyncモジュールを使えばいいという話があります。
これをつかうと並列で書けるのですが、若干癖があるので、複数人で開発している時に共有したり、ましてや自分が1年後メンテする際にちょっと苦労しそうな印象があるので、万能というわけではありません。(とはいえ、とっても便利です。)

Function.bind関数

導入が長くなりましたが、Node.jsに標準で入っているFunction.bind関数を利用することで非同期処理がだいぶ書きやすくなった話を書いておきます。

Function.bind関数はDelegate(委譲)のような振る舞いをする機能で、コールバック関数でthisをスコープとして実行できる機能です。

this.test.bind( this );

function test(){
  // thisのスコープとして動く
}

では早速やってみましょう。

続きを読む →

Google Swiffyがversion 5.3にアップデートされ、AS3ほか大量アップデート(リリースノート長い!)

Google Swiffyがversion 5.3になり、AS3ほか大量アップデートされました。

Google Swiffy

ご覧のとおり、リリースノート長いです。AS3やらAS2やら入り乱れています。

September 30, 2013 (version 5.3.0)

  • Added support for Add, Darken, Difference, Lighten, Multiply, Screen and Subtract blend modes.
  • Added support for AS2 drag and drop.
  • Added support for AS2 EditText.filters.
  • Added support for AS2 Object.hasOwnProperty.
  • Added support for AS2 ConvolutionFilter and GlowFilter.
  • Added support for AS2 flash.geom.Matrix, flash.geom.Point and flash.geom.Rectangle.
  • Added write support for AS2 Text variables which now respect changes to text or htmlText values.
  • Added support for TextField parameters in AS2 MovieClip.setMask.
  • Added support for AS3 Bitmap and BitmapData.
  • Added experimental support for AS3 ExternalInterface in directly embedded conversions.
  • Added support for AS3 Object.setPropertyIsEnumerable.
  • Added support for AS3 MouseEvents DOUBLE_CLICK, MOUSE_MOVE, MOUSE_OVER and MOUSE_OUT.
  • Added support for AS3 InteractiveObject.mouseEnabled and InteractiveObject.doubleClickEnabled.
  • Added support for AS3 DisplayObject.mouseChildren.
  • Added support for AS3 TextField.defaultTextFormat, TextField.embedFonts, TextField.getLineText, TextField.numLines, TextField.autoSize, TextField.wordWrap, TextField.multiline.
  • Added support for AS3 MovieClip.currentFrame, MovieClip.totalFrame and framesLoaded.
  • Added support for “@attribute” style string parameters in AS3 XML methods.
  • Added basic support for nested AS3 LoaderInfo objects with support for loader, loaderURL and url properties.
  • Added support for constructing AS3 EventDispatcher objects with a delegate.
  • Added support for AS2 and AS3 Array.sortOn.
  • Added support for reading display object filters in AS2 and AS3.
  • Added support for TextFormat letterSpacing, leading, rightMargin, leftMargin, underline and kerning in AS2, AS3 and tags.
  • Added support for indirect font names _sans, _serif and _typewriter.
  • Added support for paths with differing line end caps.
  • Added support for the PLACEOBJECT3 tag’s Visible and PlaceFlagHasCacheAsBitmap fields.
  • Added support for PLACEOBJECT tags directly referencing DEFINEBITS* tags.
  • Added support for the DEFINESCALINGGRID tag.
  • Added support for AVM2 CALLPROPLEX bytecode instruction.
  • Added stage.setBackground allowing the background color to be overriden on a conversion.
  • Improved filter rendering and AS2 scripting support.
  • Improved dynamic clipping paths in IE9.
  • Fixed handling of collisions between AS2 properties and display object variables.
  • Fixed execution of frame actions when jumping to positions past the final frame.
  • Fixed offsets values and inheritance of AS2 ColorMatrixFilter.
  • Fixed AS3 behavior when a derived class overrides only the getter or setter of a super class accessor.
  • Fixed invocation of AS3 methods via their interface name.
  • Fixed invocation of AS3 global functions when assigned to and called on another object.
  • Fixed AS3 init scripts to only run when first referenced, handle references between DOABC tags and correctly register global functions.
  • Fixed AS3 flash.utils.ByteArray subscript access to return unsigned values.
  • Fixed AS3 ENTER_FRAME to dispatch to all display objects with registered listeners, not just those added to the stage.
  • Fixed AS3 flash.util.Dictionary behavior when using keys with custom toString methods.
  • Fixed bounding box calculations for autosizing text fields.
  • Fixed hit zone calculations for static text including behavioral differences where Advanced Text Rendering is specified.
  • Fixed text alignment issues for SWF versions <= 7.
  • Fixed rendering artifacts present on very thin strokes in Chrome.
  • Fixed dark halos around indexed images with an alpha channel.
  • Fixed rendering of newlines in justified text.
  • Fixed dispatch of mouse events to elements appearing or disappearing under the mouse.
  • Fixed exception caused by gradients with no defined stops.
  • Fixed broken drop shadows in Firefox.
  • Fonts are now always rendered as shapes.

計73行!!軽くめまいがしますが、がんばって訳してみます。まずはGoogle翻訳様が。

続きを読む →