- + 最近の小学校では、「お父さん・お母さんの名前をグーグルで検索してみましょう」という、世にも恐ろしい授業があるらしい。・・・。 — 丹 洋介 (@yosuke_tan) January 25, 2015
- + 最近の小学校では、「お父さん・お母さんの名前をグーグルで検索してみましょう」という、世にも恐ろしい授業があるらしい。・・・。 — 丹 洋介 (@yosuke_tan) January 25, 2015
・始めに おはようございます! KMC1回生、id:murataと申します! この記事はKMC Advent Calendar 2014の9日目の記事です。 昨日はyui9さんの 「Haskellで簡単な正規表現を実装した」でした。 私はまだまだ未熟なので 過 去 の KMC の 記 事 みたいな高度な内容を書けはしませんが、ご容赦下さいまし。 ・ひねくれ数列 そろそろ12月ですね。 クリスマス とかもあって、すぐセンター試験なんかも近づいてくる時期ではないでしょうか。 特に、大学受験をされる方々は、数列をいやというほど見てきたかと思います。 高校2年生の方々は今頃のテスト範囲が数列だったりとかもあるかと思います。 1,2,4,8,...の一般項を求めよ。とか 1,1,2,3,5,8,13,21,34,55...の一般項を求めよ。とか 1,4,27,256,...の一般項を求めよ。とか、あ
これですね。これ何か呼び方あるの? なにこれ グローバル変数にならないようにする仕組み。 スコープ問題 JavaScriptではスコープ(変数の有効範囲)は関数単位(function(){~})になるのが基本。 そして一番外側、どの関数の中でもないものは「グローバルスコープ」に所属する「グローバル変数」となり、どこからでも利用できる変数になる。そうなるとどこかで変数の名前がかぶった際、勝手に値が変わったりして大変恐ろしい事になってしまう。 そこで、ファイル全体を関数で括る事でスコープを生成して、グローバルではない変数にしておこう、というもの。ただしvar宣言なしに変数を使い始めると、結局グローバル変数になってしまうので注意。 次世代JavaScriptだとletとかあるけど触れません、関係ないし。 関数の前後にくっついてる括弧は 関数は作成するだけでは何もならないので、即時実行してやります
AngularJS 嫌いな人が多い昨今について 最近 AngularJS 嫌いという言説が多いですが、そういうことを仰る方々は主に先鋭的な JSer のように思います。 ただ、僕なんかの場合には、ユーザー向けの画面の構築などには AngularJS を使って書くことは最近はほとんどなく、JS を書くといえばもっぱら管理画面です。 管理画面の JS を書くにあたっては AngularJS way にのっかってやると非常に楽ですよね。管理画面を書いたりする上では vue-js とかで頑張って書くと見通しが悪くなったりしますし、こった動きなどは必要ないというところで angular.js ワリといいなと思っています。 もっといいものがあれば移りたいですが、コストをかけずに作りやすい管理画面を作るという意味ではやはり AngularJS にまだメリットがあるなあ、と思っています。 2.0 が出た時
Code Faster.Tired of having to run your code to find bugs? Flow identifies problems as you code. Stop wasting your time guessing and checking. Code Smarter.It's hard to build smart tools for dynamic languages like JavaScript. Flow understands your code and makes its knowledge available, enabling other smart tools to be built on top of Flow. Code Confidently.Making major changes to large codebases
Enter your messy, minified, or obfuscated Javascript (JS) into the field above to have it cleaned up and made pretty. The editor above also contains helpful line numbers and syntax highlighting. There are many option to tailor the beautifier to your personal formatting tastes. When do you use Javascript Viewer, Beautifier and Formatter, Editor Often when writing Javascript (JS) your indentation, s
TideKit is a platform to develop mobile, web and desktop apps using a single code base written in JavaScript. Try TideKit today!TideKit is your partner, speaking your language, and bringing everything you need HTML5? Yes. Native? Yup! And no need to learn new vocabulary. Use what you already know, let TideKit's rich set of tools and APIs do the rest. TideKit keeps the barriers low while giving you
Your browser does not support the features we need. Try using the most recent version of Chrome, Firefox, Safari or Edge.
Intro 今日は、フロントのプログラミングスタイルに、にまた一つ大きな変化をもたらすであろう Stream という API についてです。 この仕様は現時点でまだ策定中であるため、 API は変更される恐れがある点にご注意ください。 Stream API 以前 「Node.js の Stream API で「データの流れ」を扱う方法」 という記事を書きましたが、簡単に言うとあれがブラウザにもやってくるという話です。 非同期処理おさらい もう何度も書いた話なので駆け足で。 JS はシングルスレッドでイベント駆動な世界なので、何をするにも非同期であり、コールバックを登録することで完了した結果を受け取る API が基本です。 これは、ブラウザの DOM の API でも、 Node.js でも共通しています。 概念を疑似コードで書くと以下のような感じです。 console.log('1');
概要 待ち焦がれた人も多いことだろう。ES2015の一番の目玉機能とも言えるクラス構文が、ついにV8でサポートされた。 Class構文は、『関数(コンストラクタ)定義』+『.prototypeへのメソッド定義』の糖衣構文である。 JSで今まで様々に工夫されてきたクラスの書き方を、綺麗に統一してくれる可能性を秘めている。 クラスを作る 従来、Catクラスを作ろうとした場合このように書いてきた。 function Cat(name) { this.name = name } Cat.prototype.meow = function () { alert( this.name + 'はミャオと鳴きました' ) } しかしこの書き方だとどうしても、コンストラクタとメソッドの定義が分離されているため、クラスとしてまとまりがなく分かりづらく感じる。 メソッドが増えてきた時も、Cat.prototyp
.app 1 .dev 1 #11WeeksOfAndroid 13 #11WeeksOfAndroid Android TV 1 #Android11 3 #DevFest16 1 #DevFest17 1 #DevFest18 1 #DevFest19 1 #DevFest20 1 #DevFest21 1 #DevFest22 1 #DevFest23 1 #hack4jp 3 11 weeks of Android 2 A MESSAGE FROM OUR CEO 1 A/B Testing 1 A4A 4 Accelerator 6 Accessibility 1 accuracy 1 Actions on Google 16 Activation Atlas 1 address validation API 1 Addy Osmani 1 ADK 2 AdMob 32 Ads
JavaScriptで動的にリンクを生成する際に、DOM-based XSSを防ぐためにリンク先がhttpあるいはhttpsに限定されていることを確認したい場合がある。典型的には以下のようなコードとなる。 var div, elm; // 変数 url は攻撃者がコントロール可能な文字列 if( url.match( /^https?:\/\// ) ){ div = document.getElementById( "info" ); elm = document.createElement( "a" ); elm.setAttribute( "href", url ); elm.appendChild( document.createTextNode( url ) ); div.appendChild( elm ); } この場合、変数urlに「http://example.jp」や「
It’s hard to believe it’s been nearly eight years since jQuery was released. Web development has changed a lot over the years, and jQuery has changed along with it. Through all of this time, the team has tried to walk the line between maintaining compatibility with code from the past versus supporting the best web development practices of the present. One of those best practices is semantic versio
Introduction Welcome to the third installment of the Learning React series. Today we will be learning about how Facebook’s Flux Architecture works, and how to use it in your own projects! If you haven’t already, I strongly recommend you check out the first two installments in this series, Getting Started & Concepts and Building a Real-Time Twitter Stream with Node and React. They aren’t a hard pre
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く